Browse Source

入库管理——bug修改

LZH 2 years ago
parent
commit
c5a35bd1fd

+ 6 - 9
warewms-ams/src/main/java/com/ruoyi/ams/xuankuang/service/WcsTaskSubService.java

@@ -184,13 +184,14 @@ public class WcsTaskSubService {
         BigDecimal canQty= expectedQty.subtract(receivedQty);
         InvLotAtt invLotAtt = new InvLotAtt();
         invLotAtt.setLotatt07(palletNo);
+        invLotAtt.setLotatt08(asnNo);
         List<InvLotLocId> invLotLocIds = invLotLocIdService.queryInvByInvLotatt(invLotAtt);
         for (InvLotLocId invLotLocId:invLotLocIds) {
             BigDecimal qty = invLotLocId.getQty();
-            if (qty.compareTo(expectedQty) == 1){
+            if (qty.compareTo(canQty) == 1){
                 continue;
-            }else if ( qty.compareTo(expectedQty) == 0){
-                wmsDocAsnDetails.setReceivedQty(qty);
+            }else if ( qty.compareTo(canQty) == 0){
+                wmsDocAsnDetails.setReceivedQty(expectedQty);
                 int i = iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
                 if ( i > 0){
                     wmsDocAsnDetails.setLineStatus(Constant.ASN_STS.STS40.getValue());
@@ -199,17 +200,13 @@ public class WcsTaskSubService {
                     con = false;
                     continue;
                 }
-            }else if (qty.compareTo(expectedQty) == -1){
-                wmsDocAsnDetails.setReceivedQty(qty);
-                expectedQty = canQty;
+            }else if (qty.compareTo(canQty) == -1){
+                wmsDocAsnDetails.setReceivedQty(receivedQty.add(qty));
                 int i = iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
                 if ( i > 0){
                     wmsDocAsnDetails.setLineStatus(Constant.ASN_STS.STS30.getValue());
                     iWmsDocAsnDetailsService.updateWmsDocAsnDetails(wmsDocAsnDetails);
                     con1 = false;
-                }else {
-                    con = false;
-                    continue;
                 }
             }
         }