lxb 1 年之前
父节点
当前提交
a75ec862a2
共有 11 个文件被更改,包括 172 次插入55 次删除
  1. 31 5
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java
  2. 33 6
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java
  3. 1 1
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java
  4. 2 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/ProductionresourcePositionService.java
  5. 26 19
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java
  6. 10 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ProductionresourcePositionServiceImpl.java
  7. 46 19
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java
  8. 3 0
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ProductionresourcePositionMapper.xml
  9. 3 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/dto/TaskNodeCallBackDTO.java
  10. 1 1
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/Productionresource.java
  11. 16 4
      imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

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

@@ -192,7 +192,8 @@ public class TaskWorkNode {
         Object changeHandOp = msgUtil.redis_get("CHANGE_HAND_OP"); //换手抓标识
         if(!Objects.isNull(changeHandOp) && "2".equals(changeHandOp.toString())){
             logger.info("当前机器人正在换手抓,不执行MQ方法体");
-            return;
+            Thread.sleep(3000); //等待三秒
+            throw new InterruptedException("设备资源不通过,消息重新进入队尾");
         }
 
         String returnData = "";
@@ -236,11 +237,20 @@ public class TaskWorkNode {
                 return;
             }
 
-            boolean changeFlag = checkRobotHand("1"); //更换机器人手抓标识
+            boolean changeFlag = this.checkRobotHand(DictionaryKey.CARRY_TYPE.get("TRAY_HAND")); //更换机器人手抓标识
             if(changeFlag){
                 //需要更新机器人手抓
                 msgUtil.redis_set("CHANGE_HAND_OP","2");
-                return;
+                msgUtil.redis_set("CHANGE_TARGET_HAND",DictionaryKey.CARRY_TYPE.get("TRAY_HAND"));
+                try{
+                    this.changeRobotHand(taskNode);
+                }catch (Exception e){
+                    e.printStackTrace();
+                }finally {
+                    //当前任务回到队尾
+                    throw new InterruptedException("设备资源不通过,消息重新进入队尾");
+                }
+
             }
             // add by yejian on 20220726 使用完成后释放redis资源
             if(taskNode.getCompleteBatchSort() != 1){
@@ -649,12 +659,28 @@ public class TaskWorkNode {
         if(!handType.equals(productionresource.getHandType())){
             //需要更换机器人手抓
             changeFlag = true;
-
-            //传参
         }
         return changeFlag;
     }
 
+    public void changeRobotHand(TaskNode taskNode){
+        JSONObject jsonObject = new JSONObject();
+
+        jsonObject.put("taskId", String.valueOf(taskNode.getTaskId()));
+        jsonObject.put("taskNodeId", String.valueOf(taskNode.getId()));
+
+        jsonObject.put("taskType", DictionaryKey.TASK_TYPE.get("CHANGE"));
+        jsonObject.put("carryType", DictionaryKey.CARRY_TYPE.get("TRAY_HAND"));
+        jsonObject.put("url", "");
+        jsonObject.put("port", "");
+        Map map = new HashMap();
+        map.put("location",DictionaryKey.HAND_PONIT.get("TRAY_HAND"));
+        map.put("destLocation",DictionaryKey.ROBOT_PONIT.get("CHANGE_HAND"));
+        jsonObject.put("data", map);
+
+        //msgUtil.httpForPost("http://192.168.10.150",jsonObject.toString());
+    }
+
     /**
      * 更新优先级相关信息
      * @param priorityTaskNodeIdObj

+ 33 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1535,6 +1535,9 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
     @Override
     public R taskNodeCallback(TaskNodeCallBackDTO bean) {
         log.info("[CCS指令回调]回调参数======================" + JSONObject.toJSONString(bean));
+        //取出参数
+        String code = bean.getCode();
+        String msg = bean.getMsg() != null ? bean.getMsg() : "指令操作失败";
 
         BaseContextHandler.setTenant("0000");
         String taskId = bean.getTaskId() == null ? "" : bean.getTaskId().toString();
@@ -1558,6 +1561,34 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         //把当前id存放入缓存
         msgUtil.redis_set(String.valueOf(repeatKey), String.valueOf(bean.getTaskNodeId()), 1, TimeUnit.HOURS);
 
+        if(StringUtil.isNotEmpty(bean.getTaskType()) && DictionaryKey.TASK_TYPE.get("CHANGE").equals(bean.getTaskType())){
+            if (StringUtils.isNotEmpty(code) && "1".equals(code)) {
+
+                Object changeTargetHand = msgUtil.redis_get("CHANGE_TARGET_HAND");
+                if(Objects.isNull(changeTargetHand)){
+                    log.warn("【更换手抓】目的位置不存在");
+                    return R.fail(-5,"【更换手抓】目的位置不存在");
+                }
+                Productionresource productionresource = productionresourceBizMapper.selectOne(new QueryWrap<Productionresource>().lambda().eq(Productionresource::getCode, "JQR"));
+                if(changeTargetHand.toString().equals(productionresource.getHandType())){
+                    return R.fail(-5,"【更换手抓】当前手抓类型和目标手抓类型一致");
+                }else{
+                    log.warn("【更换手抓】成功");
+                    //更新机器人手抓类型
+                    productionresource.setHandType(changeTargetHand.toString());
+                    productionresourceBizMapper.updateById(productionresource);
+
+                    //移除缓存
+                    msgUtil.redis_del("CHANGE_HAND_OP");
+                    msgUtil.redis_del("CHANGE_TARGET_HAND");
+                    msgUtil.redis_del(repeatKey);
+                }
+            }else{
+                msgUtil.redis_del(repeatKey);
+                log.warn("更换手抓失败");
+            }
+
+        }
         // begin add by yejian on 20220503 for yj on 如果排产中先等待排产完成后继续执行(防止重复发送回调)
         while (null != msgUtil.redis_get(YunjianConstant.YUNJIAN_SHEDULE_FLAG)) {
             try {
@@ -1601,10 +1632,6 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
             }
         }
 
-        //取出参数
-        String code = bean.getCode();
-        String msg = bean.getMsg() != null ? bean.getMsg() : "指令操作失败";
-
         //接口不让传多余参数,只能从缓存传
         String jsonParam = msgUtil.redis_get(YunjianConstant.YUNJIAN_CALLBACK_PARAM + "_" + taskNodeId) == null ? ""
                 : msgUtil.redis_get(YunjianConstant.YUNJIAN_CALLBACK_PARAM + "_" + taskNodeId).toString();
@@ -1692,7 +1719,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 
         //处理出库入库
         String stockType = callBackJson.getString(DemoLineConstant.DEMOLINE_STOCK_TYPE);
-        if(stockType.equals(DemoLineConstant.RFID_READ)|| stockType.equals(DemoLineConstant.RFID_WRITE)){
+        if(StringUtil.isNotEmpty(stockType) && (stockType.equals(DemoLineConstant.RFID_READ)|| stockType.equals(DemoLineConstant.RFID_WRITE))){
             if(stockType.equals(DemoLineConstant.RFID_READ)){
                 //核对 信息
             }
@@ -2068,7 +2095,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         else {
             if (StringUtils.isNotBlank(robotType)) {
                 // 有缓存位机器人,走到最后一步才释放资源
-                if ("1".equals(robotType) && "2".equals(robotStep)) {
+                if ("1".equals(robotType) && "4".equals(robotStep)) {
                     logger.info("节点{}开始判断需要释放占用的资源锁", taskNode.getId());
                     List<Storge> storgeList = storgeService.list(Wraps.<Storge>lbQ().eq(Storge::getCampId,
                             taskNode.getId()));

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -1557,7 +1557,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
             paramMap.put("orgIds", orgIdsStr);
         }
         List<Map> xbkValidList = stockInfoService.getXbkCountByShelves(paramMap);
-        xbkValidList = xbkValidList.stream().filter(item->item.containsKey("cnt") && (long)item.get("cnt")<=3).collect(Collectors.toList());
+        xbkValidList = xbkValidList.stream().filter(item->item.containsKey("cnt") && (long)item.get("cnt")<3).collect(Collectors.toList());
         if(xbkValidList.size()>0){
             xbkValid = false;
         }

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/ProductionresourcePositionService.java

@@ -88,4 +88,6 @@ public interface ProductionresourcePositionService extends SuperService<Producti
     List<ProductionresourcePosition>getFreeProductionresourcePositionByTrayTypeNos(String [] noArr,String fitTrayType);
 
     List<ProductionresourcePosition> getFreeProductionAgvResourcePositionByIds(String[] idArr);
+
+    List<ProductionresourcePosition> getFreeProductionresourcePositionByIdsAndType(String [] idArr,Long storgeTypeId);
 }

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

@@ -265,7 +265,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                     map.put("result", true);
                 }
                 break;
-            case "smu50":
+            case "马扎克":
                 Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
                 map.put("url",productionresource.getIp());
                 map.put("port",productionresource.getPort());
@@ -290,7 +290,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                         Module module  = moduleService.getOne(new LbqWrapper<Module>().eq(Module::getId, productionresource.getModuleId()));
                         data.put("remotePath", module.getCncFilePath());
                         //msgUtil.redis_set(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo(), fileName, 1, TimeUnit.DAYS);
-                        if(productionresource.getModeSpecification().contains("HEIDENHAIN")){
+                        /*if(productionresource.getModeSpecification().contains("HEIDENHAIN")){
                             //缓存程序编号信息
                             JSONObject uploadInfo = new JSONObject();
                             uploadInfo.put("url",  productionresource.getIp());
@@ -300,29 +300,36 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                             data.put("fileName", "");
                         }
 
-                        if(productionresource.getModeSpecification().contains("HELLER"))  data.put("HELLER","HELLER"); //内部调用标识
+                        if(productionresource.getModeSpecification().contains("HELLER"))  data.put("HELLER","HELLER"); //内部调用标识*/
                         map.put("data", data);
                         map.put("result", true);
                     }
                 }
                 else if ("2".equals(functionType)) {
-                    //执行加工程序,分多次执行
-                    //String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
-                     //       : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
-                    //map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "execProgram");
-                    //当前执行数量
-                    //String fileName = msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()) == null ? "" : msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()).toString();
-                     List<BomProcedureProgram> procedureProgramList = bomProcedureProgramMapper.selectList(Wraps.<BomProcedureProgram>lbQ().eq(BomProcedureProgram::getProcedureId,task.getProcedureId()));
-                    //执行程序默认按单文件处理
-                    //String fileName = "";
-                    //String fileNames[] = fileName.split(",");
-                    JSONObject data = new JSONObject();
-                    data.put("remotePath", procedureProgramList.get(0).getSubmittedFileName());
-
-                    map.put("data", data);
-                    map.put("method", "StartNCProgram");
-                    map.put("result", true);
+                    if("执行清洗".equals(taskNode.getNodeName())){
+                        map.put("method", moduleInstructions.get(0).getCode());
+                        map.put("url",plcInfo.get("url"));
+                        map.put("port",plcInfo.get("port"));
+                        map.put("result", true);
+                        map.remove("data");
+                    }else{
+                        //执行加工程序,分多次执行
+                        //String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
+                        //       : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
+                        //map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "execProgram");
+                        //当前执行数量
+                        //String fileName = msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()) == null ? "" : msgUtil.redis_get(DemoCacheKey.DEMOLINE_PROGRAME_NAMES + task.getCompleteBatchNo()).toString();
+                        List<BomProcedureProgram> procedureProgramList = bomProcedureProgramMapper.selectList(Wraps.<BomProcedureProgram>lbQ().eq(BomProcedureProgram::getProcedureId,task.getProcedureId()));
+                        //执行程序默认按单文件处理
+                        //String fileName = "";
+                        //String fileNames[] = fileName.split(",");
+                        JSONObject data = new JSONObject();
+                        data.put("remotePath", procedureProgramList.get(0).getSubmittedFileName());
 
+                        map.put("data", data);
+                        map.put("method", "StartNCProgram");
+                        map.put("result", true);
+                    }
                 }
                 else if ("3".equals(functionType)){
                      // 加工前写入工件坐标系 根据taskid查找工件三坐标测量的工件坐标系,可能存在装夹一次未果的情况,所以取最后一条数据

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

@@ -321,6 +321,16 @@ public class ProductionresourcePositionServiceImpl extends SuperServiceImpl<Prod
         return list;
     }
 
+    @Override
+    public List<ProductionresourcePosition> getFreeProductionresourcePositionByIdsAndType(String[] idArr,Long storgeTypeId) {
+        Map sxlzmap = new HashMap();
+        sxlzmap.put("resourceIdStr",StringUtil.changeIdsArrToSubQueryStr(idArr));
+        sxlzmap.put("freeFlag","1");
+        sxlzmap.put("storgeTypeId",storgeTypeId);
+        List<ProductionresourcePosition>list = baseMapper.getPPList(sxlzmap);
+        return list;
+    }
+
     @Override
     public List<ProductionresourcePosition> getProductionresourcePositionByIds(String[] idArr) {
         Map sxlzmap = new HashMap();

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

@@ -513,9 +513,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                                 msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + nextTaskNode.getId(), targetxbk, 10, TimeUnit.DAYS);
                                 dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("MOVE")); //移动类型
 
+                                Object startPoint = msgUtil.redis_get("jqr_postion");
                                 //满足条件--机器人空闲,设备或线边库有一个空闲
                                 Map locationMap = new HashMap();
-                                locationMap.put("location",startStore.getPointId());
+                                locationMap.put("location",startPoint);  //机器人当前位置
+                                locationMap.put("destLocation",startStore.getPointId()); //零件当前位置-》机器人目标位置
                                 dataMap.put("data", locationMap);
                                 dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
                                 dataMap.put("method", "MoveRobotPosition");
@@ -523,7 +525,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
 
                                 // 机器人移动到redis记录实时位子
                                 msgUtil.redis_set(taskNode.getResourceId()+"postion",startStore.getPointId());
-
+                                msgUtil.redis_set("jqr_postion",startStore.getPointId());
                             }else{
                                 dataMap.put("result", false);
                             }
@@ -537,11 +539,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 } else if (count == 1) {
                     jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
                     dataMap.put("method", "GetQualityCenter");
-                    Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
-                    dataMap.put("fromStorge", currentStore);
+                    //Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
+                    dataMap.put("fromStorge", startStore);
 
                     Map locationMap = new HashMap();
-                    locationMap.put("location",currentStore.getPointId());
+                    locationMap.put("location",startStore.getPointId());
                     locationMap.put("destLocation",jqrStorge.getPointId());
                     dataMap.put("data", locationMap);
                     //出入库类型
@@ -564,16 +566,17 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_WRITE);
                     dataMap.put("result", true);
                 }else if(count == 4) {
-                    Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
+                    //Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
                     dataMap.put("method", "SendQualityCenter");
-                    dataMap.put("fromStorge", currentStore);
+                    dataMap.put("fromStorge", startStore);
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                     //目的地为机器人手臂
                     Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
 
                     Map locationMap = new HashMap();
-                    locationMap.put("location",hcwStorge.getPointId());
+                    locationMap.put("location",startStore.getPointId());
+                    locationMap.put("destLocation",hcwStorge.getPointId());
                     dataMap.put("data", locationMap);
 
                     dataMap.put("toStorge", hcwStorge);
@@ -790,15 +793,21 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                             int storageCount = storgeService.count(new LbqWrapper<Storge>().eq(Storge::getCompleteBatchNo, taskNode.getCompleteBatchNo()).eq(Storge::getCampId, taskNode.getId()).eq(Storge::getLockStatus, "0"));
                             //当前零件满足锁定节点的零件一致允许移动
                             if(storageCount>0) {
+
+                                Object startPoint = msgUtil.redis_get("jqr_postion");
+
                                 Map locationMap = new HashMap();
-                                locationMap.put("location", targetStorge.getPointId());
+                                locationMap.put("location",startPoint);  //机器人当前位置
+                                locationMap.put("destLocation", targetStorge.getPointId());
                                 dataMap.put("data", locationMap);
 
                                 dataMap.put("method", "MoveRobotPosition");
+                                dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
                                 dataMap.put("result", true);
 
                                 // 机器人移动到redis记录实时位子
                                 msgUtil.redis_set(taskNode.getResourceId()+"postion",targetStorge.getPointId());
+                                msgUtil.redis_set("jqr_postion",targetStorge.getPointId());
                             }else{
                                 log.warn("节点{}并发抢占框体机器人移动条件不满足", taskNode.getId());
                                 dataMap.put("result", false);
@@ -820,29 +829,44 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                             //}
                         }
 
-                        Map locationMap = new HashMap();
-                        locationMap.put("location",hcwStorge.getPointId());
-                        dataMap.put("data", locationMap);
-
                         dataMap.put("fromStorge", hcwStorge);
                         Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
                         dataMap.put("toStorge", handStorge);
+
+                        Map locationMap = new HashMap();
+                        locationMap.put("location",hcwStorge.getPointId()); //开始位置 -- 缓存位
+                        locationMap.put("destLocation", handStorge.getPointId()); // 目的位置 -- 机器人手抓
+                        dataMap.put("data", locationMap);
+
                         //出入库类型
+                        dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
+                        dataMap.put("carryType",DictionaryKey.CARRY_TYPE.get("TRAY_ONE"));
                         dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                         dataMap.put("result", true);
                     }else if(count == 2){
                         //读RFID
+                        dataMap.put("method", "readAndWrite");
+                        dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("READ_WRITE")); //读取RFID
+                        dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_READ);
+                        dataMap.put("result", true);
                     }else if(count == 3){
                         //写RFID
+                        dataMap.put("method", "readAndWrite");
+                        dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("READ_WRITE")); //读取RFID
+                        dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_WRITE);
+                        dataMap.put("result", true);
                     }else if(count == 4){
+                        Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
+                        dataMap.put("fromStorge", handStorge);
+
                         dataMap.put("method", "SendQualityCenter");
                         //出入库类型
                         dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
 
                         Map locationMap = new HashMap();
 
-                        locationMap.put("location",targetStorge.getPointId());
-
+                        locationMap.put("location",handStorge.getPointId()); //开始位置 -- 机器人手抓
+                        locationMap.put("destLocation", targetStorge.getPointId()); // 目的位置
                         if(taskNode.getTargetResourceId() !=null){
                             Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
                             if(!Objects.isNull(productionresource) && StringUtil.isNotEmpty(productionresource.getModeSpecification()) && productionresource.getModeSpecification().contains("HELLER")){
@@ -866,14 +890,16 @@ public class RobotNodeServiceImpl implements NodeOperationService {
 
                         dataMap.put("toStorge", targetStorge);
 
-                        Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
-                        dataMap.put("fromStorge", handStorge);
+
                         String targetxbk =(String)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + taskNode.getId());
                         if("1".equals(targetxbk)){
                             dataMap.put(YunjianConstant.YUNJIAN_XBKFLAG, YunjianConstant.YUNJIAN_XBKFLAG);
                             //把计数去掉,从线边库开始重新计数
                             dataMap.remove(taskNode.getId().toString()+"count");
                         }
+
+                        dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
+                        dataMap.put("carryType",DictionaryKey.CARRY_TYPE.get("TRAY_ONE"));
                         dataMap.put("result", true);
                     }
                 }
@@ -1241,7 +1267,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 //目标设备
                 if(resourceId!=null){
                     String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
-                    if(zoneType.equals(ParameterKey.ZONE_YJ)){
+                    if(!"从本序加工设备取".equals(taskNode.getNodeName()) && zoneType.equals(ParameterKey.ZONE_YJ)){
                         TTask task = tTaskMapper.selectById(taskNode.getTaskId());
                         BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
                         Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,resourceId));
@@ -1297,7 +1323,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                             targetList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[] {resourceId.toString()});
                         }
                     }else{
-                        targetList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[] {resourceId.toString()});
+                        //暂时先用具体类型标识(清洗类型)
+                        targetList = productionresourcePositionService.getFreeProductionresourcePositionByIdsAndType(new String[] {resourceId.toString()},Long.parseLong("1496431321931579392"));
                     }
 
                     if(CollectionUtil.isNotEmpty(targetList)){

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ProductionresourcePositionMapper.xml

@@ -87,6 +87,9 @@
         <if test="xbkFlag != null and xbkFlag != ''">
          and (i.goods_type = '5' and s.lock_status = '1')
         </if>
+        <if test="storgeTypeId != null and storgeTypeId != ''">
+            and s.storge_type_id = #{storgeTypeId}
+        </if>
     </select>
     <select id="getStorgeIdByResource" resultType="com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition">
         select * from imcs_p_productionresource_position where 1=1

+ 3 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/dto/TaskNodeCallBackDTO.java

@@ -67,5 +67,8 @@ public class TaskNodeCallBackDTO implements Serializable {
     @ApiModelProperty(value = "工位id")
     private String stationId;
 
+    @ApiModelProperty("任务类型")
+    private String taskType;
+
 
 }

+ 1 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/Productionresource.java

@@ -267,7 +267,7 @@ public class Productionresource extends Entity<Long> {
     @TableField(value = "tool_num", condition = LIKE)
     private int toolNum;
 
-    @ApiModelProperty(value = "手抓类型(1 托盘手抓  2 刀具手抓)")
+    @ApiModelProperty(value = "手抓类型(256 托盘手抓  257 刀具手抓)")
     @Excel(name = "hand_type")
     private String handType;
 

+ 16 - 4
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

@@ -243,7 +243,7 @@ public interface DictionaryKey {
         {
             put("CARRY", "1"); // 运输
             put("MOVE", "512"); // 移动
-            put("CHANGE", "1024"); // 换
+            put("CHANGE", "1024"); // 换
             put("READ_WRITE", "2048"); // 读写RFID
         }
     };
@@ -253,9 +253,9 @@ public interface DictionaryKey {
         {
             put("TRAY_ONE", "1"); // 托盘类型-单孔
             put("TRAY_TWO", "2"); // 托盘类型-双孔
-            put("TOOL", "256"); // 刀具类型
-            put("TRAY_HAND", "1024"); // 手抓类型-托盘
-            put("TOOL_HAND", "256"); // 刀具类型-刀具
+            put("TOOL", "4"); // 刀具类型
+            put("TRAY_HAND", "256"); // 手抓类型-托盘
+            put("TOOL_HAND", "257"); // 手抓类型-刀具
         }
     };
 
@@ -267,5 +267,17 @@ public interface DictionaryKey {
         }
     };
 
+    Map<String, String> HAND_PONIT = new HashMap<String, String>(){
+        {
+            put("TRAY_HAND", "901"); // 托盘手抓
+            put("TOOL_HAND", "902"); // 刀具手抓
+        }
+    };
 
+    Map<String, String> ROBOT_PONIT = new HashMap<String, String>(){
+        {
+            put("CHANGE_HAND", "900"); // 换手抓点位
+            put("CARRY_HAND", "30"); // 搬运零件刀具手抓
+        }
+    };
 }