From ef13d890bed0a56c4406d7c7ae147d5faa48fede Mon Sep 17 00:00:00 2001
From: rcx <3084692334@qq.com>
Date: Thu, 20 Aug 2026 10:17:16 +0800
Subject: [PATCH] =?UTF-8?q?fix(oms):=E5=85=A5=E5=BA=93=E6=89=A7=E8=A1=8C?=
=?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E5=8D=95=E5=8F=B7=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E6=9F=A5=E4=B8=8D=E5=88=B0=EF=BC=8CbusinessNumber=E6=AD=BB?=
=?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=94=B9=E5=8D=95=E5=8F=B7=E6=A8=A1=E7=B3=8A?=
=?UTF-8?q?=E4=BA=92=E6=9F=A5=EF=BC=9B=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2?=
=?UTF-8?q?=E8=B4=A7=E4=B8=BB=E8=BF=87=E6=BB=A4=E7=A7=BB=E5=9B=9E=E4=B8=BB?=
=?UTF-8?q?=E8=A1=A8=E5=B9=B6=E4=BF=AE=E6=AD=A3=E5=A7=94=E6=89=98=E6=96=B9?=
=?UTF-8?q?=E8=AF=AF=E5=88=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 入库执行单列表:businessNumber条件原为BUSINESS_NUMBER精确等值,该列无写入恒空致全条件查询0条,改为业务单号/入库单号OR模糊互查
- 入库执行单列表:inOrderNumber精确等值改模糊like;删除重复的createByName条件;补businessInOrderNumber过滤(业务单号/入库单号互查)
- 库存查询:货主过滤(shipperId/Code/Name/shipperInfo)从物料表b移回库存主表a,避免LEFT JOIN退化INNER JOIN丢行
- 库存查询:委托方判定由组织层级改为UserPo.shipperEnterpriseName,避免二级组织运营人员(2841/2842)被误判强制按本人userId过滤
---
...ionMaterialInventoryApplicationService.java | 7 ++++---
.../ExecutionStockInOrderMapper.xml | 14 +++++++++-----
.../MaterialInventoryMapper.xml | 18 ++++++++----------
3 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java
index e8b061636..fe6184862 100644
--- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java
+++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationMaterialInventory/service/ReservationMaterialInventoryApplicationService.java
@@ -57,15 +57,16 @@ public class ReservationMaterialInventoryApplicationService {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null && loginUser.getUserPo() != null) {
Long loginTopOrgId = loginUser.getUserPo().getTopOrganizationId();
- Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
- boolean isTopOrgUser = userOrganizationId != null && userOrganizationId.equals(loginTopOrgId);
// 出库预约-添加货物:按一级组织(租户)过滤;委托方(货主)叠加货主维度查自己的货
+ // 委托方判定以"挂货主企业"为准,不再按组织层级判定,
+ // 避免二级组织(谷丰2842/仓码2841等)运营人员被误判为委托方、强制按本人userId过滤导致查不到库存
materialInventoryDO.setOrganizationId(null);
if (loginTopOrgId != null && loginTopOrgId != 1) {
materialInventoryDO.setTopOrganizationId(loginTopOrgId);
}
- if (!isTopOrgUser && materialInventoryDO.getShipperId() == null) {
+ boolean isShipperUser = StringUtils.isNotBlank(loginUser.getUserPo().getShipperEnterpriseName());
+ if (isShipperUser && materialInventoryDO.getShipperId() == null) {
materialInventoryDO.setShipperId(loginUser.getUserPo().getUserId());
}
}
diff --git a/mhd_oms/src/main/resources/mapper/executionStockInOrder/ExecutionStockInOrderMapper.xml b/mhd_oms/src/main/resources/mapper/executionStockInOrder/ExecutionStockInOrderMapper.xml
index 1caf7aa6c..e241f6801 100644
--- a/mhd_oms/src/main/resources/mapper/executionStockInOrder/ExecutionStockInOrderMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/executionStockInOrder/ExecutionStockInOrderMapper.xml
@@ -229,7 +229,12 @@
and a.notice_number = #{noticeNumber}
- and a.in_order_number = #{inOrderNumber}
+ and a.in_order_number like concat('%', #{inOrderNumber}, '%')
+
+
+
+ and (a.business_in_order_number like concat('%', #{businessInOrderNumber}, '%')
+ or a.in_order_number like concat('%', #{businessInOrderNumber}, '%'))
and a.status = #{status}
@@ -451,11 +456,10 @@
and a.RESERVATION_ORDER_SOURCE = #{reservationOrderSource}
+
- and a.BUSINESS_NUMBER = #{businessNumber}
-
-
- and a.create_by_name like concat('%', #{createByName}, '%')
+ and (a.business_in_order_number like concat('%', #{businessNumber}, '%')
+ or a.in_order_number like concat('%', #{businessNumber}, '%'))
and a.storage_time >= #{storageTimeStart}
diff --git a/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml
index 63fd13a93..8e11d236b 100644
--- a/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml
+++ b/mhd_oms/src/main/resources/mapper/reservationMaterialInventory/MaterialInventoryMapper.xml
@@ -88,15 +88,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-
- and b.shipper_id = #{shipperId}
-
-
- and b.shipper_code like concat('%', #{shipperCode}, '%')
-
-
- and b.shipper_name like concat('%', #{shipperName}, '%')
-
and b.material_code = #{materialCode}
@@ -123,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and b.material_type_name like concat('%', #{materialTypeName}, '%')
- and (b.shipper_code like concat('%', #{shipperInfo}, '%') or b.shipper_name like concat('%', #{shipperInfo}, '%'))
+ and (a.shipper_code like concat('%', #{shipperInfo}, '%') or a.shipper_name like concat('%', #{shipperInfo}, '%'))
and (b.material_code = #{materialInfo} or b.material_name like concat('%', #{materialInfo}, '%') or b.bar_code = #{materialInfo})
@@ -175,9 +166,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and a.warehouse_id = #{warehouseId}
+
and a.shipper_id = #{shipperId}
+
+ and a.shipper_code like concat('%', #{shipperCode}, '%')
+
+
+ and a.shipper_name like concat('%', #{shipperName}, '%')
+
and a.warehouse_code = #{warehouseCode}