提交 1b85c180 编写于 作者: sq3536's avatar sq3536

版本升级

上级 79700e8b
......@@ -156,7 +156,7 @@
<dependency>
<groupId>net.ibizsys.model</groupId>
<artifactId>ibiz-model</artifactId>
<version>0.2.8</version>
<version>0.3.0</version>
<exclusions>
<exclusion>
<artifactId>slf4j-simple</artifactId>
......
package cn.ibizlab.codegen.model;
import cn.ibizlab.codegen.utils.StringAdvUtils;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import net.ibizsys.model.app.wf.IPSAppWFVer;
import net.ibizsys.model.dataentity.action.IPSDEAction;
import net.ibizsys.model.dataentity.action.IPSDELogicAction;
import net.ibizsys.model.dataentity.action.IPSDEScriptAction;
import net.ibizsys.model.wf.*;
import org.springframework.util.ObjectUtils;
import java.util.*;
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
public class WorkflowModel extends BaseModel{
public WorkflowModel(SystemModel systemModel, IPSWFVersion ver)
{
this.opt=ver;
this.system=systemModel;
this.setCodeName(ver.getCodeName());
this.setName(ver.getName());
this.setId(String.format("%1$s-%2$s",system.getCodeName().toLowerCase(),ver.getCodeName().toLowerCase()));
}
public IPSWFVersion getWFVersion()
{
return (IPSWFVersion)opt;
}
private SystemModel system;
private Map<String,IPSWFProcessRole> refGroups;
public Map<String,IPSWFProcessRole> getRefGroups()
{
if(refGroups==null)
{
refGroups=new LinkedHashMap<>();
if(ObjectUtils.isEmpty(getWFVersion().getPSWFProcesses()))
{
getWFVersion().getPSWFProcesses().forEach(WFProcess->{
List<IPSWFProcessRole> roles=null;
if(WFProcess instanceof IPSWFInteractiveProcess)
roles=((IPSWFInteractiveProcess) WFProcess).getPSWFProcessRoles();
else if(WFProcess instanceof IPSWFCallOrgActivityProcess)
roles=((IPSWFCallOrgActivityProcess) WFProcess).getPSWFProcessRoles();
if(!ObjectUtils.isEmpty(roles))
{
roles.forEach(role->{
String roleId=role.getPSWFRole().getCodeName()+"|"+role.getPSWFRole().getName()+"|"+role.getPSWFRole().getWFRoleType();
if("DEDATASET".equalsIgnoreCase(role.getPSWFRole().getWFRoleType())&&role.getPSWFRole() instanceof IPSWFDEDataSetRole) {
IPSWFDEDataSetRole dsRole=(IPSWFDEDataSetRole)role.getPSWFRole();
if(dsRole.getWFUserIdPSDEF()!=null&&dsRole.getPSDEDataSet()!=null&&dsRole.getPSDataEntity()!=null)
roleId += ("/" + StringAdvUtils.pluralize(dsRole.getPSDataEntity().getCodeName())+"/fetch"+dsRole.getPSDEDataSet().getCodeName().toLowerCase()+"."+StringAdvUtils.camelcase(dsRole.getWFUserIdPSDEF().getCodeName()));
}
refGroups.put(roleId,role);
});
}
});
}
}
return refGroups;
}
private Map<String,EntityModel> bookings;
public Map<String,EntityModel> getBookings()
{
if(bookings==null)
{
bookings=new LinkedHashMap<>();
getWFVersion().getPSWorkflow().getPSWFDEs().forEach(de->{
bookings.put(de.getCodeName(),getSystem().getEntity(de.getCodeName()));
});
}
return bookings;
}
private Map<String,AppModel> mobApps;
public Map<String,AppModel> getMobApps() {
if (mobApps == null) {
mobApps=new LinkedHashMap<>();
getBookings().keySet().forEach(entity->{
if(ObjectUtils.isEmpty(getSystem().getApps()))
return;
getSystem().getApps().forEach(app->{
if(!app.getApplication().isMobileApp())
return;
if(ObjectUtils.isEmpty(app.getAppEntities()))
return;
for(AppEntityModel appEntity:app.getAppEntities())
{
if(appEntity.getEntity()!=null&&entity.equalsIgnoreCase(appEntity.getEntity().getCodeName()))
{
mobApps.put(app.codeName,app);
return;
}
}
});
});
}
return mobApps;
}
private Map<String,AppModel> webApps;
public Map<String,AppModel> getWebApps() {
if (webApps == null) {
webApps=new LinkedHashMap<>();
getBookings().keySet().forEach(entity->{
if(ObjectUtils.isEmpty(getSystem().getApps()))
return;
getSystem().getApps().forEach(app->{
if(app.getApplication().isMobileApp())
return;
if(ObjectUtils.isEmpty(app.getAppEntities()))
return;
for(AppEntityModel appEntity:app.getAppEntities())
{
if(appEntity.getEntity()!=null&&entity.equalsIgnoreCase(appEntity.getEntity().getCodeName()))
{
webApps.put(app.codeName,app);
return;
}
}
});
});
}
return webApps;
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册