ソースを参照

fix:优化节点数据

wang.sq@aliyun.com 3 週間 前
コミット
27d0615fad

+ 1 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -1936,6 +1936,7 @@ public class TaskWorkNode {
 
         //设备不存在
         if (!checkRobot(robotList, zone.getName(), count)) {
+            dataMap.put("resultMsg","设备不存在或者设备为满足条件");
             return null;
         }
 //        //资源临界判断

+ 7 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/CacheRobotStrategy.java

@@ -205,7 +205,13 @@ public class CacheRobotStrategy implements RobotStrategy {
                 return returnMap;
             }
 
-            TWorkpiece workpiece = workpieceList.stream().filter(item->!item.getTaskNodeId().equals(taskNode.getId())).collect(Collectors.toList()).get(0);
+            List<TWorkpiece> collect = workpieceList.stream().filter(item -> !item.getTaskNodeId().equals(taskNode.getId())).collect(Collectors.toList());
+            if(collect.isEmpty() || collect.size()==0){
+                returnMap.put("result", false);
+                return returnMap;
+            }
+            TWorkpiece workpiece = collect.get(0);
+
             Object hcwStorgeFlag = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + workpiece.getTaskNodeId());
             if(ObjectUtil.isEmpty(hcwStorgeFlag)){
                 Object hcwPriotyFlag = msgUtil.redis_get(DemoLineConstant.JQR_HCW_PART_PRIOTY_EXEC_FLAG + workpiece.getTaskNodeId());