无关风月
2 天以前 2fee40486f9473398be3c293e8311d45bd53adc9
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTaskCleanServiceImpl.java
@@ -20,6 +20,7 @@
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;
@@ -163,16 +164,36 @@
        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;