引车员可以选择操作工单所有项目

This commit is contained in:
xiaofajia 2024-12-11 13:40:36 +08:00
parent 5524a08201
commit fdfaab6ef7

View File

@ -573,12 +573,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
throw exception0(500, "查询角色为空");
}
List<Long> roleIds = roles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
List<InspectionWorkNode> workNodes = workNodeService.list(new LambdaQueryWrapper<InspectionWorkNode>()
.and(i ->
i.eq(InspectionWorkNode::getInspectionInfoId, id)
.in(InspectionWorkNode::getRoleId, roleIds)
.eq(InspectionWorkNode::getStatus, status)
));
LambdaQueryWrapper<InspectionWorkNode> 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<InspectionWorkNode> workNodes = workNodeService.list(wrapper);
if (CollUtil.isEmpty(workNodes)){
throw exception0(500, "查询节点为空");
}