fix(oms,wms): 入库反审修复:已反审tab列表查不到数据、未下发单反审补写反审记录

1. W收货单/W上架单【已反审】tab查不到数据:queryList 的 LEFT JOIN stock_in_order 固定带 a/b.DEL_FLAG=1,归档数据(反审后双方均已软删del_flag=2)关联不上b表,仓库/货主等基于b表的过滤条件把行全部过滤掉;改为按是否查反审归档动态切换关联条件(归档按del_flag=2关联,正常列表行为不变)

2. 未下发WMS的执行单反审不产生反审记录:reverseExecutionOrder 幂等跳过分支直接return导致入库异常无留痕;现补写1条反审记录(abnormalType=6,回退库存0,备注未下发WMS),同单号已有有效记录时防重,重试/重复反审幂等

3. OMS反审Feign参数透传组织三字段(organizationId/organizationName/topOrganizationId),供WMS跳过分支写反审记录使用(该场景无W入库单可取组织信息)
This commit is contained in:
rcx
2026-09-10 17:25:07 +08:00
parent e2da7177f0
commit cae62e83a5
4 changed files with 68 additions and 14 deletions
@@ -167,7 +167,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectStockReceiptOrderPo"/>
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPo"/>
from stock_receipt_order a
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
<!-- 已反审tab查归档数据: a/b 均已软删(del_flag=2), 仍按 del_flag=1 关联会导致 b 全为 NULL,
基于 b 的过滤条件(仓库/货主等)随之失效为 false, 列表恒为空; 故按是否查反审归档切换关联条件 -->
LEFT JOIN stock_in_order b ON a.in_order_number = b.in_order_number
<choose>
<when test="reverseAuditStatus != null">
and a.DEL_FLAG = 2 and b.DEL_FLAG = 2
</when>
<otherwise>
and a.DEL_FLAG = 1 and b.DEL_FLAG = 1
</otherwise>
</choose>
<where>
<include refid="selectStockReceiptOrderPo1"/>
<include refid="com.mhd.wms.domain.stockInOrder.repository.mapper.StockInOrderMapper.joinStockInOrderPoWhere"/>