浏览代码

切换模式

姚云青 3 年之前
父节点
当前提交
d18c929398

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

@@ -231,6 +231,11 @@ public class TaskWorkNode {
                 ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId, taskNode.getResourceId()));
                 ZZone zZone = zoneService.getById(zoneProductionresource.getZoneId());
                 queryMap.put("zone", zZone);
+
+
+                BBom bom = bBomMapper.selectById(tTask.getBomId());
+                ZZone bomzZone = zoneService.getById(bom.getId());
+                queryMap.put("bomzZone", bomzZone);
                 //运行条件验证
                 Map conMap = checkCon(taskNode, tTask, queryMap);
                 if (null == conMap) {
@@ -556,6 +561,7 @@ public class TaskWorkNode {
         map.put("instructions", moduleInstructions);
         map.put("moduleName", module.getName());
         map.put("zone", dataMap.get("zone"));
+        map.put("bomzZone", dataMap.get("bomzZone"));
 
         if ("1".equals(category)) {
             nodeOperationService = MsgUtil.getBean(MachineNodeServiceImpl.class);
@@ -638,7 +644,7 @@ public class TaskWorkNode {
 
                 Storge startStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
 
-                ProductionresourcePosition po = logical(robotList, targetStorge, zone);
+                ProductionresourcePosition po = logical(robotList, targetStorge,dataMap);
                 //机器人手抓没被锁定,并且有空闲未知
                 if (po != null) {
                     jqrStorge = storgeService.getById(jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS).get(0).getStorgeId());
@@ -742,7 +748,7 @@ public class TaskWorkNode {
                 jqrStorge = storgeService.getById(robotList.get(0).getStorgeId());
 
                 dataMap.put("method", "GetServoStacker");
-                if (logical(robotList, targetStorge, zone) != null) {
+                if (logical(robotList, targetStorge, dataMap) != null) {
                     Storge startStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
 
                     dataMap.put("fromStorge", startStore);
@@ -832,7 +838,14 @@ public class TaskWorkNode {
      * @param robotList
      * @return
      */
-    public ProductionresourcePosition logical(List<ProductionresourcePosition> robotList, Storge targetStorge, ZZone zone) {
+    public ProductionresourcePosition logical(List<ProductionresourcePosition> robotList, Storge targetStorge, Map<String, Object> dataMap) {
+        ZZone zone = dataMap.get("zone") == null ? null : (ZZone) dataMap.get("zone");
+        ZZone bomzZone = dataMap.get("bomzZone") == null ? null : (ZZone) dataMap.get("bomzZone");
+        //自动模式下,如果下个节点是上下料站,不让走下去
+        if(bomzZone!=null&&"1".equals(bomzZone.getRunMode())){//自动模式,
+            return null;
+        }
+
         //设备不存在
         if (checkRobot(robotList, zone.getName())) {
             return null;

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

@@ -1262,12 +1262,16 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         if (n > 0) {//
             List<TaskNode> taskNodeList = baseMapper.selectList(Wraps.<TaskNode>lbQ().eq(TaskNode::getCompleteBatchNo, taskNode.getCompleteBatchNo()).orderByAsc(TaskNode::getCompleteBatchSort).gt(TaskNode::getCompleteBatchSort, taskNode.getCompleteBatchSort()));
             if (CollectionUtil.isNotEmpty(taskNodeList)) {
-                nextTaskNode = taskNodeList.get(n - 1);
+                if(taskNodeList.size()>n-1){
+                    nextTaskNode = taskNodeList.get(n - 1);
+                }
             }
         } else {//取前面
             List<TaskNode> taskNodeList = baseMapper.selectList(Wraps.<TaskNode>lbQ().eq(TaskNode::getCompleteBatchNo, taskNode.getCompleteBatchNo()).orderByDesc(TaskNode::getCompleteBatchSort).lt(TaskNode::getCompleteBatchSort, taskNode.getCompleteBatchSort()));
             if (CollectionUtil.isNotEmpty(taskNodeList)) {
-                nextTaskNode = taskNodeList.get(-n - 1);
+                if(taskNodeList.size()>(-n - 1)) {
+                    nextTaskNode = taskNodeList.get(-n - 1);
+                }
             }
         }
         taskNode.setNextNode(nextTaskNode);

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

@@ -564,6 +564,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 xbkFlag = "1";
             }
         }else {
+            //
             if(bomProcedureType.equals("下料")){
                 // 下料特殊处理,动态查找可用立库位子存放下料后的子盘夹具
                 Long storgeId = getLikuStockInList();
@@ -578,6 +579,13 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                         targetStorge = storgeService.getById(targetList.get(0).getStorgeId());
                         returnMap.put("store",targetStorge);
                         returnMap.put("targetxbk","0");
+
+                        if("1".equals(bomzZone.getRunMode())){//自动模式下,
+                            TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode,1);
+                            if("04".equals(nextTaskNode.getInterfaceType())){//上料、下料、翻面
+                                xbkFlag = "1";
+                            }
+                        }
                     }else{//需要放到线边库
                         xbkFlag = "1";
                     }