瀏覽代碼

切换模式

姚云青 3 年之前
父節點
當前提交
94431c6b64

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/YunjianConstant.java

@@ -267,5 +267,8 @@ public interface YunjianConstant {
     String YUNJIAN_CALLBACK_PARAM = "YUNJIAN_CALLBACK_PARAM";
 
 
+    String YUNJIAN_SHEDULE_FLAG = "YUNJIAN_SHEDULE_FLAG";
+
+
 
 }

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

@@ -877,12 +877,24 @@ public class TaskWorkNode {
         String exchangeZoneFlag = workpiece.getExchangeZoneFlag();
         Long exchangeProcedureId = workpiece.getExchangeProcedureId();
         if(StringUtil.isNotEmpty(exchangeZoneFlag)&&exchangeProcedureId!=null){//正在切换产线
-            if(exchangeProcedureId.longValue()!=taskNode.getProcedureId().longValue()){
+            if(exchangeProcedureId.longValue()!=taskNode.getProcedureId().longValue()&&isSchedule()){
                 dataMap.put("result", false);
                 dataMap.put("msg", DictionaryKey.NodeException.RE_SCHEDURE);
             }
         }
         return dataMap;
     }
+
+    /**
+     *
+     * @return
+     */
+    public boolean isSchedule(){
+        //根据排产的缓存来判断是否在排产中
+        if(msgUtil.redis_get(YunjianConstant.YUNJIAN_SHEDULE_FLAG)!=null){
+            return true;
+        }
+        return false;
+    }
 }
 

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

@@ -9,6 +9,7 @@ import com.github.zuihou.business.operationManagementCenter.dao.TTaskMapper;
 import com.github.zuihou.business.operationManagementCenter.dao.WorkpieceMapper;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
 import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
+import com.github.zuihou.business.operationManagementCenter.service.OrderService;
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionResourceCenter.dao.ZZoneMapper;
 import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
@@ -69,6 +70,9 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
     @Autowired
     private ZZoneService zoneService;
 
+    @Autowired
+    private OrderService orderService;
+
     @Autowired
     private ZZoneProductionresourceService zoneProductionresourceService;
 
@@ -138,6 +142,9 @@ public class ZZoneServiceImpl extends SuperServiceImpl<ZZoneMapper, ZZone> imple
 
         updateById(zZone);
 
+        //重新排产
+        orderService.reschedulingPlanTasks();
+
         //修改workpiece当前正在执行的工序
         //先查出
         List<TWorkpiece>workpieceList = workpieceService.list(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getIsEnd, "0"));