From 39541c700550e5a54084c95fb3725fc50dfafd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E9=B8=BF=E5=B1=95?= <18031053041@163.com> Date: Thu, 2 Apr 2026 16:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E5=8D=95=EF=BC=8C=E6=8C=89=E7=85=A7=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E4=B8=BA=E5=BA=93=E7=AE=A1=E6=9D=A5=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=8A=B6=E6=80=81=E4=B8=BA=E5=B7=B2=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StockInOrderApplicationService.java | 29 ++++++++++++++++++ .../StockOutOrderApplicationService.java | 30 +++++++++++++++++++ .../stockInOrder/StockInOrderMapper.xml | 4 +-- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java index c746d8c57..c2cb61e60 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockInOrder/StockInOrderApplicationService.java @@ -125,6 +125,35 @@ public class StockInOrderApplicationService { } } } + + // 库管角色过滤:不展示已创建(status=1)的入库单 + // 说明:部分场景下角色码可能不在 userPo.roleCode 中,而在 loginUser.roles/roleList 中。 + if (loginUser != null) { + String targetRoleCode = "KGY-001"; + boolean isKuGuan = false; + + String roleCode = loginUser.getUserPo() != null ? loginUser.getUserPo().getRoleCode() : null; + if (StringUtils.isNotBlank(roleCode) && roleCode.contains(targetRoleCode)) { + isKuGuan = true; + } + + if (!isKuGuan && loginUser.getRoleList() != null) { + isKuGuan = loginUser.getRoleList().stream() + .anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode)); + } + + if (!isKuGuan && loginUser.getRoles() != null) { + isKuGuan = loginUser.getRoles().stream() + .anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode)); + } + + if (isKuGuan) { + Integer currentGtStatus = stockInOrderDO.getGtStatus(); + if (currentGtStatus == null || currentGtStatus < 1) { + stockInOrderDO.setGtStatus(1); // status > 1 + } + } + } return stockInOrderDomainService.queryList(stockInOrderDO); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java index e30e3e674..e8a6c9633 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/stockOutOrder/StockOutOrderApplicationService.java @@ -148,6 +148,36 @@ public class StockOutOrderApplicationService { } } } + + // 库管角色过滤:不展示已创建(status=1)的出库单 + // 出库状态: 1-已创建 ... + if (loginUser != null) { + String targetRoleCode = "KGY-001"; + boolean isKuGuan = false; + + String roleCode = loginUser.getUserPo() != null ? loginUser.getUserPo().getRoleCode() : null; + if (StringUtils.isNotBlank(roleCode) && roleCode.contains(targetRoleCode)) { + isKuGuan = true; + } + + if (!isKuGuan && loginUser.getRoleList() != null) { + isKuGuan = loginUser.getRoleList().stream() + .anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode)); + } + + if (!isKuGuan && loginUser.getRoles() != null) { + isKuGuan = loginUser.getRoles().stream() + .anyMatch(rc -> StringUtils.isNotBlank(rc) && rc.contains(targetRoleCode)); + } + + if (isKuGuan) { + Integer currentGtStatus = stockOutOrderDO.getGtStatus(); + if (currentGtStatus == null || currentGtStatus < 1) { + stockOutOrderDO.setGtStatus(1); // status > 1 + } + } + } + List stockOutOrderPOS = stockOutOrderDomainService.queryList(stockOutOrderDO); for (StockOutOrderPO stockOutOrderPO : stockOutOrderPOS) { StockOutOrderPO stockOutOrderPO1 = stockOutOrderDomainService.getInfoChildren(stockOutOrderPO.getOutOrderId()); diff --git a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml index 6e75010e5..52620173c 100644 --- a/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml +++ b/mhd_wms/src/main/resources/mapper/stockInOrder/StockInOrderMapper.xml @@ -200,10 +200,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.status = #{status} - and a.status < #{status} + and a.status < #{ltStatus} - and a.status > #{status} + and a.status > #{gtStatus} and a.audit_status = #{auditStatus}