From 75b786d6520952e7e0b22c1fae887c3395acf79e Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 21 Nov 2024 14:54:47 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8D=E5=87=86=E7=A1=AE=E5=AF=BC=E8=87=B4=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E7=9A=84=E5=85=A5=E5=BA=93=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=8D=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/PurchaseOrderServiceImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java index 1a424d63..e71b9598 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java @@ -1206,18 +1206,19 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService //生成仓库入库单子表 buildWarehouseChild(purchaseOrder, warehouseStorageCode,filterPurchaseOrderChildList); - //更新采购订单子表 - updatePurchaseOrderChildData(purchaseOrder, filterPurchaseOrderChildList); - int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); - if (allNotifyHasArrivedNum == 0){ + if (purchaseOrder.getNotifyHasArrivedSum() == null || purchaseOrder.getNotifyHasArrivedSum() == 0 ){ purchaseOrder.setNotifyHasArrivedSum(allNotifyArrivedNum); }else { - purchaseOrder.setNotifyHasArrivedSum(allNotifyHasArrivedNum + allNotifyArrivedNum); + purchaseOrder.setNotifyHasArrivedSum(allNotifyArrivedNum + purchaseOrder.getNotifyHasArrivedSum()); } + + //更新采购订单子表 + updatePurchaseOrderChildData(purchaseOrder, filterPurchaseOrderChildList); + if (purchaseOrder.getNotifyHasArrivedSum().equals(purchaseOrder.getActualPurchaseSum())){ purchaseOrder.setWarehouseStorageStatus("4"); }if (purchaseOrder.getNotifyHasArrivedSum() < purchaseOrder.getActualPurchaseSum()){ @@ -1231,7 +1232,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService private void updatePurchaseOrderChildData(PurchaseOrder purchaseOrder, List filterPurchaseOrderChildList) { for (PurchaseOrderChild purchaseOrderChild : filterPurchaseOrderChildList) { - if (purchaseOrderChild.getNotifyHasArrivedNum() == 0 || purchaseOrderChild.getNotifyHasArrivedNum() == null){ + if (purchaseOrderChild.getNotifyHasArrivedNum() == null || purchaseOrderChild.getNotifyHasArrivedNum() == 0){ purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyArriveNum()); }else { purchaseOrderChild.setNotifyHasArrivedNum(purchaseOrderChild.getNotifyHasArrivedNum() + purchaseOrderChild.getNotifyArriveNum()); @@ -1289,6 +1290,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService warehouseStorageOrder.setWarehouseDeptType(purchaseOrderChild.getWarehouseDept()); warehouseStorageOrder.setWarehouseQualityStatus("0"); warehouseStorageOrder.setWarehouseOrderType("0"); + warehouseStorageOrder.setArrivedTime(purchaseOrder.getArrivedTime()); int allNotifyArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyArriveNum).sum(); int allNotifyHasArrivedNum = filterPurchaseOrderChildList.stream().mapToInt(PurchaseOrderChild::getNotifyHasArrivedNum).sum(); if (allNotifyHasArrivedNum == 0){ @@ -1330,6 +1332,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService warehouseStorageOrderDetail.setMaterialType(purchaseOrderChild.getMaterialType()); warehouseStorageOrderDetail.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); warehouseStorageOrderDetail.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + warehouseStorageOrderDetail.setSupplierCode(purchaseOrder.getSupplierCode()); + warehouseStorageOrderDetail.setSupplierName(purchaseOrder.getSupplierName()); warehouseStorageOrderDetail.setCreateTime(new Date()); warehouseStorageOrderDetail.setCreateBy(ShiroUtils.getLoginName()); Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum(); @@ -1377,6 +1381,8 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService purchaseStorageChild.setMaterialType(purchaseOrderChild.getMaterialType()); purchaseStorageChild.setMaterialDeptType(purchaseOrderChild.getWarehouseDept()); purchaseStorageChild.setArrivedTime(purchaseOrderChild.getPlanDeliveryTime()); + purchaseStorageChild.setSupplierCode(purchaseOrder.getSupplierCode()); + purchaseStorageChild.setSupplierName(purchaseOrder.getSupplierName()); purchaseStorageChild.setCreateTime(new Date()); purchaseStorageChild.setCreateBy(ShiroUtils.getLoginName()); Integer notifyArriveNum = purchaseOrderChild.getNotifyArriveNum();