Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
47dd6b9a
提交
47dd6b9a
编写于
3月 03, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 发布系统代码 [ibz-lite,应用]
上级
38195632
变更
7
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
107 行增加
和
4 行删除
+107
-4
meta-dynamic-models.ts
...rc/mock/entity/meta-dynamic-models/meta-dynamic-models.ts
+38
-0
meta-dynamic-model-service-base.ts
...ice/meta-dynamic-model/meta-dynamic-model-service-base.ts
+28
-0
IMetaDynamicModelService.java
...n/ibizlab/core/lite/service/IMetaDynamicModelService.java
+2
-0
MetaDynamicModelServiceImpl.java
...b/core/lite/service/impl/MetaDynamicModelServiceImpl.java
+16
-0
h2_table.xml
ibzlite-core/src/main/resources/liquibase/h2_table.xml
+3
-3
systemResource.json
...te-core/src/main/resources/permission/systemResource.json
+1
-1
MetaDynamicModelResource.java
...in/java/cn/ibizlab/api/rest/MetaDynamicModelResource.java
+19
-0
未找到文件。
app_web/src/mock/entity/meta-dynamic-models/meta-dynamic-models.ts
浏览文件 @
47dd6b9a
...
@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey
...
@@ -233,6 +233,44 @@ mock.onPost(new RegExp(/^\/metadynamicmodels\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey
return
[
status
,
data
];
return
[
status
,
data
];
});
});
// Init
mock
.
onPost
(
new
RegExp
(
/^
\/
metadynamicmodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
init$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:metadynamicmodel 方法: Init"
);
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
>
=
[
'configid'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
metadynamicmodels
\/([
a-zA-Z0-9
\-\;]{1,35})\/
init$/
).
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.configid, tempValue.configid));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'configid'
]
==
tempValue
[
'configid'
]
){
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
];
});
// Publish
// Publish
mock
.
onPost
(
new
RegExp
(
/^
\/
metadynamicmodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
publish$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onPost
(
new
RegExp
(
/^
\/
metadynamicmodels
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
publish$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:metadynamicmodel 方法: Publish"
);
console
.
groupCollapsed
(
"实体:metadynamicmodel 方法: Publish"
);
...
...
app_web/src/service/meta-dynamic-model/meta-dynamic-model-service-base.ts
浏览文件 @
47dd6b9a
...
@@ -154,6 +154,34 @@ export default class MetaDynamicModelServiceBase extends EntityService {
...
@@ -154,6 +154,34 @@ export default class MetaDynamicModelServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Init接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public
async
Init
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/metadynamicmodels/
${
context
.
metadynamicmodel
}
/init`
,
data
,
isloading
);
return
res
;
}
/**
* InitBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MetaDynamicModelServiceBase
*/
public
async
InitBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/metadynamicmodels/initbatch`
,
tempData
,
isloading
);
}
/**
/**
* Publish接口方法
* Publish接口方法
*
*
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/IMetaDynamicModelService.java
浏览文件 @
47dd6b9a
...
@@ -34,6 +34,8 @@ public interface IMetaDynamicModelService extends IService<MetaDynamicModel> {
...
@@ -34,6 +34,8 @@ public interface IMetaDynamicModelService extends IService<MetaDynamicModel> {
MetaDynamicModel
get
(
String
key
);
MetaDynamicModel
get
(
String
key
);
MetaDynamicModel
getDraft
(
MetaDynamicModel
et
);
MetaDynamicModel
getDraft
(
MetaDynamicModel
et
);
boolean
checkKey
(
MetaDynamicModel
et
);
boolean
checkKey
(
MetaDynamicModel
et
);
MetaDynamicModel
init
(
MetaDynamicModel
et
);
boolean
initBatch
(
List
<
MetaDynamicModel
>
etList
);
MetaDynamicModel
publish
(
MetaDynamicModel
et
);
MetaDynamicModel
publish
(
MetaDynamicModel
et
);
boolean
publishBatch
(
List
<
MetaDynamicModel
>
etList
);
boolean
publishBatch
(
List
<
MetaDynamicModel
>
etList
);
boolean
save
(
MetaDynamicModel
et
);
boolean
save
(
MetaDynamicModel
et
);
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaDynamicModelServiceImpl.java
浏览文件 @
47dd6b9a
...
@@ -123,6 +123,22 @@ public class MetaDynamicModelServiceImpl extends ServiceImpl<MetaDynamicModelMap
...
@@ -123,6 +123,22 @@ public class MetaDynamicModelServiceImpl extends ServiceImpl<MetaDynamicModelMap
public
boolean
checkKey
(
MetaDynamicModel
et
)
{
public
boolean
checkKey
(
MetaDynamicModel
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getConfigid
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getConfigid
())));
return
(!
ObjectUtils
.
isEmpty
(
et
.
getConfigid
()))
&&
(!
Objects
.
isNull
(
this
.
getById
(
et
.
getConfigid
())));
}
}
@Override
@Transactional
public
MetaDynamicModel
init
(
MetaDynamicModel
et
)
{
//自定义代码
return
et
;
}
@Override
@Transactional
public
boolean
initBatch
(
List
<
MetaDynamicModel
>
etList
)
{
for
(
MetaDynamicModel
et
:
etList
)
{
init
(
et
);
}
return
true
;
}
@Override
@Override
@Transactional
@Transactional
public
MetaDynamicModel
publish
(
MetaDynamicModel
et
)
{
public
MetaDynamicModel
publish
(
MetaDynamicModel
et
)
{
...
...
ibzlite-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
47dd6b9a
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
<!--输出实体[META_DYNAMICMODEL]数据结构 -->
<!--输出实体[META_DYNAMICMODEL]数据结构 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-meta_dynamicmodel-1
05
-12"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"tab-meta_dynamicmodel-1
17
-12"
>
<createTable
tableName=
"IBZDYNAMICMODEL"
>
<createTable
tableName=
"IBZDYNAMICMODEL"
>
<column
name=
"DYNAINSTID"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"DYNAINSTID"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</column>
...
@@ -448,10 +448,10 @@
...
@@ -448,10 +448,10 @@
<!--输出实体[DST_VIEW]外键关系 -->
<!--输出实体[DST_VIEW]外键关系 -->
<!--输出实体[META_DATASET]外键关系 -->
<!--输出实体[META_DATASET]外键关系 -->
<!--输出实体[META_DYNAMICMODEL]外键关系 -->
<!--输出实体[META_DYNAMICMODEL]外键关系 -->
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-meta_dynamicmodel-1
05
-18"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-meta_dynamicmodel-1
17
-18"
>
<addForeignKeyConstraint
baseColumnNames=
"SYSTEMID"
baseTableName=
"IBZDYNAMICMODEL"
constraintName=
"DER1N_META_DYNAMICMODEL_DST_SY"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PSSYSTEMID"
referencedTableName=
"IBZPSSYSTEM"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SYSTEMID"
baseTableName=
"IBZDYNAMICMODEL"
constraintName=
"DER1N_META_DYNAMICMODEL_DST_SY"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PSSYSTEMID"
referencedTableName=
"IBZPSSYSTEM"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-meta_dynamicmodel-1
05
-19"
>
<changeSet
author=
"a_A_5d9d78509"
id=
"fk-meta_dynamicmodel-1
17
-19"
>
<addForeignKeyConstraint
baseColumnNames=
"PDYNAINSTID"
baseTableName=
"IBZDYNAMICMODEL"
constraintName=
"DER1N_META_DYNAMICMODEL_META_D"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CONFIGID"
referencedTableName=
"IBZDYNAMICMODEL"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PDYNAINSTID"
baseTableName=
"IBZDYNAMICMODEL"
constraintName=
"DER1N_META_DYNAMICMODEL_META_D"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CONFIGID"
referencedTableName=
"IBZDYNAMICMODEL"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[META_ENTITY]外键关系 -->
<!--输出实体[META_ENTITY]外键关系 -->
...
...
ibzlite-core/src/main/resources/permission/systemResource.json
浏览文件 @
47dd6b9a
...
@@ -120,7 +120,7 @@
...
@@ -120,7 +120,7 @@
"delogicname"
:
"动态模型"
,
"delogicname"
:
"动态模型"
,
"sysmoudle"
:{
"id"
:
"LITE"
,
"name"
:
"lite"
},
"sysmoudle"
:{
"id"
:
"LITE"
,
"name"
:
"lite"
},
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
},{
"id"
:
"DynaInst"
,
"name"
:
"主实例数据查询"
}],
"dedataset"
:[{
"id"
:
"Default"
,
"name"
:
"数据集"
},{
"id"
:
"DynaInst"
,
"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"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"Publish"
,
"name"
:
"发布模型"
,
"type"
:
"USERCUSTOM"
},{
"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"
:
"CheckKey"
,
"name"
:
"CheckKey"
,
"type"
:
"BUILTIN"
},{
"id"
:
"
Init"
,
"name"
:
"初始化副本实例"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"
Publish"
,
"name"
:
"发布模型"
,
"type"
:
"USERCUSTOM"
},{
"id"
:
"Save"
,
"name"
:
"Save"
,
"type"
:
"BUILTIN"
}],
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
"datascope"
:[{
"id"
:
"all"
,
"name"
:
"全部数据"
}]
}
}
,
{
,
{
...
...
ibzlite-provider/ibzlite-provider-api/src/main/java/cn/ibizlab/api/rest/MetaDynamicModelResource.java
浏览文件 @
47dd6b9a
...
@@ -121,6 +121,25 @@ public class MetaDynamicModelResource {
...
@@ -121,6 +121,25 @@ public class MetaDynamicModelResource {
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metadynamicmodelService
.
checkKey
(
metadynamicmodelMapping
.
toDomain
(
metadynamicmodeldto
)));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metadynamicmodelService
.
checkKey
(
metadynamicmodelMapping
.
toDomain
(
metadynamicmodeldto
)));
}
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDynamicModel-Init-all')"
)
@ApiOperation
(
value
=
"初始化副本实例"
,
tags
=
{
"动态模型"
},
notes
=
"初始化副本实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metadynamicmodels/{metadynamicmodel_id}/init"
)
public
ResponseEntity
<
MetaDynamicModelDTO
>
init
(
@PathVariable
(
"metadynamicmodel_id"
)
String
metadynamicmodel_id
,
@RequestBody
MetaDynamicModelDTO
metadynamicmodeldto
)
{
MetaDynamicModel
domain
=
metadynamicmodelMapping
.
toDomain
(
metadynamicmodeldto
);
domain
.
setConfigid
(
metadynamicmodel_id
);
domain
=
metadynamicmodelService
.
init
(
domain
);
metadynamicmodeldto
=
metadynamicmodelMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
metadynamicmodeldto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDynamicModel-Init-all')"
)
@ApiOperation
(
value
=
"批量处理[初始化副本实例]"
,
tags
=
{
"动态模型"
},
notes
=
"批量处理[初始化副本实例]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metadynamicmodels/initbatch"
)
public
ResponseEntity
<
Boolean
>
initBatch
(
@RequestBody
List
<
MetaDynamicModelDTO
>
metadynamicmodeldtos
)
{
List
<
MetaDynamicModel
>
domains
=
metadynamicmodelMapping
.
toDomain
(
metadynamicmodeldtos
);
boolean
result
=
metadynamicmodelService
.
initBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDynamicModel-Publish-all')"
)
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibzlite-MetaDynamicModel-Publish-all')"
)
@ApiOperation
(
value
=
"发布模型"
,
tags
=
{
"动态模型"
},
notes
=
"发布模型"
)
@ApiOperation
(
value
=
"发布模型"
,
tags
=
{
"动态模型"
},
notes
=
"发布模型"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metadynamicmodels/{metadynamicmodel_id}/publish"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/metadynamicmodels/{metadynamicmodel_id}/publish"
)
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录