fix(wms,oms):入库排名统计查询恒为空修复:OMS执行入库单状态不回传(全停status=1)无法按已入库过滤,改为仅排除已取消(6)/已关闭(7)(与入库明细查询页口径一致);入仓日期为空的历史单筛选与展示均兜底建档时间create_time(与出库明细统计口径一致);WMS仍保持仅已入库(5)

This commit is contained in:
rcx
2026-09-01 09:24:20 +08:00
parent 1300a4e1f8
commit a588264849
4 changed files with 15 additions and 13 deletions
@@ -8,15 +8,16 @@
入库排名统计公共查询条件(OMS 执行入库链路)
数据源:执行入库明细 execution_in_material_detail(a,仅 level=1 主行防重复) join 执行入仓单 execution_stock_in_order(b)
left join NGWL_TEST_WMS.material_base_info(c,跨库取货品档案保额作投保总额)
口径:b.status = 5已入库OMS 入库状态枚举 1~7,排除已取消(6)/已关闭(7)及未完成单据);
日期筛选按执行入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源);
口径:b.status not in (6已取消,7已关闭)OMS 执行入库状态不回传,实际数据长期停留 status=1已创建,
无法按"已入库5"过滤,与入库明细查询页面口径一致不按状态筛选,仅排除已取消/已关闭);
日期筛选按执行入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源,为空的历史单按建档时间兜底);
一行 = 某仓单(b.in_order_number)内某货品(a.material_code)的合计,按件数降序排名
-->
<sql id="inboundRankConditions">
a.del_flag = 1
and a.level = 1
and b.del_flag = 1
and b.status = 5
and b.status not in (6, 7)
<if test="topOrganizationId != null">
and b.top_organization_id = #{topOrganizationId}
</if>
@@ -39,10 +40,10 @@
and a.material_name like concat('%', #{materialName}, '%')
</if>
<if test="warehouseDateStart != null and warehouseDateStart != ''">
and date_format(b.warehouse_date,'%Y-%m-%d') &gt;= #{warehouseDateStart}
and date_format(IFNULL(b.warehouse_date, b.create_time),'%Y-%m-%d') &gt;= #{warehouseDateStart}
</if>
<if test="warehouseDateEnd != null and warehouseDateEnd != ''">
and date_format(b.warehouse_date,'%Y-%m-%d') &lt;= #{warehouseDateEnd}
and date_format(IFNULL(b.warehouse_date, b.create_time),'%Y-%m-%d') &lt;= #{warehouseDateEnd}
</if>
</sql>
@@ -56,7 +57,7 @@
<select id="queryMaterialRankList" parameterType="com.mhd.oms.domain.inboundRank.repository.todo.ExecutionInboundRankDO"
resultType="com.mhd.oms.domain.inboundRank.repository.po.ExecutionInboundMaterialRankPO">
select
MAX(b.warehouse_date) AS warehouseDate,
IFNULL(MAX(b.warehouse_date), MAX(b.create_time)) AS warehouseDate,
b.in_order_number AS inOrderNumber,
MAX(b.shipper_code) AS shipperCode,
MAX(b.shipper_name) AS shipperName,