入库单,出库单,按照用户角色为库管来过滤状态为已创建的
This commit is contained in:
+29
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+30
@@ -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<StockOutOrderPO> stockOutOrderPOS = stockOutOrderDomainService.queryList(stockOutOrderDO);
|
||||
for (StockOutOrderPO stockOutOrderPO : stockOutOrderPOS) {
|
||||
StockOutOrderPO stockOutOrderPO1 = stockOutOrderDomainService.getInfoChildren(stockOutOrderPO.getOutOrderId());
|
||||
|
||||
@@ -200,10 +200,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and a.status = #{status}
|
||||
</if>
|
||||
<if test="ltStatus != null ">
|
||||
and a.status < #{status}
|
||||
and a.status < #{ltStatus}
|
||||
</if>
|
||||
<if test="gtStatus != null ">
|
||||
and a.status > #{status}
|
||||
and a.status > #{gtStatus}
|
||||
</if>
|
||||
<if test="auditStatus != null ">
|
||||
and a.audit_status = #{auditStatus}
|
||||
|
||||
Reference in New Issue
Block a user