Bläddra i källkod

线边库功能基础处理

oyq28 4 månader sedan
förälder
incheckning
53561a5f09

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

@@ -44,6 +44,8 @@ import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionre
 import com.github.zuihou.business.productionResourceCenter.entity.*;
 import com.github.zuihou.business.productionResourceCenter.service.*;
 import com.github.zuihou.business.productionResourceCenter.service.impl.*;
+import com.github.zuihou.business.productionResourceCenter.strategy.RobotHandlerContext;
+import com.github.zuihou.business.productionResourceCenter.strategy.RobotStrategy;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.common.constant.*;
 import com.github.zuihou.common.util.StringUtil;
@@ -163,6 +165,9 @@ public class TaskWorkNode {
     @Autowired
     private ToolTaskExecuteService toolTaskExecuteService;
 
+    @Autowired
+    private RobotHandlerContext robotHandlerContext;
+
     //总控端口
     private final String ZK_port = "120";
 
@@ -1102,14 +1107,23 @@ public class TaskWorkNode {
 
         Storge targetStorge = null;
 
-        List<ProductionresourcePosition> robotList = null;
-
         // 先判断上一指令是否为是否为设备指令,在判断工序最后一个指令是agv动作时锁定锁定agv接驳位
 
 
         dataMap.put(YunjianConstant.YUNJIAN_XBKFLAG, YunjianConstant.YUNJIAN_XBKFLAG);
         //执行到第几步
-        dataMap.put(taskNode.getId().toString() + "count",count );
+        //dataMap.put(taskNode.getId().toString() + "count",count );
+        String zoneName = zone.getName();
+        String cache = zoneService.getRobotTypebyZone(zoneName);
+        RobotStrategy robotStrategy = robotHandlerContext.getStrategy(cache);
+        List<ProductionresourcePosition> robotList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{taskNode.getResourceId().toString()});
+
+        Storge startStorge = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
+        targetStorge = workpieceService.getWorkPieceTargetStock(taskNode.getId());
+
+        //调用机器人放线边库功能处理
+        Map returnMap = robotStrategy.robotPut(dataMap, taskNode, startStorge, targetStorge, robotList, "1", taskNode.getTargetResourceId());
+
         /**
         //前序是设备序并且最后一个节点是agv搬运,锁定agv相关库位信息
         if (BizConstant.ROBOT_TYPE_CACHE.equals(zoneService.getRobotTypebyZone(zone.getName()))) { //有缓存位的机器人
@@ -1485,8 +1499,8 @@ public class TaskWorkNode {
          **/
         //dataMap = robotStrategy.robotCheck(taskNode, robotInfo, flikustockInfos, bomProcedure);
 
-        dataMap.put("instructionUrl", instructionUrl);
-        return dataMap;
+        returnMap.put("instructionUrl", instructionUrl);
+        return returnMap;
     }
 
     public Map getTargetStorge(TaskNode taskNode, String findAgvFlag, ZZone zZone,String bomProcedureType, ZZone bomzZone) {