fix: 流程启动的时候process_all获取部到prc_type
This commit is contained in:
@@ -58,11 +58,14 @@ public enum ProcessTypeEnum {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Integer getValueByName(String name) {
|
||||
public static Integer getValueByName(String name, String processDefinitionId) {
|
||||
for (ProcessTypeEnum enumObject : values()) {
|
||||
if (enumObject.getName().equals(name)) {
|
||||
return enumObject.getValue();
|
||||
}
|
||||
if (processDefinitionId.contains(enumObject.toString().toLowerCase().replace("_", "-"))) {
|
||||
return enumObject.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
-2
@@ -90,7 +90,7 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
||||
processAll.setPrcNum(DateUtil.format(date, DatePattern.PURE_DATETIME_MS_PATTERN));
|
||||
processAll.setProcessDefinitionId(processDefinitionId);
|
||||
processAll.setProcessInstanceId(processInstanceId);
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByName(name));
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByName(name, processDefinitionId));
|
||||
processAll.setPrcStatus(ProcessStatusEnum.INCOMPLETE.getValue());
|
||||
processAllService.save(processAll);
|
||||
log.info("id = " + execution.getId());
|
||||
@@ -249,7 +249,7 @@ public class MyGlobalEventListener implements ActivitiEventListener {
|
||||
.eq(ProcessAll::getProcessInstanceId, processInstanceId));
|
||||
ProcessNodeService processNodeService = SpringContextUtil.getBean(ProcessNodeService.class);
|
||||
// 企标复审流程前两个节点都要视为第一个节点
|
||||
if (process.getPrcType().equals(ProcessTypeEnum.ES_RECHECK.getValue())) {
|
||||
if (process.getPrcType() != null && process.getPrcType().equals(ProcessTypeEnum.ES_RECHECK.getValue())) {
|
||||
List<ProcessNode> nodeList = processNodeService.list(new LambdaQueryWrapper<ProcessNode>()
|
||||
.eq(ProcessNode::getProcessDefinitionId, process.getProcessDefinitionId())
|
||||
.eq(ProcessNode::getSort, 2));
|
||||
|
||||
@@ -37,7 +37,7 @@ public class StartListener implements ExecutionListener {
|
||||
//新增流程总表信息(剩余的内容在启动流程时填充)
|
||||
ProcessAll processAll = new ProcessAll();
|
||||
processAll.setProcessInstanceId(processInstanceId);
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByName(name));
|
||||
processAll.setPrcType(ProcessTypeEnum.getValueByName(name, processDefinitionId));
|
||||
processAll.setPrcStatus(ProcessStatusEnum.INCOMPLETE.getValue());
|
||||
processAllService.save(processAll);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user