Browse Source

- 理货备货扫描出库单号之后,再扫描托盘号的时候需要立马给出提示;

Gizmo 1 year ago
parent
commit
96f5288704

+ 12 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdaController.java

@@ -541,6 +541,18 @@ public class PdaController {
         return wmsDocOrderHeaderService.toPick(pickForm);
         return wmsDocOrderHeaderService.toPick(pickForm);
     }
     }
 
 
+    /**
+     * 理货备货 托盘、出库单号验证
+     */
+    @PostMapping("/docOrder/groupDiskCheck")
+    public AjaxResult groupDiskCheck(@RequestBody GroupDiskFrom groupDiskFrom) {
+
+        //通过ERP单号获取WMS的出库单号
+        String orderNo = wmsDocOrderHeaderService.changeErpNoToOrderNo(groupDiskFrom.getOrderNo());
+        groupDiskFrom.setOrderNo(orderNo);
+        return wmsDocOrderHeaderService.groupDiskBHCheck(groupDiskFrom);
+    }
+
     /**
     /**
      * 组盘
      * 组盘
      * 1.PDA备货组盘(传出库单号) 2.PDA分拣组盘(不传出库单号)
      * 1.PDA备货组盘(传出库单号) 2.PDA分拣组盘(不传出库单号)

+ 5 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/service/IWmsDocOrderHeaderService.java

@@ -243,6 +243,11 @@ public interface IWmsDocOrderHeaderService {
      */
      */
     AjaxResult groupDisk(GroupDiskFrom groupDiskFrom);
     AjaxResult groupDisk(GroupDiskFrom groupDiskFrom);
 
 
+    /**
+     * 理货备货 托盘号、出库单号验证
+     */
+    AjaxResult groupDiskBHCheck(GroupDiskFrom groupDiskFrom);
+
     /**
     /**
      * 组盘(备货)
      * 组盘(备货)
      * @param groupDiskFrom
      * @param groupDiskFrom

+ 28 - 3
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -1296,6 +1296,31 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
 
 
+    @Override
+    public AjaxResult groupDiskBHCheck(GroupDiskFrom groupDiskFrom) {
+
+        // 验证出库单
+        WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(groupDiskFrom.getOrderNo());
+        if (null == header) return AjaxResult.error("查无此出库单数据" + groupDiskFrom.getOrderNo());
+        if (!header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
+            return AjaxResult.error("出库单类型不可备货组盘!");
+        }
+        if (!header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
+                && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
+                && !header.getOrderStatus().equals(Constant.ORDER_STS.STS22.getValue())) {
+            return AjaxResult.error("出库单状态不可备货组盘!");
+        }
+
+        //验证目标托盘库存,一个托盘只能备货一个出库单
+        AjaxResult ajaxResultC = invLotLocIdService.checkPalletIsOnlyOrderNo(groupDiskFrom.getPalletNoTo()
+                , groupDiskFrom.getOrderNo());
+        if (!ajaxResultC.isSuccess()) {
+            return ajaxResultC;
+        }
+
+        return AjaxResult.success();
+    }
+
     @Transactional
     @Transactional
     @Override
     @Override
     public synchronized AjaxResult groupDiskBH(GroupDiskFrom groupDiskFrom) {
     public synchronized AjaxResult groupDiskBH(GroupDiskFrom groupDiskFrom) {
@@ -1366,7 +1391,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         // 组盘是把出库的库存重新组到一个新的托盘上,所以起始托盘和条码理应可以查询到系统里有对应的库存。
         // 组盘是把出库的库存重新组到一个新的托盘上,所以起始托盘和条码理应可以查询到系统里有对应的库存。
         if (invLotLocIdLotattList.size() == 0) {
         if (invLotLocIdLotattList.size() == 0) {
             // 备货(不是当前出库单分配的)
             // 备货(不是当前出库单分配的)
-            return groupDiskUnAllocationBH(groupDiskFrom);
+            return groupDiskUnAllocationBH(groupDiskFrom, taskQty);
 //            return AjaxResult.error(String.format("不存在对应库存!起始托盘:%s,条码:%s", palletNoFrom, sn));
 //            return AjaxResult.error(String.format("不存在对应库存!起始托盘:%s,条码:%s", palletNoFrom, sn));
         }
         }
         // 产品的话基本只能查出有一条库存 但是物料可能会多条 但是我们只处理一条库存
         // 产品的话基本只能查出有一条库存 但是物料可能会多条 但是我们只处理一条库存
@@ -1499,7 +1524,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
      * @return
      * @return
      */
      */
     @Transactional
     @Transactional
-    public AjaxResult groupDiskUnAllocationBH(GroupDiskFrom groupDiskFrom) {
+    public AjaxResult groupDiskUnAllocationBH(GroupDiskFrom groupDiskFrom, int taskQty) {
         String palletNoFrom = groupDiskFrom.getPalletNoFrom(); // 起始托盘
         String palletNoFrom = groupDiskFrom.getPalletNoFrom(); // 起始托盘
         String palletNoTo = groupDiskFrom.getPalletNoTo(); // 目标托盘
         String palletNoTo = groupDiskFrom.getPalletNoTo(); // 目标托盘
         String sn = groupDiskFrom.getSn(); // 条码号
         String sn = groupDiskFrom.getSn(); // 条码号
@@ -1672,7 +1697,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         boxInfoUpdate.setId(wmsBoxInfo.getId());
         boxInfoUpdate.setId(wmsBoxInfo.getId());
         boxInfoUpdate.setLocationId(currentVirtualZone);
         boxInfoUpdate.setLocationId(currentVirtualZone);
         wmsBoxInfoService.updateWmsBoxInfo(boxInfoUpdate);
         wmsBoxInfoService.updateWmsBoxInfo(boxInfoUpdate);
-        return AjaxResult.success("当前托盘备货成功!(未分配条码),还剩余未备数:" + residual);
+        return AjaxResult.success("当前托盘备货成功!(未分配条码),备货情况:" + taskQty + "/" + residual);
     }
     }
 
 
     @Transactional
     @Transactional