fix: 流程启动的时候process_all获取部到prc_type

This commit is contained in:
2024-01-25 10:57:42 +08:00
parent 5b0ca9793d
commit fe001cbc2a
3 changed files with 7 additions and 4 deletions
@@ -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;
}
@@ -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);
}