Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
086dcbd6
提交
086dcbd6
编写于
12月 29, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zoo457790531 发布系统代码 [ibz-dst,应用]
上级
0dd5b3d3
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
238 行增加
和
2 行删除
+238
-2
meta-models.ts
app_web/src/mock/entity/meta-models/meta-models.ts
+38
-0
meta-model-service-base.ts
app_web/src/service/meta-model/meta-model-service-base.ts
+28
-0
export-file-ui-logic-base.ts
...web/src/uiservice/meta-model/export-file-ui-logic-base.ts
+22
-0
export-file-ui-logic.ts
app_web/src/uiservice/meta-model/export-file-ui-logic.ts
+22
-0
meta-model-ui-service-base.ts
...eb/src/uiservice/meta-model/meta-model-ui-service-base.ts
+81
-0
MetaModelExService.java
...n/ibizlab/core/extensions/service/MetaModelExService.java
+10
-0
IMetaModelService.java
.../java/cn/ibizlab/core/lite/service/IMetaModelService.java
+2
-0
MetaModelServiceImpl.java
.../ibizlab/core/lite/service/impl/MetaModelServiceImpl.java
+16
-0
h2_table.xml
ibzdst-core/src/main/resources/liquibase/h2_table.xml
+1
-1
systemResource.json
...st-core/src/main/resources/permission/systemResource.json
+1
-1
MetaModelResource.java
.../src/main/java/cn/ibizlab/api/rest/MetaModelResource.java
+17
-0
未找到文件。
app_web/src/mock/entity/meta-models/meta-models.ts
浏览文件 @
086dcbd6
...
...
@@ -271,6 +271,44 @@ mock.onPost(new RegExp(/^\/metamodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).re
return
[
status
,
data
];
});
// ExportFile
mock
.
onPost
(
new
RegExp
(
/^
\/
metamodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
exportfile$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:metamodel 方法: ExportFile"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
metamodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
exportfile$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
metamodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:metamodel 方法: Save"
);
...
...
app_web/src/service/meta-model/meta-model-service-base.ts
浏览文件 @
086dcbd6
...
...
@@ -181,6 +181,34 @@ export default class MetaModelServiceBase extends EntityService {
return
res
;
}
/**
* ExportFile接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaModelServiceBase
*/
public
async
ExportFile
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/metamodels/
${
context
.
metamodel
}
/exportfile`
,
data
,
isloading
);
return
res
;
}
/**
* ExportFileBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaModelServiceBase
*/
public
async
ExportFileBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/metamodel/exportfilebatch`
,
tempData
,
isloading
);
}
/**
* Save接口方法
*
...
...
app_web/src/uiservice/meta-model/export-file-ui-logic-base.ts
0 → 100644
浏览文件 @
086dcbd6
/**
* 导出文件
*
* @export
* @class ExportFileUILogicBase
*/
export
default
class
ExportFileUILogicBase
{
/**
* Creates an instance of exportFileBase.
*
* @param {*} [opts={}]
* @memberof ExportFileUILogicBase
*/
constructor
(
opts
:
any
=
{})
{
}
}
\ No newline at end of file
app_web/src/uiservice/meta-model/export-file-ui-logic.ts
0 → 100644
浏览文件 @
086dcbd6
import
{
Http
,
Util
}
from
'@/utils'
;
import
ExportFileUILogicBase
from
'./export-file-ui-logic-base'
;
/**
* 导出文件
*
* @export
* @class ExportFileUILogic
*/
export
default
class
ExportFileUILogic
extends
ExportFileUILogicBase
{
/**
* Creates an instance of ExportFileUILogic
*
* @param {*} [opts={}]
* @memberof ExportFileUILogic
*/
constructor
(
opts
:
any
=
{})
{
super
(
opts
);
}
}
\ No newline at end of file
app_web/src/uiservice/meta-model/meta-model-ui-service-base.ts
浏览文件 @
086dcbd6
...
...
@@ -119,6 +119,87 @@ export default class MetaModelUIServiceBase extends UIService {
public
initDeMainStateOPPrivsMap
(){
}
/**
* 导出文件
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public
async
MetaModel_exportFile
(
args
:
any
[],
context
:
any
=
{},
params
:
any
=
{},
$event
?:
any
,
xData
?:
any
,
actionContext
?:
any
,
srfParentDeName
?:
string
){
let
data
:
any
=
{};
let
parentContext
:
any
=
{};
let
parentViewParam
:
any
=
{};
const
_this
:
any
=
actionContext
;
const
_args
:
any
[]
=
Util
.
deepCopy
(
args
);
const
actionTarget
:
string
|
null
=
'MULTIKEY'
;
Object
.
assign
(
context
,
{
metamodel
:
'%metamodel%'
});
Object
.
assign
(
params
,
{
id
:
'%metamodel%'
});
Object
.
assign
(
params
,
{
name
:
'%name%'
});
if
(
_this
.
context
){
parentContext
=
_this
.
context
;
}
if
(
_this
.
viewparams
){
parentViewParam
=
_this
.
viewparams
;
}
context
=
UIActionTool
.
handleContextParam
(
actionTarget
,
_args
,
parentContext
,
parentViewParam
,
context
);
data
=
UIActionTool
.
handleActionParam
(
actionTarget
,
_args
,
parentContext
,
parentViewParam
,
params
);
if
(
Object
.
is
(
actionTarget
,
"MULTIKEY"
)){
let
tempDataArray
:
Array
<
any
>
=
[];
if
((
_args
.
length
>
1
)
&&
(
Object
.
keys
(
data
).
length
>
0
)){
for
(
let
i
=
0
;
i
<
_args
.
length
;
i
++
){
let
tempObject
:
any
=
{};
Object
.
keys
(
data
).
forEach
((
key
:
string
)
=>
{
Object
.
assign
(
tempObject
,{[
key
]:
data
[
key
].
split
(
','
)[
i
]});
})
tempDataArray
.
push
(
tempObject
);
}
}
else
{
tempDataArray
.
push
(
data
);
}
data
=
tempDataArray
;
}
context
=
Object
.
assign
({},
actionContext
.
context
,
context
);
let
parentObj
:
any
=
{
srfparentdename
:
srfParentDeName
?
srfParentDeName
:
null
,
srfparentkey
:
srfParentDeName
?
context
[
srfParentDeName
.
toLowerCase
()]:
null
};
if
(
!
Object
.
is
(
actionTarget
,
"MULTIKEY"
)){
Object
.
assign
(
data
,
parentObj
);
}
Object
.
assign
(
context
,
parentObj
);
// 直接调实体服务需要转换的数据
if
(
context
&&
context
.
srfsessionid
){
context
.
srfsessionkey
=
context
.
srfsessionid
;
delete
context
.
srfsessionid
;
}
const
backend
=
()
=>
{
const
curService
:
MetaModelService
=
new
MetaModelService
();
curService
.
ExportFileBatch
(
context
,
data
,
true
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
actionContext
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
return
;
}
actionContext
.
$Notice
.
success
({
title
:
'成功'
,
desc
:
'导出文件成功'
});
const
_this
:
any
=
actionContext
;
return
response
;
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
actionContext
.
$Notice
.
error
({
title
:
(
actionContext
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
actionContext
.
$Notice
.
error
({
title
:
(
actionContext
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
actionContext
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
return
response
;
});
};
backend
();
}
/**
* 获取指定数据的重定向页面
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/extensions/service/MetaModelExService.java
浏览文件 @
086dcbd6
...
...
@@ -31,5 +31,15 @@ public class MetaModelExService extends MetaModelServiceImpl {
public
MetaModel
change
(
MetaModel
et
)
{
return
super
.
change
(
et
);
}
/**
* [ExportFile:导出文件] 行为扩展:导出文件zip格式
* @param et
* @return
*/
@Override
@Transactional
public
MetaModel
exportFile
(
MetaModel
et
)
{
return
super
.
exportFile
(
et
);
}
}
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/IMetaModelService.java
浏览文件 @
086dcbd6
...
...
@@ -39,6 +39,8 @@ public interface IMetaModelService extends IService<MetaModel> {
MetaModel
change
(
MetaModel
et
);
boolean
changeBatch
(
List
<
MetaModel
>
etList
);
boolean
checkKey
(
MetaModel
et
);
MetaModel
exportFile
(
MetaModel
et
);
boolean
exportFileBatch
(
List
<
MetaModel
>
etList
);
boolean
save
(
MetaModel
et
);
@CacheEvict
(
value
=
"metamodel"
,
allEntries
=
true
)
void
saveBatch
(
List
<
MetaModel
>
list
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaModelServiceImpl.java
浏览文件 @
086dcbd6
...
...
@@ -149,6 +149,22 @@ public class MetaModelServiceImpl extends ServiceImpl<MetaModelMapper, MetaModel
public
boolean
checkKey
(
MetaModel
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
())));
}
@Override
@Transactional
public
MetaModel
exportFile
(
MetaModel
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
exportFileBatch
(
List
<
MetaModel
>
etList
)
{
for
(
MetaModel
et
:
etList
)
{
exportFile
(
et
);
}
return
true
;
}
@Override
@Transactional
public
boolean
save
(
MetaModel
et
)
{
...
...
ibzdst-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
086dcbd6
...
...
@@ -328,7 +328,7 @@
<!--输出实体[META_MODEL]数据结构 -->
<changeSet
author=
"root"
id=
"tab-meta_model-
18
-12"
>
<changeSet
author=
"root"
id=
"tab-meta_model-
20
-12"
>
<createTable
tableName=
"IBZMODEL"
>
<column
name=
"MODELID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_MODEL_MODELID"
/>
...
...
ibzdst-core/src/main/resources/permission/systemResource.json
浏览文件 @
086dcbd6
...
...
@@ -120,7 +120,7 @@
"delogicname"
:
"模型"
,
"sysmoudle"
:{
"id"
:
"LITE"
,
"name"
:
"lite"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Change"
,
"name"
:
"change"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"deaction"
:[{
"id"
:
"Create"
,
"name"
:
"Create"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Update"
,
"name"
:
"Update"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Remove"
,
"name"
:
"Remove"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Get"
,
"name"
:
"Get"
,
"type"
:
"BUILTIN"
},{
"id"
:
"GetDraft"
,
"name"
:
"GetDraft"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Change"
,
"name"
:
"change"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"
ExportFile"
,
"name"
:
"导出文件"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"
Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
,
{
...
...
ibzdst-provider/ibzdst-provider-api/src/main/java/cn/ibizlab/api/rest/MetaModelResource.java
浏览文件 @
086dcbd6
...
...
@@ -138,6 +138,23 @@ public class MetaModelResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metamodelService
.
checkKey
(
metamodelMapping
.
toDomain
(
metamodeldto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-MetaModel-ExportFile-all')"
)
@ApiOperation
(
value
=
"导出文件"
,
tags
=
{
"模型"
},
notes
=
"导出文件"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metamodels/{metamodel_id}/exportfile"
)
public
ResponseEntity
<
MetaModelDTO
>
exportFile
(
@PathVariable
(
"metamodel_id"
)
String
metamodel_id
,
@RequestBody
MetaModelDTO
metamodeldto
)
{
MetaModel
domain
=
metamodelMapping
.
toDomain
(
metamodeldto
);
domain
.
setId
(
metamodel_id
);
domain
=
metamodelService
.
exportFile
(
domain
);
metamodeldto
=
metamodelMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metamodeldto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-MetaModel-ExportFile-all')"
)
@ApiOperation
(
value
=
"批量处理[导出文件]"
,
tags
=
{
"模型"
},
notes
=
"批量处理[导出文件]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metamodels/{metamodel_id}/exportfilebatch"
)
public
ResponseEntity
<
Boolean
>
exportFileBatch
(
@RequestBody
List
<
MetaModelDTO
>
metamodeldtos
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metamodelService
.
exportFileBatch
(
metamodelMapping
.
toDomain
(
metamodeldtos
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzdst-MetaModel-Save-all')"
)
@ApiOperation
(
value
=
"保存模型"
,
tags
=
{
"模型"
},
notes
=
"保存模型"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metamodels/save"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录