Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzlite
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzlite
提交
b23b6d5e
提交
b23b6d5e
编写于
9月 15, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
a3c3e28c
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
177 行增加
和
0 行删除
+177
-0
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
-0
MetaEntityServiceImpl.java
...ibizlab/core/lite/service/impl/MetaEntityServiceImpl.java
+16
-0
MetaFieldServiceImpl.java
.../ibizlab/core/lite/service/impl/MetaFieldServiceImpl.java
+32
-0
MetaRelationshipServiceImpl.java
...b/core/lite/service/impl/MetaRelationshipServiceImpl.java
+61
-0
未找到文件。
ibzlite-core/src/main/java/cn/ibizlab/core/lite/domain/MetaEntity.java
浏览文件 @
b23b6d5e
...
...
@@ -123,6 +123,38 @@ public class MetaEntity extends EntityMP implements Serializable {
private
cn
.
ibizlab
.
core
.
lite
.
domain
.
DstSystem
system
;
/**
* 数据集
*/
@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
;
/**
* 设置 [实体名]
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/IMetaDataSetService.java
浏览文件 @
b23b6d5e
...
...
@@ -40,6 +40,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}
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/IMetaFieldService.java
浏览文件 @
b23b6d5e
...
...
@@ -40,6 +40,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
)
;
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/IMetaRelationshipService.java
浏览文件 @
b23b6d5e
...
...
@@ -40,8 +40,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}
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaDataSetServiceImpl.java
浏览文件 @
b23b6d5e
...
...
@@ -168,6 +168,38 @@ public class MetaDataSetServiceImpl extends ServiceImpl<MetaDataSetMapper, MetaD
this
.
remove
(
new
QueryWrapper
<
MetaDataSet
>().
eq
(
"entityid"
,
entity_id
));
}
@Autowired
@Lazy
IMetaDataSetService
proxyService
;
@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
)
proxyService
.
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
proxyService
.
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
proxyService
.
removeBatch
(
delIds
);
}
/**
* 查询集合 数据集
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaEntityServiceImpl.java
浏览文件 @
b23b6d5e
...
...
@@ -72,6 +72,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
fillParentData
(
et
);
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
;
}
...
...
@@ -89,6 +93,10 @@ public class MetaEntityServiceImpl extends ServiceImpl<MetaEntityMapper, MetaEnt
fillParentData
(
et
);
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
;
}
...
...
@@ -103,6 +111,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
;
}
...
...
@@ -122,6 +134,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
;
}
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaFieldServiceImpl.java
浏览文件 @
b23b6d5e
...
...
@@ -173,6 +173,38 @@ public class MetaFieldServiceImpl extends ServiceImpl<MetaFieldMapper, MetaField
this
.
remove
(
new
QueryWrapper
<
MetaField
>().
eq
(
"entityid"
,
entity_id
));
}
@Autowired
@Lazy
IMetaFieldService
proxyService
;
@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
)
proxyService
.
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
proxyService
.
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
proxyService
.
removeBatch
(
delIds
);
}
@Override
public
List
<
MetaField
>
selectByRefFieldId
(
String
field_id
)
{
return
baseMapper
.
selectByRefFieldId
(
field_id
);
...
...
ibzlite-core/src/main/java/cn/ibizlab/core/lite/service/impl/MetaRelationshipServiceImpl.java
浏览文件 @
b23b6d5e
...
...
@@ -171,6 +171,38 @@ public class MetaRelationshipServiceImpl extends ServiceImpl<MetaRelationshipMap
this
.
remove
(
new
QueryWrapper
<
MetaRelationship
>().
eq
(
"entityid"
,
entity_id
));
}
@Autowired
@Lazy
IMetaRelationshipService
proxyService
;
@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
)
proxyService
.
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
proxyService
.
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
proxyService
.
removeBatch
(
delIds
);
}
@Override
public
List
<
MetaRelationship
>
selectByRefEntityId
(
String
entity_id
)
{
return
baseMapper
.
selectByRefEntityId
(
entity_id
);
...
...
@@ -181,6 +213,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
)
proxyService
.
updateBatch
(
_update
);
if
(
_create
.
size
()>
0
)
proxyService
.
createBatch
(
_create
);
if
(
delIds
.
size
()>
0
)
proxyService
.
removeBatch
(
delIds
);
}
/**
* 查询集合 数据集
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录