From ff95284448f96d64e17b3c63fac5e4b5cc929e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Tue, 12 May 2026 15:36:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=95=B0=E9=87=8F=E4=B8=8D=E5=8F=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/MaterialInventoryMapper.java | 2 + .../persistence/MaterialInventoryImpl.java | 2 + .../repository/todo/MaterialInventoryDO.java | 2 +- .../service/StockOutOrderDomainService.java | 5 + .../MaterialInventoryDTO.java | 2 +- .../MaterialInventoryApi.java | 6 +- .../MaterialInventoryMapper.xml | 199 +++++++++++++++++- 7 files changed, 213 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 a333dd8a8..5a42b31a8 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 @@ -33,6 +33,8 @@ public interface MaterialInventoryMapper extends BaseMapper public List queryListByWl(MaterialInventoryDO materialInventoryDO); //查物料库存列表-货主 public List queryListByHz(MaterialInventoryDO materialInventoryDO); + //查物料库存列表-货主+物料(同一物料在不同货主下各一行) + public List queryListByHzWl(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 19e88a9e9..fbed436d4 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 @@ -74,6 +74,8 @@ public class MaterialInventoryImpl extends ServiceImpl list = materialInventoryApplicationService.queryList(materialInventoryDO); return getDataTable(list); } diff --git a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml index bbda42547..64b1b5548 100644 --- a/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml +++ b/mhd_wms/src/main/resources/mapper/materialInventory/MaterialInventoryMapper.xml @@ -89,6 +89,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.in_order_number,a.lot_number + + + a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id, + a.shipper_id, a.shipper_code, a.shipper_name, + loc.warehouse_id, loc.warehouse_code, loc.warehouse_name, + loc.storage_section_id, loc.storage_code, loc.storage_name, loc.storage_location_id, loc.storage_location_code, loc.storage_location_name, a.material_base_info_id,a.material_detail_id, + a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name + ,IFNULL (sum(a.freeze_quantity), 0) freeze_quantity,a.is_able, + IFNULL (sum(a.inventory_quantity), 0) inventory_quantity, + IFNULL (sum(a.allocation_quantity), 0) allocation_quantity, + a.remark, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, + a.del_flag,a.unit, + IFNULL (sum(a.area), 0) area, + IFNULL (sum(a.NET_WEIGHT), 0) NET_WEIGHT, + IFNULL (sum(a.GROSS_WEIGHT), 0) GROSS_WEIGHT, + IFNULL (sum(a.VOLUME), 0) VOLUME, + a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4, + a.production_date, a.expiry_date, a.inventory_date, + a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name, + a.bar_code as inv_bar_code, + a.in_order_number,a.lot_number + + and a.material_inventory_id = #{materialInventoryId} @@ -211,6 +234,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + and mi.material_inventory_id = #{materialInventoryId} + + + and mi.organization_id = #{organizationId} + + + and mi.organization_name like concat('%', #{organizationName}, '%') + + + and mi.top_organization_id = #{topOrganizationId} + + + and mi.warehouse_id = #{warehouseId} + + + and mi.shipper_id = #{shipperId} + + + and mi.warehouse_code = #{warehouseCode} + + + and mi.warehouse_name like concat('%', #{warehouseName}, '%') + + + and mi.storage_section_id = #{storageSectionId} + + + and mi.storage_code = #{storageCode} + + + and mi.storage_name like concat('%', #{storageName}, '%') + + + and mi.storage_location_id = #{storageLocationId} + + + and mi.storage_location_code = #{storageLocationCode} + + + and mi.storage_location_name like concat('%', #{storageLocationName}, '%') + + + and mi.material_base_info_id = #{materialBaseInfoId} + + + and mi.material_detail_id, = #{materialDetailId} + + + + and (mi.container_code like concat('%', #{containerOrBatch}, '%') or mi.batch_number like concat('%', #{containerOrBatch}, '%')) + + + and (mi.batch_number like concat('%', #{batchNumber}, '%') or mi.container_code like concat('%', #{containerCode}, '%')) + + + + and mi.batch_number like concat('%', #{batchNumber}, '%') + + + and mi.container_code like concat('%', #{containerCode}, '%') + + + + + and mi.material_status_code like concat('%', #{materialStatusCode}, '%') + + + and mi.material_status_name like concat('%', #{materialStatusName}, '%') + + + and mi.container_id = #{containerId} + + + and mi.container_type like concat('%', #{containerType}, '%') + + + and mi.container_type_name like concat('%', #{containerTypeName}, '%') + + + and mi.inventory_quantity = #{inventoryQuantity} + + + and mi.allocation_quantity = #{allocationQuantity} + + + and mi.freeze_quantity = #{freezeQuantity} + + + and COALESCE(mi.inventory_quantity, 0) > 0 + + + + and mi.create_by_name like concat('%', #{createByName}, '%') + + + and mi.update_by_name like concat('%', #{updateByName}, '%') + + + and mi.del_flag = #{delFlag} + and mi.del_flag = 1 + + + and (mi.storage_location_code = #{storageInfo} or material_code = #{storageInfo} or material_name like concat('%', #{storageInfo}, '%') or bar_code = #{storageInfo}) + + + and mi.BATCH_REF_NO like concat('%', #{batchRefNo}, '%') + + + and mi.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%') + + + and mi.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%') + + + select - + from material_inventory a left join material_base_info b on a.material_base_info_id = b.material_base_info_id + inner join ( + select material_base_info_id, warehouse_id, warehouse_code, warehouse_name, + storage_section_id, storage_code, storage_name, + storage_location_id, storage_location_code, storage_location_name + from ( + select mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name, + mi.storage_section_id, mi.storage_code, mi.storage_name, + mi.storage_location_id, mi.storage_location_code, mi.storage_location_name, + row_number() over (partition by mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as wl_rn + from material_inventory mi + left join material_base_info b on mi.material_base_info_id = b.material_base_info_id + + + + + ) wl_ranked where wl_ranked.wl_rn = 1 + ) loc on loc.material_base_info_id = a.material_base_info_id - GROUP BY a.MATERIAL_BASE_INFO_ID + GROUP BY a.MATERIAL_BASE_INFO_ID, + loc.warehouse_id, loc.warehouse_code, loc.warehouse_name, + loc.storage_section_id, loc.storage_code, loc.storage_name, + loc.storage_location_id, loc.storage_location_code, loc.storage_location_name + + + +