瀏覽代碼

入库下发任务同列阻挡优化

dfsfs 1 年之前
父節點
當前提交
983fbf73a6

+ 9 - 4
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -162,6 +162,7 @@ public class BusinessServiceImpl implements IBusinessService {
                         String currentColNo = null;// 当前列
                         Long currentZoneId = null; // 当前库区
                         for (BaseLocationInfo baseLocationInfo : locationToList) {
+                            // 如果当前库位和标记的
                             if (baseLocationInfo.getColNo().equals(currentColNo) && baseLocationInfo.getZoneId().equals(currentZoneId)) {
                                 continue;
                             }
@@ -170,7 +171,7 @@ public class BusinessServiceImpl implements IBusinessService {
                             // 查询当前库位的库存包含批次属性
                             List<InvLotLocIdLotattVO> invLotLocIdLotattVOS = invLotLocIdService.selectInvLocIdLotattByLocationId(baseLocationInfo.getId());
                             for (InvLotLocIdLotattVO invLotLocIdLotattVO : invLotLocIdLotattVOS) {
-                                // 库存当前某列有不同班组
+                                // 当前库存某列有不同班组
                                 if (Objects.nonNull(invLotLocIdLotattVO) && !invLotLocIdLotattVO.getLotatt09().equals(team)) {
                                     // 标记当前列不分配
                                     columnAvailable = false;
@@ -846,14 +847,18 @@ public class BusinessServiceImpl implements IBusinessService {
                         BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(wcsTask.getLocationFrom(), Constant.WAREHOUSE_ID);
                         //同列里面是否有任务
                         List<BaseLocationInfo> occupyByLocs = baseLocationInfoMapper.queryByListOccupyByLocOR(baseLocationInfo);
-                        if (occupyByLocs.size() > 0) {
-                            log.info("同列里面有任务=========={}", occupyByLocs);
-                            continue;
+                        for (int i=0 ; i < occupyByLocs.size(); i++){
+                           WcsTask wTask =  wcsTaskService.selectWcsTaskByLocationTo(occupyByLocs.get(i).getId());
+                           if(wTask != null){
+                               wcsTask.setRemark("目标库位同列后方存在未取货完成的任务,请等待!");
+                               break;
+                           }
                         }
                         //同列前方是否有阻挡
                         List<BaseLocationInfo> inStockByLocs = baseLocationInfoMapper.queryByListInStockByLoc(baseLocationInfo);
                         if (inStockByLocs.size() > 0) {
                             log.info("同列有阻挡=========={}", inStockByLocs);
+                            wcsTask.setRemark("目标库位同列有阻挡,请处理!");
                             continue;
                         }
                     }

+ 1 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/mapper/WcsTaskMapper.java

@@ -112,4 +112,5 @@ public interface WcsTaskMapper extends BaseMapper<WcsTask>
      List<WcsTask> selectBeforeTask(@Param("taskNo") String taskNo);
 
 
+    WcsTask selectWcsTaskByLocationTo(@Param("locationTo")Long locationTo);
 }

+ 1 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/service/IWcsTaskService.java

@@ -185,4 +185,5 @@ public interface IWcsTaskService {
      */
     AjaxResult moveStartingPointToDestination(WcsTask wcsTask);
 
+    WcsTask selectWcsTaskByLocationTo(Long id);
 }

+ 4 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java

@@ -599,6 +599,10 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
         return AjaxResult.success();
     }
 
+    @Override
+    public WcsTask selectWcsTaskByLocationTo(Long locationTo) {
+        return wcsTaskMapper.selectWcsTaskByLocationTo(locationTo);
+    }
 
 
     /**

+ 6 - 0
warewms-ams/src/main/resources/mapper/ams/WcsTaskMapper.xml

@@ -337,5 +337,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select * from wcs_task
         where task_no = #{taskNo} and state not in (2,7,4,11,12)
     </select>
+    <select id="selectWcsTaskByLocationTo" resultType="com.ruoyi.ams.task.domain.WcsTask">
+        select * from wcs_task
+        where location_to = #{locationTo}
+        and state in (9,10,1)
+        order by create_date desc
+    </select>
 
 </mapper>