From cb136a19b4694820779bf35820d984fd46752443 Mon Sep 17 00:00:00 2001 From: rcx <3084692334@qq.com> Date: Fri, 7 Aug 2026 15:08:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=20=E3=80=8C=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E3=80=8D-=E3=80=8C=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E3=80=8D=E5=A2=9E=E5=8A=A0=E6=8C=89=E8=B4=A7?= =?UTF-8?q?=E4=B8=BB/=E7=89=A9=E6=96=99=E6=9F=A5=E8=AF=A2=20-=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E6=8C=89=EF=BC=88=E8=B4=A7=E4=B8=BB=20+=20=E7=89=A9?= =?UTF-8?q?=E6=96=99=20+=20=E4=BB=93=E5=BA=93=20+=20=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=EF=BC=89=E7=BB=84=E5=90=88=E8=81=9A=E5=90=88?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=8F=96=E7=BB=84=E5=86=85=E6=9C=80=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/MaterialInventoryMapper.java | 2 + .../persistence/MaterialInventoryImpl.java | 12 +++-- .../MaterialInventoryMapper.xml | 49 +++++++++++++++++++ 3 files changed, 58 insertions(+), 5 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java index 2cb15e4f0..58fbf0e2f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/mapper/MaterialInventoryMapper.java @@ -38,6 +38,8 @@ public interface MaterialInventoryMapper extends BaseMapper public List queryListByHz(MaterialInventoryDO materialInventoryDO); //查物料库存列表-货主+物料(同一物料在不同货主下各一行) public List queryListByHzWl(MaterialInventoryDO materialInventoryDO); + //查物料库存列表-按货主+物料+仓库(库存查询第三个页签,update_time 取合并后最大值) + public List queryListByHzWlUnit(MaterialInventoryDO materialInventoryDO); /** * @description 批量增加库存 diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java index 4b1e1b14e..a536436ce 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialInventory/repository/persistence/MaterialInventoryImpl.java @@ -77,17 +77,19 @@ public class MaterialInventoryImpl extends ServiceImpl + + + + 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 + + + +