提交 aaf3bfbc 编写于 作者: xignzi006's avatar xignzi006

fix:流程发布对象

上级 f5b850f7
...@@ -142,6 +142,13 @@ public class ModelStorage { ...@@ -142,6 +142,13 @@ public class ModelStorage {
rt.addOption(opt); 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)) { // else if (type.equals(TemplateFileType.subService)) {
// getSystemModel().getSubServiceApi().forEach(item -> { // getSystemModel().getSubServiceApi().forEach(item -> {
// CliOption opt = newCliOption(TemplateFileType.subService) // CliOption opt = newCliOption(TemplateFileType.subService)
......
...@@ -32,32 +32,27 @@ import java.util.regex.Pattern; ...@@ -32,32 +32,27 @@ import java.util.regex.Pattern;
@Accessors(chain = true) @Accessors(chain = true)
public class SystemModel extends BaseModel { public class SystemModel extends BaseModel {
public SystemModel(IPSSystem system) public SystemModel(IPSSystem system) {
{ this.opt = system;
this.opt=system; system.getAllPSSystemModules().forEach(item -> {
system.getAllPSSystemModules().forEach(item->{
}); });
if(!ObjectUtils.isEmpty(system.getAllPSSysSFPubs())) if (!ObjectUtils.isEmpty(system.getAllPSSysSFPubs())) {
{ system.getAllPSSysSFPubs().forEach(pub -> {
system.getAllPSSysSFPubs().forEach(pub->{ if (pub.isMainPSSysSFPub())
if(pub.isMainPSSysSFPub()) this.pub = pub;
this.pub=pub;
}); });
if(this.pub==null) if (this.pub == null)
this.pub=system.getAllPSSysSFPubs().get(0); this.pub = system.getAllPSSysSFPubs().get(0);
} }
if(this.pub!=null) if (this.pub != null) {
{
this.setCodeName(this.pub.getCodeName()); this.setCodeName(this.pub.getCodeName());
this.setName(this.pub.getName()); this.setName(this.pub.getName());
this.setProjectName(this.pub.getCodeName().toLowerCase()); this.setProjectName(this.pub.getCodeName().toLowerCase());
this.setProjectDesc(this.pub.getName()); this.setProjectDesc(this.pub.getName());
this.setPackageName(this.pub.getPKGCodeName()); this.setPackageName(this.pub.getPKGCodeName());
} } else {
else
{
this.setCodeName(system.getCodeName()); this.setCodeName(system.getCodeName());
this.setName(system.getName()); this.setName(system.getName());
this.setProjectName(system.getCodeName().toLowerCase()); this.setProjectName(system.getCodeName().toLowerCase());
...@@ -67,9 +62,8 @@ public class SystemModel extends BaseModel { ...@@ -67,9 +62,8 @@ public class SystemModel extends BaseModel {
getEntitiesMap(); getEntitiesMap();
} }
public IPSSystem getSystem() public IPSSystem getSystem() {
{ return (IPSSystem) opt;
return (IPSSystem)opt;
} }
private String projectName; private String projectName;
...@@ -78,137 +72,150 @@ public class SystemModel extends BaseModel { ...@@ -78,137 +72,150 @@ public class SystemModel extends BaseModel {
private String packageName; private String packageName;
private boolean enableDS=false; private boolean enableDS = false;
private boolean enableES=false; private boolean enableES = false;
private boolean enableMongo=false; private boolean enableMongo = false;
private boolean enableMQ=false; private boolean enableMQ = false;
private boolean enableOAuth2=false; private boolean enableOAuth2 = false;
private boolean enableGlobalTransaction=false; private boolean enableGlobalTransaction = false;
private boolean enableMysql=false; private boolean enableMysql = false;
private boolean enableOracle=false; private boolean enableOracle = false;
private boolean enableDameng=false; private boolean enableDameng = false;
private boolean enablePostgreSQL=false; private boolean enablePostgreSQL = false;
private boolean enableDyna=false; private boolean enableDyna = false;
private boolean enableWorkflow=false; private boolean enableWorkflow = false;
private IPSSysSFPub pub; private IPSSysSFPub pub;
private Set<String> mqSubscribes; private Set<String> mqSubscribes;
private Map<String,EntityModel> entitiesMap; private Map<String, EntityModel> entitiesMap;
public synchronized Map<String, EntityModel> getEntitiesMap() { public synchronized Map<String, EntityModel> getEntitiesMap() {
if(entitiesMap==null) { if (entitiesMap == null) {
entitiesMap = new LinkedHashMap<>(); entitiesMap = new LinkedHashMap<>();
getSystem().getAllPSDataEntities().forEach(entity -> { getSystem().getAllPSDataEntities().forEach(entity -> {
if((entity.getStorageMode()==1 || entity.getStorageMode()==2) && "DEFAULT".equals(entity.getDSLink())) if ((entity.getStorageMode() == 1 || entity.getStorageMode() == 2) && "DEFAULT".equals(entity.getDSLink()))
enableDS=true; enableDS = true;
if(entity.getStorageMode()==2) if (entity.getStorageMode() == 2)
enableMongo=true; enableMongo = true;
if(ObjectUtils.isEmpty(entity.getAllPSDEWFs())) if (ObjectUtils.isEmpty(entity.getAllPSDEWFs()))
enableWorkflow=true; enableWorkflow = true;
if(!enableES && "elasticsearch".equalsIgnoreCase(entity.getUserTag())) if (!enableES && "elasticsearch".equalsIgnoreCase(entity.getUserTag()))
enableES=true; enableES = true;
if(!enableMQ && !ObjectUtils.isEmpty(entity.getAllPSDEDataSyncs())) if (!enableMQ && !ObjectUtils.isEmpty(entity.getAllPSDEDataSyncs()))
enableMQ=true; enableMQ = true;
if(entity.getAllPSDEDataSyncs()!=null) if (entity.getAllPSDEDataSyncs() != null) {
{ entity.getAllPSDEDataSyncs().forEach(sync -> {
entity.getAllPSDEDataSyncs().forEach(sync->{ if (sync.getInPSSysDataSyncAgent() != null) {
if(sync.getInPSSysDataSyncAgent()!=null) if (mqSubscribes == null) mqSubscribes = new LinkedHashSet<>();
{
if(mqSubscribes==null) mqSubscribes=new LinkedHashSet<>();
mqSubscribes.add(sync.getCodeName()); mqSubscribes.add(sync.getCodeName());
} }
}); });
} }
entitiesMap.put(entity.getCodeName(),new EntityModel(this,entity)); entitiesMap.put(entity.getCodeName(), new EntityModel(this, entity));
}); });
} }
return entitiesMap; 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()); return !ObjectUtils.isEmpty(getSystem().getAllPSSysMsgTempls());
} }
public boolean isHasRuntimeDict() public boolean isHasRuntimeDict() {
{ if (getSystem().getAllPSCodeLists() != null) {
if(getSystem().getAllPSCodeLists()!=null) for (IPSCodeList dict : getSystem().getAllPSCodeLists()) {
{ if ("RUNTIME".equalsIgnoreCase(dict.getPredefinedType()))
for(IPSCodeList dict:getSystem().getAllPSCodeLists())
{
if("RUNTIME".equalsIgnoreCase(dict.getPredefinedType()))
return true; return true;
} }
} }
return false; return false;
} }
public Collection<EntityModel> getEntities(){ public Collection<EntityModel> getEntities() {
return getEntitiesMap().values(); return getEntitiesMap().values();
} }
private Map<String,AppModel> appsMap; private Map<String, AppModel> appsMap;
public synchronized Map<String, AppModel> getAppsMap() { public synchronized Map<String, AppModel> getAppsMap() {
if(appsMap==null) if (appsMap == null) {
{ appsMap = new LinkedHashMap<>();
appsMap=new LinkedHashMap<>(); if (getSystem().getAllPSApps() != null) {
if(getSystem().getAllPSApps()!=null) {
getSystem().getAllPSApps().forEach(item -> { getSystem().getAllPSApps().forEach(item -> {
appsMap.put(item.getCodeName(),new AppModel(item).setSystem(this)); appsMap.put(item.getCodeName(), new AppModel(item).setSystem(this));
}); });
} }
} }
return appsMap; return appsMap;
} }
public Collection<AppModel> getApps() public Collection<AppModel> getApps() {
{
return getAppsMap().values(); return getAppsMap().values();
} }
private Map<String,ApiModel> apisMap; private Map<String, ApiModel> apisMap;
public synchronized Map<String, ApiModel> getApisMap() { public synchronized Map<String, ApiModel> getApisMap() {
if(apisMap==null) if (apisMap == null) {
{ try {
apisMap=new LinkedHashMap<>(); apisMap = new LinkedHashMap<>();
getSystem().getAllPSSysServiceAPIs().forEach(api->{ getSystem().getAllPSSysServiceAPIs().forEach(api -> {
apisMap.put(api.getCodeName(),new ApiModel(api).setSystem(this)); apisMap.put(api.getCodeName(), new ApiModel(api).setSystem(this));
}); });
} catch (Exception e) {
}
} }
return apisMap; return apisMap;
} }
public Collection<ApiModel> getApis() public Collection<ApiModel> getApis() {
{
return getApisMap().values(); return getApisMap().values();
} }
private Map<String,SubServiceApiModel> subServiceApiMap; private Map<String, SubServiceApiModel> subServiceApiMap;
public synchronized Map<String, SubServiceApiModel> getSubServiceApiMap() { public synchronized Map<String, SubServiceApiModel> getSubServiceApiMap() {
if(subServiceApiMap==null) if (subServiceApiMap == null) {
{ subServiceApiMap = new LinkedHashMap<>();
subServiceApiMap=new LinkedHashMap<>(); getSystem().getAllPSSubSysServiceAPIs().forEach(subSysServiceAPI -> {
getSystem().getAllPSSubSysServiceAPIs().forEach(subSysServiceAPI->{ subServiceApiMap.put(subSysServiceAPI.getCodeName(), new SubServiceApiModel(subSysServiceAPI).setSystem(this));
subServiceApiMap.put(subSysServiceAPI.getCodeName(),new SubServiceApiModel(subSysServiceAPI).setSystem(this));
}); });
} }
return subServiceApiMap; return subServiceApiMap;
} }
public Collection<SubServiceApiModel> getSubServiceApi() public Collection<SubServiceApiModel> getSubServiceApi() {
{
return getSubServiceApiMap().values(); return getSubServiceApiMap().values();
} }
public EntityModel getEntity(String codeName) {
public EntityModel getEntity(String codeName)
{
return getEntitiesMap().get(codeName); return getEntitiesMap().get(codeName);
} }
......
...@@ -9,7 +9,8 @@ public enum TemplateFileType { ...@@ -9,7 +9,8 @@ public enum TemplateFileType {
apiDto(Constants.API_DTOS), apiDto(Constants.API_DTOS),
entity(Constants.ENTITIES), entity(Constants.ENTITIES),
module(Constants.MODULES), module(Constants.MODULES),
subService(Constants.SUB_SERVICEAPI), workflow(Constants.WORKFLOWS),
subService(Constants.SUB_SERVICEAPIS),
subEntity(Constants.SUB_ENTITIES), subEntity(Constants.SUB_ENTITIES),
api(Constants.APIS), api(Constants.APIS),
app(Constants.APPS), app(Constants.APPS),
...@@ -50,7 +51,8 @@ public enum TemplateFileType { ...@@ -50,7 +51,8 @@ public enum TemplateFileType {
public static final String APIS = "apis"; public static final String APIS = "apis";
public static final String APPS = "apps"; public static final String APPS = "apps";
public static final String ENTITIES = "entities"; 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 SUB_ENTITIES = "subEntities";
public static final String API_ENTITIES = "apiEntities"; public static final String API_ENTITIES = "apiEntities";
public static final String API_DTOS = "apiDtos"; public static final String API_DTOS = "apiDtos";
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册