姚云青 3 éve
szülő
commit
7c06970f48

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

@@ -891,13 +891,16 @@ public class TaskWorkNode {
      * @return
      */
     public Map checkPreCondition(TaskNode taskNode, TTask task, Map<String, Object> dataMap){
-        TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,taskNode.getCompleteBatchNo()));
-        String exchangeZoneFlag = workpiece.getExchangeZoneFlag();
-        Long exchangeProcedureId = workpiece.getExchangeProcedureId();
-        if(StringUtil.isNotEmpty(exchangeZoneFlag)&&exchangeProcedureId!=null){//正在切换产线
-            if(exchangeProcedureId.longValue()!=taskNode.getProcedureId().longValue()&&isSchedule()){
-                dataMap.put("result", false);
-                dataMap.put("msg", DictionaryKey.NodeException.RE_SCHEDURE);
+        List<TWorkpiece>list = workpieceMapper.selectList(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,taskNode.getCompleteBatchNo()));
+        if(CollectionUtil.isNotEmpty(list)){
+            TWorkpiece workpiece = list.get(0);
+            String exchangeZoneFlag = workpiece.getExchangeZoneFlag();
+            Long exchangeProcedureId = workpiece.getExchangeProcedureId();
+            if(StringUtil.isNotEmpty(exchangeZoneFlag)&&exchangeProcedureId!=null){//正在切换产线
+                if(exchangeProcedureId.longValue()!=taskNode.getProcedureId().longValue()&&isSchedule()){
+                    dataMap.put("result", false);
+                    dataMap.put("msg", DictionaryKey.NodeException.RE_SCHEDURE);
+                }
             }
         }
         return dataMap;