|
|
|
@ -794,7 +794,27 @@ public class ErfExpApplyServiceImpl extends ServiceImpl<ErfExpApplyMapper, ErfEx |
|
|
|
|
|
|
|
// 特殊处理:如果当前是并发审批阶段,需要返回用户实际的审批节点 |
|
|
|
if ("生产和质量经理审批".equals(currentNodeCode)) { |
|
|
|
// 查询当前用户在该申请单中待审核的节点 |
|
|
|
// 工程实验申请管理员:不限定 assignee,取第一个待审核子节点代为审批 |
|
|
|
if (currentUserId != null) { |
|
|
|
List<UserRoleDto> adminRoles = |
|
|
|
sysUserDao.getUserRolesByRoleNames(currentUserId, List.of("工程实验申请管理员")); |
|
|
|
if (!adminRoles.isEmpty()) { |
|
|
|
QueryWrapper<ErfFlowNodeInstance> adminNodeQuery = new QueryWrapper<>(); |
|
|
|
adminNodeQuery.eq("apply_no", applyNo) |
|
|
|
.eq("status", "待审核") |
|
|
|
.in("node_code", "生产经理审批", "质量经理审批") |
|
|
|
.orderByAsc("node_code") |
|
|
|
.last("OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY"); |
|
|
|
ErfFlowNodeInstance adminNodeInstance = erfFlowNodeInstanceMapper.selectOne(adminNodeQuery); |
|
|
|
if (adminNodeInstance != null) { |
|
|
|
log.info("管理员用户{}代理审批,实际节点: {}", currentUserId, adminNodeInstance.getNodeCode()); |
|
|
|
return adminNodeInstance.getNodeCode(); |
|
|
|
} |
|
|
|
throw new XJException("未找到待审核的并发审批节点"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 普通用户:查询当前用户在该申请单中待审核的节点 |
|
|
|
QueryWrapper<ErfFlowNodeInstance> nodeQuery = new QueryWrapper<>(); |
|
|
|
nodeQuery.eq("apply_no", applyNo) |
|
|
|
.eq("assignee_user_id", currentUserId) |
|
|
|
|