fix(wms,oms):入库排名统计口径修复:件数改为实际上架量SUM(SHELVES_QUANTITY)(原PIECE_COUNT为建档申报值不随收货上架变化);OMS端数据源跨库改查WMS入库表NGWL_TEST_WMS.stock_in_order/in_material_detail(OMS执行单状态不回传且上架量回填代码未启用,与出库排名1300a4e1跨库修法一致),状态恢复为已入库(5);入仓日期为空兜底建档时间;OMS与WMS两端数字一致;接口路径/参数/返回结构不变
This commit is contained in:
@@ -5,19 +5,23 @@
|
||||
<mapper namespace="com.mhd.oms.domain.inboundRank.repository.mapper.ExecutionInboundRankMapper">
|
||||
|
||||
<!--
|
||||
入库排名统计公共查询条件(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 not in (6已取消,7已关闭)(OMS 执行入库单状态不回传,实际数据长期停留 status=1已创建,
|
||||
无法按"已入库5"过滤,与入库明细查询页面口径一致不按状态筛选,仅排除已取消/已关闭);
|
||||
日期筛选按执行入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源,为空的历史单按建档时间兜底);
|
||||
一行 = 某仓单(b.in_order_number)内某货品(a.material_code)的合计,按件数降序排名
|
||||
入库排名统计公共查询条件(OMS 端,跨库取 WMS 入库数据)
|
||||
数据源:WMS 库入库明细 NGWL_TEST_WMS.in_material_detail(a,仅 level=1 主行防重复)
|
||||
join WMS 库入仓单 NGWL_TEST_WMS.stock_in_order(b)
|
||||
left join WMS 库货品档案 NGWL_TEST_WMS.material_base_info(c,取保额作投保总额)
|
||||
说明:OMS 库执行入库单状态/上架数量均不回传(状态长期停留 status=1,上架量回填代码未启用),
|
||||
"已入库/实际上架量"的真实数据在 WMS 库,故跨库取数
|
||||
(与 OMS 出库排名跨库取 NGWL_TEST_WMS 出库表、OMS 库存查询跨库 join material_base_info 同一模式),
|
||||
口径与 WMS 端 /inboundRankApi 完全一致,两边数字一致;
|
||||
条件:b.status = 5已入库(排除已取消(6)/已关闭(7)及未完成单据);
|
||||
日期筛选按入仓单入仓日期 b.warehouse_date(与列表"入仓日期"列同源,为空的历史单按建档时间兜底);
|
||||
一行 = 某仓单(b.in_order_number)内某货品(a.material_code)的合计,
|
||||
按件数(实际上架量 SUM(a.SHELVES_QUANTITY))降序排名
|
||||
-->
|
||||
<sql id="inboundRankConditions">
|
||||
a.del_flag = 1
|
||||
and a.level = 1
|
||||
and b.del_flag = 1
|
||||
and b.status not in (6, 7)
|
||||
and b.status = 5
|
||||
<if test="topOrganizationId != null">
|
||||
and b.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
@@ -48,12 +52,12 @@
|
||||
</sql>
|
||||
|
||||
<sql id="inboundRankFrom">
|
||||
from execution_in_material_detail a
|
||||
join execution_stock_in_order b on a.in_order_number = b.in_order_number and b.del_flag = 1
|
||||
from NGWL_TEST_WMS.in_material_detail a
|
||||
join NGWL_TEST_WMS.stock_in_order b on a.in_order_number = b.in_order_number and b.del_flag = 1
|
||||
left join NGWL_TEST_WMS.material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||
</sql>
|
||||
|
||||
<!-- 商品入库排名列表(仓单+货品汇总,按件数降序) -->
|
||||
<!-- 商品入库排名列表(仓单+货品汇总,按件数=实际上架量降序) -->
|
||||
<select id="queryMaterialRankList" parameterType="com.mhd.oms.domain.inboundRank.repository.todo.ExecutionInboundRankDO"
|
||||
resultType="com.mhd.oms.domain.inboundRank.repository.po.ExecutionInboundMaterialRankPO">
|
||||
select
|
||||
@@ -65,7 +69,7 @@
|
||||
MAX(a.material_name) AS materialName,
|
||||
MAX(a.SPECIFICATION_MODEL) AS specificationModel,
|
||||
MAX(a.unit_name) AS unitName,
|
||||
IFNULL(SUM(a.PIECE_COUNT), 0) AS pieceCount,
|
||||
IFNULL(SUM(a.SHELVES_QUANTITY), 0) AS pieceCount,
|
||||
ROUND(IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) / 1000, 3) AS grossWeightTon,
|
||||
MAX(IFNULL(c.insure_amount, 0)) AS insureAmount,
|
||||
IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume
|
||||
@@ -89,7 +93,7 @@
|
||||
from (
|
||||
select
|
||||
b.in_order_number AS inOrderNumber,
|
||||
IFNULL(SUM(a.PIECE_COUNT), 0) AS pieceCount,
|
||||
IFNULL(SUM(a.SHELVES_QUANTITY), 0) AS pieceCount,
|
||||
IFNULL(SUM(a.TOTAL_GROSS_WEIGHT), 0) AS grossWeightKG,
|
||||
MAX(IFNULL(c.insure_amount, 0)) AS insureAmount,
|
||||
IFNULL(SUM(a.TOTAL_VOLUME), 0) AS totalVolume
|
||||
|
||||
Reference in New Issue
Block a user