Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
f4b459bf
提交
f4b459bf
编写于
10月 28, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
差异文件
合并分支 'dev' 到 'master'
Dev 查看合并请求
!33
上级
6583b3e4
46674f25
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
245 行增加
和
30 行删除
+245
-30
CHANGELOG.md
CHANGELOG.md
+7
-1
application-%APP_PKGPATH%-prod.yml.ftl
...src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
+1
-1
application-dev.yml.ftl
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
+1
-1
%DE%.java.ftl
...ava/%SYS_PKGPATH%/core/%MOD_PKGPATH%/domain/%DE%.java.ftl
+5
-5
I%DE%Service.java.ftl
...PKGPATH%/core/%MOD_PKGPATH%/service/I%DE%Service.java.ftl
+16
-2
%DE%ServiceImpl.java.ftl
.../core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
+113
-7
20200620200620_init_ibzcfg2.xml.ftl
...s/liquibase/changelog/20200620200620_init_ibzcfg2.xml.ftl
+6
-1
h2_table.xml.ftl
...UBPRJ%-core/src/main/resources/liquibase/h2_table.xml.ftl
+3
-3
view.xml.ftl
SLN/%PUBPRJ%-core/src/main/resources/liquibase/view.xml.ftl
+1
-1
%SYS%.json.ftl
SLN/%PUBPRJ%-core/src/main/resources/sysmodel/%SYS%.json.ftl
+6
-1
ESAspect.java.ftl
...src/main/java/%SYS_PKGPATH%/util/aspect/ESAspect.java.ftl
+4
-4
StaticDict.java.ftl
...src/main/java/%SYS_PKGPATH%/util/dict/StaticDict.java.ftl
+79
-0
application-sys.yml.ftl
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
+3
-3
未找到文件。
CHANGELOG.md
浏览文件 @
f4b459bf
# **iBiz4j Spring R7 Template ChangeLog**
## [v2020.10.28]
-
修复虚拟联合主键模板错误
-
修复serviceApi实体数据导入外键值检查报错问题
-
补充静态代码表
-
支持实体关系中主实体删除(同步删除、限制删除、置空)等操作
## [v2020.10.17]
-
支持es查询加速:开启查询加速的实体,在完成标准实体存储之外,还会将一份数据存入es中,用于后续在es中进行检索。
-
兼容虚拟主键、多个联合键值属性类型不统一的问题。
...
...
@@ -8,7 +15,6 @@
-
修复程序异常时,L1缓存值为空的问题。
## [v2020.09.22]
-
处理逻辑:支持处理逻辑中启动工作流
-
**实体属性:模板全局属性javaType调整(请用户自行确认并同步调整USR代码)**
-
虚拟主键:支持虚拟主键,虚拟主键由联合键值构成,新建、更新、删除等操作均通过联合键值实现
...
...
SLN/%PUBPRJ%-app/%PUBPRJ%-app-%APP_PKGPATH%/src/main/resources/application-%APP_PKGPATH%-prod.yml.ftl
浏览文件 @
f4b459bf
...
...
@@ -69,7 +69,7 @@ zuul:
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
config:
path: /config/**
path: /config
s
/**
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
<#if sys.getCodeName()!='ibzou' && sys.getCodeName()!='ibzrt'>
...
...
SLN/%PUBPRJ%-boot/src/main/resources/application-dev.yml.ftl
浏览文件 @
f4b459bf
...
...
@@ -79,7 +79,7 @@ zuul:
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
config:
path: /config/**
path: /config
s
/**
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
<#if sys.getCodeName()!='ibzou' && sys.getCodeName()!='ibzrt'>
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/domain/%DE%.java.ftl
浏览文件 @
f4b459bf
...
...
@@ -287,8 +287,8 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable {
<#
comment
>
联合主键
</#
comment
>
<#
assign
keyField
=
item
.
getKeyPSDEField
()>
<#
if
item
.
getUnionKeyValuePSDEFields
()??>
<#
assign
pr
i
vateCodeName
=
srfcaseformat
(
keyField
.
getCodeName
(),
'l_u2lC'
)
>
<#
assign
publicCodeName
=
pr
i
vateCodeName
?
cap_first
>
<#
assign
prvateCodeName
=
srfcaseformat
(
keyField
.
getCodeName
(),
'l_u2lC'
)
>
<#
assign
publicCodeName
=
prvateCodeName
?
cap_first
>
<#
if
keyField
.
isPhisicalDEField
()==
false
>
<#
comment
>
虚拟联合主键
</#
comment
>
<#
assign
unionKeySize
=
0
>
...
...
@@ -334,10 +334,10 @@ public class ${item.getCodeName()} extends EntityMP implements Serializable {
*
获取
[${
keyField
.
getLogicName
()}]
*/
public
${
srfr7javatype
(
keyField
.
getStdDataType
())}
get
${
publicCodeName
}(){
if
(
ObjectUtils
.
isEmpty
(${
pr
i
vateCodeName
})){
${
pr
i
vateCodeName
}=(${
srfr7javatype
(
keyField
.
stdDataType
)})
getDefaultKey
(
true
);
if
(
ObjectUtils
.
isEmpty
(${
prvateCodeName
})){
${
prvateCodeName
}=(${
srfr7javatype
(
keyField
.
stdDataType
)})
getDefaultKey
(
true
);
}
return
${
pr
i
vateCodeName
};
return
${
prvateCodeName
};
}
@
Override
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/I%DE%Service.java.ftl
浏览文件 @
f4b459bf
...
...
@@ -176,11 +176,25 @@ public interface I${item.codeName}Service{
<#
if
de
.
getDefaultPSDEDataSet
()??>
<#
assign
deDefaultDataSet
=
de
.
getDefaultPSDEDataSet
()>
<#
if
deDefaultDataSet
.
getPSDEDataQueries
()??>
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
;
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
});
<#
comment
>
主实体关联实体行为
</#
comment
>
<#
if
MinorPSDER
.
getRemoveActionType
()??>
<#
if
MinorPSDER
.
getRemoveActionType
()?
c
==
'3'
><#
comment
>
限制删除
</#
comment
>
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
);
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'2'
><#
comment
>
置空
</#
comment
>
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
});
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
);
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'1'
><#
comment
>
同时删除
</#
comment
>
<#
if
item
.
isEnableEntityCache
()==
true
>
@
CacheEvict
(
value
=
"${item.codeName?lower_case}"
,
allEntries
=
true
)
</#
if
>
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
);
</#
if
>
</#
if
>
<#
if
item
.
isEnableEntityCache
()==
true
>
@
CacheEvict
(
value
=
"${item.codeName?lower_case}"
,
allEntries
=
true
)
</#
if
>
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
;
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
});
<#
assign
nested
=
MinorPSDER
.
isNestedRS
()>
<#
if
nested
==
false
&&
MinorPSDER
.
getMinorPSDataEntity
().
getAllPSDEServiceAPIs
()??>
<#
list
MinorPSDER
.
getMinorPSDataEntity
().
getAllPSDEServiceAPIs
()
as
api
>
...
...
SLN/%PUBPRJ%-core/src/main/java/%SYS_PKGPATH%/core/%MOD_PKGPATH%/service/impl/%DE%ServiceImpl.java.ftl
浏览文件 @
f4b459bf
...
...
@@ -485,6 +485,8 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#
assign
minorKeyField
=
der
.
getMinorPSDataEntity
().
getKeyPSDEField
()>
${
srfcaseformat
(
der
.
getMinorPSDataEntity
().
getCodeName
(),
'l_u2lC'
)}
Service
.
removeBy
${
srfcaseformat
(
MajorDerField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
key
)
;
</#
if
>
<#
comment
>
主实体删除操作(同时删除、置空、限制删除)
</#
comment
>
<@
majorEntityRemove
der
/>
</#
list
>
</#
if
>
<#
comment
>
同步清除索引主实体数据
</#
comment
>
...
...
@@ -508,6 +510,8 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
<#
if
hasPSDERsMapping
>
List
<${
item
.
getCodeName
()}>
entities
=
baseMapper
.
selectBatchIds
(
idList
);
</#
if
>
<#
comment
>
主实体删除操作(同时删除、置空、限制删除)
</#
comment
>
<@
majorEntityRemoveBatch
/>
removeByIds
(
idList
);
<#
comment
>
批量更新父数据(实体关系属性映射)
</#
comment
>
<#
if
hasPSDERsMapping
>
...
...
@@ -591,7 +595,8 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
public
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
return
baseMapper
.
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
MajorkeyField
.
codeName
?
lower_case
});
}
<#
comment
>
主实体删除关联实体行为
</#
comment
>
<@
majorEntityRemove_RefAction_SqlStore
MinorPSDER
/>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
this
.
remove
(
new
QueryWrapper
<${
item
.
getCodeName
()}>().
eq
(
"${MajorField.getName()?lower_case}"
,${
MajorkeyField
.
codeName
?
lower_case
}));
...
...
@@ -1330,7 +1335,8 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
Query
query
=
new
BasicQuery
(
context
.
getSelectCond
().
get
().
toString
());
return
mongoTemplate
.
find
(
query
,${
item
.
getCodeName
()}.
class
);
}
<#
comment
>
输出主实体删除关联行为
</#
comment
>
<@
majorEntityRemove_RefAction
MinorPSDER
/>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
Set
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>
delIds
=
new
HashSet
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>();
...
...
@@ -1340,7 +1346,6 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
if
(
delIds
.
size
()>
0
)
this
.
removeBatch
(
delIds
);
}
<#
assign
nested
=
MinorPSDER
.
isNestedRS
()>
<#
if
nested
==
false
&&
MinorPSDER
.
getMinorPSDataEntity
().
getAllPSDEServiceAPIs
()??>
<#
list
MinorPSDER
.
getMinorPSDataEntity
().
getAllPSDEServiceAPIs
()
as
api
>
...
...
@@ -1865,7 +1870,8 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
context
.
setN_
${
MajorField
.
name
?
lower_case
}
_eq
(${
MajorkeyField
.
codeName
?
lower_case
});
return
${
subSysServiceApiDECodeName
?
uncap_first
}
FeignClient
.
search
${
deDefaultDataSet
.
getCodeName
()}(
context
).
getContent
();
}
<#
comment
>
输出主实体删除关联行为
</#
comment
>
<@
majorEntityRemove_RefAction
MinorPSDER
/>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
Set
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>
delIds
=
new
HashSet
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>();
...
...
@@ -2183,7 +2189,8 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
public
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
return
null
;
}
<#
comment
>
输出主实体删除关联行为
</#
comment
>
<@
majorEntityRemove_RefAction
MinorPSDER
/>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
Set
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>
delIds
=
new
HashSet
<${
srfr7javatype
(
keyfield
.
stdDataType
)}>();
...
...
@@ -2671,10 +2678,12 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#
assign
MajorEntity
=
MinorPSDER
.
getMajorPSDataEntity
()>
<#
assign
MajorEntityCodeName
=
MinorPSDER
.
getMajorPSDataEntity
().
codeName
>
<#
assign
MajorEntityService
=
srfcaseformat
(
MinorPSDER
.
getMajorPSDataEntity
().
getCodeName
(),
'l_u2lC'
)+
"Service"
>
<#
assign
MajorEntityKeyFieldCodeName
=
srfcaseformat
(
MajorEntity
.
getKeyPSDEField
().
codeName
,
'l_u2lC'
)?
cap_first
>
//
实体关系
[${
MinorPSDER
.
name
}]
if
(
!ObjectUtils.isEmpty(entity.get${MajorKeyFieldCodeName}())){
${
pub
.
getPKGCodeName
()}.
core
.${
MajorEntity
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
MajorEntityCodeName
}
fkEntity
=${
MajorEntityService
}.
getById
(
entity
.
get
${
MajorKeyFieldCodeName
}());
if
(
ObjectUtils
.
isEmpty
(
fkEntity
)){
${
pub
.
getPKGCodeName
()}.
core
.${
MajorEntity
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
MajorEntityCodeName
}
fkEntity
=
new
${
pub
.
getPKGCodeName
()}.
core
.${
MajorEntity
.
getPSSystemModule
().
getCodeName
()?
lower_case
}.
domain
.${
MajorEntityCodeName
}();
fkEntity
.
set
${
MajorEntityKeyFieldCodeName
}(
entity
.
get
${
MajorKeyFieldCodeName
}());
if
(
!${MajorEntityService}.checkKey(fkEntity)){
Integer
lineNum
=
i
+
1
;
errorLines
.
add
(
lineNum
);
errorMsgs
.
add
(
String
.
format
(
"第"
+
lineNum
+
"行:[%s]父数据有误。"
,
entity
.
get
${
MajorKeyFieldCodeName
}()));
...
...
@@ -2849,4 +2858,101 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
</#
if
>
</#
macro
>
<#
comment
>
主实体删除操作
</#
comment
>
<#
macro
majorEntityRemove
der
>
<#
if
der
.
getDERType
()
==
'DER1N'
&&
der
.
getRemoveActionType
()??
&&
der
.
getMinorPSDataEntity
()??
&&
(
der
.
getMinorPSDataEntity
().
getStorageMode
()==
1
||
der
.
getMinorPSDataEntity
().
getStorageMode
()==
2
||
der
.
getMinorPSDataEntity
().
getStorageMode
()==
4
)
>
<#
assign
MajorDerField
=
der
.
getPSPickupDEField
()>
<#
assign
minorKeyField
=
der
.
getMinorPSDataEntity
().
getKeyPSDEField
()>
<#
assign
minorEntityCodeName
=
der
.
getMinorPSDataEntity
().
getCodeName
()>
<#
if
der
.
getRemoveActionType
()?
c
==
'1'
><#
comment
>
同时删除
</#
comment
>
${
srfcaseformat
(
minorEntityCodeName
,
'l_u2lC'
)}
Service
.
removeBy
${
srfcaseformat
(
MajorDerField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
key
);
<#
elseif
der
.
getRemoveActionType
()?
c
==
'2'
><#
comment
>
置空
</#
comment
>
${
srfcaseformat
(
minorEntityCodeName
,
'l_u2lC'
)}
Service
.
resetBy
${
srfcaseformat
(
MajorDerField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
key
);
<#
elseif
der
.
getRemoveActionType
()?
c
==
'3'
><#
comment
>
限制删除
</#
comment
>
if
(
!ObjectUtils.isEmpty(${srfcaseformat(minorEntityCodeName,'l_u2lC')}Service.selectBy${srfcaseformat(MajorDerField.codeName,'l_u2lC')?cap_first}(key)))
throw
new
BadRequestAlertException
(
"删除数据失败,当前数据存在关系实体[${minorEntityCodeName}]数据,无法删除!"
,
""
,
""
);
</#
if
>
</#
if
>
</#
macro
>
<#
comment
>
主实体批量删除操作
</#
comment
>
<#
macro
majorEntityRemoveBatch
>
<#
if
de
.
getMajorPSDERs
()??>
<#
list
de
.
getMajorPSDERs
()
as
der
>
<#
if
der
.
getDERType
()
==
'DER1N'
&&
der
.
getRemoveActionType
()??
&&
der
.
getMinorPSDataEntity
()??
&&
(
der
.
getMinorPSDataEntity
().
getStorageMode
()==
1
||
der
.
getMinorPSDataEntity
().
getStorageMode
()==
2
||
der
.
getMinorPSDataEntity
().
getStorageMode
()==
4
)
>
<#
assign
MajorDerField
=
der
.
getPSPickupDEField
()>
<#
assign
minorKeyField
=
der
.
getMinorPSDataEntity
().
getKeyPSDEField
()>
<#
assign
minorEntityCodeName
=
der
.
getMinorPSDataEntity
().
getCodeName
()>
<#
if
der
.
getRemoveActionType
()?
c
==
'1'
><#
comment
>
同时删除
</#
comment
>
${
srfcaseformat
(
minorEntityCodeName
,
'l_u2lC'
)}
Service
.
removeBy
${
srfcaseformat
(
MajorDerField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
idList
);
<#
elseif
der
.
getRemoveActionType
()?
c
==
'2'
><#
comment
>
置空
</#
comment
>
${
srfcaseformat
(
minorEntityCodeName
,
'l_u2lC'
)}
Service
.
resetBy
${
srfcaseformat
(
MajorDerField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
idList
);
<#
elseif
der
.
getRemoveActionType
()?
c
==
'3'
><#
comment
>
限制删除
</#
comment
>
if
(
!ObjectUtils.isEmpty(${srfcaseformat(minorEntityCodeName,'l_u2lC')}Service.selectBy${srfcaseformat(MajorDerField.codeName,'l_u2lC')?cap_first}(idList)))
throw
new
BadRequestAlertException
(
"删除数据失败,当前数据存在关系实体[${minorEntityCodeName}]数据,无法删除!"
,
""
,
""
);
</#
if
>
</#
if
>
</#
list
>
</#
if
>
</#
macro
>
<#
comment
>
主实体关联实体行为
</#
comment
>
<#
macro
majorEntityRemove_RefAction_SqlStore
MinorPSDER
>
<#
if
MinorPSDER
.
getRemoveActionType
()??>
<#
if
MinorPSDER
.
getRemoveActionType
()?
c
==
'3'
><#
comment
>
限制删除
</#
comment
>
@
Override
public
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
return
this
.
list
(
new
QueryWrapper
<${
item
.
getCodeName
()}>().
in
(
"${MajorkeyField.codeName?lower_case}"
,
ids
));
}
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'2'
><#
comment
>
置空
</#
comment
>
@
Override
public
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
this
.
update
(
new
UpdateWrapper
<${
item
.
getCodeName
()}>().
set
(
"${MajorField.getName()?lower_case}"
,
null
).
eq
(
"${MajorField.getName()?lower_case}"
,${
MajorkeyField
.
codeName
?
lower_case
}));
}
@
Override
public
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
this
.
update
(
new
UpdateWrapper
<${
item
.
getCodeName
()}>().
set
(
"${MajorField.getName()?lower_case}"
,
null
).
in
(
"${MajorField.getName()?lower_case}"
,
ids
));
}
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'1'
><#
comment
>
同时删除
</#
comment
>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
this
.
remove
(
new
QueryWrapper
<${
item
.
getCodeName
()}>().
in
(
"${MajorField.getName()?lower_case}"
,
ids
));
}
</#
if
>
</#
if
>
</#
macro
>
<#
comment
>
主实体关联实体行为
</#
comment
>
<#
macro
majorEntityRemove_RefAction
MinorPSDER
>
<#
if
MinorPSDER
.
getRemoveActionType
()??>
<#
if
MinorPSDER
.
getRemoveActionType
()?
c
==
'3'
><#
comment
>
限制删除
</#
comment
>
@
Override
public
List
<${
item
.
getCodeName
()}>
selectBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
//
暂未支持
return
null
;
}
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'2'
><#
comment
>
置空
</#
comment
>
@
Override
public
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(${
srfr7javatype
(
MajorField
.
stdDataType
)}
${
MajorkeyField
.
codeName
?
lower_case
})
{
}
@
Override
public
void
resetBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
}
<#
elseif
MinorPSDER
.
getRemoveActionType
()?
c
==
'1'
><#
comment
>
同时删除
</#
comment
>
@
Override
public
void
removeBy
${
srfcaseformat
(
MajorField
.
codeName
,
'l_u2lC'
)?
cap_first
}(
Collection
<${
srfr7javatype
(
MajorField
.
stdDataType
)}>
ids
)
{
}
</#
if
>
</#
if
>
</#
macro
>
</#
if
>
SLN/%PUBPRJ%-core/src/main/resources/liquibase/changelog/202006
01200530_init_ibzcfg
.xml.ftl
→
SLN/%PUBPRJ%-core/src/main/resources/liquibase/changelog/202006
20200620_init_ibzcfg2
.xml.ftl
浏览文件 @
f4b459bf
...
...
@@ -3,7 +3,12 @@ TARGET=PSSYSTEM
</#ibiztemplate>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
<changeSet author="Think (generated)" id="1591012776347-1">
<changeSet author="Think (generated)" id="1592547336292-1">
<preConditions onFail="MARK_RAN" >
<not >
<tableExists tableName="IBZCFG" />
</not>
</preConditions>
<createTable remarks="配置" tableName="IBZCFG">
<column name="CFGID" remarks="配置标识" type="VARCHAR(100)">
<constraints primaryKey="true"/>
...
...
SLN/%PUBPRJ%-core/src/main/resources/liquibase/h2_table.xml.ftl
浏览文件 @
f4b459bf
...
...
@@ -28,7 +28,7 @@ TARGET=PSSYSTEM
<#assign deName=de.getName()?lower_case>
<#comment>输出表结构</#comment>
<#if !P.exists("table_",de.getTableName(),"") && bPubDb==true>
<changeSet author="
${dbinst.getUserName()}
" id="tab-${deName}-${deVersion}-${sequenceNumber}">
<changeSet author="
<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>
" id="tab-${deName}-${deVersion}-${sequenceNumber}">
<createTable tableName="${de.getTableName()}">
<#list de.getAllPSDEFields() as defield>
<#if defield.isPhisicalDEField()==true><#comment>物理属性</#comment>
...
...
@@ -48,7 +48,7 @@ TARGET=PSSYSTEM
<#assign dataType="DECIMAL(38,2)"><#comment>数据类型转换varchar-->decimal</#comment>
</#if>
<#comment>由于liquibase不支持修改mysql的remarks,修改remarks会导致启动报错,所以mysql数据库暂时不发remarks</#comment>
<column name="${defield.getName()}" remarks="<#if (dbinst.getDBType()!='MYSQL5')>${defield.getLogicName()}</#if>" type="${dataType}">
<column name="${defield.getName()}" remarks="<#if
dbinst?? &&
(dbinst.getDBType()!='MYSQL5')>${defield.getLogicName()}</#if>" type="${dataType}">
<#if defield.isKeyDEField()==true>
<#comment>oracle中约束名长度不能大于30</#comment>
<#assign constraintName="PK_"+de.getName()+"_"+defield.getName()>
...
...
@@ -92,7 +92,7 @@ TARGET=PSSYSTEM
<#assign fkConstraintName=fkConstraintName?substring(0,30)>
</#if>
<#if !P.exists("fk_",fkConstraintName,"") && bPubDb==true>
<changeSet author="
${dbinst.getUserName()}
" id="fk-${deName}-${deVersion}-${sequenceNumber}">
<changeSet author="
<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>
" id="fk-${deName}-${deVersion}-${sequenceNumber}">
<addForeignKeyConstraint baseColumnNames="${fk.getPSPickupDEField().getName()}" baseTableName="${de.getTableName()}" constraintName="${fkConstraintName}" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="${fk.getMajorPSDataEntity().getKeyPSDEField().getName()}" referencedTableName="${fk.getMajorPSDataEntity().getTableName()}" validate="true"/>
</changeSet>
</#if>
...
...
SLN/%PUBPRJ%-core/src/main/resources/liquibase/view.xml.ftl
浏览文件 @
f4b459bf
...
...
@@ -27,7 +27,7 @@ TARGET=PSSYSTEM
<#assign deName=de.getName()?lower_case>
<#if !P.exists("view_",de.getViewName(),"") && bPubDb == true>
<!--输出实体[${de.getName()}]视图结构信息 runOnChange="true" 当视图发生变更时,通过liquibase强刷prod的视图,实现视图的同步-->
<changeSet author="
${dbinst.getUserName()}
" id="view-${deName}-${deVersion}-${sequenceNumber}" runOnChange="true">
<changeSet author="
<#if dbinst?? && dbinst.getUserName()??>${dbinst.getUserName()}<#else>root</#if>
" id="view-${deName}-${deVersion}-${sequenceNumber}" runOnChange="true">
<createView fullDefinition="false" replaceIfExists="true" viewName="${de.getViewName()}">
<#if de.getAllPSDEDataQueries?? && de.getAllPSDEDataQueries()??>
<#assign resultDataQuery = de.getAllPSDEDataQueries()>
...
...
SLN/%PUBPRJ%-core/src/main/resources/sysmodel/%SYS%.json.ftl
浏览文件 @
f4b459bf
...
...
@@ -45,7 +45,9 @@ TARGET=PSSYSTEM
<#if defield.getPrecision()?c!='0'>
"data_preci":${defield.getPrecision()?c},
</#if>
<#--"expression":"",-->
<#if defield.getDefaultPSDEFDTColumn()?? && defield.getDefaultPSDEFDTColumn().isFormula()==true>
"expression":"${defield.getDefaultPSDEFDTColumn().getFormulaFormat()}",
</#if>
<#if defield.getPredefinedType()?? && defield.getPredefinedType()!=''>
"predefined":"${defield.getPredefinedType()}",
</#if>
...
...
@@ -53,6 +55,9 @@ TARGET=PSSYSTEM
<#if defield.getUnionKeyValue()?? && defield.getUnionKeyValue()!=''>
"union_key":"${defield.getUnionKeyValue()}",
</#if>
<#if defield.getOrderValue?? && defield.getOrderValue()??>
"show_order":${defield.getOrderValue()?c},
</#if>
"major_field":<#if defield.isMajorDEField()==true>1<#else>0</#if>
}<#if defield_has_next>,</#if>
</#list>
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/aspect/ESAspect.java.ftl
浏览文件 @
f4b459bf
...
...
@@ -73,7 +73,10 @@ public class ESAspect
return
;
}
Object
arg
=
args
[
0
];
if
(
arg
instanceof
EntityBase
||
arg
instanceof
List
){
if
(
"remove"
.
equals
(
action
)
||
"removeBatch"
.
equals
(
action
)){
executeESMethod
(
exService
,
action
,
arg
);
}
else
if
(
arg
instanceof
EntityBase
||
arg
instanceof
List
){
EvaluationContext
exMappingCtx
=
new
StandardEvaluationContext
();
exMappingCtx
.
setVariable
(
"service"
,
service
);
Expression
esMappingExp
=
parser
.
parseExpression
(
"#service.getESMapping()"
);
...
...
@@ -89,9 +92,6 @@ public class ESAspect
arg
=
esDomainExp
.
getValue
(
exDomainCtx
);
executeESMethod
(
exService
,
action
,
arg
);
}
else
if
(
"remove"
.
equals
(
action
)
||
"removeBatch"
.
equals
(
action
)){
executeESMethod
(
exService
,
action
,
arg
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"同步[{}]实体全文检索数据失败,{}"
,
deName
,
e
);
}
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/dict/StaticDict.java.ftl
0 → 100644
浏览文件 @
f4b459bf
<#
ibiztemplate
>
TARGET
=
PSSYSTEM
</#
ibiztemplate
>
<#
assign
hasCodeList
=
false
>
<#
if
sys
.
getAllPSCodeLists
()??>
<#
list
sys
.
getAllPSCodeLists
()
as
codeList
>
<#
if
codeList
.
getCodeListType
()==
'STATIC'
>
<#
assign
hasCodeList
=
true
>
<#
break
>
</#
if
>
</#
list
>
</#
if
>
<#
if
hasCodeList
>
package
${
pub
.
getPKGCodeName
()}.
util
.
dict
;
import
lombok
.
Getter
;
public
class
StaticDict
{
<#
if
sys
.
getAllPSCodeLists
()??>
<#
list
sys
.
getAllPSCodeLists
()
as
codeList
>
<#
assign
hasCodeItem
=
calcHasCodeItem
(
codeList
)>
<#
if
codeList
.
getCodeListType
()==
'STATIC'
&&
hasCodeItem
>
<#
assign
codeListName
=
codeList
.
codeName
>
<#
comment
>
数值代码表
int
,其余为
String
</#
comment
>
<#
if
codeList
.
isCodeItemValueNumber
()>
<#
assign
valueType
=
"int"
>
<#
else
>
<#
assign
valueType
=
"String"
>
</#
if
>
/**
*
代码表
[${
codeList
.
name
}]
*/
@
Getter
public
enum
${
codeListName
}
{
<#
if
codeList
.
getAllPSCodeItems
()??>
<#
list
codeList
.
getAllPSCodeItems
()
as
codeItem
>
<#
assign
codeItemValue
=
codeItem
.
getValue
()>
<#
assign
codeItemText
=
codeItem
.
getText
()>
${
codeItem
.
codeName
?
upper_case
}(<#
if
valueType
==
'int'
>${
codeItemValue
}<#
else
>
"${codeItemValue}"
</#
if
>,
"${codeItemText}"
)<#
if
codeItem_has_next
>,<#
else
>;</#
if
>
</#
list
>
</#
if
>
private
${
valueType
}
value
;
private
String
text
;
private
String
valueSeparator
=
"<#if codeList.getValueSeparator()??>${codeList.getValueSeparator()}</#if>"
;
private
String
textSeparator
=
"<#if codeList.getTextSeparator()??>${codeList.getTextSeparator()}</#if>"
;
private
String
emptyText
=
"<#if codeList.getEmptyText()?? && codeList.getEmptyText()!='未定义'>${codeList.getEmptyText()}</#if>"
;
${
codeListName
}(${
valueType
}
value
,
String
text
)
{
this
.
value
=
value
;
this
.
text
=
text
;
}
}
</#
if
>
</#
list
>
</#
if
>
}
</#
if
>
<#
comment
>
替换代码表中的特殊字符
</#
comment
>
<#
function
replaceCodeItemValue
codeItemValue
>
<#
assign
result
=
codeItemValue
?
replace
(
"[^
\\
w]+"
,
"_"
,
"r"
)>
<#
return
result
>
</#
function
>
<#
comment
>
判断是否含有代码项
</#
comment
>
<#
function
calcHasCodeItem
codeList
>
<#
assign
hasCodeItem
=
false
>
<#
if
codeList
.
getAllPSCodeItems
()??>
<#
list
codeList
.
getAllPSCodeItems
()
as
codeItem
>
<#
assign
hasCodeItem
=
true
>
<#
break
>
</#
list
>
</#
if
>
<#
return
hasCodeItem
>
</#
function
>
\ No newline at end of file
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
浏览文件 @
f4b459bf
...
...
@@ -348,7 +348,7 @@ seata:
pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20
isSyncDBSchema: false
defaultSchema:
${dbUserName}
defaultSchema:
<#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
conf: classpath:liquibase/master.xml
</#macro>
...
...
@@ -382,7 +382,7 @@ seata:
driver-class-name: ${dbDriver}
conf: classpath:liquibase/master.xml
isSyncDBSchema: false
defaultSchema:
${dbUserName}
defaultSchema:
<#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
<#list sys.getAllPSDataEntities() as entity>
<#if (entity.getStorageMode()==1 || entity.getStorageMode()==2) && entity.getDSLink()!='DEFAULT'>
<#assign dbLink=entity.getDSLink()?lower_case>
...
...
@@ -394,7 +394,7 @@ seata:
driver-class-name: ${dbDriver}
conf: classpath:liquibase/master.xml
isSyncDBSchema: false
defaultSchema:
${dbUserName}
defaultSchema:
<#if dbUserName=='root'>${sys.name}<#else>${dbUserName}</#if>
</#if>
</#if>
</#list>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录