24282 2 lat temu
rodzic
commit
944f1aed1f

+ 3 - 3
hx-flow/src/main/java/com/fjhx/flow/enums/FlowStatusEnum.java

@@ -11,10 +11,10 @@ import java.util.Map;
 @AllArgsConstructor
 public enum FlowStatusEnum {
 
-    UNINITIATED(0, "未发起"),
+    READY_START(0, "未发起"),
     IN_PROGRESS(1, "进行中"),
-    HAVE_PASSED(2, "已通过"),
-    REJECTED(3, "已驳回"),
+    PASS(2, "已通过"),
+    REJECT(3, "已驳回"),
     ;
 
     private final Integer key;

+ 14 - 10
hx-flow/src/main/java/com/fjhx/flow/service/flow/impl/FlowProcessServiceImpl.java

@@ -126,7 +126,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
             flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
         } else {
             // 流程已通过
-            flowExample.setStatus(FlowStatusEnum.HAVE_PASSED.getKey());
+            flowExample.setStatus(FlowStatusEnum.PASS.getKey());
         }
 
         // 执行开始流程方法
@@ -244,12 +244,13 @@ public class FlowProcessServiceImpl implements FlowProcessService {
                 // 赋值流程所在id
                 flowExample.setDefinitionNodeId(nextUserNode.getId());
 
-                // 如果下一节点为结束节点,赋值下一个节点处理用户id
+                // 如果下一节点为结束节点
                 if (NodeTypeEnum.END.equals(NodeTypeEnum.getEnum(nextUserNode.getNodeType()))) {
                     // 流程已通过
-                    flowExample.setStatus(FlowStatusEnum.HAVE_PASSED.getKey());
-                } else {
-
+                    flowExample.setStatus(FlowStatusEnum.PASS.getKey());
+                }
+                // 如果下一节点不为结束节点
+                else {
                     FlowResult handleUser = getHandleUser(nextUserNode, dto.getHandleUserId());
 
                     // 如果下一节点处理用户只有1人,赋值用户id
@@ -269,7 +270,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
 
             // 结束流程
             case REJECT:
-                flowExample.setStatus(FlowStatusEnum.REJECTED.getKey());
+                flowExample.setStatus(FlowStatusEnum.REJECT.getKey());
                 break;
 
             // 返回上一节点
@@ -286,7 +287,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
                 // 如果流程回退到开始节点
                 if (NodeTypeEnum.START.getKey().equals(lastOneFlowExampleDetail.getFlowDefinitionNodeType())) {
                     // 流程未发起
-                    flowExample.setStatus(FlowStatusEnum.UNINITIATED.getKey());
+                    flowExample.setStatus(FlowStatusEnum.READY_START.getKey());
                 } else {
                     // 流程进行中
                     flowExample.setStatus(FlowStatusEnum.IN_PROGRESS.getKey());
@@ -302,7 +303,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
 
                 flowExample.setHandleUserId(exampleDetail.getCreateUser());
                 flowExample.setDefinitionNodeId(exampleDetail.getFlowDefinitionNodeId());
-                flowExample.setStatus(FlowStatusEnum.UNINITIATED.getKey());
+                flowExample.setStatus(FlowStatusEnum.READY_START.getKey());
                 FlowThreadLocalUtil.setNextHandleUserId(exampleDetail.getCreateUser());
                 break;
 
@@ -334,7 +335,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
         flowExampleDetailList.add(nodeExampleDetail);
 
         // 如果流程已结束
-        if (FlowStatusEnum.HAVE_PASSED.getKey().equals(flowExample.getStatus())) {
+        if (FlowStatusEnum.PASS.getKey().equals(flowExample.getStatus())) {
 
             // 执行结束方法
             invokeEndMethod(nextUserNode, flowDelegate);
@@ -498,13 +499,16 @@ public class FlowProcessServiceImpl implements FlowProcessService {
                 if (sysDept == null) {
                     throw new ServiceException("部门为空");
                 }
+                // 部门负责人
                 if (HandleObjectTypeEnum.DETP_LEADER.equals(handleObjectTypeEnum)) {
                     Long leaderId = sysDept.getLeaderId();
                     if (leaderId == null) {
                         throw new ServiceException("部门负责人为空");
                     }
                     flowResult.setUserId(leaderId);
-                } else {
+                }
+                // 部门总监
+                else {
                     Long directorId = sysDept.getDirectorId();
                     if (directorId == null) {
                         throw new ServiceException("部门总监为空");