fix(oms):入库执行单列表单号搜索查不到,businessNumber死条件改单号模糊互查;库存查询货主过滤移回主表并修正委托方误判

- 入库执行单列表:businessNumber条件原为BUSINESS_NUMBER精确等值,该列无写入恒空致全条件查询0条,改为业务单号/入库单号OR模糊互查

- 入库执行单列表:inOrderNumber精确等值改模糊like;删除重复的createByName条件;补businessInOrderNumber过滤(业务单号/入库单号互查)
- 库存查询:货主过滤(shipperId/Code/Name/shipperInfo)从物料表b移回库存主表a,避免LEFT JOIN退化INNER JOIN丢行
- 库存查询:委托方判定由组织层级改为UserPo.shipperEnterpriseName,避免二级组织运营人员(2841/2842)被误判强制按本人userId过滤
This commit is contained in:
rcx
2026-08-20 10:17:16 +08:00
parent cc943d164b
commit ef13d890be
3 changed files with 21 additions and 18 deletions
@@ -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());
}
}