Browse Source

- 解决多入库单跨单成品扫码校验的问题;
- 入库码盘、理货备货、分拣出库提交返回提示新增操作进度;

Gizmo 1 year ago
parent
commit
2db1cb3f38

+ 18 - 13
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java

@@ -387,7 +387,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
             } else {
             } else {
                 for (WmsDocAsnDetails details : list) {
                 for (WmsDocAsnDetails details : list) {
                     if (totalQty.compareTo(BigDecimal.ZERO) == 0) {
                     if (totalQty.compareTo(BigDecimal.ZERO) == 0) {
-                        return AjaxResult.success("");
+                        continue;
                     }
                     }
                     // 成品条码,扫码新托盘的时候,自动解绑老托盘数据。
                     // 成品条码,扫码新托盘的时候,自动解绑老托盘数据。
                     if (codeSkuRelationshipVO.isProduct()) {
                     if (codeSkuRelationshipVO.isProduct()) {
@@ -395,7 +395,7 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
                         attQuery.setSku(codeSkuRelationshipVO.getSku());
                         attQuery.setSku(codeSkuRelationshipVO.getSku());
 //                        attQuery.setLotatt07(stockForm.getPalletNo());
 //                        attQuery.setLotatt07(stockForm.getPalletNo());
                         attQuery.setLotatt02(codeSkuRelationshipVO.getSn());
                         attQuery.setLotatt02(codeSkuRelationshipVO.getSn());
-                        attQuery.setLotatt08(details.getAsnNo());
+                        attQuery.setLotatt08(stockForm.getAsnNo().toString());
 //                        attQuery.setLotatt14(stockForm.getOrderNo());
 //                        attQuery.setLotatt14(stockForm.getOrderNo());
                         List<InvLotLocIdLotattVO> samePalletInvList = invLotLocIdMapper.queryInvLotattByInvLotatt(attQuery);
                         List<InvLotLocIdLotattVO> samePalletInvList = invLotLocIdMapper.queryInvLotattByInvLotatt(attQuery);
                         if (samePalletInvList != null && samePalletInvList.size() > 0) {
                         if (samePalletInvList != null && samePalletInvList.size() > 0) {
@@ -492,22 +492,27 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
                 }
                 }
             }
             }
         }
         }
-        // 验证入库单是否完全收货
-        String endMsg = "";
-        boolean con = true;
+        // 统计码盘情况
+        int expectedQty = 0;
+        int receivedQty = 0;
+        StringBuilder endMsg = new StringBuilder();
         List<String> asnNo = stockForm.getAsnNo();
         List<String> asnNo = stockForm.getAsnNo();
         for (String s : asnNo) {
         for (String s : asnNo) {
+
             WmsDocAsnHeader wmsDocAsnHeader = wmsDocAsnHeaderMapper.selectWmsDocAsnHeaderByAsnNo(s);
             WmsDocAsnHeader wmsDocAsnHeader = wmsDocAsnHeaderMapper.selectWmsDocAsnHeaderByAsnNo(s);
-            if (!wmsDocAsnHeader.getAsnStatus().equals(Constant.ASN_STS.STS40.getValue())) {
-                endMsg = "入库单还未完全收货!";
-                con = false;
-                break;
+
+            for (WmsDocAsnDetails docAsnDetails : wmsDocAsnHeader.getWmsDocAsnDetailsList()) {
+
+                expectedQty += docAsnDetails.getExpectedQty().intValue();
+                receivedQty += docAsnDetails.getReceivedQty().intValue();
             }
             }
+
+            endMsg.append("\n").append(wmsDocAsnHeader.getAsnReference1()).append("码盘情况:").append(receivedQty).append("/").append(expectedQty);
+            expectedQty = 0;
+            receivedQty = 0;
         }
         }
-        if (con) {
-            endMsg = "入库单已经完全收货!";
-        }
-        return AjaxResult.success("操作成功!" + endMsg);
+
+        return AjaxResult.success("操作成功!" + endMsg.toString());
     }
     }
 
 
     /**
     /**

+ 13 - 7
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -810,7 +810,8 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         }
         }
         wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(wmsDocOrderDetails);
         wmsDocOrderDetailsMapper.updateWmsDocOrderDetails(wmsDocOrderDetails);
         // 更新头单
         // 更新头单
-        String endMsg = "出货单已完全拣货!";
+        int qtyOrdered = 0;
+        int qtyPicked = 0;
         String orderSts = Constant.ORDER_STS.STS99.getValue();
         String orderSts = Constant.ORDER_STS.STS99.getValue();
         WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
         WmsDocOrderHeader wmsDocOrderHeader = new WmsDocOrderHeader();
         wmsDocOrderHeader.setOrderNo(orderNo);
         wmsDocOrderHeader.setOrderNo(orderNo);
@@ -818,9 +819,9 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         for (WmsDocOrderDetails details : wmsDocOrderDetailsList) {
         for (WmsDocOrderDetails details : wmsDocOrderDetailsList) {
             if (!details.getLineStatus().equals(Constant.ORDER_STS.STS40.getValue())) {
             if (!details.getLineStatus().equals(Constant.ORDER_STS.STS40.getValue())) {
                 orderSts = Constant.ORDER_STS.STS30.getValue();
                 orderSts = Constant.ORDER_STS.STS30.getValue();
-                endMsg = "出货单还有未完全拣货!";
-                break;
             }
             }
+            qtyOrdered += details.getQtyOrdered().intValue();
+            qtyPicked += details.getQtyPicked().intValue();
         }
         }
         wmsDocOrderHeader.setOrderStatus(orderSts);
         wmsDocOrderHeader.setOrderStatus(orderSts);
         wmsDocOrderHeaderService.updateWmsDocOrderHeader(wmsDocOrderHeader);
         wmsDocOrderHeaderService.updateWmsDocOrderHeader(wmsDocOrderHeader);
@@ -828,7 +829,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         erpBarcodesService.recordErpBarcodeListSo(wmsDocOrderDetails, sn
         erpBarcodesService.recordErpBarcodeListSo(wmsDocOrderDetails, sn
                 , "SORTATION01", palletNo, BigDecimal.ONE, "");
                 , "SORTATION01", palletNo, BigDecimal.ONE, "");
 
 
-        return AjaxResult.success("拣货成功!" + endMsg);
+        return AjaxResult.success("拣货成功!分拣情况:" + qtyPicked + "/" + qtyOrdered);
     }
     }
 
 
     @Override
     @Override
@@ -1308,6 +1309,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         boolean isAllUpdate = false; // 库存转移类型,是全部修改,还是拆分
         boolean isAllUpdate = false; // 库存转移类型,是全部修改,还是拆分
         boolean isStockPalletNoTo = groupDiskFrom.isStockPalletNoTo(); // 目标托盘是否是备货托盘,为了方便,目标托盘默认是备货托盘
         boolean isStockPalletNoTo = groupDiskFrom.isStockPalletNoTo(); // 目标托盘是否是备货托盘,为了方便,目标托盘默认是备货托盘
         final Double toQty;
         final Double toQty;
+        int taskQty = 0;
         Long currentVirtualZone; // 当前所在的虚拟区
         Long currentVirtualZone; // 当前所在的虚拟区
         if (StringUtils.isNotEmpty(groupDiskFrom.getOrderNo())) {
         if (StringUtils.isNotEmpty(groupDiskFrom.getOrderNo())) {
             orderNo = groupDiskFrom.getOrderNo();
             orderNo = groupDiskFrom.getOrderNo();
@@ -1315,15 +1317,19 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         // 验证出库单
         // 验证出库单
         if (StringUtils.isNotEmpty(orderNo)) {
         if (StringUtils.isNotEmpty(orderNo)) {
             WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
             WmsDocOrderHeader header = wmsDocOrderHeaderService.selectWmsDocOrderHeaderByOrderNo(orderNo);
+            if (null == header) return AjaxResult.error("查无此出库单数据" + orderNo);
             if (!header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
             if (!header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
                 return AjaxResult.error("出库单类型不可备货组盘!");
                 return AjaxResult.error("出库单类型不可备货组盘!");
             }
             }
-            if (header != null
-                    && !header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
+            if (!header.getOrderStatus().equals(Constant.ORDER_STS.STS10.getValue())
                     && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
                     && !header.getOrderStatus().equals(Constant.ORDER_STS.STS20.getValue())
                     && !header.getOrderStatus().equals(Constant.ORDER_STS.STS22.getValue())) {
                     && !header.getOrderStatus().equals(Constant.ORDER_STS.STS22.getValue())) {
                 return AjaxResult.error("出库单状态不可备货组盘!");
                 return AjaxResult.error("出库单状态不可备货组盘!");
             }
             }
+
+            for (WmsDocOrderDetails docOrderDetails : header.getWmsDocOrderDetailsList()) {
+                taskQty += docOrderDetails.getQtyOrdered().intValue();
+            }
         }
         }
 
 
         // 根据条码获取物料号
         // 根据条码获取物料号
@@ -1483,7 +1489,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);
     }
     }
 
 
     /**
     /**

+ 1 - 1
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -596,7 +596,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 <if test="lotatt05 != null  and lotatt05 != ''"> and att.lotatt05 = #{lotatt05}</if>
                 <if test="lotatt05 != null  and lotatt05 != ''"> and att.lotatt05 = #{lotatt05}</if>
                 <if test="lotatt06 != null  and lotatt06 != ''"> and att.lotatt06 = #{lotatt06}</if>
                 <if test="lotatt06 != null  and lotatt06 != ''"> and att.lotatt06 = #{lotatt06}</if>
                 <if test="lotatt07 != null  and lotatt07 != ''"> and att.lotatt07 = #{lotatt07}</if>
                 <if test="lotatt07 != null  and lotatt07 != ''"> and att.lotatt07 = #{lotatt07}</if>
-                <if test="lotatt08 != null  and lotatt08 != ''"> and att.lotatt08 = #{lotatt08}</if>
+                <if test="lotatt08 != null  and lotatt08 != ''"> and INSTR(#{lotatt08}, att.lotatt08)</if>
                 <if test="lotatt09 != null  and lotatt09 != ''"> and att.lotatt09 = #{lotatt09}</if>
                 <if test="lotatt09 != null  and lotatt09 != ''"> and att.lotatt09 = #{lotatt09}</if>
                 <if test="lotatt10 != null  and lotatt10 != ''"> and att.lotatt10 = #{lotatt10}</if>
                 <if test="lotatt10 != null  and lotatt10 != ''"> and att.lotatt10 = #{lotatt10}</if>
                 <if test="lotatt11 != null  and lotatt11 != ''"> and att.lotatt11 = #{lotatt11}</if>
                 <if test="lotatt11 != null  and lotatt11 != ''"> and att.lotatt11 = #{lotatt11}</if>

File diff suppressed because it is too large
+ 23 - 5
warewms-ams/src/main/resources/mapper/docAsn/WmsDocAsnHeaderMapper.xml