diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java index 0aea939..0bd0b13 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java @@ -758,13 +758,13 @@ public class TaskServiceImpl extends BaseServiceImpl imp task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(","))); task.setInspectTaskSum(tasks.size()); // 所有处理完成巡检任务 - List finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList()); + List finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(4)).collect(Collectors.toList()); if(CollectionUtil.isEmpty(finshList)){ return task; } task.setInspectTaskFinish(finshList.size()); // 未执行任务数 - List notExecuteList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(0)).collect(Collectors.toList()); + List notExecuteList = tasks.stream().filter(o-> !finshList.stream().map(TaskEntity::getId).collect(Collectors.toList()).contains(o.getId())).collect(Collectors.toList()); if(CollectionUtil.isEmpty(notExecuteList)){ return task; } diff --git a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java index 314cf00..9cfa208 100644 --- a/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java +++ b/hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java @@ -81,7 +81,7 @@ public class PhenomenonServiceImpl extends BaseServiceImplString.valueOf(o.getId())).collect(Collectors.joining(","))); defectVO.setDefectSum(operPhenomenonList.size()); // 消缺数 - List defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())). + List defectList = operPhenomenonList.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())). map(OperPhenomenonEntity::getId).collect(Collectors.toList()); if(CollectionUtil.isEmpty(defectList)){ defectVO.setDefect(0); @@ -118,8 +118,7 @@ public class PhenomenonServiceImpl extends BaseServiceImpl shortagesList = defects.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())). - map(OperPhenomenonEntity::getId).collect(Collectors.toList()); + List shortagesList = defects.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList()); if(CollectionUtil.isEmpty(shortagesList)){ shortagesVo.setShortages(0); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java index d7527c4..61b1c82 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java @@ -545,8 +545,13 @@ public class TaskServiceImpl extends BaseServiceImpl imp .filter(Func::isNotEmpty).map(String::valueOf).collect(Collectors.joining(",")); // 获取巡检任务人员名称 String userNames = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId).filter(Func::isNotEmpty) - .map(UserCache::getUser).map(user -> Optional.ofNullable(user).map(User::getName).orElse("")) - .collect(Collectors.joining(",")); + .map(userId -> { + User user = UserCache.getUser(userId); + if(ObjectUtil.isEmpty(user)){ + return ""; + } + return user.getName(); + }).collect(Collectors.joining(",")); taskVo.setUserIds(userIds); taskVo.setUserNames(userNames); // 获取机器人信息