xuhy
10 天以前 fbff8d87d3e4c7a99725bfc25d8e616bdb373d46
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/WorkbenchesController.java
@@ -115,12 +115,21 @@
            if (deptType == 1) {
                // 查询片区
                TProjectDept projectDept = projectDeptService.getById(deptId);
                // 查询项目部
                TProjectDept parent = projectDeptService.getById(projectDept.getParentId());
                List<TProjectDept> children = new ArrayList<>();
                children.add(projectDept);
                parent.setChildren(children);
                projectDeptList.add(parent);
                if("0".equals(projectDept.getParentId())){
                    // 查询项目部
                    List<TProjectDept> childProjectDept = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                            .eq(TProjectDept::getStatus,1)
                            .eq(TProjectDept::getParentId,projectDept.getId()));
                    projectDept.setChildren(childProjectDept);
                    projectDeptList.add(projectDept);
                }else {
                    // 查询项目部
                    TProjectDept parent = projectDeptService.getById(projectDept.getParentId());
                    List<TProjectDept> children = new ArrayList<>();
                    children.add(projectDept);
                    parent.setChildren(children);
                    projectDeptList.add(parent);
                }
            }else {
                projectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                        .eq(TProjectDept::getStatus,1)
@@ -180,8 +189,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -305,10 +323,9 @@
        Long userId = tokenService.getLoginUser().getUserId();
        TaskSituationVO taskSituationVO = new TaskSituationVO();
        LambdaQueryWrapper<TTask> wrapper = new LambdaQueryWrapper<>();
        if(StringUtils.isEmpty(query.getStartTime()) || StringUtils.isNotEmpty(query.getEndTime())){
        if(StringUtils.isEmpty(query.getStartTime()) || StringUtils.isEmpty(query.getEndTime())){
            LocalDate now = LocalDate.now();
            String startTime = now.minusDays(6) + " 00:00:00";
            String endTime = now + " 23:59:59";
@@ -337,8 +354,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -511,8 +537,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -674,8 +709,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -788,8 +832,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -943,8 +996,17 @@
            if (deptType == 1) {
                // 项目部人员
                if(CollectionUtils.isEmpty(query.getProjectId())){
                    TProjectDept projectDept = projectDeptService.getById(deptId);
                    List<String> projectIds = new ArrayList<>();
                    projectIds.add(deptId);
                    if("0".equals(projectDept.getParentId())){
                        List<TProjectDept> tProjectDeptList = projectDeptService.list(Wrappers.lambdaQuery(TProjectDept.class)
                                .eq(TProjectDept::getStatus, 1)
                                .eq(TProjectDept::getParentId, projectDept.getId()));
                        List<String> ids = tProjectDeptList.stream().map(TProjectDept::getId).collect(Collectors.toList());
                        projectIds.addAll(ids);
                    }else {
                        projectIds.add(deptId);
                    }
                    query.setProjectId(projectIds);
                }
            }else {
@@ -986,6 +1048,7 @@
            List<TTaskDetail> taskDetails = tTaskDetailService.list(Wrappers.lambdaQuery(TTaskDetail.class)
                    .in(TTaskDetail::getTaskId, taskIds)
                    .eq(TTaskDetail::getClearStatus, 2)
                    .eq(TTaskDetail::getHandleType,1)
                    .orderByDesc(TTaskDetail::getCreateTime));
            List<TTaskDetail> taskDetailList = new ArrayList<>();
            for (TTask task : list) {
@@ -1001,7 +1064,7 @@
                    .eq(TDictData::getDataType, 2));
            List<AnalysisUnqualifiedCleaningDetailVO> analysisUnqualifiedCleaningDetailVOS = new ArrayList<>();
            for (TDictData tDictData : dictDataList) {
                List<TTaskDetail> tTaskDetails = taskDetailList.stream().filter(taskDetail -> taskDetail.getUnqualified().equals(tDictData.getId())).collect(Collectors.toList());
                List<TTaskDetail> tTaskDetails = taskDetailList.stream().filter(taskDetail -> StringUtils.isNotEmpty(taskDetail.getUnqualified())&&taskDetail.getUnqualified().equals(tDictData.getId())).collect(Collectors.toList());
                AnalysisUnqualifiedCleaningDetailVO analysisUnqualifiedCleaningDetailVO = new AnalysisUnqualifiedCleaningDetailVO();
                analysisUnqualifiedCleaningDetailVO.setUnqualifiedName(tDictData.getDataContent());
                analysisUnqualifiedCleaningDetailVO.setCount(tTaskDetails.size());
@@ -1054,6 +1117,7 @@
            List<String> taskIds = tasks.stream().map(TTask::getId).collect(Collectors.toList());
            List<TTaskDetail> taskDetails = tTaskDetailService.list(Wrappers.lambdaQuery(TTaskDetail.class)
                    .in(TTaskDetail::getTaskId, taskIds)
                    .eq(TTaskDetail::getHandleType,1)
                    .eq(TTaskDetail::getClearStatus, 2)
                    .orderByDesc(TTaskDetail::getCreateTime));
            List<TTaskDetail> taskDetailList = new ArrayList<>();
@@ -1070,7 +1134,7 @@
                    .eq(TDictData::getDataType, 2));
            List<AnalysisUnqualifiedCleaningDetailVO> analysisUnqualifiedCleaningDetailVOS = new ArrayList<>();
            for (TDictData tDictData : dictDataList) {
                List<TTaskDetail> tTaskDetails = taskDetailList.stream().filter(taskDetail -> taskDetail.getUnqualified().equals(tDictData.getId())).collect(Collectors.toList());
                List<TTaskDetail> tTaskDetails = taskDetailList.stream().filter(taskDetail -> StringUtils.isNotEmpty(taskDetail.getUnqualified())&&taskDetail.getUnqualified().equals(tDictData.getId())).collect(Collectors.toList());
                AnalysisUnqualifiedCleaningDetailVO analysisUnqualifiedCleaningDetailVO = new AnalysisUnqualifiedCleaningDetailVO();
                analysisUnqualifiedCleaningDetailVO.setUnqualifiedName(tDictData.getDataContent());
                analysisUnqualifiedCleaningDetailVO.setCount(tTaskDetails.size());