From ee4cd312abe20f3d9d46dbe9d72c8c30bce412eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Mon, 9 Feb 2026 18:11:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=A3=E8=B4=A7=E5=AE=8C=E6=88=90=E6=97=A0?= =?UTF-8?q?=E8=AE=BA=E6=8B=A3=E8=B4=A7=E5=A4=9A=E5=B0=91=E9=83=BD=E4=B8=BA?= =?UTF-8?q?=E6=8B=A3=E8=B4=A7=E5=AE=8C=E6=88=90;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/HandoverTaskOrderDomainService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java index 08eaf146a..c7ef7ca8e 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/handoverTaskOrder/service/HandoverTaskOrderDomainService.java @@ -206,10 +206,18 @@ public class HandoverTaskOrderDomainService { BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(checkQuantity); + BigDecimal oldArea = materialInventoryPO.getArea(); BigDecimal oldVolume = materialInventoryPO.getVolume(); BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight(); BigDecimal oldNetWeight = materialInventoryPO.getNetWeight(); + + // 初始化旧数据,避免空指针 + oldArea = oldArea != null ? oldArea : BigDecimal.ZERO; + oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO; + oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO; + oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO; + BigDecimal newArea = oldArea.subtract(checkArea); BigDecimal newVolume = oldVolume.subtract(checkVolume); BigDecimal newGrossWeight = oldGrossWeight.subtract(checkGrossWeight);