Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
518ceaad
提交
518ceaad
编写于
1月 16, 2022
作者:
ibiz4j
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
workflow
上级
04469c92
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
327 行增加
和
0 行删除
+327
-0
EntityModel.java
...e/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
+31
-0
OptionItem.java
...re/src/main/java/cn/ibizlab/codegen/model/OptionItem.java
+15
-0
{{entities@SQL}}ServiceImpl.java.hbs
...dules}}/service/impl/{{entities@SQL}}ServiceImpl.java.hbs
+55
-0
systemMsgTempl.json.hbs
...-core/src/main/resources/msgtempl/systemMsgTempl.json.hbs
+11
-0
systemResource.json.hbs
...ore/src/main/resources/permission/systemResource.json.hbs
+80
-0
%SYS%.json.hbs
...ectName}}-core/src/main/resources/sysmodel/%SYS%.json.hbs
+105
-0
RuntimeDict.json.hbs
...e}}-core/src/main/resources/sysmodel/RuntimeDict.json.hbs
+30
-0
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/EntityModel.java
浏览文件 @
518ceaad
...
...
@@ -499,6 +499,37 @@ public class EntityModel extends BaseModel {
return
publishers
;
}
public
List
<
OptionItem
>
getDataScopes
()
{
List
<
OptionItem
>
dataScopes
=
new
ArrayList
<>();
dataScopes
.
add
(
new
OptionItem
().
setId
(
"all"
).
setName
(
"全部数据"
));
boolean
hasOrgId
=
false
,
hasDetpId
=
false
,
hasCreateBy
=
false
;
for
(
FieldModel
field:
getFields
())
{
if
(
"ORGID"
.
equalsIgnoreCase
(
field
.
getDataEntityField
().
getPredefinedType
()))
hasOrgId
=
true
;
else
if
(
"ORGSECTORID"
.
equalsIgnoreCase
(
field
.
getDataEntityField
().
getPredefinedType
()))
hasDetpId
=
true
;
else
if
(
"CREATEMAN"
.
equalsIgnoreCase
(
field
.
getDataEntityField
().
getPredefinedType
()))
hasCreateBy
=
true
;
}
if
(
hasOrgId
)
{
dataScopes
.
add
(
new
OptionItem
().
setId
(
"curorg"
).
setName
(
"当前单位"
));
dataScopes
.
add
(
new
OptionItem
().
setId
(
"porg"
).
setName
(
"上级单位"
));
dataScopes
.
add
(
new
OptionItem
().
setId
(
"sorg"
).
setName
(
"下级单位"
));
}
if
(
hasDetpId
)
{
dataScopes
.
add
(
new
OptionItem
().
setId
(
"curorgdept"
).
setName
(
"当前部门"
));
dataScopes
.
add
(
new
OptionItem
().
setId
(
"porgdept"
).
setName
(
"上级部门"
));
dataScopes
.
add
(
new
OptionItem
().
setId
(
"sorgdept"
).
setName
(
"下级部门"
));
}
if
(
hasCreateBy
)
dataScopes
.
add
(
new
OptionItem
().
setId
(
"createman"
).
setName
(
"创建人"
));
return
dataScopes
;
}
private
Map
<
String
,
POSchema
>
poSchemas
;
public
POSchema
getDefaultPOSchema
()
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/OptionItem.java
0 → 100644
浏览文件 @
518ceaad
package
cn
.
ibizlab
.
codegen
.
model
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.Setter
;
import
lombok.experimental.Accessors
;
@Getter
@Setter
@NoArgsConstructor
@Accessors
(
chain
=
true
)
public
class
OptionItem
{
private
String
id
;
private
String
name
;
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/service/impl/{{entities@SQL}}ServiceImpl.java.hbs
浏览文件 @
518ceaad
...
...
@@ -37,6 +37,7 @@ import {{packageName}}.core.{{entity.module}}.service.I{{entity.codeName}}Servic
import
{{
packageName
}}
.core.
{{
entity
.
module
}}
.mapper.
{{
entity
.
codeName
}}
Mapper;
import cn.ibizlab.util.helper.CachedBeanCopier;
import cn.ibizlab.util.helper.DEFieldCacheMap;
import cn.ibizlab.util.security.AuthenticationUser;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
...
@@ -340,7 +341,14 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
{{/
entity
.
extActions
}}
{{#
entity
.
dataSets
}}
public Page
<
{{#if
enableGroup
}}
Map
{{else}}{{
entity
.
codeName
}}{{/if}}
>
search
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context) {
{{#if
entity
.
hasPSDEWF
}}
Map
<String
,
Map
<
String
,
Object
>
> businesskeys = fillWFTaskContext(context);
{{/if}}
com.baomidou.mybatisplus.extension.plugins.pagination.Page
<
{{#if
enableGroup
}}
Map
{{else}}{{
entity
.
codeName
}}{{/if}}
>
pages=baseMapper.search
{{
pascalCase
codeName
}}
(context.getPages(),context,context.getSelectCond());
{{#if
entity
.
hasPSDEWF
}}
if(!StringUtils.isEmpty(context.getSrfWF()))
fillWFParam(pages,businesskeys);
{{/if}}
return new PageImpl
<
{{#if
enableGroup
}}
Map
{{else}}{{
entity
.
codeName
}}{{/if}}
>
(pages.getRecords(), context.getPageable(), pages.getTotal());
}
public List
<
{{#if
enableGroup
}}
Map
{{else}}{{
entity
.
codeName
}}{{/if}}
>
list
{{
pascalCase
codeName
}}
(
{{
entity
.
codeName
}}
SearchContext context) {
...
...
@@ -393,4 +401,51 @@ public class {{entity.codeName}}ServiceImpl extends ServiceImpl<{{entity.codeNam
{{/
entity
.
references
}}
{{#if
entity
.
hasPSDEWF
}}
@Autowired
private cn.ibizlab.util.client.IBZWFFeignClient ibzwfFeignClient;
/**
* 查询统一工作流待办
* @param context
*/
private Map
<String
,
Map
<
String
,
Object
>
> fillWFTaskContext(
{{
entity
.
codeName
}}
SearchContext context){
Map
<String
,
Map
<
String
,
Object
>
> keys = null;
Collection
<String>
businessKeys = null;
if(!StringUtils.isEmpty(context.getSrfWF())){
keys= ibzwfFeignClient.getMyTask("
{{
lowerCase
system
.
codeName
}}
", "", "
{{
pluralize
entity
.
codeName
}}
");
if(!ObjectUtils.isEmpty(keys))
businessKeys = keys.keySet();
}
else if(!StringUtils.isEmpty(context.getUserTaskId())
&&
!StringUtils.isEmpty(context.getProcessDefinitionKey()))
businessKeys= ibzwfFeignClient.getbusinesskeysByUserId("
{{
lowerCase
system
.
codeName
}}
", AuthenticationUser.getAuthenticationUser().getUserid(),"
{{
pluralize
entity
.
codeName
}}
",context.getProcessDefinitionKey(),context.getUserTaskId());
if(!ObjectUtils.isEmpty(businessKeys))
context.getSelectCond().in("
{{
entity
.
keyField
.
columnName
}}
",businessKeys);
else
context.getSelectCond().apply("1
<>
1");
return keys;
}
/**
* 填充工作流参数
* @param pages
* @param businesskeys
*/
private void fillWFParam(com.baomidou.mybatisplus.extension.plugins.pagination.Page
<
{{
entity
.
codeName
}}
>
pages, Map
<String
,
Map
<
String
,
Object
>
> businesskeys) {
if (!ObjectUtils.isEmpty(businesskeys)) {
for (
{{
entity
.
codeName
}}
entity : pages.getRecords()) {
Object id = entity.get
{{
pascalCase
entity
.
keyField
.
codeName
}}
();
if (!ObjectUtils.isEmpty(id)
&&
businesskeys.containsKey(id)) {
Map
<String
,
Object
>
params = businesskeys.get(id);
for (Map.Entry
<String
,
Object
>
entry : params.entrySet()) {
entity.set(entry.getKey(), entry.getValue());
}
}
}
}
}
{{/if}}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/resources/msgtempl/systemMsgTempl.json.hbs
0 → 100644
浏览文件 @
518ceaad
{{#if
system
.
allPSSysMsgTempls
}}
[
{{#
each
system
.
allPSSysMsgTempls
as
|
msgTempl
|
}}
{
"tid":"
{{
lowerCase
msgTempl
.
codeName
}}
",
"template_name":"
{{
msgTempl
.
getName
}}
",
"content":"
{{
msgTempl
.
content
}}
"
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
{{/if}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/resources/permission/systemResource.json.hbs
0 → 100644
浏览文件 @
518ceaad
{{#
*
inline
"getAppMenuItems"
}}
[
{{#
each
menuGroup
.
psAppMenuItems
as
|
appMenuItem
|
}}
{
"id": "
{{
appMenuItem
.
name
}}
",
"name": "
{{
appMenuItem
.
caption
}}
"
{{#if
appMenuItem
.
psAppMenuItems
}}
,
"item":
{{>
getAppMenuItems
menuGroup
=
appMenuItem
}}
{{/if}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
{{/
inline
}}
{
"systemid": "
{{
system
.
codeName
}}
",
"systemname": "
{{
system
.
logicName
}}
",
"unires": [
{{#
each
system
.
allPSSysUniReses
as
|
unires
|
}}
{
"unirescode": "
{{
unires
.
resCode
}}
",
"uniresname": "
{{
unires
.
name
}}
"
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
],
"appmenus": [
{{#
each
system
.
apps
as
|
app
|
}}
{
"appid": "
{{
app
.
codeName
}}
",
"appname": "
{{
app
.
name
}}
",
"appmenu": [
{{#
each
app
.
allPSAppMenuModels
as
|
appMenu
|
}}
{
"menuid": "
{{
appMenu
.
codeName
}}
",
"menuname": "
{{
appMenu
.
name
}}
",
"menuitem":
{{>
getAppMenuItems
menuGroup
=
appMenu
}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
],
"entities": [
{{#
each
system
.
entities
as
|
de
|
}}
{
"dename":"
{{
de
.
codeName
}}
",
"delogicname": "
{{
de
.
logicName
}}
",
"sysmodule": {
"id": "
{{
upperCase
de
.
psSystemModule
.
codeName
}}
",
"name": "
{{
de
.
psSystemModule
.
name
}}
"
},
"dedataset": [
{{#
each
de
.
dataSets
as
|
dataSet
|
}}
{
"id": "
{{
dataSet
.
codeName
}}
",
"name": "
{{#if
dataSet
.
logicName
}}{{
dataSet
.
logicName
}}{{else}}{{
dataSet
.
codeName
}}{{/if}}
"
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
],
"deaction": [
{{#
each
de
.
actions
as
|
action
|
}}
{
"id": "
{{
action
.
codeName
}}
",
"name": "
{{#if
action
.
logicName
}}{{
action
.
logicName
}}{{else}}{{
action
.
codeName
}}{{/if}}
",
"type": "
{{
action
.
actionType
}}
"
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
],
"datascope": [
{{#
each
de
.
dataScopes
as
|
dataScope
|
}}
{
"id": "
{{
dataScope
.
id
}}
",
"name": "
{{
dataScope
.
name
}}
"
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/resources/sysmodel/%SYS%.json.hbs
0 → 100644
浏览文件 @
518ceaad
{{#
eq
system
.
codeName
"1"
}}
<
#
ibiztemplate
>
TARGET=PSSYSTEM
</
#
ibiztemplate>
{
"systemid":"${sys.codeName}",
"systemname":"${sys.getLogicName()}",
"entities":[
<
#
if
sys
.
getAllPSDataEntities
()??
>
<
#
list
sys
.
getAllPSDataEntities
()
as
de
>
{
"entity_name":"${de.name}",
"logic_name":"${de.logicName}",
"code_name":"${de.codeName}",
"table_name":"${de.getTableName()}",
"system_id":"${sys.codeName}",
"system_name":"${sys.logicName}",
"module_id":"${de.getPSSystemModule().codeName}",
"module_name":"${de.getPSSystemModule().name}",
<
#
--
"
ds_id
"
:null
,
--
>
<
#
--
"
ds_name
"
:
"",
--
>
"fields":[
<
#
if
de
.
getPSDEFields
()??
>
<
#
list
de
.
getPSDEFields
()
as
defield
>
{
"fieldname":"${defield.name}" ,
"codename":"${defield.codeName}",
"field_logic_name":"${defield.logicName}",
"entity_name":"${de.name}",
<
#
if
defield
.
getRelatedPSDEField
??
&&
defield
.
getRelatedPSDEField
()??
>
"ref_de":"${defield.getRelatedPSDEField().getPSDataEntity().name}",
"ref_field_name":"${defield.getRelatedPSDEField().name}",
</
#
if>
<
#
if
(((
defield
.
getDataType
())!'')=='
PICKUP
'
||
((
defield
.
getDataType
())!'')=='
PICKUPDATA
'
||
((
defield
.
getDataType
())!'')=='
PICKUPTEXT
'
)
&&
defield
.
getPSDER1N
()??
>
"relation_name":"${defield.getPSDER1N().getName()}",
"relation_codename":"${defield.getPSDER1N().getCodeName()}",
</
#
if>
"field_type":"${defield.getDataType()}",
<
#
if
defield
.
getPSCodeList
()??
>
"dict":"${defield.getPSCodeList().codeName}",
</
#
if>
"nullable":
<
#
if
defield
.
isAllowEmpty
()
>
1
<
#
else
>
0
</
#
if>
,
"physical_field":
<
#
if
defield
.
isPhisicalDEField
()
>
1
<
#
else
>
0
</
#
if>
,
"data_type":"${srfdatatype(defield.getStdDataType())}",
<
#
if
defield
.
getLength
()?
c
!='
-1
'
>
"data_length":${defield.getLength()?c},
</
#
if>
<
#
if
defield
.
getPrecision
()?
c
!='
0
'
>
"data_preci":${defield.getPrecision()?c},
</
#
if>
<
#
if
defield
.
getDefaultPSDEFDTColumn
??
&&
defield
.
getDefaultPSDEFDTColumn
()??
&&
defield
.
getDefaultPSDEFDTColumn
().
isFormula
()==
true
>
"expression":"${defield.getDefaultPSDEFDTColumn().getFormulaFormat()}",
</
#
if>
<
#
if
defield
.
getPredefinedType
()??
&&
defield
.
getPredefinedType
()!=''
>
"predefined":"${defield.getPredefinedType()}",
</
#
if>
"key_field":
<
#
if
defield
.
isKeyDEField
()==
true
>
1
<
#
else
>
0
</
#
if>
,
<
#
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>
</
#
if>
],
"subEntitys":[
<
#
if
de
.
getMinorPSDERs
()??
>
<
#
list
de
.
getMajorPSDERs
()
as
majorPSDER
>
{"name":"${majorPSDER.name}",
"relation_type":"${majorPSDER.getDERType()}",
"code_name":"${majorPSDER.getCodeName()}",
"entity_name":"${majorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${majorPSDER.getMajorPSDataEntity().name}"
<
#
--
"
nested_name
"
:
"",
--
>
<
#
--
"
lookup
"
:
""
--
>
}
<
#
if
majorPSDER_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
],
"parentEntitys":[
<
#
if
de
.
getMinorPSDERs
()??
>
<
#
list
de
.
getMinorPSDERs
()
as
minorPSDER
>
{"name":"${minorPSDER.name}",
"relation_type":"${minorPSDER.getDERType()}",
"code_name":"${minorPSDER.getCodeName()}",
"entity_name":"${minorPSDER.getMinorPSDataEntity().name}",
"ref_entity_name":"${minorPSDER.getMajorPSDataEntity().name}"
<
#
--
"
nested_name
"
:
"",
--
>
<
#
--
"
lookup
"
:
""
--
>
}
<
#
if
minorPSDER_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
]
}
<
#
if
de_has_next
>
,
</
#
if>
</
#
list>
</
#
if>
]
}
{{/
eq
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/{{projectName}}-core/src/main/resources/sysmodel/RuntimeDict.json.hbs
0 → 100644
浏览文件 @
518ceaad
[
{{#
each
system
.
allPSCodeLists
as
|
codelist
|
}}
{{#
eq
codelist
.
predefinedType
'RUNTIME'
}}
{
"name": "
{{
codelist
.
name
}}
",
"code": "
{{
codelist
.
codeName
}}
",
"group": "",
"memo": "",
{{#if
codelist
.
allPSCodeItems
}}
"items": [
{{#
each
codelist
.
allPSCodeItems
as
|
codeItem
|
}}
{
"catalog_id": "
{{
codelist
.
codeName
}}
",
"catalog_name": "
{{
codelist
.
name
}}
",
"value_key": "
{{
codelist
.
codeName
}}
-
{{
codeItem
.
codeName
}}
",
"value": "
{{
codeItem
.
value
}}
",
"label":"
{{
codeItem
.
text
}}
",
"disabled": "0",
{{#if
codeItem
.
parentCodeItem
}}
"parent": "
{{
codeItem
.
parentCodeItem
.
value
}}
",
{{/if}}
"showorder":
{{
@index
}}
}
{{#
unless
@last
}}
,
{{/
unless
}}
{{/
each
}}
]
{{/if}}
}
{{/
eq
}}
{{/
each
}}
]
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录