Pārlūkot izejas kodu

云箭机器人

姚云青 3 gadi atpakaļ
vecāks
revīzija
dbf2cef8a1

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/DemoCacheKey.java

@@ -11,6 +11,8 @@ public interface DemoCacheKey {
     //预占用用的key
     String DEMOLINE_CAMP = "DEMOLINE_CAMP";
 
+    String YUNJIAN_CAMP = "YUNJIAN_CAMP";
+
     //接驳位位置缓存
     String DEMOLINE_JBW_POSITION_MAP = "DEMOLINE_JBW_POSITION_MAP";
 

+ 275 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/YunjianConstant.java

@@ -0,0 +1,275 @@
+package com.github.zuihou.business.DemoLine;
+
+/**
+ * 示范线用到的常量
+ */
+public interface YunjianConstant {
+    String JBW ="jbw";
+    //10个接驳位
+    String JBW_A ="QjbwA";
+    String JBW_B ="QjbwB";
+//    String JBW_C ="jbwC";
+    String JBW_D ="QjbwD";
+    String JBW_E ="QjbwE";
+    String JBW_F ="ZjbwF";
+    String JBW_G ="jbwG";
+    String JBW_H ="RjbwH";
+    String JBW_I ="RjbwI";
+
+    String Q3ZUOBIAO ="Q3zuobiao";
+
+    //机器人1
+    String JQR1 ="Qjiqiren";
+
+    //机器人2
+    String JQR2 ="Zjiqiren";
+
+    //机器人3
+    String JQR3 ="Rjiqiren";
+
+    //小手抓
+    String XIAOSHOUZHUA="xiaoshouzhua";
+
+
+    //缓存位
+    String YUNJIAN_HCW = "YUNJIAN_HCW";
+    //柔性机器人的三个点位
+    String DEMOLINE_RJQR_ZS = "124";
+    String DEMOLINE_RJQR_KW1 = "126";
+    String DEMOLINE_RJQR_KW2 = "125";
+
+    //云箭目标库位
+    String YUNJIAN_TARGET_STORE = "YUNJIAN_TARGET_STORE";
+
+
+    //柔性机器人的三个点位
+    String YUJIAN_SFTJ_ = "371";
+
+    //上下料站
+    String SXLZ ="sxlz";
+
+    //上下料站1
+    String SXLZ1 ="Qstation1";
+
+    //上下料站1
+    String SXLZ2 ="Qstation2";
+
+    //托板
+    String TB = "TB";
+
+    //托板1
+    String ZTB1 = "Ztb1";
+
+    //托板2
+    String RTB1 = "Rtb1";
+
+    //托板3
+    String RTB2 = "Rtb2";
+
+    //托板4
+    String TB4 = "TB3";
+    //智能单元托板
+    String ZNDY_TB = "TP_202114310008";
+
+    //柔性线托板
+    String RXDY_TB = "TP_202114320009";
+
+
+    //打标机
+    String DEMOLINE_DABIAOJI = "Rdabiaoji";
+
+    //清洗机
+    String DEMOLINE_QINGXIJI = "Rqingxiji";
+
+
+    //生产资源
+    String DEMOLINE_SUM50_RXDY4 = "Rsmu50_4";
+    //生产资源
+    String DEMOLINE_SUM50_ZNDY = "Zsum50_5";
+
+
+
+    //产线(生产单元)智能生产单元
+    String DEMOLINE_WORK_SPACE1 = "DY_202012311409309";
+
+    //产线(生产单元)柔性智能加工生产区
+    String DEMOLINE_WORK_SPACE2 = "DY_202109340001";
+
+    //产线类型智能生产单元
+    String DEMOLINE_ZONE_TYPE1 = "1";
+    //产线类型柔性
+    String DEMOLINE_ZONE_TYPE2 = "2";
+    //产线类型智能生产单元的数量
+    int DEMOLINE_ZONE_TYPE1_NUM = 4;
+    //产线类型柔性生产的数量
+    int DEMOLINE_ZONE_TYPE2_NUM = 2;
+
+    String XBK = "XBK";
+    //三个线边库
+    //1-质量中心
+    String NODE_RESOURCE_ZLZX_XBK = "Qxianbianku";
+
+    //2-智能生产单元
+    String NODE_RESOURCE_ZNSCDY_XBK = "Zxianbianku";
+
+    //3-柔性生产区
+    String NODE_RESOURCE_RXSC_XBK = "Rxianbianku";
+
+
+    //三个线边库
+    //舱体线边库
+    String NODE_RESOURCE_CT_XBK = "CTxianbianku";
+
+    //框体线边库
+    String NODE_RESOURCE_KT_XBK = "KTxianbianku";
+
+    //保障中心线边库
+    String NODE_RESOURCE_BZZX_XBK = "BZZXxianbianku";
+
+    //节点编号
+    String DEMOLINE_OP01_01 ="DEMOLINE_OP01_01";
+    String DEMOLINE_OP01_02 ="DEMOLINE_OP01_02";
+    String DEMOLINE_OP01_03 ="DEMOLINE_OP01_03";
+    String DEMOLINE_OP01_04 ="DEMOLINE_OP01_04";
+    String DEMOLINE_OP01_05 ="DEMOLINE_OP01_05";
+    String DEMOLINE_OP01_06 ="DEMOLINE_OP01_06";
+    String DEMOLINE_OP01_07 ="DEMOLINE_OP01_07";
+    String DEMOLINE_OP01_08 ="DEMOLINE_OP01_08";
+
+    String DEMOLINE_OP02_01 ="DEMOLINE_OP02_01";
+    String DEMOLINE_OP02_02 ="DEMOLINE_OP02_02";
+    String DEMOLINE_OP02_03 ="DEMOLINE_OP02_03";
+    String DEMOLINE_OP02_04 ="DEMOLINE_OP02_04";
+    String DEMOLINE_OP02_05 ="DEMOLINE_OP02_05";
+    String DEMOLINE_OP02_06 ="DEMOLINE_OP02_06";
+    String DEMOLINE_OP02_07 ="DEMOLINE_OP02_07";
+    String DEMOLINE_OP02_08 ="DEMOLINE_OP02_08";
+
+
+    String DEMOLINE_OP03_01 ="DEMOLINE_OP03_01";
+    String DEMOLINE_OP03_02 ="DEMOLINE_OP03_02";
+    String DEMOLINE_OP03_03 ="DEMOLINE_OP03_03";
+    String DEMOLINE_OP03_04 ="DEMOLINE_OP03_04";
+
+
+    String DEMOLINE_OP04_01 ="DEMOLINE_OP04_01";
+    String DEMOLINE_OP04_02 ="DEMOLINE_OP04_02";
+    String DEMOLINE_OP04_03 ="DEMOLINE_OP04_03";
+    String DEMOLINE_OP04_09 ="DEMOLINE_OP04_09";
+    String DEMOLINE_OP04_10 ="DEMOLINE_OP04_10";
+
+
+    String DEMOLINE_OP05_01 ="DEMOLINE_OP05_01";
+    String DEMOLINE_OP05_02 ="DEMOLINE_OP05_02";
+    String DEMOLINE_OP05_03 ="DEMOLINE_OP05_03";
+    String DEMOLINE_OP05_04 ="DEMOLINE_OP05_04";
+    String DEMOLINE_OP05_05 ="DEMOLINE_OP05_05";
+    String DEMOLINE_OP05_06 ="DEMOLINE_OP05_06";
+
+
+    String DEMOLINE_OP06_01 ="DEMOLINE_OP06_01";
+    String DEMOLINE_OP06_02 ="DEMOLINE_OP06_02";
+    String DEMOLINE_OP06_03 ="DEMOLINE_OP06_03";
+    String DEMOLINE_OP06_04 ="DEMOLINE_OP06_04";
+    String DEMOLINE_OP06_05 ="DEMOLINE_OP06_05";
+
+    //示范线传参常量
+    String DEMOLINE_BIZ_TYPE ="DEMOLINE_BIZ_TYPE";
+
+
+    //示范线传参常量-----线边库作为MQ的情形
+    String DEMOLINE_XBKFLAG ="DEMOLINE_XBKFLAG";
+
+    //示范线传参常量
+    String DEMOLINE_XBK_TYPE ="DEMOLINE_XBK_TYPE";
+
+    //线边库队列执行
+    String DEMOLINE_EXEXBKFLAG ="DEMOLINE_EXEXBKFLAG";
+
+    //示范线上传程序
+    String DEMOLINE_UPLOADPRO_FLAG ="DEMOLINE_UPLOADPRO_FLAG";
+
+    //示范线执行程序
+    String DEMOLINE_EXEPRO_FLAG ="DEMOLINE_EXEPRO_FLAG";
+
+    //柔性机器人搬运标志,
+    String DEMOLINE_RXJQR_FLAG ="DEMOLINE_RXJQR_FLAG";
+
+    //柔性机器人搬运标志,(不需要移动)
+    String DEMOLINE_RXJQR_NOMOVE_FLAG ="DEMOLINE_RXJQR_NOMOVE_FLAG";
+
+    //柔性机器人换手抓标志,
+    String DEMOLINE_CHANGEHAND_FLAG ="DEMOLINE_CHANGEHAND_FLAG";
+
+
+    //示范线搬运类型
+    String DEMOLINE_XBK_CARRY_TYPE ="DEMOLINE_XBK_CARRY_TYPE";
+
+
+
+
+
+    //示范线传参常量
+//    String DEMOLINE_XBK_TYPE_ZLZX ="DEMOLINE_XBK_TYPE_ZLZX";
+//
+//    String DEMOLINE_XBK_TYPE_ZNDY ="DEMOLINE_XBK_TYPE_ZNDY";
+//
+//    String DEMOLINE_XBK_TYPE_RXDY ="DEMOLINE_XBK_TYPE_RXDY";
+
+    //加工序,需要记录加工序所属的生产单元(产线)
+    String DEMOLINE_WORK_OP = "OP20";
+
+    String DEMOLINE_GOODS_TYPE = "DEMOLINE_GOODS_TYPE";
+    //毛坯
+    String DEMOLINE_GOODS_TYPE_MAOPI = "0";
+    //成品
+    String DEMOLINE_GOODS_TYPE_CHENGPIN = "1";
+
+
+    //WMS
+    String DEMOLINE_WMS_TYPE = "DEMOLINE_WMS_TYPE";
+    String DEMOLINE_WMS_CHUKU = "wmsDown";
+    String DEMOLINE_WMS_RUKU = "wmsUp";
+
+
+    //出入库类型
+    String DEMOLINE_STOCK_TYPE = "DEMOLINE_STOCK_TYPE";
+    //原料入库
+    String DEMOLINE_STOCK_TYPE_METERIAL_RK = "DEMOLINE_STOCK_TYPE_METERIAL_RK";
+    //原料出库
+    String DEMOLINE_STOCK_TYPE_METERIAL_CK = "DEMOLINE_STOCK_TYPE_METERIAL_CK";
+    //原料出入库
+    String DEMOLINE_STOCK_TYPE_METERIAL_CRK = "DEMOLINE_STOCK_TYPE_METERIAL_CRK";
+    //托板出入库
+    String DEMOLINE_STOCK_TYPE_PLATE_CRK = "DEMOLINE_STOCK_TYPE_PLATE_CRK";
+    //托盘夹具出入库
+    String DEMOLINE_STOCK_TYPE_TRAY_CRK = "DEMOLINE_STOCK_TYPE_TRAY_CRK";
+    //托盘夹具原材料出入库
+    String DEMOLINE_STOCK_TYPE_ALL_CRK = "DEMOLINE_STOCK_TYPE_ALL_CRK";
+    //机械手入库
+    String DEMOLINE_STOCK_TYPE_HAND_RK = "DEMOLINE_STOCK_TYPE_HAND_RK";
+    //机械手出库
+    String DEMOLINE_STOCK_TYPE_HAND_CK = "DEMOLINE_STOCK_TYPE_HAND_CK";
+
+    //抓手库位
+    String DEMOLINE_HAND_STOCK_CODE = "031";
+
+
+    //PLC动作
+    String DEMOLINE_FETCHMATERIAL = "fetchMaterial";
+
+    String DEMOLINE_PUTMATERIAL = "putMaterial";
+
+
+    //设备采集字段
+    String GATHER_DYN_FILED_QXJ = "";
+
+    String GATHER_DYN_FILED_DBJ = "";
+
+    String GATHER_DYN_FILED_SZB = "";
+
+    String GATHER_DYN_FILED_SMU = "";
+
+
+
+}

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

@@ -155,19 +155,6 @@ public class TaskWorkNode {
             throw new InterruptedException("当前任务为空");
         }
 //        //获取配置序数据
-//        BomProcedureProductionresource bomProcedureProductionresource = bomProcedureProductionresourceService.getOne(new QueryWrapper<BomProcedureProductionresource>().eq("resourceId",tTask.getResourceId()).eq("procedureId", tTask.getProcedureId()));
-//        if(bomProcedureProductionresource == null || bomProcedureProductionresource.getResourceBusinessId() == null){
-//            throw new InterruptedException("自动化节点配置为空");
-//        }
-//        ResourceBusiness resourceBusiness = resourceBusinessService.getById(bomProcedureProductionresource.getResourceBusinessId());
-//        if(resourceBusiness == null || resourceBusiness.getIsFinal() == null){
-//            throw new InterruptedException("自动化节点配置有误");
-//        }
-//
-//        List<ResourceAutoCode> resourceAutoCodeList = resourceAutoCodeService.getTree(new LbqWrapper<ResourceAutoCode>().eq(ResourceAutoCode::getParentId, bomProcedureProductionresource.getResourceBusinessId()).eq(ResourceAutoCode::getStatus, "1").ne(ResourceAutoCode::getParentId, "0").orderByAsc(ResourceAutoCode::getWeight,ResourceAutoCode::getCreateTime));
-//        if(resourceAutoCodeList == null || resourceAutoCodeList.size() == 0){
-//            throw new InterruptedException("动作节点配置为空");
-//        }
         //任务初始化判断
         if ("1".equals(tTask.getStatus())) {
             //下发的数据才更新状态
@@ -318,37 +305,6 @@ public class TaskWorkNode {
             bizJsonObject.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, stockType);
         }
 
-        /*
-        //机器上下料相关
-        if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {
-            //String location = conMap.get("location").toString();
-            nodeOperationService = new RobotNodeServiceImpl();
-            Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
-            jsonObject = (JSONObject) map.get("jsonObject");
-            bizJsonObject = (JSONObject) map.get("bizJsonObject");
-        }
-        else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
-            //生产加工
-            nodeOperationService = new MachineNodeServiceImpl();
-            Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
-            jsonObject = (JSONObject) map.get("jsonObject");
-            bizJsonObject = (JSONObject) map.get("bizJsonObject");
-        }
-        else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
-            //AGV取料
-            nodeOperationService = new AGVNodeServiceImpl();
-            Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
-            jsonObject = (JSONObject) map.get("jsonObject");
-            bizJsonObject = (JSONObject) map.get("bizJsonObject");
-        }
-        else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
-            //WMS分出库和入库
-            //通过自动化程序的CODE区分是上料还是下料
-            conMap.put("NO_WMS", false);
-            Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
-            jsonObject = (JSONObject) map.get("jsonObject");
-            bizJsonObject = (JSONObject) map.get("bizJsonObject");
-        } */
 
         //业务回调数据,传给接口,接口再返回过来。
         jsonObject.put("bizCallBackData", bizJsonObject.toJSONString());
@@ -453,166 +409,6 @@ public class TaskWorkNode {
         //初始化设备资源
         nodeOperationService.initResource(taskNode, task, map);
 
-        //线边库轮询两个机械手和接驳位资源。如果两个都有空则从线边库搬运到接驳位
-//        if (BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX.equals(bizType)) {
-//            //执行线边库队列标志
-//            map.put(DemoLineConstant.DEMOLINE_EXEXBKFLAG, "1");
-//            if (BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX_JBW.equals(carryType)) {
-//                int currCount = msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()) == null ? 0 : Integer.parseInt(msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()).toString());
-//                if (currCount == 1) {
-//                    //判断接驳位D\E是否为空
-//                    String jbwarr[] = {DemoLineConstant.JBW_D, DemoLineConstant.JBW_E};
-//                    Map plateMap = storgeService.getPlateStorgeByNo(jbwarr, task.getCompleteBatchNo());
-//                    //获取锁定的托板上的库位
-//                    Storge plantStorge = plateMap.get("storge") == null ? null : (Storge) plateMap.get("storge");
-//                    String jbwCode = plateMap.get("jbwCode") == null ? "" : plateMap.get("jbwCode").toString();
-//
-//                    //判断机器人库位是否为空
-//                    String jrqarr[] = {DemoLineConstant.JQR1};
-//                    List<ProductionresourcePosition> jqrList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jrqarr);
-//                    if (plantStorge != null && CollectionUtil.isNotEmpty(jqrList)) {
-//                        //锁定其中一个
-//                        //获取下一个节点,用于锁定
-//                        TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
-//                        //锁定库位,锁定的业务ID是下一个节点的ID
-//                        plantStorge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                        storgeService.lockStorge(plantStorge, nextTaskNode.getId());
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.TB + taskNode.getId(), plantStorge, 1, TimeUnit.DAYS);
-//
-//                        Storge jqrStorge = storgeService.getById(jqrList.get(0).getStorgeId());
-//                        map.put("toStorge", jqrStorge);
-//                        //机器人库位锁定
-//                        jqrStorge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                        storgeService.lockStorge(jqrStorge, taskNode.getId());
-//
-//                        //线边库库位ID
-//                        String storgeId = dataMap.get("storgeId").toString();
-//                        Storge xbkstorge = storgeService.getById(storgeId);
-//                        //把参数传芳map
-//                        map.put("fromStorge", xbkstorge);
-//                        //所属接驳位
-//                        map.put("jbwCode", jbwCode);
-//                        //记录产品流转到的库位
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), jqrStorge, 1, TimeUnit.DAYS);
-//                        map.put("result", (plantStorge != null && jqrList != null && jqrList.size() > 0));
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), ++currCount, 1, TimeUnit.DAYS);
-//                    }
-//                    //机器人和托板有空位
-//                    map.put("result", plantStorge != null && CollectionUtil.isNotEmpty(jqrList));
-//                }
-//                else if (currCount == 2) {
-//                    Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-//                    Object plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.TB + taskNode.getId());
-//                    map.put("fromStorge", jqrStorge);
-//                    map.put("toStorge", plantStorge);
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
-//                    //前一步已经锁定完毕,直接满足条件
-//                    map.put("result", true);
-//                }
-//            }
-//            else if (BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX_SZB.equals(carryType)) {//从线边库到三坐标
-//                int currCount = msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()) == null ? 0 : Integer.parseInt(msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()).toString());
-//                if (currCount == 1) {
-//                    //判断接驳位D\E是否为空
-//                    String szbarr[] = {DemoLineConstant.Q3ZUOBIAO};
-//                    List<ProductionresourcePosition> szbList = productionresourcePositionService.getFreeProductionresourcePositionByNos(szbarr);
-//
-//                    //判断机器人库位是否为空
-//                    String jrqarr[] = {DemoLineConstant.JQR1};
-//                    List<ProductionresourcePosition> jqrList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jrqarr);
-//
-//                    Storge szbStorge = null;
-//                    if (CollectionUtil.isNotEmpty(szbList) && CollectionUtil.isNotEmpty(jqrList)) {
-//                        //锁定其中一个
-//                        //获取下一个节点,用于锁定
-//                        TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
-//                        //锁定库位,锁定的业务ID是下一个节点的ID
-//                        szbStorge = storgeService.getById(szbList.get(0).getStorgeId());
-//                        szbStorge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                        storgeService.lockStorge(szbStorge, nextTaskNode.getId());
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.Q3ZUOBIAO + nextTaskNode.getId(), szbStorge, 1, TimeUnit.DAYS);
-//
-//                        Storge jqrStorge = storgeService.getById(jqrList.get(0).getStorgeId());
-//                        map.put("toStorge", jqrStorge);
-//                        //机器人库位锁定
-//                        jqrStorge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                        storgeService.lockStorge(jqrStorge, taskNode.getId());
-//
-//                        //线边库库位ID
-//                        String storgeId = dataMap.get("storgeId").toString();
-//                        Storge xbkstorge = storgeService.getById(storgeId);
-//                        //把参数传芳map
-//                        map.put("fromStorge", xbkstorge);
-//                        //记录产品流转到的库位
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), jqrStorge, 1, TimeUnit.DAYS);
-//                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), ++currCount, 1, TimeUnit.DAYS);
-//                    }
-//                    //机器人和托板有空位
-//                    map.put("result", (CollectionUtil.isNotEmpty(szbList) && CollectionUtil.isNotEmpty(jqrList)));
-//                } else if (currCount == 2) {
-//                    Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-//                    Object szbStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.Q3ZUOBIAO + taskNode.getId());
-//                    map.put("fromStorge", jqrStorge);
-//                    map.put("toStorge", szbStorge);
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), szbStorge, 1, TimeUnit.DAYS);
-//                    //前一步已经锁定完毕,直接满足条件
-//                    map.put("result", true);
-//                }
-//            }
-//
-//        }
-//        else if (BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZNDY.equals(bizType)) {
-//            //智能单元
-//            //执行线边库队列标志
-//            map.put(DemoLineConstant.DEMOLINE_EXEXBKFLAG, "1");
-//            int currCount = msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()) == null ? 0 : Integer.parseInt(msgUtil.redis_get(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo()).toString());
-//            if (currCount == 1) {
-//                //判断接驳位D\E是否为空
-//                String sum50[] = {DemoLineConstant.DEMOLINE_SUM50_ZNDY};
-//                List<ProductionresourcePosition> sum50List = productionresourcePositionService.getFreeProductionresourcePositionByNos(sum50);
-//
-//                //判断机器人库位是否为空
-//                String jrqarr[] = {DemoLineConstant.JQR2};
-//                List<ProductionresourcePosition> jqrList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jrqarr);
-//
-//                if (sum50List != null && sum50List.size() > 0 && jqrList != null && jqrList.size() > 0) {
-//                    Storge sum50Storge = storgeService.getById(sum50List.get(0).getStorgeId());
-//                    sum50Storge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                    storgeService.lockStorge(sum50Storge, taskNode.getId());
-//                    //放入缓存,下个节点使用
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_SUM50_ZNDY + taskNode.getId(), sum50Storge, 1, TimeUnit.DAYS);
-//
-//                    //线边库库位ID
-//                    String storgeId = dataMap.get("storgeId").toString();
-//                    Storge xbkstorge = storgeService.getById(storgeId);
-//                    //把参数传芳map
-//                    map.put("fromStorge", xbkstorge);
-//
-//                    Storge jqrStorge = storgeService.getById(jqrList.get(0).getStorgeId());
-//                    map.put("toStorge", jqrStorge);
-//                    //记录产品流转到的库位
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), jqrStorge, 1, TimeUnit.DAYS);
-//                    //机器人库位锁定
-//                    jqrStorge.setCompleteBatchNo(task.getCompleteBatchNo());
-//                    storgeService.lockStorge(jqrStorge, taskNode.getId());
-//                    map.put("result", (sum50List != null && sum50List.size() > 0 && jqrList != null && jqrList.size() > 0));
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), ++currCount, 1, TimeUnit.DAYS);
-//                }
-//            } else if (currCount == 2) {
-//                Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-//                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);
-//                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sum50Storge, 1, TimeUnit.DAYS);
-//                }
-//                map.put("fromStorge", jqrStorge);
-//                map.put("result", true);
-//                logger.error("12");
-//            }
-//
-//        }
         if (bizType == "0")  {//正常节点类型
             BomProcedureProductionresource bomProcedureProductionresource = bomProcedureProductionresourceService.getOne(new QueryWrapper<BomProcedureProductionresource>().eq("resourceId",task.getResourceId()).eq("procedureId", task.getProcedureId()));
             //List<ResourceAutoCode>  resourceAutoCodeList = resourceAutoCodeService.getNodeList(resourceAutoCode);
@@ -662,9 +458,9 @@ public class TaskWorkNode {
                 //目标对象是接驳位上托盘的库位
                 String[] jbwarr = new String[]{productionresource.getCode()};
                 //获取托盘的库位
-                Map plateMap = storgeService.getPlateStorgeByNo(jbwarr, task.getCompleteBatchNo());
-                storge = plateMap.get("storge") == null ? null : (Storge) plateMap.get("storge");
-                bool = bool && (storge!=null );
+//                Map plateMap = storgeService.getPlateStorgeByNo(jbwarr, task.getCompleteBatchNo());
+//                storge = plateMap.get("storge") == null ? null : (Storge) plateMap.get("storge");
+//                bool = bool && (storge!=null );
             }else{
                 //目标地址是加工设备
                 storge = storgeService.getById(resourcePosition.getStorgeId());

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

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
+import com.github.zuihou.business.DemoLine.YunjianConstant;
 import com.github.zuihou.business.edgeLibrary.entity.Storge;
 import com.github.zuihou.business.edgeLibrary.service.StorgeService;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
@@ -285,13 +286,13 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                         storgeService.lockStorge(targetStorge, nextTaskNode.getId());
 
                         //抓手缓存
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + nextTaskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
+                        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + nextTaskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
+                        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
                         //缓存位缓存
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + nextTaskNode.getId(), hcwStorge, 1, TimeUnit.DAYS);
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + taskNode.getId(), hcwStorge, 1, TimeUnit.DAYS);
+                        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + nextTaskNode.getId(), hcwStorge, 1, TimeUnit.DAYS);
+                        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId(), hcwStorge, 1, TimeUnit.DAYS);
                         //目标缓存
-                        msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + nextTaskNode.getId(), targetStorge, 1, TimeUnit.DAYS);
+                        msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + nextTaskNode.getId(), targetStorge, 1, TimeUnit.DAYS);
 
                         //满足条件--机器人空闲,设备或线边库有一个空闲
                         dataMap.put("Data", startStore);
@@ -299,7 +300,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     }
                     dataMap.put("result", logical(robotList,targetStorge));
                 } else if (count == 1) {
-                    jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
+                    jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
                     dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
                     Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
                     dataMap.put("fromStorge", currentStore);
@@ -316,7 +317,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                     //目的地为机器人手臂
-                    Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + taskNode.getId());
+                    Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
                     dataMap.put("Data", hcwStorge);
                     dataMap.put("toStorge", hcwStorge);
                     dataMap.put("result", true);
@@ -338,6 +339,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                     //目的地为机器人手臂
                     dataMap.put("toStorge", jqrStorge);
+
+                    dataMap.put("bizType", type);
                     //锁定机器人
                     jqrStorge.setCompleteBatchNo(task.getCompleteBatchNo());
                     storgeService.lockStorge(jqrStorge, nextTaskNode.getId());
@@ -347,15 +350,15 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     storgeService.lockStorge(targetStorge, nextTaskNode.getId());
 
                     //抓手缓存
-                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + nextTaskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
-                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
+                    msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + nextTaskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
+                    msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId(), jqrStorge, 1, TimeUnit.DAYS);
                     //目标缓存
-                    msgUtil.redis_set(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + nextTaskNode.getId(), targetStorge, 1, TimeUnit.DAYS);
+                    msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + nextTaskNode.getId(), targetStorge, 1, TimeUnit.DAYS);
                     map.put("result", true);
                 }
             }
         }else if ("放".equals(params[0])) {
-            Object targetStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId());
+            Object targetStorge = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId());
             //执行到第几步
             map.put(taskNode.getId().toString()+"count",count);
             map.put(DemoLineConstant.DEMOLINE_RXJQR_FLAG, "1");
@@ -366,10 +369,10 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
                 }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());
+                    Storge hcwStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
                     map.put("Data", hcwStorge);
                     map.put("fromStorge", hcwStorge);
-                    Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
+                    Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
                     map.put("toStorge", handStorge);
                     //出入库类型
                     map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
@@ -380,7 +383,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     map.put("Data", targetStorge);
                     map.put("toStorge", targetStorge);
 
-                    Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
+                    Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
                     map.put("fromStorge", handStorge);
                 }
             }else if (BizConstant.ROBOT_TYPE_NOCACHE.equals(zoneService.getRobotTypebyZone(zoneName))) {