Переглянути джерело

更新代码内容进度(约75%)

oyq28 3 роки тому
батько
коміт
9d00d0874a

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

@@ -359,7 +359,8 @@ public class TaskWorkNode {
             String count = conMap.get(taskNode.getId().toString() + "count") == null ? "" : conMap.get(taskNode.getId().toString() + "count").toString();
             jsonObject.put("BusinessType", carryRequest);
             //传参数--起始终点位置
-            if ("testwork".equals(carryRequest) || "print".equals(carryRequest)) {//三坐标的Data参数比较特殊
+            if ("testwork".equals(carryRequest) || "print".equals(carryRequest)) {
+                //三坐标的Data参数比较特殊
                 String data = conMap.get("Data") == null ? null : conMap.get("Data").toString();
                 jsonObject.put("Data", data);
             } else {
@@ -399,7 +400,6 @@ public class TaskWorkNode {
                 bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_TYPE, xbkType);
                 bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, carryType);
             }
-//            }
         } else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
             jsonObject.put("url", task.getIp());
             jsonObject.put("port", task.getPort());
@@ -693,12 +693,14 @@ public class TaskWorkNode {
                     else if (DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())) {
                         //机器人放子盘夹具到上下料站(从机械手到上下料站)
                         //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
-                        map.put("functionName", "QSTATION_IN");
-                        nodeOperationService.initResource(taskNode,task,map);
+                        //map.put("functionName", "QSTATION_IN");
+                        //nodeOperationService.initResource(taskNode,task,map);
+                        map.put("robotType", DemoLineConstant.JQR1);
                         map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP01_06.equals(taskNode.getNodeNo())) {
                         //机器人取料(机器人从人工上料站取料放到机械手)
+                        map.put("robotType", DemoLineConstant.JQR1);
                         map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP01_07.equals(taskNode.getNodeNo())) {
@@ -737,18 +739,17 @@ public class TaskWorkNode {
                         String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
                                 : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
 
-                        //根据产线编号,匹配出产线类型。
-                        String JQR = "";
-
                         //记录产品流转到的库位
                         Storge jqrFromStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
                         map.put("fromStorge", jqrFromStorge);
                         if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            map.put("functionName", "SMU50_IN");
-                            nodeOperationService.initResource(taskNode,task,map);
+                            //map.put("functionName", "SMU50_IN");
+                            //nodeOperationService.initResource(taskNode,task,map);
+                            map.put("robotType", DemoLineConstant.JQR2);
                             map = nodeOperationService.checkCondition(taskNode,task,map);
                         }
                         else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
+                            map.put("robotType", DemoLineConstant.JQR3);
                             map = nodeOperationService.checkCondition(taskNode,task,map);
                         }
                     }
@@ -779,7 +780,7 @@ public class TaskWorkNode {
                         map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP03_03.equals(taskNode.getNodeNo())) {
-                        //清洗,PLC接口
+                        //柔性线清洗,PLC接口
                         map.put("functionName", "RX_CLEAN");
                         map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
@@ -829,81 +830,22 @@ public class TaskWorkNode {
                                 : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
 
                         //根据产线编号,匹配出产线类型。
-                        String JQR = "";
 
                         if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-                            Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
-                            map.put("zkIp", ZK_ip_zndy);
-                            map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                            map.put("fromStorge", jqrStorge);
-                            map.put("toStorge", plantStorge);
-                            map.put("Data", plantStorge);
-                            //出入库类型
-                            map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                            msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
-                            //前一步已经锁定完毕,直接满足条件
-                            map.put("result", true);
-                        } else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
-                            //当前步骤。骤有的节点会生产多步执行
-                            int count = dataMap.get(taskNode.getId().toString() + "count") == null ? 0 : Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count").toString());
-                            //执行到第几步
-                            map.put(taskNode.getId().toString() + "count", count);
-                            map.put(DemoLineConstant.DEMOLINE_RXJQR_FLAG, "1");
-                            map.put("zkIp", ZK_ip_rxx);
-//                    JQR = DemoLineConstant.JQR3;
-//                    TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
-                            if (count == 0) {//第一步移动
-                                Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
-                                if (plantStorge != null) {
-                                    map.put("Data", plantStorge);
-                                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
-                                } else {
-                                    //前序绑定的线边库
-                                    Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
-                                    if (xbkStorge != null) {
-                                        xbkStorge = (Storge) xbkStorge;
-                                        //目的地为线边库
-                                        map.put("toStorge", xbkStorge);
-                                        //临时存放到了线边库的标志
-                                        map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
-                                        //临时存放到了智能单元的线边库
-                                        map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
-                                        //当前执行数量
-                                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
-                                    }
-                                }
-                            } else if (count == 1) {//从缓存位拿出来
-                                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
-                                Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + taskNode.getId());
-                                map.put("Data", hcwStorge);
-                                map.put("fromStorge", hcwStorge);
-                                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
-                                map.put("toStorge", jqrStorge);
-                                //出入库类型
-                                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                            } else if (count == 2) {
-                                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                                //出入库类型
-                                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                                Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
-                                map.put("Data", plantStorge);
-                                map.put("toStorge", plantStorge);
-                                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
-                                map.put("fromStorge", jqrStorge);
-                                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
-                            }
-                            map.put("result", true);
+                            map.put("robotType", DemoLineConstant.JQR2);
+                            map = nodeOperationService.checkCondition(taskNode,task,map);
+                        }
+                        else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
+                            map.put("robotType", DemoLineConstant.JQR3);
+                            map = nodeOperationService.checkCondition(taskNode,task,map);
                         }
-
                     }
                     break;
                 case "OP50":
                     //质检
                     if (DemoLineConstant.DEMOLINE_OP05_01.equals(taskNode.getNodeNo())) {
                         //AGV运回
-                        nodeOperationService.checkCondition(taskNode, task, dataMap);
-
+                        map = nodeOperationService.checkCondition(taskNode, task, dataMap);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP05_02.equals(taskNode.getNodeNo())) {
                         //取放到三坐标
@@ -911,42 +853,8 @@ public class TaskWorkNode {
                         map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP05_03.equals(taskNode.getNodeNo())) {
-                        //取放到三坐标  从机器人手臂到三坐标
-                        Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-
-                        map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                        map.put("zkIp", ZK_ip_zlzx);
-                        map.put("fromStorge", jqrStorge);
-                        map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                        //前序绑定的sum50
-                        Object szbStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.Q3ZUOBIAO + taskNode.getId());
-                        if (szbStorge != null) {//前序是绑定到托板
-                            szbStorge = (Storge) szbStorge;
-                            //目的地为机器人手臂
-                            map.put("toStorge", szbStorge);
-                            map.put("Data", szbStorge);
-                            msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), szbStorge, 1, TimeUnit.DAYS);
-                        } else {
-                            //前序绑定的线边库
-                            Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZLZX_XBK + taskNode.getId());
-                            if (xbkStorge != null) {
-                                xbkStorge = (Storge) xbkStorge;
-                                //目的地为线边库
-                                map.put("toStorge", xbkStorge);
-                                map.put("Data", xbkStorge);
-                                //出入库类型
-                                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                                //临时存放到了线边库的标志
-                                map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
-                                //临时存放到了智能单元的线边库
-                                map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZLZX_XBK);
-                                //搬运类型
-                                map.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX_SZB);
-                                //当前执行数量
-                                msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
-                            }
-                        }
-                        map.put("result", true);
+                        map.put("robotType", DemoLineConstant.JQR2);
+                        map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP05_04.equals(taskNode.getNodeNo())) {
                         //执行三坐标测量
@@ -965,22 +873,8 @@ public class TaskWorkNode {
                         //机器人放子盘夹具到上下料站(从机械手到上下料站)
                         //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
                         //1、取出机器人
-                        Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
-                        //2、取出上下料站
-                        Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
-                        map.put("zkIp", ZK_ip_zlzx);
-                        //3、把起始终点库位存放到map,用于接口
-                        map.put("fromStorge", jqrStorge);
-                        map.put("toStorge", sxlzstorge);
-                        map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                        //出入库类型
-                        map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                        //目的地为机器人手臂
-                        map.put("Data", sxlzstorge);
-                        //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
-                        map.put("result", true);
-                        //4、记录机器人的库位,下一个步骤使用
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
+                        map.put("robotType", DemoLineConstant.JQR1);
+                        map = nodeOperationService.checkCondition(taskNode,task,map);
                     }
                     break;
                 case "OP60":
@@ -994,23 +888,8 @@ public class TaskWorkNode {
                         //机器人放子盘夹具到上下料站(从机械手到上下料站)
                         //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
                         //1、取出机器人
-                        Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
-//                //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
-//                storgeService.lockStorge(jqrStorge, taskNode.getId());
-                        //2、取出上下料站
-                        Storge xbkstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.XBK + taskNode.getId());
-                        map.put("zkIp", ZK_ip_zlzx);
-                        //3、把起始终点库位存放到map,用于接口
-                        map.put("fromStorge", jqrStorge);
-                        map.put("toStorge", xbkstorge);
-                        map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
-
-                        map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                        map.put("Data", xbkstorge);
-                        //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
-                        map.put("result", true);
-                        //4、记录机器人的库位,下一个步骤使用
-//                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
+                        map.put("robotType", DemoLineConstant.JQR1);
+                        map = nodeOperationService.checkCondition(taskNode, task, dataMap);
                     }
                     else if (DemoLineConstant.DEMOLINE_OP06_04.equals(taskNode.getNodeNo())) {
                         //AGV

+ 7 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/AGVNodeServiceImpl.java

@@ -17,6 +17,7 @@ import com.github.zuihou.business.productionResourceCenter.service.Productionres
 import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -48,7 +49,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
     private MsgUtil msgUtil;
 
     private ProductionresourcePosition productionresourcePosition;
-    private String zoneNo;
+    private String zoneNo = null;
     private String[] jbwarr = null;
 
 
@@ -66,7 +67,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
         //具体的搬运类型
         String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
 
-        Map<String, Object> map = new HashMap<>();
+        Map<String, Object> map = Maps.newHashMap();
         map.put("taskNode", taskNode);
         map.put("task", task);
         map.put("bizType", bizType);
@@ -83,6 +84,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
                 map.put("toStorge", jbwstorge);
                 //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
                 map.put("result", true);
+                //出入库类型-原料出入库
                 map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_CRK);
                 //4、记录机器人的库位,下一个步骤使用
                 msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), jbwstorge, 1, TimeUnit.DAYS);
@@ -115,7 +117,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
                     msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JBW + nextTaskNode.getId(), jbwstorge, 1, TimeUnit.DAYS);
                     //目的地为接驳位
                     map.put("toStorge", jbwstorge);
-                    //出入库类型
+                    //出入库类型-托板出入库
                     map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_PLATE_CRK);
                     //记录产品流转到的库位
                     msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_JBW_STORAGE + "_" + task.getCompleteBatchNo(), jbwstorge, 1, TimeUnit.DAYS);
@@ -143,7 +145,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
                     msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JBW + nextTaskNode.getId(), jbwstorge, 1, TimeUnit.DAYS);
                     //目的地为接驳位
                     map.put("toStorge", jbwstorge);
-                    //出入库类型
+                    //出入库类型-托板出入库
                     map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_PLATE_CRK);
                     //记录产品流转到的库位
 //                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" +task.getCompleteBatchNo(), jbwstorge, 1, TimeUnit.DAYS);
@@ -170,6 +172,7 @@ public class AGVNodeServiceImpl implements NodeOperationService {
                     Storge jbwBstorge = storgeService.getById(jbwBList.get(0).getStorgeId());
                     map.put("fromStorge", jbwBstorge);
                 }
+                //出入库类型-原料出入库
                 map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_CRK);
                 map.put("result", true);
             }

+ 10 - 100
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java

@@ -22,6 +22,7 @@ import com.github.zuihou.business.productionResourceCenter.service.NodeOperation
 import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.common.util.StringUtil;
+import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -62,12 +63,13 @@ public class MachineNodeServiceImpl implements NodeOperationService {
     @Autowired
     private BomProcedureService bomProcedureService;
 
-    //关联线边库
-    private String[] zxzxXBKarr = null;
-
     //关联接驳位
     private String[] jbwarr = null;
 
+    private Map<String, Object> map = Maps.newHashMap();
+
+    private Map<String, Object> queryMap = Maps.newHashMap();
+
     private String ZK_ip_zlzx = "192.168.170.61";
 
     //智能单元
@@ -79,16 +81,6 @@ public class MachineNodeServiceImpl implements NodeOperationService {
     @Override
     public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
 
-        //Map map = productionresourcePositionService.getProductionresourcePositionMap();
-        //List<ProductionresourcePosition> productionresourcePositionList = (List<ProductionresourcePosition>)map.get((long)taskNode.getResourceId());
-        String functionName = dataMap.get("functionName").toString();
-        //获取种类
-        if ("WMS_OUT".equals(functionName)) {
-            this.zxzxXBKarr = new String[]{DemoLineConstant.NODE_RESOURCE_ZLZX_XBK};
-            this.jbwarr = new String[]{DemoLineConstant.JBW_A, DemoLineConstant.JBW_B};
-        }
-
-
     }
 
     @Override
@@ -98,7 +90,6 @@ public class MachineNodeServiceImpl implements NodeOperationService {
         //具体的搬运类型
         String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
 
-        Map<String, Object> map = new HashMap<>();
         map.put("taskNode", taskNode);
         map.put("task", task);
         map.put("bizType", bizType);
@@ -110,6 +101,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
             case "WMS":
                 //WMS出库
                 if ("WMS_OUT".equals(functionName)) {
+                    jbwarr = new String[]{DemoLineConstant.JBW_A, DemoLineConstant.JBW_B};
+                    String[] zxzxXBKarr = new String[]{DemoLineConstant.NODE_RESOURCE_ZLZX_XBK};
                     List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(zxzxXBKarr);
                     List<ProductionresourcePosition> jbwList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jbwarr);
                     Map<String, List<ProductionresourcePosition>> jbwMap = jbwList.stream().collect(groupingBy(ProductionresourcePosition::getCode));
@@ -126,6 +119,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                         map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_METERIAL_RK);
                         map.put("locationName", "Location-8002");
                         map.put(DemoLineConstant.DEMOLINE_WMS_TYPE, DemoLineConstant.DEMOLINE_WMS_CHUKU);//出库
+
                         Map jsonMap = new HashMap();
                         jsonMap.put("productNo", task.getMeterialId());
                         jsonMap.put("productCount", "1");
@@ -166,7 +160,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                     map.put(DemoLineConstant.DEMOLINE_WMS_TYPE, DemoLineConstant.DEMOLINE_WMS_RUKU);//入库
                     //TODO临时这样写
                     Map queryMap = new HashMap();
-                    String jbwarr[] = {DemoLineConstant.JBW_A};
+                    jbwarr = new String[]{DemoLineConstant.JBW_A};
                     queryMap.put("codes", StringUtil.changeIdsArrToSubQueryStr(jbwarr));
                     List<ProductionresourcePosition> jbwAList = productionresourcePositionMapper.getPPList(queryMap);
                     if (CollectionUtil.isNotEmpty(jbwAList)) {
@@ -185,58 +179,6 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                 }
                 break;
             case "上下料站":
-                //托盘夹具放入上下料站
-                if ("QSTATION_OUT".equals(functionName)) {
-                    //1、取出质量中心机器人
-                    Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
-                    //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
-                    //storgeService.lockStorge(jqrStorge, taskNode.getId());
-                    //2、取出上下料站
-                    Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
-                    map.put("zkIp", ZK_ip_zlzx);
-                    //3、把起始终点库位存放到map,用于接口
-                    map.put("fromStorge", jqrStorge);
-                    map.put("toStorge", sxlzstorge);
-                    //出入库类型
-                    map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
-
-                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                    map.put("Data", sxlzstorge);
-                    //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
-                    map.put("result", true);
-                    //4、记录机器人的库位,下一个步骤使用
-//                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
-                }
-                else if ("QSTATION_OUT".equals(functionName)) {
-                    map.put("zkIp", ZK_ip_zndy);
-                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                    //前序绑定的sum50
-                    Object sum50Storge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId());
-                    if (sum50Storge != null) {//前序是绑定到sum50
-                        sum50Storge = (Storge) sum50Storge;
-                        //目的地为机器人手臂
-                        map.put("toStorge", sum50Storge);
-                        map.put("Data", sum50Storge);
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
-                    } else {
-                        //前序绑定的线边库
-                        Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
-                        if (xbkStorge != null) {
-                            xbkStorge = (Storge) xbkStorge;
-                            //目的地为线边库
-                            map.put("toStorge", xbkStorge);
-                            map.put("Data", xbkStorge);
-                            //临时存放到了线边库的标志
-                            map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
-                            //临时存放到了智能单元的线边库
-                            map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
-                        }
-                    }
-                    map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                    //
-                    map.put("result", true);
-                }
-
                 break;
 
             case "打标机":
@@ -253,37 +195,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
 
                 break;
             case "smu50":
-                if ("SMU50_IN".equals(functionName)) {
-                    map.put("zkIp", ZK_ip_zndy);
-                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
-                    //前序绑定的sum50
-                    Object sum50Storge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId());
-                    if (sum50Storge != null) {//前序是绑定到sum50
-                        sum50Storge = (Storge) sum50Storge;
-                        //目的地为机器人手臂
-                        map.put("toStorge", sum50Storge);
-                        map.put("Data", sum50Storge);
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
-                    } else {
-                        //前序绑定的线边库
-                        Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
-                        if (xbkStorge != null) {
-                            xbkStorge = (Storge) xbkStorge;
-                            //目的地为线边库
-                            map.put("toStorge", xbkStorge);
-                            map.put("Data", xbkStorge);
-                            //临时存放到了线边库的标志
-                            map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
-                            //临时存放到了智能单元的线边库
-                            map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
-                        }
-                    }
-                    map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
-                    //
-                    map.put("result", true);
-                }
-                else if ("SMU50_FILE".equals(functionName)) {
-                    Map queryMap = new HashMap<>();
+                 if ("SMU50_FILE".equals(functionName)) {
                     queryMap.put("procedureId", task.getProcedureId());
                     queryMap.put("haveFile", "1");
                     List<BomProcedureProgramGroup> bomProcedureProgramGroupList = bomProcedureProgramGroupMapper.getProgramGroupList(queryMap);
@@ -349,13 +261,11 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                     //查出工序三坐标相关
                     BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
 
-                    Map queryMap = new HashMap();
                     String unionCode = workpieceService.getUnionCode(task.getCompleteBatchNo());
                     queryMap.put("WorkId", unionCode);
                     queryMap.put("WorkType", StringUtil.isNotEmpty(procedure.getProgramTestPrograme()) ? procedure.getProgramTestPrograme() : "1111");
 
                     map.put("Data", JSONObject.toJSONString(queryMap));
-
                     map.put("result", true);
                 }
 

+ 204 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -84,6 +84,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
         map.put("task", task);
         map.put("bizType", bizType);
 
+        //质量中心机器人
         if(DemoLineConstant.JQR1.equals(robotType)){
             //机器人放子盘夹具到上下料站(从子盘到机械手)。可能进行换手操作
             if (DemoLineConstant.DEMOLINE_OP01_03.equals(taskNode.getNodeNo())) {
@@ -161,6 +162,27 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 }
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())) {
+                //1、取出质量中心机器人
+                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
+                //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
+                //storgeService.lockStorge(jqrStorge, taskNode.getId());
+                //2、取出上下料站
+                Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
+                map.put("zkIp", ZK_ip_zlzx);
+                //3、把起始终点库位存放到map,用于接口
+                map.put("fromStorge", jqrStorge);
+                map.put("toStorge", sxlzstorge);
+                //出入库类型-托盘夹具出入库
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
+
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                map.put("Data", sxlzstorge);
+                //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
+                map.put("result", true);
+                //4、记录机器人的库位,下一个步骤使用
+//                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
+            }
             else if (DemoLineConstant.DEMOLINE_OP01_06.equals(taskNode.getNodeNo())) {
                 //机器人取料(机器人从人工上料站取料放到机械手)
                 int count = dataMap.get(taskNode.getId().toString() + "count") == null ? 0 : Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count").toString());
@@ -472,6 +494,28 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 }
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP05_06.equals(taskNode.getNodeNo())) {
+                //机器人放子盘夹具到上下料站(从机械手到上下料站)
+                //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
+                //1、取出机器人
+                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
+                //2、取出上下料站
+                Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
+                map.put("zkIp", ZK_ip_zlzx);
+                //3、把起始终点库位存放到map,用于接口
+                map.put("fromStorge", jqrStorge);
+                map.put("toStorge", sxlzstorge);
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                //出入库类型
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                //目的地为机器人手臂
+                map.put("Data", sxlzstorge);
+                //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
+                map.put("result", true);
+                //4、记录机器人的库位,下一个步骤使用
+                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
+            }
+
             else if (DemoLineConstant.DEMOLINE_OP06_02.equals(taskNode.getNodeNo())) {
                 //子盘,夹具,归还线边库
                 int count = dataMap.get(taskNode.getId().toString() + "count") == null ? 0 : Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count").toString());
@@ -539,9 +583,31 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 }
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP06_03.equals(taskNode.getNodeNo())) {
+                //机器人放子盘夹具到上下料站(从机械手到上下料站)
+                //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
+                //1、取出机器人
+                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
+//                //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
+//                storgeService.lockStorge(jqrStorge, taskNode.getId());
+                //2、取出上下料站
+                Storge xbkstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.XBK + taskNode.getId());
+                map.put("zkIp", ZK_ip_zlzx);
+                //3、把起始终点库位存放到map,用于接口
+                map.put("fromStorge", jqrStorge);
+                map.put("toStorge", xbkstorge);
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
 
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                map.put("Data", xbkstorge);
+                //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
+                map.put("result", true);
+                //4、记录机器人的库位,下一个步骤使用
+//                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
+            }
 
         }
+        //智能单元机器人
         else if(DemoLineConstant.JQR2.equals(robotType)){
             if (DemoLineConstant.DEMOLINE_OP02_01.equals(taskNode.getNodeNo())) {
                 map.put("zkIp", ZK_ip_zndy);
@@ -600,6 +666,37 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 map.put("result", (CollectionUtil.isNotEmpty(jqrList) && ((CollectionUtil.isNotEmpty(sum50List) || CollectionUtil.isNotEmpty(xbkList)))));
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP02_02.equals(taskNode.getNodeNo())) {
+                map.put("zkIp", ZK_ip_zndy);
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                //前序绑定的sum50
+                Object sum50Storge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId());
+                if (sum50Storge != null) {//前序是绑定到sum50
+                    sum50Storge = (Storge) sum50Storge;
+                    //目的地为机器人手臂
+                    map.put("toStorge", sum50Storge);
+                    map.put("Data", sum50Storge);
+                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
+                } else {
+                    //前序绑定的线边库
+                    Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
+                    if (xbkStorge != null) {
+                        xbkStorge = (Storge) xbkStorge;
+                        //目的地为线边库
+                        map.put("toStorge", xbkStorge);
+                        map.put("Data", xbkStorge);
+                        //临时存放到了线边库的标志
+                        map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
+                        //临时存放到了智能单元的线边库
+                        map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
+                    }
+                }
+                //出入库类型-托盘夹具原材料出入库
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                //
+                map.put("result", true);
+            }
+
             else if (DemoLineConstant.DEMOLINE_OP04_09.equals(taskNode.getNodeNo())) {
                 String jrqarr[] = {DemoLineConstant.JQR2};
                 List<ProductionresourcePosition> jqrList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jrqarr);
@@ -655,7 +752,62 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 }
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP04_10.equals(taskNode.getNodeNo())) {
+                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
+                Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
+                map.put("zkIp", ZK_ip_zndy);
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                map.put("fromStorge", jqrStorge);
+                map.put("toStorge", plantStorge);
+                map.put("Data", plantStorge);
+                //出入库类型-托盘夹具原材料出入库
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
+                //前一步已经锁定完毕,直接满足条件
+                map.put("result", true);
+            }
+
+            else if (DemoLineConstant.DEMOLINE_OP05_03.equals(taskNode.getNodeNo())) {
+                //取放到三坐标  从机器人手臂到三坐标
+                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
+
+                map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                map.put("zkIp", ZK_ip_zlzx);
+                map.put("fromStorge", jqrStorge);
+                map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                //前序绑定的sum50
+                Object szbStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.Q3ZUOBIAO + taskNode.getId());
+                if (szbStorge != null) {//前序是绑定到托板
+                    szbStorge = (Storge) szbStorge;
+                    //目的地为机器人手臂
+                    map.put("toStorge", szbStorge);
+                    map.put("Data", szbStorge);
+                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), szbStorge, 1, TimeUnit.DAYS);
+                } else {
+                    //前序绑定的线边库
+                    Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZLZX_XBK + taskNode.getId());
+                    if (xbkStorge != null) {
+                        xbkStorge = (Storge) xbkStorge;
+                        //目的地为线边库
+                        map.put("toStorge", xbkStorge);
+                        map.put("Data", xbkStorge);
+                        //出入库类型
+                        map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                        //临时存放到了线边库的标志
+                        map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
+                        //临时存放到了智能单元的线边库
+                        map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZLZX_XBK);
+                        //搬运类型
+                        map.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX_SZB);
+                        //当前执行数量
+                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
+                    }
+                }
+                map.put("result", true);
+            }
+
         }
+        //柔性线机器人
         else if(DemoLineConstant.JQR3.equals(robotType)){
             if (DemoLineConstant.DEMOLINE_OP02_01.equals(taskNode.getNodeNo())) {
                 //当前步骤。骤有的节点会生产多步执行
@@ -1170,6 +1322,58 @@ public class RobotNodeServiceImpl implements NodeOperationService {
 //                    }
             }
 
+            else if (DemoLineConstant.DEMOLINE_OP04_10.equals(taskNode.getNodeNo())) {
+                //当前步骤。骤有的节点会生产多步执行
+                int count = dataMap.get(taskNode.getId().toString() + "count") == null ? 0 : Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count").toString());
+                //执行到第几步
+                map.put(taskNode.getId().toString() + "count", count);
+                map.put(DemoLineConstant.DEMOLINE_RXJQR_FLAG, "1");
+                map.put("zkIp", ZK_ip_rxx);
+//                    JQR = DemoLineConstant.JQR3;
+//                    TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
+                if (count == 0) {//第一步移动
+                    Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
+                    if (plantStorge != null) {
+                        map.put("Data", plantStorge);
+                        map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
+                    } else {
+                        //前序绑定的线边库
+                        Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
+                        if (xbkStorge != null) {
+                            xbkStorge = (Storge) xbkStorge;
+                            //目的地为线边库
+                            map.put("toStorge", xbkStorge);
+                            //临时存放到了线边库的标志
+                            map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
+                            //临时存放到了智能单元的线边库
+                            map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
+                            //当前执行数量
+                            msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
+                        }
+                    }
+                } else if (count == 1) {//从缓存位拿出来
+                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
+                    Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + taskNode.getId());
+                    map.put("Data", hcwStorge);
+                    map.put("fromStorge", hcwStorge);
+                    Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
+                    map.put("toStorge", jqrStorge);
+                    //出入库类型
+                    map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                } else if (count == 2) {
+                    map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                    //出入库类型-托盘夹具原材料出入库
+                    map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
+                    Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
+                    map.put("Data", plantStorge);
+                    map.put("toStorge", plantStorge);
+                    Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
+                    map.put("fromStorge", jqrStorge);
+                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
+                }
+                map.put("result", true);
+            }
+
         }
         return map;
     }

+ 1 - 1
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/BizConstant.java

@@ -159,7 +159,7 @@ public interface BizConstant {
 
     String TENANT = "0000";
 
-    //普通的节点类型
+    //普通的节点类型(bizType)
     String MQ_TASK_NODE_TYPE_COMMON = "1";
     //质量中心线边库轮询类型
     String MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX = "2";