fix(wms,oms):物料/过期日期查询补查入库日期(create_time)与更新时间,分组页签入库日期显示为空

This commit is contained in:
rcx
2026-08-31 15:59:54 +08:00
parent a74afd837c
commit a983ae639e
2 changed files with 23 additions and 0 deletions
@@ -379,6 +379,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
MAX(a.unit) AS unit,
MAX(a.unit_name) AS unit_name,
MAX(a.create_time) AS create_time,
MAX(a.update_time) AS update_time,
MAX(a.production_date) AS production_date,
MAX(a.inventory_date) AS inventory_date,
MAX(a.purchase_date) AS purchase_date,
@@ -386,6 +388,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
MAX(a.bar_code) AS inv_bar_code,
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
b.material_code, b.material_name,
MAX(b.material_classify_code) AS material_classify_code,
MAX(b.material_classify_name) AS material_classify_name,
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
from reservation_material_inventory a
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
@@ -416,6 +416,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by a.MATERIAL_INVENTORY_ID order by sort_order, a.update_time desc
</select>
<!-- 库存数量合计:与 queryList 相同筛选条件,对全部命中明细行 SUM(库存数量);
不受 queryRule 分组展示影响(各分组行之和即全部明细之和) -->
<select id="sumInventoryQuantity" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO"
resultType="java.math.BigDecimal">
select IFNULL(SUM(a.inventory_quantity), 0)
from material_inventory a
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
<where>
<include refid="selectMaterialInventoryPo1"/>
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
</where>
</select>
<!-- ============ 出库单明细可分配库存(库存分配弹窗专用) ============
列复用通用片段;条件独立成段,不改动 selectMaterialInventoryPo1,库存查询页零影响。
与 /list 的三点差异:
@@ -552,6 +565,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
MAX(a.unit) AS unit,
MAX(a.unit_name) AS unit_name,
MAX(a.create_time) AS create_time,
MAX(a.update_time) AS update_time,
MAX(a.production_date) AS production_date,
MAX(a.inventory_date) AS inventory_date,
MAX(a.purchase_date) AS purchase_date,
@@ -560,6 +575,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
MAX(b.specification_model) AS specification_model,
MAX(b.material_code) AS material_code, MAX(b.material_name) AS material_name,
MAX(b.material_classify_code) AS material_classify_code,
MAX(b.material_classify_name) AS material_classify_name,
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
from material_inventory a
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
@@ -635,6 +652,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.top_organization_id,
MAX(b.material_type) AS material_type,
MAX(b.material_type_name) AS material_type_name,
MAX(b.material_classify_code) AS material_classify_code,
MAX(b.material_classify_name) AS material_classify_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,