姚云青 3 anos atrás
pai
commit
b2a006006e

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

@@ -1376,7 +1376,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 //        msgUtil.pushTask(task);
 
         //推送到消息队列
-        msgUtil.pushToNextMq(taskNode, task, taskNodeList, n, callBackJson);
+        msgUtil.pushToNextMq(taskNode, task, taskNodeList, n, callBackJson,currWorkpiece);
 
     }
 

+ 11 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/MsgUtil.java

@@ -7,6 +7,7 @@ import com.github.zuihou.business.DemoLine.YunjianConstant;
 import com.github.zuihou.business.edgeLibrary.service.StockInfoService;
 import com.github.zuihou.business.edgeLibrary.service.impl.StockInfoServiceImpl;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
+import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
 import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.operationManagementCenter.service.TaskService;
 import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
@@ -90,12 +91,21 @@ public class MsgUtil implements ApplicationContextAware {
      * @param taskNodeList
      * @param callBackJson
      */
-    public void pushToNextMq(TaskNode taskNode, TTask task, List<TaskNode>taskNodeList, int n, JSONObject callBackJson){
+    public void pushToNextMq(TaskNode taskNode, TTask task, List<TaskNode>taskNodeList, int n, JSONObject callBackJson, TWorkpiece currWorkpiece){
         //把推送把下一个节点丢到MQ。
         JSONObject jsonObject = new JSONObject();
 
         if(n<taskNodeList.size()-1){//尚未执行到最后一个
             TaskNode nextTaskNode = taskNodeList.get(n+1);
+
+            //如果切换了产线,则只把当前工序走完
+            if(currWorkpiece!=null&&"1".equals(currWorkpiece.getExchangeZoneFlag())){
+                Long exchangeProcedureId = currWorkpiece.getExchangeProcedureId();
+                if(exchangeProcedureId.longValue()!=nextTaskNode.getProcedureId().longValue()){
+                    return;
+                }
+            }
+
             jsonObject.put("taskNodeId",nextTaskNode.getId().toString());
             if(callBackJson.containsKey(DemoLineConstant.DEMOLINE_XBKFLAG)){//临时存放到了线边库,向虚拟线边库发一个MQ。
                 if(callBackJson.containsKey(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG)){//带缓存位机器人的多步骤执行