Sfoglia il codice sorgente

出入库任务优先级优化

dfsfs 1 anno fa
parent
commit
cf3e409497

+ 19 - 5
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -750,7 +750,21 @@ public class BusinessServiceImpl implements IBusinessService {
             if (wcsTask.getPriority() == 99) {
                 int current = wcsTaskMapper.selectCurrentPriority();
                 priority = current - 100;
-            } else {
+            }else if (StringUtils.isNotEmpty(wcsTask.getExt7()) // 出库任务优先级设置
+                    && (wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.FOURTEEN.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.FIFTEEN.getValue())))){
+                priority = 10;
+            }else if (StringUtils.isNotEmpty(wcsTask.getExt7()) // 入库任务优先级设置
+                    && (wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.NINE.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.TEN.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.TWELVE.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.THIRTEEN.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.FOUR.getValue()))
+                    || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.SIX.getValue())))){
+                // 保证所有入库任务优先级高于出库任务 下发AGV的时候入库任务会优先下发
+                priority = 20;
+            }else {
+                //
                 int current = wcsTaskMapper.selectCurrentPriority();
                 priority = current + 10;
             }
@@ -783,7 +797,7 @@ public class BusinessServiceImpl implements IBusinessService {
                 if (wcsTask.getPriority() == 99) {
                     int current = wcsTaskMapper.selectCurrentPriority();
                     priority = current - 100;
-                } else {
+                }else {
                     int current = wcsTaskMapper.selectCurrentPriority();
                     priority = current + 10;
                 }
@@ -909,9 +923,9 @@ public class BusinessServiceImpl implements IBusinessService {
                             || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.FOUR.getValue()))
                             || wcsTask.getExt7().equals(String.valueOf(Constant.FLOW_CONFIG_ID.SIX.getValue())))) {
                         log.info("入库任务下发AMS调用AGV{}", JSON.toJSONString(wcsTask));
-                        // 根据起始地查询库位信息
-                        BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID);
-                        // 同列里面是否有任务
+                        // 根据目标地查询库位信息
+                        BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationTo(), Constant.WAREHOUSE_ID);
+                        // 目标地同列里面是否有被占用的库位
                         List<BaseLocationInfo> occupyByLocs = baseLocationInfoMapper.queryByListOccupyByLocOR(baseLocationInfo);
                         for (int i = 0; i < occupyByLocs.size(); i++) {
                             // 查询前方是否有未取货完成的任务