zhangjiansheng 10 months ago
parent
commit
33d8b0af7b

+ 53 - 56
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java

@@ -202,76 +202,73 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
202
         return success(postCheckedProblemService.historyProblemNumberView(type));
202
         return success(postCheckedProblemService.historyProblemNumberView(type));
203
     }
203
     }
204
 
204
 
205
-/*
206
     @ApiOperation("7-部门详情")
205
     @ApiOperation("7-部门详情")
207
     @GetMapping("/deptDetaailView")
206
     @GetMapping("/deptDetaailView")
208
-    public AjaxResult deptDetaailView() {
207
+    public AjaxResult deptDetaailView(CheckedProblemDeptDetaailView notParam) { //notParam不是参数-是返回信息-方便接口联调
209
 //         查询问题表
208
 //         查询问题表
210
 //        select * from "public"."post_checked_problem";
209
 //        select * from "public"."post_checked_problem";
211
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
210
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
212
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
211
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
213
 
212
 
214
 
213
 
215
-        List<DeptDetaailView> list = new ArrayList<>();
216
-
217
-        //TODO 第一步:得到4个职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
218
-        //TODO 第二步:遍历职责类别 -> (总数和已完成数)设置问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
219
-        DeptDetaailView data1 = new DeptDetaailView();
220
-//        data4.setdutyTypeOne //业务职责
221
-        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
222
-        DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
223
-//        child1.set完整性数量") private Integer problemComplete;
224
-//        child1.set适宜性数量") private Integer problemSuitable;
225
-//        child1.set有效性数量") private Integer problemEffective;
226
-//        child1.set已完成完整性数量") private Integer problemCompleteChecked;
227
-//        child1.set已完成适宜性数量") private Integer problemSuitableChecked;
228
-//        child1.set已完成有效性数量") private Integer problemEffectiveChecked;
229
-        children1.add(child1);
230
-        data1.setChildren(children1);
214
+        List<CheckedProblemDeptDetaailView> list = new ArrayList<>();
215
+
216
+        //TODO 第一步:得到各个部门ID、部门名称、问题总数量、重要问题数量、一般问题数量、统计时间
217
+        //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
218
+        //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
219
+
220
+
221
+        CheckedProblemDeptDetaailView data1 = new CheckedProblemDeptDetaailView();
222
+        data1.setDeptId(1l); //部门ID
223
+        data1.setDeptName("测试部门名称1");// 部门名称
224
+        data1.setProblemTotal(10); //问题数量
225
+        data1.setProblemLeveTwo(2); //重要问题
226
+        data1.setProblemLeveOne(8); //一般问题
227
+        data1.setStatisticsTime(new Date());// 统计时间
228
+
229
+//        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
230
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
231
+        child1.setProblemComplete(1); //child1.set完整性数量
232
+        child1.setProblemSuitable(2); //child1.set适宜性数量
233
+        child1.setProblemEffective(3);//child1.set有效性数量
234
+        //children1.add(child1);
235
+        //data1.setChildren(children1);
236
+        data1.getChildren().add(child1);
231
         list.add(data1);
237
         list.add(data1);
232
 
238
 
233
-        DeptDetaailView data2 = new DeptDetaailView();
234
-//        data4.setdutyTypeTwo 党建及党风廉政
235
-        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
236
-        DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
237
-//        child2.set完整性数量") private Integer problemComplete;
238
-//        child2.set适宜性数量") private Integer problemSuitable;
239
-//        child2.set有效性数量") private Integer problemEffective;
240
-//        child2.set已完成完整性数量") private Integer problemCompleteChecked;
241
-//        child2.set已完成适宜性数量") private Integer problemSuitableChecked;
242
-//        child2.set已完成有效性数量") private Integer problemEffectiveChecked;
243
-        children1.add(child2);
244
-        data2.setChildren(children2);
239
+        CheckedProblemDeptDetaailView data2 = new CheckedProblemDeptDetaailView();
240
+        data2.setDeptId(2l); //部门ID
241
+        data2.setDeptName("测试部门名称2");// 部门名称
242
+        data2.setProblemTotal(9); //问题数量
243
+        data2.setProblemLeveTwo(2); //重要问题
244
+        data2.setProblemLeveOne(7); //一般问题
245
+        data2.setStatisticsTime(new Date());// 统计时间
246
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child2 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
247
+        data2.getChildren().add(child2);
245
         list.add(data2);
248
         list.add(data2);
246
 
249
 
247
-        DeptDetaailView data3 = new DeptDetaailView();
248
-//        data4.setdutyTypeThree 安全环保职责
249
-        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
250
-        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
251
-//        child3.set完整性数量") private Integer problemComplete;
252
-//        child3.set适宜性数量") private Integer problemSuitable;
253
-//        child3.set有效性数量") private Integer problemEffective;
254
-//        child3.set已完成完整性数量") private Integer problemCompleteChecked;
255
-//        child3.set已完成适宜性数量") private Integer problemSuitableChecked;
256
-//        child3.set已完成有效性数量") private Integer problemEffectiveChecked;
257
-        children1.add(child3);
258
-        data3.setChildren(children3);
250
+        CheckedProblemDeptDetaailView data3 = new CheckedProblemDeptDetaailView();
251
+        data3.setDeptId(3l); //部门ID
252
+        data3.setDeptName("测试部门名称3");// 部门名称
253
+        data3.setProblemTotal(8); //问题数量
254
+        data3.setProblemLeveTwo(3); //重要问题
255
+        data3.setProblemLeveOne(5); //一般问题
256
+        data3.setStatisticsTime(new Date());// 统计时间
257
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child3 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
258
+        data3.getChildren().add(child3);
259
         list.add(data3);
259
         list.add(data3);
260
 
260
 
261
-        DeptDetaailView data4 = new DeptDetaailView();
262
-//        data4.setdutyTypeFour 合规保密职
263
-        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
264
-        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
265
-//        child4.set完整性数量") private Integer problemComplete;
266
-//        child4.set适宜性数量") private Integer problemSuitable;
267
-//        child4.set有效性数量") private Integer problemEffective;
268
-//        child4.set已完成完整性数量") private Integer problemCompleteChecked;
269
-//        child4.set已完成适宜性数量") private Integer problemSuitableChecked;
270
-//        child4.set已完成有效性数量") private Integer problemEffectiveChecked;
271
-        children1.add(child4);
272
-        data4.setChildren(children4);
261
+        CheckedProblemDeptDetaailView data4 = new CheckedProblemDeptDetaailView();
262
+        data4.setDeptId(4l); //部门ID
263
+        data4.setDeptName("测试部门名称4");// 部门名称
264
+        data4.setProblemTotal(6); //问题数量
265
+        data4.setProblemLeveTwo(1); //重要问题
266
+        data4.setProblemLeveOne(5); //一般问题
267
+        data4.setStatisticsTime(new Date());// 统计时间
268
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child4 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
269
+        data4.getChildren().add(child4);
273
         list.add(data4);
270
         list.add(data4);
274
-        return success(list);
271
+        Integer type = 1;
272
+        return success(postCheckedProblemService.deptDetaailView(type));
275
     }
273
     }
276
-    */
277
 }
274
 }

+ 10 - 27
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java

@@ -64,13 +64,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
64
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
64
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
65
 
65
 
66
 
66
 
67
-        List<CoverageRateView> list = new ArrayList<>();
68
-        CoverageRateView data = new CoverageRateView();
69
-        data.setProblemTotal(6);
70
-        data.setProblemComplete(5);
71
-
72
-        list.add(data);
73
-        return success(list);
67
+        Integer type = 2;
68
+        return success(postCheckedProblemService.coverageRateView(type));
74
     }
69
     }
75
 
70
 
76
     @ApiOperation("3-岗检问题职责类别占比")
71
     @ApiOperation("3-岗检问题职责类别占比")
@@ -81,15 +76,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
81
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
76
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
82
 
77
 
83
 
78
 
84
-        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
85
-        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
86
-        data.setDutyTypeOne(1);
87
-        data.setDutyTypeTwo(2);
88
-        data.setDutyTypeThree(3);
89
-        data.setDutyTypeFour(4);
90
-
91
-        list.add(data);
92
-        return success(list);
79
+        Integer type = 2;
80
+        return success(postCheckedProblemService.dutyTypeProblemStatisticsView(type));
93
     }
81
     }
94
 
82
 
95
     @ApiOperation("4-岗检问题级别占比")
83
     @ApiOperation("4-岗检问题级别占比")
@@ -99,14 +87,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
99
 //        select * from "public"."post_checked_problem";
87
 //        select * from "public"."post_checked_problem";
100
 //        group by problem_level   问题等级(一般、重要)
88
 //        group by problem_level   问题等级(一般、重要)
101
 
89
 
102
-        List<ProblemLevelView> list = new ArrayList<>();
103
-        ProblemLevelView data = new ProblemLevelView();
104
-        data.setProblemLeveOne(2);
105
-        data.setProblemLeveTwo(1);
106
-
107
-
108
-        list.add(data);
109
-        return success(list);
90
+        Integer type = 2;
91
+        return success(postCheckedProblemService.problemLevelView(type));
110
     }
92
     }
111
 
93
 
112
 
94
 
@@ -197,7 +179,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
197
         list.add(data6);
179
         list.add(data6);
198
 
180
 
199
 
181
 
200
-        return success(list);
182
+        Integer type = 2;
183
+        return success(postCheckedProblemService.problemAttributeCategoryView(type));
201
     }
184
     }
202
 
185
 
203
 
186
 
@@ -224,8 +207,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
224
 //        data.set任职资格
207
 //        data.set任职资格
225
 //        data.set其他
208
 //        data.set其他
226
 
209
 
227
-        list.add(data);
228
-        return success(list);
210
+        Integer type = 2;
211
+        return success(postCheckedProblemService.historyProblemNumberView(type));
229
     }
212
     }
230
 
213
 
231
 
214
 

+ 3 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostCheckedProblemService.java

@@ -11,6 +11,7 @@ import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
11
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
11
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
12
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
12
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
13
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
13
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
14
+import com.ruoyi.postCheck.domain.problemStatistics.CheckedProblemDeptDetaailView;
14
 import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
15
 import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
15
 import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
16
 import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
16
 import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
17
 import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
@@ -200,4 +201,6 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
200
     List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type);
201
     List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type);
201
 
202
 
202
     List<HistoryProblemNumberView>  historyProblemNumberView(Integer type);
203
     List<HistoryProblemNumberView>  historyProblemNumberView(Integer type);
204
+
205
+    List<CheckedProblemDeptDetaailView>  deptDetaailView(Integer type);
203
 }
206
 }

+ 138 - 41
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java

@@ -26,6 +26,7 @@ import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
26
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
26
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
27
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
27
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
28
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
28
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
29
+import com.ruoyi.postCheck.domain.problemStatistics.CheckedProblemDeptDetaailView;
29
 import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
30
 import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
30
 import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
31
 import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
31
 import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
32
 import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
@@ -746,16 +747,16 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
746
         if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
747
         if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
747
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
748
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
748
                 problemTotal++;
749
                 problemTotal++;
749
-                if (postCheckedProblem.getProblemAttribute() == 1){
750
+                if (postCheckedProblem.getProblemAttribute() == 1) {
750
                     problemComplete++;
751
                     problemComplete++;
751
                 }
752
                 }
752
-                if (postCheckedProblem.getProblemAttribute() == 2){
753
+                if (postCheckedProblem.getProblemAttribute() == 2) {
753
                     problemEffective++;
754
                     problemEffective++;
754
                 }
755
                 }
755
-                if (postCheckedProblem.getProblemAttribute() == 3){
756
+                if (postCheckedProblem.getProblemAttribute() == 3) {
756
                     problemSuitable++;
757
                     problemSuitable++;
757
                 }
758
                 }
758
-                if (postCheckedProblem.getProblemCategory() == null )
759
+                if (postCheckedProblem.getProblemCategory() == null)
759
                     continue;
760
                     continue;
760
                 if (postCheckedProblem.getProblemCategory().equals("1"))
761
                 if (postCheckedProblem.getProblemCategory().equals("1"))
761
                     problemCategoryOne++;
762
                     problemCategoryOne++;
@@ -790,8 +791,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
790
 //        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
791
 //        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
791
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
792
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
792
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
793
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
793
-        if (deptIdListByType == null && deptIdListByType.size() == 0){
794
-            throw new IllegalArgumentException("查询职能部门个数为:0");
794
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
795
+            return new ArrayList<>();
795
         }
796
         }
796
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
797
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
797
         // 查询职能问题数量
798
         // 查询职能问题数量
@@ -799,10 +800,10 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
799
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
800
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
800
         );
801
         );
801
         List<CoverageRateView> list = new ArrayList<>();
802
         List<CoverageRateView> list = new ArrayList<>();
802
-        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
803
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
803
             CoverageRateView data = new CoverageRateView();
804
             CoverageRateView data = new CoverageRateView();
804
             data.setProblemTotal(postCheckedProblems.size());
805
             data.setProblemTotal(postCheckedProblems.size());
805
-            List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getIsRectificationCompleted().equals(1)).collect(Collectors.toList());
806
+            List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getIsRectificationCompleted() != null && d.getIsRectificationCompleted().equals(1)).collect(Collectors.toList());
806
             data.setProblemComplete(collect.size());
807
             data.setProblemComplete(collect.size());
807
             list.add(data);
808
             list.add(data);
808
         }
809
         }
@@ -812,8 +813,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
812
     @Override
813
     @Override
813
     public List<DutyTypeProblemStatisticsView> dutyTypeProblemStatisticsView(Integer type) {
814
     public List<DutyTypeProblemStatisticsView> dutyTypeProblemStatisticsView(Integer type) {
814
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
815
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
815
-        if (deptIdListByType == null && deptIdListByType.size() == 0){
816
-            throw new IllegalArgumentException("查询职能部门个数为:0");
816
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
817
+            return new ArrayList<>();
817
         }
818
         }
818
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
819
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
819
         // 查询职能问题数量
820
         // 查询职能问题数量
@@ -821,18 +822,18 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
821
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
822
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
822
         );
823
         );
823
         List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
824
         List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
824
-        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
825
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
825
 //            @ApiModelProperty("业务职责")
826
 //            @ApiModelProperty("业务职责")
826
-             Integer dutyTypeOne = 0;
827
+            Integer dutyTypeOne = 0;
827
 
828
 
828
 //            @ApiModelProperty("党建及党风廉政")
829
 //            @ApiModelProperty("党建及党风廉政")
829
-             Integer dutyTypeTwo = 0;
830
+            Integer dutyTypeTwo = 0;
830
 
831
 
831
 //            @ApiModelProperty("安全环保职责")
832
 //            @ApiModelProperty("安全环保职责")
832
-             Integer dutyTypeThree = 0;
833
+            Integer dutyTypeThree = 0;
833
 
834
 
834
 //            @ApiModelProperty("合规保密职")
835
 //            @ApiModelProperty("合规保密职")
835
-             Integer dutyTypeFour = 0;
836
+            Integer dutyTypeFour = 0;
836
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
837
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
837
                 if (postCheckedProblem.getDutyType() == 1)
838
                 if (postCheckedProblem.getDutyType() == 1)
838
                     dutyTypeOne++;
839
                     dutyTypeOne++;
@@ -861,8 +862,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
861
 //        select * from "public"."post_checked_problem";
862
 //        select * from "public"."post_checked_problem";
862
 //        group by problem_level   问题等级(一般、重要)
863
 //        group by problem_level   问题等级(一般、重要)
863
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
864
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
864
-        if (deptIdListByType == null && deptIdListByType.size() == 0){
865
-            throw new IllegalArgumentException("查询职能部门个数为:0");
865
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
866
+            return new ArrayList<>();
866
         }
867
         }
867
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
868
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
868
         // 查询职能问题数量
869
         // 查询职能问题数量
@@ -870,7 +871,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
870
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
871
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
871
         );
872
         );
872
         List<ProblemLevelView> list = new ArrayList<>();
873
         List<ProblemLevelView> list = new ArrayList<>();
873
-        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
874
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
874
             List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getProblemLevel() != null && d.getProblemLevel().equals("2")).collect(Collectors.toList());
875
             List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getProblemLevel() != null && d.getProblemLevel().equals("2")).collect(Collectors.toList());
875
             ProblemLevelView data = new ProblemLevelView();
876
             ProblemLevelView data = new ProblemLevelView();
876
             data.setProblemLeveOne(collect.size());
877
             data.setProblemLeveOne(collect.size());
@@ -882,15 +883,15 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
882
     }
883
     }
883
 
884
 
884
     @Override
885
     @Override
885
-    public  List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type) {
886
+    public List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type) {
886
         //         查询问题表
887
         //         查询问题表
887
 //        select * from "public"."post_checked_problem";
888
 //        select * from "public"."post_checked_problem";
888
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
889
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
889
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
890
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
890
 
891
 
891
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
892
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
892
-        if (deptIdListByType == null && deptIdListByType.size() == 0){
893
-            throw new IllegalArgumentException("查询职能部门个数为:0");
893
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
894
+            return new ArrayList<>();
894
         }
895
         }
895
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
896
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
896
         // 查询职能问题数量
897
         // 查询职能问题数量
@@ -898,35 +899,35 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
898
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
899
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
899
         );
900
         );
900
         List<ProblemAttributeCategoryView> list = new ArrayList<>();
901
         List<ProblemAttributeCategoryView> list = new ArrayList<>();
901
-        if(postCheckedProblems!=null && postCheckedProblems.size() >0){
902
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
902
             Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getProblemCategory));
903
             Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getProblemCategory));
903
 //           问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
904
 //           问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
904
             for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
905
             for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
905
                 List<PostCheckedProblem> value = stringListEntry.getValue();
906
                 List<PostCheckedProblem> value = stringListEntry.getValue();
906
-                if (value!=null&&value.size()>0){
907
+                if (value != null && value.size() > 0) {
907
 
908
 
908
                     ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
909
                     ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
909
-                    if(stringListEntry.getKey().equals("1")){
910
+                    if (stringListEntry.getKey().equals("1")) {
910
                         data.setProblemCategoryType(1);
911
                         data.setProblemCategoryType(1);
911
                         data.setProblemCategoryTypeView("职责权限问题");
912
                         data.setProblemCategoryTypeView("职责权限问题");
912
                     }
913
                     }
913
-                    if(stringListEntry.getKey().equals("2")){
914
+                    if (stringListEntry.getKey().equals("2")) {
914
                         data.setProblemCategoryType(2);
915
                         data.setProblemCategoryType(2);
915
                         data.setProblemCategoryTypeView("工作内容问题");
916
                         data.setProblemCategoryTypeView("工作内容问题");
916
                     }
917
                     }
917
-                    if(stringListEntry.getKey().equals("3")){
918
+                    if (stringListEntry.getKey().equals("3")) {
918
                         data.setProblemCategoryType(3);
919
                         data.setProblemCategoryType(3);
919
                         data.setProblemCategoryTypeView("工作标准问题");
920
                         data.setProblemCategoryTypeView("工作标准问题");
920
                     }
921
                     }
921
-                    if(stringListEntry.getKey().equals("4")){
922
+                    if (stringListEntry.getKey().equals("4")) {
922
                         data.setProblemCategoryType(4);
923
                         data.setProblemCategoryType(4);
923
                         data.setProblemCategoryTypeView("考核奖励问题");
924
                         data.setProblemCategoryTypeView("考核奖励问题");
924
                     }
925
                     }
925
-                    if(stringListEntry.getKey().equals("5")){
926
+                    if (stringListEntry.getKey().equals("5")) {
926
                         data.setProblemCategoryType(5);
927
                         data.setProblemCategoryType(5);
927
                         data.setProblemCategoryTypeView("任职资格问题");
928
                         data.setProblemCategoryTypeView("任职资格问题");
928
                     }
929
                     }
929
-                    if(stringListEntry.getKey().equals("6")){
930
+                    if (stringListEntry.getKey().equals("6")) {
930
                         data.setProblemCategoryType(6);
931
                         data.setProblemCategoryType(6);
931
                         data.setProblemCategoryTypeView("其他");
932
                         data.setProblemCategoryTypeView("其他");
932
                     }
933
                     }
@@ -938,13 +939,13 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
938
                     int problemEffective = 0;
939
                     int problemEffective = 0;
939
 
940
 
940
                     for (PostCheckedProblem postCheckedProblem : value) {
941
                     for (PostCheckedProblem postCheckedProblem : value) {
941
-                        if (postCheckedProblem.getProblemAttribute() == 1){
942
+                        if (postCheckedProblem.getProblemAttribute() == 1) {
942
                             problemComplete++;
943
                             problemComplete++;
943
                         }
944
                         }
944
-                        if (postCheckedProblem.getProblemAttribute() == 2){
945
+                        if (postCheckedProblem.getProblemAttribute() == 2) {
945
                             problemEffective++;
946
                             problemEffective++;
946
                         }
947
                         }
947
-                        if (postCheckedProblem.getProblemAttribute() == 3){
948
+                        if (postCheckedProblem.getProblemAttribute() == 3) {
948
                             problemSuitable++;
949
                             problemSuitable++;
949
                         }
950
                         }
950
                     }
951
                     }
@@ -968,7 +969,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
968
 //        data.set其他
969
 //        data.set其他
969
 
970
 
970
 
971
 
971
-        return null;
972
+        return list;
972
     }
973
     }
973
 
974
 
974
     @Override
975
     @Override
@@ -980,8 +981,8 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
980
 
981
 
981
 
982
 
982
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
983
         List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
983
-        if (deptIdListByType == null && deptIdListByType.size() == 0){
984
-            throw new IllegalArgumentException("查询职能部门个数为:0");
984
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
985
+            return new ArrayList<>();
985
         }
986
         }
986
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
987
         List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
987
         // 查询职能问题数量
988
         // 查询职能问题数量
@@ -989,7 +990,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
989
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
990
                 .in(PostCheckedProblem::getCheckedDeptId, deptIds)
990
         );
991
         );
991
         List<HistoryProblemNumberView> list = new ArrayList<>();
992
         List<HistoryProblemNumberView> list = new ArrayList<>();
992
-        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
993
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
993
             SimpleDateFormat adf = new SimpleDateFormat("yyyy-MM-dd");
994
             SimpleDateFormat adf = new SimpleDateFormat("yyyy-MM-dd");
994
             Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(d -> adf.format(d.getCreateTime()), Collectors.toList()));
995
             Map<String, List<PostCheckedProblem>> collect = postCheckedProblems.stream().collect(Collectors.groupingBy(d -> adf.format(d.getCreateTime()), Collectors.toList()));
995
             HistoryProblemNumberView data = new HistoryProblemNumberView();
996
             HistoryProblemNumberView data = new HistoryProblemNumberView();
@@ -1016,19 +1017,19 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
1016
             int problemCategorySix = 0;
1017
             int problemCategorySix = 0;
1017
             for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
1018
             for (Map.Entry<String, List<PostCheckedProblem>> stringListEntry : collect.entrySet()) {
1018
                 List<PostCheckedProblem> value = stringListEntry.getValue();
1019
                 List<PostCheckedProblem> value = stringListEntry.getValue();
1019
-                if (value!=null && value.size()>0){
1020
+                if (value != null && value.size() > 0) {
1020
                     for (PostCheckedProblem postCheckedProblem : value) {
1021
                     for (PostCheckedProblem postCheckedProblem : value) {
1021
                         problemTotal++;
1022
                         problemTotal++;
1022
-                        if (postCheckedProblem.getProblemAttribute() == 1){
1023
+                        if (postCheckedProblem.getProblemAttribute() == 1) {
1023
                             problemComplete++;
1024
                             problemComplete++;
1024
                         }
1025
                         }
1025
-                        if (postCheckedProblem.getProblemAttribute() == 2){
1026
+                        if (postCheckedProblem.getProblemAttribute() == 2) {
1026
                             problemEffective++;
1027
                             problemEffective++;
1027
                         }
1028
                         }
1028
-                        if (postCheckedProblem.getProblemAttribute() == 3){
1029
+                        if (postCheckedProblem.getProblemAttribute() == 3) {
1029
                             problemSuitable++;
1030
                             problemSuitable++;
1030
                         }
1031
                         }
1031
-                        if (postCheckedProblem.getProblemCategory() == null )
1032
+                        if (postCheckedProblem.getProblemCategory() == null)
1032
                             continue;
1033
                             continue;
1033
                         if (postCheckedProblem.getProblemCategory().equals("1"))
1034
                         if (postCheckedProblem.getProblemCategory().equals("1"))
1034
                             problemCategoryOne++;
1035
                             problemCategoryOne++;
@@ -1059,5 +1060,101 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
1059
         }
1060
         }
1060
         return list;
1061
         return list;
1061
     }
1062
     }
1063
+
1064
+    @Override
1065
+    public List<CheckedProblemDeptDetaailView> deptDetaailView(Integer type) {
1066
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
1067
+        if (deptIdListByType == null || deptIdListByType.size() == 0) {
1068
+            return new ArrayList<>();
1069
+        }
1070
+        List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
1071
+        // 查询职能问题数量
1072
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
1073
+                .in(PostCheckedProblem::getCheckedDeptId, deptIds)
1074
+        );
1075
+
1076
+        List<CheckedProblemDeptDetaailView> list = new ArrayList<>();
1077
+
1078
+        //TODO 第一步:得到各个部门ID、部门名称、问题总数量、重要问题数量、一般问题数量、统计时间
1079
+        //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
1080
+        //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
1081
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
1082
+            Map<Long, List<PostCheckedProblem>> deptMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
1083
+            for (Map.Entry<Long, List<PostCheckedProblem>> longListEntry : deptMap.entrySet()) {
1084
+                Long key = longListEntry.getKey();
1085
+                List<PostCheckedProblem> value = longListEntry.getValue();
1086
+                CheckedProblemDeptDetaailView data1 = new CheckedProblemDeptDetaailView();
1087
+                data1.setDeptId(key); //部门ID
1088
+                data1.setDeptName(postAssessmentRatingMapper.getSysDeptName(key));// 部门名称
1089
+                int problemTotal = 0;
1090
+//    @ApiModelProperty("一般")
1091
+                Integer problemLeveOne = 0;
1092
+//    @ApiModelProperty("重要")
1093
+                Integer problemLeveTwo = 0;
1094
+                for (PostCheckedProblem postCheckedProblem : value) {
1095
+                    problemTotal++;
1096
+                    if (postCheckedProblem.getProblemLevel().equals("1")){
1097
+                        problemLeveOne++;
1098
+                    }
1099
+                    if (postCheckedProblem.getProblemLevel().equals("2")){
1100
+                        problemLeveTwo++;
1101
+                    }
1102
+                }
1103
+                data1.setProblemTotal(problemTotal); //问题数量
1104
+                data1.setProblemLeveTwo(problemLeveTwo); //重要问题
1105
+                data1.setProblemLeveOne(problemLeveOne); //一般问题
1106
+                Map<Integer, List<PostCheckedProblem>> dutyMap = value.stream().collect(Collectors.groupingBy(PostCheckedProblem::getDutyType));
1107
+
1108
+
1109
+                for (Map.Entry<Integer, List<PostCheckedProblem>> integerListEntry : dutyMap.entrySet()) {
1110
+                    //        @ApiModelProperty("完整性数量")
1111
+                    int problemComplete = 0;
1112
+//        @ApiModelProperty("适宜性数量")
1113
+                    int problemSuitable = 0;
1114
+//        @ApiModelProperty("有效性数量")
1115
+                    int problemEffective = 0;
1116
+                    Integer duty = integerListEntry.getKey();
1117
+                    CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
1118
+                    child1.setDutyType(duty);
1119
+                    List<PostCheckedProblem> postCheckedProblemList = integerListEntry.getValue();
1120
+                    for (PostCheckedProblem postCheckedProblem : postCheckedProblemList) {
1121
+                        if (postCheckedProblem.getProblemAttribute() == 1) {
1122
+                            problemComplete++;
1123
+                        }
1124
+                        if (postCheckedProblem.getProblemAttribute() == 2) {
1125
+                            problemEffective++;
1126
+                        }
1127
+                        if (postCheckedProblem.getProblemAttribute() == 3) {
1128
+                            problemSuitable++;
1129
+                        }
1130
+                    }
1131
+                    child1.setProblemComplete(problemComplete);
1132
+                    child1.setProblemEffective(problemEffective);
1133
+                    child1.setProblemSuitable(problemSuitable);
1134
+                }
1135
+                list.add(data1);
1136
+            }
1137
+        }
1138
+
1139
+
1140
+//        data1.setDeptId(1l); //部门ID
1141
+//        data1.setDeptName("测试部门名称1");// 部门名称
1142
+//        data1.setProblemTotal(10); //问题数量
1143
+//        data1.setProblemLeveTwo(2); //重要问题
1144
+//        data1.setProblemLeveOne(8); //一般问题
1145
+//        data1.setStatisticsTime(new Date());// 统计时间
1146
+//
1147
+//        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
1148
+//        CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
1149
+//        child1.setProblemComplete(1); //child1.set完整性数量
1150
+//        child1.setProblemSuitable(2); //child1.set适宜性数量
1151
+//        child1.setProblemEffective(3);//child1.set有效性数量
1152
+//        //children1.add(child1);
1153
+//        //data1.setChildren(children1);
1154
+//        data1.getChildren().add(child1);
1155
+
1156
+
1157
+        return null;
1158
+    }
1062
 }
1159
 }
1063
 
1160