Browse Source

#流程统计修改

zhongwei
yang_shj 1 year ago
parent
commit
ce3cb427b1
  1. 4
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/inspect/impl/TaskServiceImpl.java
  2. 5
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/business/impl/PhenomenonServiceImpl.java
  3. 9
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

4
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<TaskMapper, TaskEntity> imp
task.setInspectTaskIds(tasks.stream().map(TaskEntity::getId).map(Object::toString).collect(Collectors.joining(",")));
task.setInspectTaskSum(tasks.size());
// 所有处理完成巡检任务
List<TaskEntity> finshList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(3)).collect(Collectors.toList());
List<TaskEntity> 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<TaskEntity> notExecuteList = tasks.stream().filter(o-> null != o.getStatus() && o.getStatus().equals(0)).collect(Collectors.toList());
List<TaskEntity> 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;
}

5
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 BaseServiceImpl<PhenomenonMapper, Ope
defectVO.setTotalIds(operPhenomenonList.stream().map(o->String.valueOf(o.getId())).collect(Collectors.joining(",")));
defectVO.setDefectSum(operPhenomenonList.size());
// 消缺数
List<Long> defectList = operPhenomenonList.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
List<Long> 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<PhenomenonMapper, Ope
}
// 消缺数
shortagesVo.setShortagesSum(defects.size());
List<Long> shortagesList = defects.stream().filter(o -> (Func.isNotEmpty(o.getIsDefect()) && o.getIsDefect() == 0) || "1".equals(o.getConclusionStatus())).
map(OperPhenomenonEntity::getId).collect(Collectors.toList());
List<Long> shortagesList = defects.stream().filter(defect-> !ObjectUtil.isEmpty(defect.getHandleTaskId())).map(OperPhenomenonEntity::getId).collect(Collectors.toList());
if(CollectionUtil.isEmpty(shortagesList)){
shortagesVo.setShortages(0);
}

9
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -545,8 +545,13 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> 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);
// 获取机器人信息

Loading…
Cancel
Save