diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index c848ddac..c5d09503 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -573,12 +573,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl roleIds = roles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); - List workNodes = workNodeService.list(new LambdaQueryWrapper() - .and(i -> - i.eq(InspectionWorkNode::getInspectionInfoId, id) - .in(InspectionWorkNode::getRoleId, roleIds) - .eq(InspectionWorkNode::getStatus, status) - )); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(InspectionWorkNode::getInspectionInfoId, id); + wrapper.eq(InspectionWorkNode::getStatus, status); + InspectionInfo inspectionInfo = baseMapper.selectById(id); + if (!inspectionInfo.getLeadManId().equals(userId)){ + wrapper.in(InspectionWorkNode::getRoleId, roleIds); + } + List workNodes = workNodeService.list(wrapper); if (CollUtil.isEmpty(workNodes)){ throw exception0(500, "查询节点为空"); }