|
|
@@ -2,6 +2,7 @@ package cn.start.tz.module.pressure2.service.equippipescheduling;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.collection.ListUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.start.tz.framework.common.exception.ServiceException;
|
|
|
import cn.start.tz.framework.common.pojo.CommonResult;
|
|
|
import cn.start.tz.framework.ip.core.Area;
|
|
|
@@ -1326,7 +1327,7 @@ public class EquipPipeSchedulingServiceImpl extends ServiceImpl<EquipPipeSchedul
|
|
|
.toList();
|
|
|
|
|
|
// 查询检验员和团队信息
|
|
|
- Map<String, List<EquipPipeSchedulingUserDO>> taskIdToUsersMap = new HashMap<>();
|
|
|
+ Map<String, List<EquipPipeSchedulingUserDO>> taskIdToUsersMap;
|
|
|
if (!taskIds.isEmpty()) {
|
|
|
List<EquipPipeSchedulingUserDO> schedulingUsers = equipPipeSchedulingUserMapper.selectList(
|
|
|
new LambdaQueryWrapperX<EquipPipeSchedulingUserDO>()
|
|
|
@@ -1338,6 +1339,8 @@ public class EquipPipeSchedulingServiceImpl extends ServiceImpl<EquipPipeSchedul
|
|
|
taskIdToUsersMap = schedulingUsers.stream()
|
|
|
.filter(user -> user.getSchedulingId() != null) // 过滤掉 schedulingId 为 null 的记录
|
|
|
.collect(Collectors.groupingBy(EquipPipeSchedulingUserDO::getSchedulingId));
|
|
|
+ } else {
|
|
|
+ taskIdToUsersMap = new HashMap<>();
|
|
|
}
|
|
|
|
|
|
// 查询任务ID对应的设备ID列表
|
|
|
@@ -1421,6 +1424,28 @@ public class EquipPipeSchedulingServiceImpl extends ServiceImpl<EquipPipeSchedul
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 根据检验员姓名过滤
|
|
|
+ if (StringUtils.isNotBlank(pageReqVO.getCheckerName())) {
|
|
|
+ pipeShiftScheduleItemRespVOS = pipeShiftScheduleItemRespVOS.stream()
|
|
|
+ .filter(item -> {
|
|
|
+ String taskId = item.getTaskId();
|
|
|
+ if (taskId == null || !taskIdToUsersMap.containsKey(taskId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ List<EquipPipeSchedulingUserDO> users = taskIdToUsersMap.get(taskId);
|
|
|
+ if (users == null || users.isEmpty()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return users.stream()
|
|
|
+ .map(EquipPipeSchedulingUserDO::getUserId)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .map(userIdToUserMap::get)
|
|
|
+ .filter(Objects::nonNull)
|
|
|
+ .anyMatch(user -> StrUtil.contains(user.getNickname(), pageReqVO.getCheckerName()));
|
|
|
+ })
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
// 处理数据,确保所有字段都有值
|
|
|
for (PipeShiftScheduleRespVO item : pipeShiftScheduleItemRespVOS) {
|
|
|
// 设置状态
|