| | |
| | | import com.ruoyi.system.vo.system.TaskListVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | List<TDept> deptList = deptMapper.selectList(Wrappers.lambdaQuery(TDept.class)); |
| | | List<TProjectDept> projectDeptList = projectDeptMapper.selectList(Wrappers.lambdaQuery(TProjectDept.class)); |
| | | |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | |
| | | List<String> taskIds = list.stream().map(TLocationTaskListVO::getId).collect(Collectors.toList()); |
| | | List<TTaskDetail> taskDetails = taskDetailMapper.selectList(Wrappers.lambdaQuery(TTaskDetail.class) |
| | | .in(TTaskDetail::getTaskId,taskIds) |
| | | .orderByDesc(BaseModel::getCreateTime)); |
| | | |
| | | for (TLocationTaskListVO tLocationTaskListVO : list) { |
| | | if(tLocationTaskListVO.getDeptType()==1){ |
| | | projectDeptList.stream().filter(e -> e.getId().equals(tLocationTaskListVO.getDeptId())).findFirst().ifPresent(e -> { |
| | | tLocationTaskListVO.setDeptName(e.getProjectName()); |
| | | if("0".equals(e.getParentId())){ |
| | | tLocationTaskListVO.setDeptName(e.getProjectName()); |
| | | }else { |
| | | projectDeptList.stream().filter(ee -> ee.getId().equals(e.getParentId())).findFirst().ifPresent(ee -> { |
| | | tLocationTaskListVO.setDeptName(ee.getProjectName()); |
| | | }); |
| | | } |
| | | }); |
| | | }else { |
| | | deptList.stream().filter(e -> e.getId().equals(tLocationTaskListVO.getDeptId())).findFirst().ifPresent(e -> { |
| | | tLocationTaskListVO.setDeptName(e.getDeptName()); |
| | | }); |
| | | } |
| | | |
| | | taskDetails.stream().filter(e -> e.getTaskId().equals(tLocationTaskListVO.getId())).findFirst().ifPresent(e -> { |
| | | tLocationTaskListVO.setClearStatus(e.getClearStatus()); |
| | | }); |
| | | |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |