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

fix:流程发布对象

上级 f5b850f7
......@@ -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)
......
......@@ -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);
}
......
......@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册