Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
aaf3bfbc
提交
aaf3bfbc
编写于
1月 19, 2022
作者:
xignzi006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:流程发布对象
上级
f5b850f7
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
106 行增加
和
90 行删除
+106
-90
ModelStorage.java
.../src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
+7
-0
SystemModel.java
...e/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
+95
-88
TemplateFileType.java
.../java/cn/ibizlab/codegen/templating/TemplateFileType.java
+4
-2
未找到文件。
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/ModelStorage.java
浏览文件 @
aaf3bfbc
...
...
@@ -142,6 +142,13 @@ public class ModelStorage {
rt
.
addOption
(
opt
);
});
}
else
if
(
type
.
equals
(
TemplateFileType
.
workflow
))
{
getSystemModel
().
getWorkflows
().
forEach
(
item
->
{
CliOption
opt
=
newCliOption
(
TemplateFileType
.
workflow
)
.
baseData
(
item
,
item
.
getCodeName
().
toString
());
rt
.
addOption
(
opt
);
});
}
// else if (type.equals(TemplateFileType.subService)) {
// getSystemModel().getSubServiceApi().forEach(item -> {
// CliOption opt = newCliOption(TemplateFileType.subService)
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/model/SystemModel.java
浏览文件 @
aaf3bfbc
...
...
@@ -32,32 +32,27 @@ import java.util.regex.Pattern;
@Accessors
(
chain
=
true
)
public
class
SystemModel
extends
BaseModel
{
public
SystemModel
(
IPSSystem
system
)
{
this
.
opt
=
system
;
system
.
getAllPSSystemModules
().
forEach
(
item
->{
public
SystemModel
(
IPSSystem
system
)
{
this
.
opt
=
system
;
system
.
getAllPSSystemModules
().
forEach
(
item
->
{
});
if
(!
ObjectUtils
.
isEmpty
(
system
.
getAllPSSysSFPubs
()))
{
system
.
getAllPSSysSFPubs
().
forEach
(
pub
->{
if
(
pub
.
isMainPSSysSFPub
())
this
.
pub
=
pub
;
if
(!
ObjectUtils
.
isEmpty
(
system
.
getAllPSSysSFPubs
()))
{
system
.
getAllPSSysSFPubs
().
forEach
(
pub
->
{
if
(
pub
.
isMainPSSysSFPub
())
this
.
pub
=
pub
;
});
if
(
this
.
pub
==
null
)
this
.
pub
=
system
.
getAllPSSysSFPubs
().
get
(
0
);
if
(
this
.
pub
==
null
)
this
.
pub
=
system
.
getAllPSSysSFPubs
().
get
(
0
);
}
if
(
this
.
pub
!=
null
)
{
if
(
this
.
pub
!=
null
)
{
this
.
setCodeName
(
this
.
pub
.
getCodeName
());
this
.
setName
(
this
.
pub
.
getName
());
this
.
setProjectName
(
this
.
pub
.
getCodeName
().
toLowerCase
());
this
.
setProjectDesc
(
this
.
pub
.
getName
());
this
.
setPackageName
(
this
.
pub
.
getPKGCodeName
());
}
else
{
}
else
{
this
.
setCodeName
(
system
.
getCodeName
());
this
.
setName
(
system
.
getName
());
this
.
setProjectName
(
system
.
getCodeName
().
toLowerCase
());
...
...
@@ -67,9 +62,8 @@ public class SystemModel extends BaseModel {
getEntitiesMap
();
}
public
IPSSystem
getSystem
()
{
return
(
IPSSystem
)
opt
;
public
IPSSystem
getSystem
()
{
return
(
IPSSystem
)
opt
;
}
private
String
projectName
;
...
...
@@ -78,137 +72,150 @@ public class SystemModel extends BaseModel {
private
String
packageName
;
private
boolean
enableDS
=
false
;
private
boolean
enableES
=
false
;
private
boolean
enableMongo
=
false
;
private
boolean
enableMQ
=
false
;
private
boolean
enableOAuth2
=
false
;
private
boolean
enableGlobalTransaction
=
false
;
private
boolean
enableMysql
=
false
;
private
boolean
enableOracle
=
false
;
private
boolean
enableDameng
=
false
;
private
boolean
enablePostgreSQL
=
false
;
private
boolean
enableDyna
=
false
;
private
boolean
enableWorkflow
=
false
;
private
boolean
enableDS
=
false
;
private
boolean
enableES
=
false
;
private
boolean
enableMongo
=
false
;
private
boolean
enableMQ
=
false
;
private
boolean
enableOAuth2
=
false
;
private
boolean
enableGlobalTransaction
=
false
;
private
boolean
enableMysql
=
false
;
private
boolean
enableOracle
=
false
;
private
boolean
enableDameng
=
false
;
private
boolean
enablePostgreSQL
=
false
;
private
boolean
enableDyna
=
false
;
private
boolean
enableWorkflow
=
false
;
private
IPSSysSFPub
pub
;
private
Set
<
String
>
mqSubscribes
;
private
Map
<
String
,
EntityModel
>
entitiesMap
;
private
Map
<
String
,
EntityModel
>
entitiesMap
;
public
synchronized
Map
<
String
,
EntityModel
>
getEntitiesMap
()
{
if
(
entitiesMap
==
null
)
{
if
(
entitiesMap
==
null
)
{
entitiesMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSDataEntities
().
forEach
(
entity
->
{
if
((
entity
.
getStorageMode
()==
1
||
entity
.
getStorageMode
()==
2
)
&&
"DEFAULT"
.
equals
(
entity
.
getDSLink
()))
enableDS
=
true
;
if
(
entity
.
getStorageMode
()==
2
)
enableMongo
=
true
;
if
(
ObjectUtils
.
isEmpty
(
entity
.
getAllPSDEWFs
()))
enableWorkflow
=
true
;
if
(!
enableES
&&
"elasticsearch"
.
equalsIgnoreCase
(
entity
.
getUserTag
()))
enableES
=
true
;
if
(!
enableMQ
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getAllPSDEDataSyncs
()))
enableMQ
=
true
;
if
(
entity
.
getAllPSDEDataSyncs
()!=
null
)
{
entity
.
getAllPSDEDataSyncs
().
forEach
(
sync
->{
if
(
sync
.
getInPSSysDataSyncAgent
()!=
null
)
{
if
(
mqSubscribes
==
null
)
mqSubscribes
=
new
LinkedHashSet
<>();
if
((
entity
.
getStorageMode
()
==
1
||
entity
.
getStorageMode
()
==
2
)
&&
"DEFAULT"
.
equals
(
entity
.
getDSLink
()))
enableDS
=
true
;
if
(
entity
.
getStorageMode
()
==
2
)
enableMongo
=
true
;
if
(
ObjectUtils
.
isEmpty
(
entity
.
getAllPSDEWFs
()))
enableWorkflow
=
true
;
if
(!
enableES
&&
"elasticsearch"
.
equalsIgnoreCase
(
entity
.
getUserTag
()))
enableES
=
true
;
if
(!
enableMQ
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getAllPSDEDataSyncs
()))
enableMQ
=
true
;
if
(
entity
.
getAllPSDEDataSyncs
()
!=
null
)
{
entity
.
getAllPSDEDataSyncs
().
forEach
(
sync
->
{
if
(
sync
.
getInPSSysDataSyncAgent
()
!=
null
)
{
if
(
mqSubscribes
==
null
)
mqSubscribes
=
new
LinkedHashSet
<>();
mqSubscribes
.
add
(
sync
.
getCodeName
());
}
});
}
entitiesMap
.
put
(
entity
.
getCodeName
(),
new
EntityModel
(
this
,
entity
));
entitiesMap
.
put
(
entity
.
getCodeName
(),
new
EntityModel
(
this
,
entity
));
});
}
return
entitiesMap
;
}
public
boolean
isHasMsgTemplate
()
{
private
Map
<
String
,
WorkflowModel
>
workflowsMap
;
public
synchronized
Map
<
String
,
WorkflowModel
>
getWorkflowsMap
()
{
if
(
workflowsMap
==
null
)
{
try
{
workflowsMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSWorkflows
().
forEach
(
workflow
->
{
workflow
.
getPSWFVersions
().
forEach
(
workflowVersion
->
{
workflowsMap
.
put
(
workflowVersion
.
getCodeName
(),
new
WorkflowModel
(
this
,
workflowVersion
));
});
});
}
catch
(
Exception
e
)
{
}
}
return
workflowsMap
;
}
public
Collection
<
WorkflowModel
>
getWorkflows
()
{
return
getWorkflowsMap
().
values
();
}
public
boolean
isHasMsgTemplate
()
{
return
!
ObjectUtils
.
isEmpty
(
getSystem
().
getAllPSSysMsgTempls
());
}
public
boolean
isHasRuntimeDict
()
{
if
(
getSystem
().
getAllPSCodeLists
()!=
null
)
{
for
(
IPSCodeList
dict:
getSystem
().
getAllPSCodeLists
())
{
if
(
"RUNTIME"
.
equalsIgnoreCase
(
dict
.
getPredefinedType
()))
public
boolean
isHasRuntimeDict
()
{
if
(
getSystem
().
getAllPSCodeLists
()
!=
null
)
{
for
(
IPSCodeList
dict
:
getSystem
().
getAllPSCodeLists
())
{
if
(
"RUNTIME"
.
equalsIgnoreCase
(
dict
.
getPredefinedType
()))
return
true
;
}
}
return
false
;
}
public
Collection
<
EntityModel
>
getEntities
(){
public
Collection
<
EntityModel
>
getEntities
()
{
return
getEntitiesMap
().
values
();
}
private
Map
<
String
,
AppModel
>
appsMap
;
private
Map
<
String
,
AppModel
>
appsMap
;
public
synchronized
Map
<
String
,
AppModel
>
getAppsMap
()
{
if
(
appsMap
==
null
)
{
appsMap
=
new
LinkedHashMap
<>();
if
(
getSystem
().
getAllPSApps
()!=
null
)
{
if
(
appsMap
==
null
)
{
appsMap
=
new
LinkedHashMap
<>();
if
(
getSystem
().
getAllPSApps
()
!=
null
)
{
getSystem
().
getAllPSApps
().
forEach
(
item
->
{
appsMap
.
put
(
item
.
getCodeName
(),
new
AppModel
(
item
).
setSystem
(
this
));
appsMap
.
put
(
item
.
getCodeName
(),
new
AppModel
(
item
).
setSystem
(
this
));
});
}
}
return
appsMap
;
}
public
Collection
<
AppModel
>
getApps
()
{
public
Collection
<
AppModel
>
getApps
()
{
return
getAppsMap
().
values
();
}
private
Map
<
String
,
ApiModel
>
apisMap
;
private
Map
<
String
,
ApiModel
>
apisMap
;
public
synchronized
Map
<
String
,
ApiModel
>
getApisMap
()
{
if
(
apisMap
==
null
)
{
apisMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSSysServiceAPIs
().
forEach
(
api
->{
apisMap
.
put
(
api
.
getCodeName
(),
new
ApiModel
(
api
).
setSystem
(
this
));
});
if
(
apisMap
==
null
)
{
try
{
apisMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSSysServiceAPIs
().
forEach
(
api
->
{
apisMap
.
put
(
api
.
getCodeName
(),
new
ApiModel
(
api
).
setSystem
(
this
));
});
}
catch
(
Exception
e
)
{
}
}
return
apisMap
;
}
public
Collection
<
ApiModel
>
getApis
()
{
public
Collection
<
ApiModel
>
getApis
()
{
return
getApisMap
().
values
();
}
private
Map
<
String
,
SubServiceApiModel
>
subServiceApiMap
;
private
Map
<
String
,
SubServiceApiModel
>
subServiceApiMap
;
public
synchronized
Map
<
String
,
SubServiceApiModel
>
getSubServiceApiMap
()
{
if
(
subServiceApiMap
==
null
)
{
subServiceApiMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSSubSysServiceAPIs
().
forEach
(
subSysServiceAPI
->{
subServiceApiMap
.
put
(
subSysServiceAPI
.
getCodeName
(),
new
SubServiceApiModel
(
subSysServiceAPI
).
setSystem
(
this
));
if
(
subServiceApiMap
==
null
)
{
subServiceApiMap
=
new
LinkedHashMap
<>();
getSystem
().
getAllPSSubSysServiceAPIs
().
forEach
(
subSysServiceAPI
->
{
subServiceApiMap
.
put
(
subSysServiceAPI
.
getCodeName
(),
new
SubServiceApiModel
(
subSysServiceAPI
).
setSystem
(
this
));
});
}
return
subServiceApiMap
;
}
public
Collection
<
SubServiceApiModel
>
getSubServiceApi
()
{
public
Collection
<
SubServiceApiModel
>
getSubServiceApi
()
{
return
getSubServiceApiMap
().
values
();
}
public
EntityModel
getEntity
(
String
codeName
)
{
public
EntityModel
getEntity
(
String
codeName
)
{
return
getEntitiesMap
().
get
(
codeName
);
}
...
...
modules/ibizlab-generator-core/src/main/java/cn/ibizlab/codegen/templating/TemplateFileType.java
浏览文件 @
aaf3bfbc
...
...
@@ -9,7 +9,8 @@ public enum TemplateFileType {
apiDto
(
Constants
.
API_DTOS
),
entity
(
Constants
.
ENTITIES
),
module
(
Constants
.
MODULES
),
subService
(
Constants
.
SUB_SERVICEAPI
),
workflow
(
Constants
.
WORKFLOWS
),
subService
(
Constants
.
SUB_SERVICEAPIS
),
subEntity
(
Constants
.
SUB_ENTITIES
),
api
(
Constants
.
APIS
),
app
(
Constants
.
APPS
),
...
...
@@ -50,7 +51,8 @@ public enum TemplateFileType {
public
static
final
String
APIS
=
"apis"
;
public
static
final
String
APPS
=
"apps"
;
public
static
final
String
ENTITIES
=
"entities"
;
public
static
final
String
SUB_SERVICEAPI
=
"subServiceApi"
;
public
static
final
String
WORKFLOWS
=
"workflows"
;
public
static
final
String
SUB_SERVICEAPIS
=
"subServiceApis"
;
public
static
final
String
SUB_ENTITIES
=
"subEntities"
;
public
static
final
String
API_ENTITIES
=
"apiEntities"
;
public
static
final
String
API_DTOS
=
"apiDtos"
;
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录