Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdst
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdst
提交
26752799
提交
26752799
编写于
1月 20, 2021
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
demoadmin 发布系统代码 [ibz-dst,应用]
上级
3e40bc62
变更
9
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
181 行增加
和
13 行删除
+181
-13
MetaEntity.java
...src/main/java/cn/ibizlab/core/lite/domain/MetaEntity.java
+32
-0
IMetaDataSetService.java
...ava/cn/ibizlab/core/lite/service/IMetaDataSetService.java
+1
-0
IMetaFieldService.java
.../java/cn/ibizlab/core/lite/service/IMetaFieldService.java
+1
-0
IMetaRelationshipService.java
...n/ibizlab/core/lite/service/IMetaRelationshipService.java
+2
-0
MetaDataSetServiceImpl.java
...bizlab/core/lite/service/impl/MetaDataSetServiceImpl.java
+32
-3
MetaEntityServiceImpl.java
...ibizlab/core/lite/service/impl/MetaEntityServiceImpl.java
+16
-0
MetaFieldServiceImpl.java
.../ibizlab/core/lite/service/impl/MetaFieldServiceImpl.java
+32
-3
MetaRelationshipServiceImpl.java
...b/core/lite/service/impl/MetaRelationshipServiceImpl.java
+61
-3
h2_table.xml
ibzdst-core/src/main/resources/liquibase/h2_table.xml
+4
-4
未找到文件。
ibzdst-core/src/main/java/cn/ibizlab/core/lite/domain/MetaEntity.java
浏览文件 @
26752799
...
...
@@ -179,6 +179,38 @@ public class MetaEntity extends EntityMP implements Serializable {
private
cn
.
ibizlab
.
core
.
lite
.
domain
.
MetaModule
module
;
/**
* 数据集
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
List
<
cn
.
ibizlab
.
core
.
lite
.
domain
.
MetaDataSet
>
dataSets
;
/**
* 属性
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
List
<
cn
.
ibizlab
.
core
.
lite
.
domain
.
MetaField
>
fields
;
/**
* 实体关系
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
List
<
cn
.
ibizlab
.
core
.
lite
.
domain
.
MetaRelationship
>
parentEntitys
;
/**
* 实体关系
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
List
<
cn
.
ibizlab
.
core
.
lite
.
domain
.
MetaRelationship
>
subEntitys
;
/**
* 设置 [实体名]
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/IMetaDataSetService.java
浏览文件 @
26752799
...
...
@@ -39,6 +39,7 @@ public interface IMetaDataSetService extends IService<MetaDataSet> {
Page
<
MetaDataSet
>
searchDefault
(
MetaDataSetSearchContext
context
);
List
<
MetaDataSet
>
selectByEntityId
(
String
entity_id
);
void
removeByEntityId
(
String
entity_id
);
void
saveByEntityId
(
String
entity_id
,
List
<
MetaDataSet
>
list
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/IMetaFieldService.java
浏览文件 @
26752799
...
...
@@ -39,6 +39,7 @@ public interface IMetaFieldService extends IService<MetaField> {
Page
<
MetaField
>
searchDefault
(
MetaFieldSearchContext
context
);
List
<
MetaField
>
selectByEntityId
(
String
entity_id
);
void
removeByEntityId
(
String
entity_id
);
void
saveByEntityId
(
String
entity_id
,
List
<
MetaField
>
list
)
;
List
<
MetaField
>
selectByRefFieldId
(
String
field_id
);
void
removeByRefFieldId
(
String
field_id
);
List
<
MetaField
>
selectByRelationId
(
String
id
);
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/IMetaRelationshipService.java
浏览文件 @
26752799
...
...
@@ -39,8 +39,10 @@ public interface IMetaRelationshipService extends IService<MetaRelationship> {
Page
<
MetaRelationship
>
searchDefault
(
MetaRelationshipSearchContext
context
);
List
<
MetaRelationship
>
selectByEntityId
(
String
entity_id
);
void
removeByEntityId
(
String
entity_id
);
void
saveByEntityId
(
String
entity_id
,
List
<
MetaRelationship
>
list
)
;
List
<
MetaRelationship
>
selectByRefEntityId
(
String
entity_id
);
void
removeByRefEntityId
(
String
entity_id
);
void
saveByRefEntityId
(
String
entity_id
,
List
<
MetaRelationship
>
list
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaDataSetServiceImpl.java
浏览文件 @
26752799
...
...
@@ -198,6 +198,38 @@ public class MetaDataSetServiceImpl extends ServiceImpl<MetaDataSetMapper, MetaD
this
.
remove
(
new
QueryWrapper
<
MetaDataSet
>().
eq
(
"entityid"
,
entity_id
));
}
public
IMetaDataSetService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
@Override
public
void
saveByEntityId
(
String
entity_id
,
List
<
MetaDataSet
>
list
)
{
if
(
list
==
null
)
return
;
Set
<
String
>
delIds
=
new
HashSet
<
String
>();
List
<
MetaDataSet
>
_update
=
new
ArrayList
<
MetaDataSet
>();
List
<
MetaDataSet
>
_create
=
new
ArrayList
<
MetaDataSet
>();
for
(
MetaDataSet
before:
selectByEntityId
(
entity_id
)){
delIds
.
add
(
before
.
getDatasetId
());
}
for
(
MetaDataSet
sub:
list
)
{
sub
.
setEntityId
(
entity_id
);
if
(
ObjectUtils
.
isEmpty
(
sub
.
getDatasetId
()))
sub
.
setDatasetId
((
String
)
sub
.
getDefaultKey
(
true
));
if
(
delIds
.
contains
(
sub
.
getDatasetId
()))
{
delIds
.
remove
(
sub
.
getDatasetId
());
_update
.
add
(
sub
);
}
else
_create
.
add
(
sub
);
}
if
(
_update
.
size
()>
0
)
getProxyService
().
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
getProxyService
().
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
getProxyService
().
removeBatch
(
delIds
);
}
/**
* 查询集合 数据集
...
...
@@ -259,9 +291,6 @@ public class MetaDataSetServiceImpl extends ServiceImpl<MetaDataSetMapper, MetaD
public
IMetaDataSetService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaEntityServiceImpl.java
浏览文件 @
26752799
...
...
@@ -76,6 +76,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
{
return
false
;
}
metadatasetService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getDataSets
());
metafieldService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getFields
());
metarelationshipService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getParentEntitys
());
metarelationshipService
.
saveByRefEntityId
(
et
.
getEntityId
(),
et
.
getSubEntitys
());
CachedBeanCopier
.
copy
(
get
(
et
.
getEntityId
()),
et
);
return
true
;
}
...
...
@@ -94,6 +98,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
if
(!
update
(
et
,
(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"entityid"
,
et
.
getEntityId
())))
{
return
false
;
}
metadatasetService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getDataSets
());
metafieldService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getFields
());
metarelationshipService
.
saveByEntityId
(
et
.
getEntityId
(),
et
.
getParentEntitys
());
metarelationshipService
.
saveByRefEntityId
(
et
.
getEntityId
(),
et
.
getSubEntitys
());
CachedBeanCopier
.
copy
(
get
(
et
.
getEntityId
()),
et
);
return
true
;
}
...
...
@@ -108,6 +116,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
@Override
@Transactional
public
boolean
remove
(
String
key
)
{
metadatasetService
.
removeByEntityId
(
key
)
;
metafieldService
.
removeByEntityId
(
key
)
;
metarelationshipService
.
removeByEntityId
(
key
)
;
metarelationshipService
.
removeByRefEntityId
(
key
)
;
boolean
result
=
removeById
(
key
);
return
result
;
}
...
...
@@ -127,6 +139,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
et
.
setEntityId
(
key
);
}
else
{
et
.
setDataSets
(
metadatasetService
.
selectByEntityId
(
key
));
et
.
setFields
(
metafieldService
.
selectByEntityId
(
key
));
et
.
setParentEntitys
(
metarelationshipService
.
selectByEntityId
(
key
));
et
.
setSubEntitys
(
metarelationshipService
.
selectByRefEntityId
(
key
));
}
return
et
;
}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaFieldServiceImpl.java
浏览文件 @
26752799
...
...
@@ -203,6 +203,38 @@ public class MetaFieldServiceImpl extends ServiceImpl<MetaFieldMapper, MetaField
this
.
remove
(
new
QueryWrapper
<
MetaField
>().
eq
(
"entityid"
,
entity_id
));
}
public
IMetaFieldService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
@Override
public
void
saveByEntityId
(
String
entity_id
,
List
<
MetaField
>
list
)
{
if
(
list
==
null
)
return
;
Set
<
String
>
delIds
=
new
HashSet
<
String
>();
List
<
MetaField
>
_update
=
new
ArrayList
<
MetaField
>();
List
<
MetaField
>
_create
=
new
ArrayList
<
MetaField
>();
for
(
MetaField
before:
selectByEntityId
(
entity_id
)){
delIds
.
add
(
before
.
getFieldId
());
}
for
(
MetaField
sub:
list
)
{
sub
.
setEntityId
(
entity_id
);
if
(
ObjectUtils
.
isEmpty
(
sub
.
getFieldId
()))
sub
.
setFieldId
((
String
)
sub
.
getDefaultKey
(
true
));
if
(
delIds
.
contains
(
sub
.
getFieldId
()))
{
delIds
.
remove
(
sub
.
getFieldId
());
_update
.
add
(
sub
);
}
else
_create
.
add
(
sub
);
}
if
(
_update
.
size
()>
0
)
getProxyService
().
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
getProxyService
().
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
getProxyService
().
removeBatch
(
delIds
);
}
@Override
public
List
<
MetaField
>
selectByRefFieldId
(
String
field_id
)
{
return
baseMapper
.
selectByRefFieldId
(
field_id
);
...
...
@@ -306,9 +338,6 @@ public class MetaFieldServiceImpl extends ServiceImpl<MetaFieldMapper, MetaField
public
IMetaFieldService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibzdst-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaRelationshipServiceImpl.java
浏览文件 @
26752799
...
...
@@ -201,6 +201,38 @@ public class MetaRelationshipServiceImpl extends ServiceImpl<MetaRelationshipMap
this
.
remove
(
new
QueryWrapper
<
MetaRelationship
>().
eq
(
"entityid"
,
entity_id
));
}
public
IMetaRelationshipService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
@Override
public
void
saveByEntityId
(
String
entity_id
,
List
<
MetaRelationship
>
list
)
{
if
(
list
==
null
)
return
;
Set
<
String
>
delIds
=
new
HashSet
<
String
>();
List
<
MetaRelationship
>
_update
=
new
ArrayList
<
MetaRelationship
>();
List
<
MetaRelationship
>
_create
=
new
ArrayList
<
MetaRelationship
>();
for
(
MetaRelationship
before:
selectByEntityId
(
entity_id
)){
delIds
.
add
(
before
.
getId
());
}
for
(
MetaRelationship
sub:
list
)
{
sub
.
setEntityId
(
entity_id
);
if
(
ObjectUtils
.
isEmpty
(
sub
.
getId
()))
sub
.
setId
((
String
)
sub
.
getDefaultKey
(
true
));
if
(
delIds
.
contains
(
sub
.
getId
()))
{
delIds
.
remove
(
sub
.
getId
());
_update
.
add
(
sub
);
}
else
_create
.
add
(
sub
);
}
if
(
_update
.
size
()>
0
)
getProxyService
().
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
getProxyService
().
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
getProxyService
().
removeBatch
(
delIds
);
}
@Override
public
List
<
MetaRelationship
>
selectByRefEntityId
(
String
entity_id
)
{
return
baseMapper
.
selectByRefEntityId
(
entity_id
);
...
...
@@ -210,6 +242,35 @@ public class MetaRelationshipServiceImpl extends ServiceImpl<MetaRelationshipMap
this
.
remove
(
new
QueryWrapper
<
MetaRelationship
>().
eq
(
"refentityid"
,
entity_id
));
}
@Override
public
void
saveByRefEntityId
(
String
entity_id
,
List
<
MetaRelationship
>
list
)
{
if
(
list
==
null
)
return
;
Set
<
String
>
delIds
=
new
HashSet
<
String
>();
List
<
MetaRelationship
>
_update
=
new
ArrayList
<
MetaRelationship
>();
List
<
MetaRelationship
>
_create
=
new
ArrayList
<
MetaRelationship
>();
for
(
MetaRelationship
before:
selectByRefEntityId
(
entity_id
)){
delIds
.
add
(
before
.
getId
());
}
for
(
MetaRelationship
sub:
list
)
{
sub
.
setRefEntityId
(
entity_id
);
if
(
ObjectUtils
.
isEmpty
(
sub
.
getId
()))
sub
.
setId
((
String
)
sub
.
getDefaultKey
(
true
));
if
(
delIds
.
contains
(
sub
.
getId
()))
{
delIds
.
remove
(
sub
.
getId
());
_update
.
add
(
sub
);
}
else
_create
.
add
(
sub
);
}
if
(
_update
.
size
()>
0
)
getProxyService
().
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
getProxyService
().
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
getProxyService
().
removeBatch
(
delIds
);
}
/**
* 查询集合 数据集
...
...
@@ -282,9 +343,6 @@ public class MetaRelationshipServiceImpl extends ServiceImpl<MetaRelationshipMap
public
IMetaRelationshipService
getProxyService
()
{
return
cn
.
ibizlab
.
util
.
security
.
SpringContextHolder
.
getBean
(
this
.
getClass
());
}
}
...
...
ibzdst-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
26752799
...
...
@@ -210,7 +210,7 @@
<!--输出实体[META_DATASET]数据结构 -->
<changeSet
author=
"root"
id=
"tab-meta_dataset-
3
-9"
>
<changeSet
author=
"root"
id=
"tab-meta_dataset-
4
-9"
>
<createTable
tableName=
"IBZDATASET"
>
<column
name=
"DATASETID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_DATASET_DATASETID"
/>
...
...
@@ -232,7 +232,7 @@
<!--输出实体[META_ENTITY]数据结构 -->
<changeSet
author=
"root"
id=
"tab-meta_entity-
17
-10"
>
<changeSet
author=
"root"
id=
"tab-meta_entity-
21
-10"
>
<createTable
tableName=
"IBZENTITY"
>
<column
name=
"ENTITYID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_ENTITY_ENTITYID"
/>
...
...
@@ -264,7 +264,7 @@
<!--输出实体[META_FIELD]数据结构 -->
<changeSet
author=
"root"
id=
"tab-meta_field-
8
-11"
>
<changeSet
author=
"root"
id=
"tab-meta_field-
9
-11"
>
<createTable
tableName=
"IBZFIELD"
>
<column
name=
"FIELDID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_FIELD_FIELDID"
/>
...
...
@@ -372,7 +372,7 @@
<!--输出实体[META_RELATION]数据结构 -->
<changeSet
author=
"root"
id=
"tab-meta_relation-
9
-14"
>
<changeSet
author=
"root"
id=
"tab-meta_relation-
12
-14"
>
<createTable
tableName=
"IBZRELATION"
>
<column
name=
"RELATIONID"
remarks=
""
type=
"VARCHAR(100)"
>
<constraints
primaryKey=
"true"
primaryKeyName=
"PK_META_RELATION_RELATIONID"
/>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录