From 0f88ad75b9ae77471abaa9990789ff3db3c186cf Mon Sep 17 00:00:00 2001
From: rcx <3084692334@qq.com>
Date: Sat, 8 Aug 2026 10:07:39 +0800
Subject: [PATCH] =?UTF-8?q?fix(wms=20=E5=BA=93=E5=AD=98=E6=A8=A1=E5=9D=97)?=
=?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=AD=98=E6=B1=87=E6=80=BB?=
=?UTF-8?q?=E5=88=86=E7=BB=84=E6=8B=86=E5=88=86bug=E5=B9=B6=E8=A1=A5?=
=?UTF-8?q?=E5=85=85=E5=BA=93=E5=AD=98=E8=B0=83=E6=95=B4=E4=BB=93=E5=BA=93?=
=?UTF-8?q?=E7=A9=BA=E5=80=BC=E6=A0=A1=E9=AA=8C=201.=20queryListByHzWlUnit?=
=?UTF-8?q?=E3=80=81queryListByWlExpiry=20=E7=9A=84=20GROUP=20BY=20?=
=?UTF-8?q?=E7=A7=BB=E9=99=A4=20=20=20=20shipper=5Fcode/material=5Fcode=20?=
=?UTF-8?q?=E7=AD=89=E6=8F=8F=E8=BF=B0=E5=88=97=EF=BC=8C=E5=8F=AA=E4=BF=9D?=
=?UTF-8?q?=E7=95=99ID=E5=88=97=EF=BC=9B=E5=AF=B9=E5=BA=94SELECT=20=20=20?=
=?UTF-8?q?=20=E6=8F=8F=E8=BF=B0=E5=88=97=E6=94=B9=E7=94=A8MAX()=E8=81=9A?=
=?UTF-8?q?=E5=90=88=EF=BC=8C=E9=81=BF=E5=85=8D=E5=90=8CID=E6=98=8E?=
=?UTF-8?q?=E7=BB=86=E5=9B=A0=E6=8F=8F=E8=BF=B0=E5=88=97NULL/=E5=80=BC?=
=?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E8=A2=AB=E9=94=99=E8=AF=AF=E6=8B=86?=
=?UTF-8?q?=E5=88=86=E3=80=82=202.=20=E5=BA=93=E5=AD=98=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=20ObjectUtil.isNotNull(war?=
=?UTF-8?q?ehousePO)=20=E7=A9=BA=E5=80=BC=E6=A0=A1=E9=AA=8C=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...nventoryAdjustmentRecordDomainService.java | 2 +-
.../MaterialInventoryMapper.xml | 75 +++++++++++--------
2 files changed, 43 insertions(+), 34 deletions(-)
diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java
index 2f0fe6053..51ad599be 100644
--- a/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java
+++ b/mhd_wms/src/main/java/com/mhd/wms/domain/inventoryAdjustmentRecord/service/InventoryAdjustmentRecordDomainService.java
@@ -292,7 +292,7 @@ public class InventoryAdjustmentRecordDomainService {
//推送oms库存调整记录
try{
// 当仓库启用 oms 才进行推送
- if (warehousePO.getIsEnable() == 1) {
+ if (ObjectUtil.isNotNull(warehousePO) && warehousePO.getIsEnable() == 1) {
Boolean pushSuccess = pushOms(materialInventory, inventoryAdjustmentRecordDO);
if (!pushSuccess) {
throw new ServiceException("库存调整推送OMS失败,请稍后重试");
diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
index 8656e711d..25a2173a3 100644
--- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
+++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml
@@ -458,8 +458,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -531,28 +531,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- a.shipper_id, a.shipper_code, a.shipper_name,
- b.material_base_info_id, b.material_code, b.material_name, b.SPECIFICATION_MODEL,
- a.warehouse_id, a.warehouse_code, a.warehouse_name,
- a.organization_id, a.organization_name, a.top_organization_id,
- MAX(b.material_type) AS material_type,
- MAX(b.material_type_name) AS material_type_name,
- MAX(b.bar_code) AS bar_code,
- MAX(nvl(a.unit_name, b.unit_name)) AS unit_name,
- MAX(b.pack_id) AS pack_id,
- MAX(b.pack_code) AS pack_code,
- MAX(b.pack_name) AS pack_name,
- MAX(a.unit) AS unit,
- IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity,
- IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity,
- IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity,
- IFNULL(SUM(a.area), 0) AS area,
- IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT,
- IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT,
- IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
- MIN(a.create_time) AS create_time, -- 新增:首次入库时间
- MAX(a.update_time) AS update_time,
- CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
+ a.shipper_id,
+ MAX(a.shipper_code) AS shipper_code,
+ MAX(a.shipper_name) AS shipper_name,
+ b.material_base_info_id,
+ MAX(b.material_code) AS material_code,
+ MAX(b.material_name) AS material_name,
+ MAX(b.SPECIFICATION_MODEL) AS SPECIFICATION_MODEL,
+ a.warehouse_id,
+ MAX(a.warehouse_code) AS warehouse_code,
+ MAX(a.warehouse_name) AS warehouse_name,
+ a.organization_id,
+ MAX(a.organization_name) AS organization_name,
+ a.top_organization_id,
+ MAX(b.material_type) AS material_type,
+ MAX(b.material_type_name) AS material_type_name,
+ MAX(b.bar_code) AS bar_code,
+ MAX(nvl(a.unit_name, b.unit_name)) AS unit_name,
+ MAX(b.pack_id) AS pack_id,
+ MAX(b.pack_code) AS pack_code,
+ MAX(b.pack_name) AS pack_name,
+ MAX(a.unit) AS unit,
+ IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity,
+ IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity,
+ IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity,
+ IFNULL(SUM(a.area), 0) AS area,
+ IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT,
+ IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT,
+ IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
+ MIN(a.create_time) AS create_time,
+ MAX(a.update_time) AS update_time,
+ CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order