Browse Source

PDA反拣组盘解绑出库备货扫描记录+测试

k 1 year ago
parent
commit
b0fdaab34c

+ 1 - 1
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/IErpBarcodesService.java

@@ -101,7 +101,7 @@ public interface IErpBarcodesService {
             , String palletNo, BigDecimal qty, String boxNo);
 
     /**
-     * 入库扫码记录扫描信息 解绑
+     * 入库备货扫码记录扫描信息 解绑
      *
      * @param erpNo
      * @param erpName

+ 9 - 0
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/impl/ErpBarcodesServiceImpl.java

@@ -228,6 +228,15 @@ public class ErpBarcodesServiceImpl implements IErpBarcodesService {
     @Override
     public AjaxResult untieRecordErpBarcodeListAsnSo(String erpNo, String erpName, String sn) {
         if (StringUtils.isEmpty(erpName)) {
+            ErpBarcodes erpBarcodes = new ErpBarcodes();
+            erpBarcodes.setErpNo(erpNo);
+            erpBarcodes.setBarcode(sn);
+            ErpBarcodes erpBarcodes1 = this.selectErpBarcodesByModel(erpBarcodes);
+            if (erpBarcodes1 != null) {
+                erpBarcodes1.setUserdefine1("N");
+                erpBarcodes1.setUserdefine8("N");
+                this.updateErpBarcodes(erpBarcodes1);
+            }
             return AjaxResult.success();
         }
         ErpBarcodes erpBarcodes = new ErpBarcodes();

+ 15 - 8
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -1677,6 +1677,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         String sn = groupDiskFrom.getSn(); // 条码号
         String sku = ""; // 物料编码
         String orderNo = groupDiskFrom.getOrderNo();
+        String erpNo = ""; //erp单号
         Double qty = Double.valueOf(groupDiskFrom.getQty()); // 数量
         final Double toQty;
         Long currentVirtualZone; // 当前所在的虚拟区
@@ -1687,6 +1688,7 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
             if (!header.getOrderType().equals(Constant.ORDER_TYP.BH.getValue())) {
                 return AjaxResult.error("出库单类型不可反拣组盘!");
             }
+            erpNo = header.getSoReference1();
         }
         // 根据条码获取物料号
         CodeSkuRelationshipVO codeSkuRelationshipVO = codeSkuRelationshipService.checkIsProduct(sn);
@@ -1724,14 +1726,15 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         }
         // 验证库存
         if (StringUtils.isEmpty(endLotattVO.getLotatt15())) {
-            return AjaxResult.success("扫描的条码不可反拣组盘!");
-        }
-        WmsDocOrderHeader header = wmsDocOrderHeaderService.selectDocOrderHeaderByOrderNo(endLotattVO.getLotatt15());
-        if (header == null || !header.getOrderType().equals(Constant.ORDER_TYP.LH.getValue())) {
-            return AjaxResult.success("扫描的条码不可反拣组盘!不存在对应的出库理货单!");
-        }
-        if (!orderNo.equals(header.getSoReference1())) {
-            return AjaxResult.success("扫描的出库单和托盘库存不匹配!");
+
+        }else {
+            WmsDocOrderHeader header = wmsDocOrderHeaderService.selectDocOrderHeaderByOrderNo(endLotattVO.getLotatt15());
+            if (header == null || !header.getOrderType().equals(Constant.ORDER_TYP.LH.getValue())) {
+                return AjaxResult.success("扫描的条码不可反拣组盘!不存在对应的出库理货单!");
+            }
+            if (!orderNo.equals(header.getSoReference1())) {
+                return AjaxResult.success("扫描的出库单和托盘库存不匹配!");
+            }
         }
 
         currentVirtualZone = endLotattVO.getLocationId();
@@ -1829,6 +1832,10 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
                     invLotLocIdUpdate.setQtyallocated(BigDecimal.ZERO);
                     invLotLocIdUpdate.setLotnumTo(newLotnum);
                     invLotLocIdService.updateInvLotLocId(invLotLocIdUpdate);
+                    // 解绑条码扫描记录
+                    erpBarcodesService.untieRecordErpBarcodeListAsnSo(erpNo
+                            , ""
+                            , sn);
 
                 }