home 2 年 前
コミット
13ac07490b

+ 14 - 6
hx-common/service-flow/src/main/java/com/fjhx/service/example/impl/ExampleInfoServiceImpl.java

@@ -98,17 +98,26 @@ public class ExampleInfoServiceImpl extends ServiceImpl<ExampleInfoMapper, Examp
             List<ProcessNode> processNodes = parentProcessNodeMap.get((Long) map.get("nodeId"));
             if (processNodes != null && processNodes.size() == 1) {
                 nextNode = processNodes.get(0);
-            }
 
-        } else {
-            nextNode = processNodeList.get(0);
+                HashMap<String, Object> item = new HashMap<>();
+                item.put("type", ButtonNameEnum.HAVE_IN_HAND.getType());
+                item.put("typeName", ButtonNameEnum.HAVE_IN_HAND.getName());
+                item.put("nodeName", nextNode.getName());
+                item.put("nodeId", nextNode.getId());
+                result.add(item);
+
+                List<ProcessNode> nextProcessNodes = parentProcessNodeMap.get(nextNode.getId());
+                if (nextProcessNodes != null && nextProcessNodes.size() == 1) {
+                    nextNode = nextProcessNodes.get(0);
+                }
+            }
         }
 
         // 寻找之后未处理的节点
         while (nextNode != null) {
             HashMap<String, Object> map = new HashMap<>();
-            map.put("type", 0);
-            map.put("typeName", "未开始");
+            map.put("type", ButtonNameEnum.NOT_STARTED.getType());
+            map.put("typeName", ButtonNameEnum.NOT_STARTED.getName());
             map.put("nodeName", nextNode.getName());
             map.put("nodeId", nextNode.getId());
             result.add(map);
@@ -117,7 +126,6 @@ public class ExampleInfoServiceImpl extends ServiceImpl<ExampleInfoMapper, Examp
             if (processNodes != null && processNodes.size() == 1) {
                 nextNode = processNodes.get(0);
             }
-
         }
 
         return null;

+ 1 - 1
hx-service-api/service-flow-api/src/main/java/com/fjhx/enums/ButtonNameEnum.java

@@ -23,7 +23,7 @@ public enum ButtonNameEnum {
     BRANCH(7, "分支"),
 
     // 流程未开始
-    NotStarted(97, "未开始"),
+    NOT_STARTED(97, "未开始"),
     // 流程进行中
     HAVE_IN_HAND(98, "进行中"),
     // 结束流程