| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public PageInfo<TaskListVO> pageList(TaskListQuery query) { |
| | | PageInfo<TaskListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TaskListVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | |
| | | List<TTaskDetail> tTaskDetails = taskDetailMapper.selectList(new LambdaQueryWrapper<TTaskDetail>() |
| | | .orderByDesc(BaseModel::getCreateTime) |
| | | .in(TTaskDetail::getHandleType,Arrays.asList(1,4))); |
| | | List<String> collect = list.stream().map(TTask::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | return pageInfo; |
| | | } |
| | | List<TTaskDetail> taskDetails = taskDetailMapper.selectList(Wrappers.lambdaQuery(TTaskDetail.class) |
| | | .in(TTaskDetail::getTaskId, collect) |
| | | .eq(TTaskDetail::getClearStatus, 2) |
| | | .eq(TTaskDetail::getHandleType,1) |
| | | .orderByDesc(TTaskDetail::getCreateTime)); |
| | | taskDetails = new ArrayList<>(taskDetails.stream() |
| | | .collect(Collectors.groupingBy( |
| | | TTaskDetail::getTaskId, |
| | | Collectors.collectingAndThen( |
| | | Collectors.toList(), |
| | | listAll -> listAll.get(0) |
| | | ) |
| | | )) |
| | | .values()); |
| | | |
| | | for (TaskListVO temp : list) { |
| | | SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(temp.getPatrolInspector())); |
| | |
| | | } |
| | | } |
| | | } |
| | | TTaskDetail tTaskDetail = tTaskDetails.stream().filter(e -> e.getTaskId().equals(temp.getId())).findFirst().orElse(null); |
| | | TTaskDetail tTaskDetail = taskDetails.stream().filter(e -> e.getTaskId().equals(temp.getId())).findFirst().orElse(null); |
| | | if (tTaskDetail!=null){ |
| | | temp.setPicture(tTaskDetail.getPicture()); |
| | | temp.setClearStatus(tTaskDetail.getClearStatus()); |