|
|
@ -524,18 +524,24 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<TaskVo> page(TaskDTO taskDTO) { |
|
|
|
public BladePage<TaskVo> page(TaskDTO taskDTO) { |
|
|
|
Query query = new Query(); |
|
|
|
Query query = new Query(); |
|
|
|
query.setSize(taskDTO.getSize()); |
|
|
|
query.setSize(taskDTO.getSize()); |
|
|
|
query.setCurrent(taskDTO.getCurrent()); |
|
|
|
query.setCurrent(taskDTO.getCurrent()); |
|
|
|
TaskEntity request = BeanUtil.copy(taskDTO,TaskEntity.class); |
|
|
|
IPage<TaskVo> pages = Condition.getPage(query); |
|
|
|
LambdaQueryWrapper<TaskEntity> queryWrapper = Condition.getQueryWrapper(TaskEntity.class,request); |
|
|
|
List<TaskVo> list = this.baseMapper.getAllPageList(pages,taskDTO); |
|
|
|
getQueryWrapper(taskDTO, queryWrapper); |
|
|
|
list = list.stream().map(taskVo -> { |
|
|
|
IPage page = this.page(Condition.getPage(query), queryWrapper); |
|
|
|
// 获取机器人信息
|
|
|
|
List<TaskEntity> records = page.getRecords(); |
|
|
|
if (taskVo.getAutoVideo().equals(PlanContants.InspectTypeEnum.ROBOT.getVal()) ) { |
|
|
|
List<TaskVo> taskVos = getTaskVos(records); |
|
|
|
if (Func.isNotEmpty( ObjectUtil.isNotEmpty(taskVo.getUserId()))) { |
|
|
|
page.setRecords(taskVos); |
|
|
|
taskVo.setRobot(robotService.getDetailByUserId(taskVo.getUserId())); |
|
|
|
return page; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return taskVo; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
pages.setRecords(list); |
|
|
|
|
|
|
|
BladePage<TaskVo> bladePage = BladePage.of(pages); |
|
|
|
|
|
|
|
return bladePage; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void getQueryWrapper(TaskDTO taskDTO, LambdaQueryWrapper<TaskEntity> queryWrapper) { |
|
|
|
private void getQueryWrapper(TaskDTO taskDTO, LambdaQueryWrapper<TaskEntity> queryWrapper) { |
|
|
@ -1020,10 +1026,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<InspectTaskExportVO> exportTaskList(TaskDTO task) { |
|
|
|
public List<InspectTaskExportVO> exportTaskList(TaskDTO task) { |
|
|
|
TaskEntity request = BeanUtil.copy(task,TaskEntity.class); |
|
|
|
List<TaskVo> taskEntities = super.baseMapper.getAllExportList(task); |
|
|
|
LambdaQueryWrapper<TaskEntity> queryWrapper = Condition.getQueryWrapper(TaskEntity.class,request); |
|
|
|
|
|
|
|
getQueryWrapper(task, queryWrapper); |
|
|
|
|
|
|
|
List<TaskEntity> taskEntities = super.baseMapper.selectList(queryWrapper); |
|
|
|
|
|
|
|
List<InspectTaskExportVO> list=new ArrayList<>(); |
|
|
|
List<InspectTaskExportVO> list=new ArrayList<>(); |
|
|
|
if (CollectionUtils.isNotEmpty(taskEntities)){ |
|
|
|
if (CollectionUtils.isNotEmpty(taskEntities)){ |
|
|
|
list=taskEntities.parallelStream().map(taskVo -> { |
|
|
|
list=taskEntities.parallelStream().map(taskVo -> { |
|
|
@ -1062,22 +1065,26 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> imp |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
resEntity.setContent("正常"); |
|
|
|
resEntity.setContent("正常"); |
|
|
|
} |
|
|
|
} |
|
|
|
if(ObjectUtil.isNotEmpty(taskVo.getId())) { |
|
|
|
if (ObjectUtil.isNotEmpty(taskVo.getUserNames())) { |
|
|
|
List<TaskUserEntity> taskUserList = taskUserService.list(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId, taskVo.getId())); |
|
|
|
resEntity.setUserName(taskVo.getUserNames()); |
|
|
|
if (CollectionUtil.isNotEmpty(taskUserList)) { |
|
|
|
} |
|
|
|
// 获取巡检任务人员名称
|
|
|
|
// if(ObjectUtil.isNotEmpty(taskVo.getId())) {
|
|
|
|
String userNames = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId).filter(Func::isNotEmpty) |
|
|
|
// List<TaskUserEntity> taskUserList = taskUserService.list(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId, taskVo.getId()));
|
|
|
|
.map(userId -> { |
|
|
|
// if (CollectionUtil.isNotEmpty(taskUserList)) {
|
|
|
|
User user = UserCache.getUser(userId); |
|
|
|
// // 获取巡检任务人员名称
|
|
|
|
if (ObjectUtil.isEmpty(user)) { |
|
|
|
// String userNames = taskUserList.stream().filter(Func::isNotEmpty).map(TaskUserEntity::getUserId).filter(Func::isNotEmpty)
|
|
|
|
return ""; |
|
|
|
// .map(userId -> {
|
|
|
|
} |
|
|
|
// User user = UserCache.getUser(userId);
|
|
|
|
return user.getName(); |
|
|
|
// if (ObjectUtil.isEmpty(user)) {
|
|
|
|
}).collect(Collectors.joining(",")); |
|
|
|
// return "";
|
|
|
|
resEntity.setUserName(userNames); |
|
|
|
// }
|
|
|
|
} |
|
|
|
// return user.getName();
|
|
|
|
} |
|
|
|
// }).collect(Collectors.joining(","));
|
|
|
|
|
|
|
|
// resEntity.setUserName(userNames);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
resEntity.setStatus(Optional.ofNullable(DictCache.getValue(TaskContants.TASK_STATUS, taskVo.getStatus())).orElse("")); |
|
|
|
resEntity.setStatus(Optional.ofNullable(DictCache.getValue(TaskContants.TASK_STATUS, taskVo.getStatus())).orElse("")); |
|
|
|
|
|
|
|
resEntity.setType(Optional.ofNullable(DictCache.getValue(TaskContants.INSPECT_TASK_TYPE, taskVo.getStatus())).orElse("")); |
|
|
|
return resEntity; |
|
|
|
return resEntity; |
|
|
|
}catch (Exception e){ |
|
|
|
}catch (Exception e){ |
|
|
|
log.error("巡检导出失败---》param"+taskVo+"报错信息:"+e.getStackTrace()); |
|
|
|
log.error("巡检导出失败---》param"+taskVo+"报错信息:"+e.getStackTrace()); |
|
|
|