zhangjiansheng il y a 10 mois
Parent
commit
1bbc670e23

+ 11 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostAssessmentRatingController.java

@@ -169,4 +169,15 @@ public class PostAssessmentRatingController extends BaseController {
169 169
     public AjaxResult remove(@PathVariable Long[] ids) {
170 170
         return toAjax(postAssessmentRatingService.deletePostAssessmentRatingByIds(ids));
171 171
     }
172
+
173
+
174
+    /**
175
+     * 根据部门查询问题
176
+     */
177
+    @ApiOperation("根据部门查询问题")
178
+    @ApiImplicitParam(name = "deptId", value = "Long类型的主键", dataType = "Long", dataTypeClass = Long.class)
179
+    @GetMapping("/{deptId}")
180
+    public AjaxResult getProblemByDeptId(@PathVariable Long deptId) {
181
+        return success(postAssessmentRatingService.getProblemByDeptId(deptId));
182
+    }
172 183
 }

+ 20 - 95
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java

@@ -37,59 +37,25 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
37 37
     @ApiOperation("1-职能部各部门问题数量对比")
38 38
     @GetMapping("/functionDeptProblemContrast")
39 39
 //    @ApiImplicitParam(name = "notParam", value = "V2方便接口联调-这是返回信息", dataType = "FunctionDeptProblemContrastView", dataTypeClass = FunctionDeptProblemContrastView.class)
40
-    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
40
+    public AjaxResult functionDeptProblemContrast() { //notParam不是参数-是返回信息-方便接口联调
41 41
 //         查询问题表
42 42
 //        select * from "public"."post_checked_problem";
43 43
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
44 44
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
45
-
46 45
         List<FunctionDeptProblemContrastView> list = new ArrayList<>();
47
-        FunctionDeptProblemContrastView data = new FunctionDeptProblemContrastView();
48
-        data.setDeptId(100l);
49
-        data.setDeptName("测试部门1");
50
-        data.setProblemTotal(6);
51
-        data.setProblemComplete(1);
52
-        data.setProblemSuitable(2);
53
-        data.setProblemEffective(3);
54
-
55
-        data.setProblemCategoryOne(1);
56
-        data.setProblemCategoryTwo(1);
57
-        data.setProblemCategoryThree(1);
58
-        data.setProblemCategoryFour(1);
59
-        data.setProblemCategoryFive(1);
60
-        data.setProblemCategorySix(1);
61
-
62
-        list.add(data);
63
-        FunctionDeptProblemContrastView data1 = new FunctionDeptProblemContrastView();
64
-        data1.setDeptId(101l);
65
-        data1.setDeptName("测试部门2");
66
-//        data1.setProblemTotal(6);
67
-//        data1.setProblemComplete(1);
68
-//        data1.setProblemSuitable(2);
69
-        data1.setProblemEffective(3);
70
-        data1.setProblemCategoryOne(1);
71
-        data1.setProblemCategoryTwo(1);
72
-        data1.setProblemCategoryThree(2);
73
-        data1.setProblemCategoryFour(1);
74
-        data1.setProblemCategoryFive(4);
75
-        data1.setProblemCategorySix(1);
76
-        list.add(data1);
77 46
 
78
-        FunctionDeptProblemContrastView data2 = new FunctionDeptProblemContrastView();
79
-        data2.setDeptId(102l);
80
-        data2.setDeptName("测试部门3");
81
-        data2.setProblemTotal(6);
82
-        data2.setProblemComplete(1);
83
-//        data2.setProblemSuitable(2);
84
-        data2.setProblemEffective(3);
47
+        Integer type = 1;
48
+        List<Map<String, Object>> deptIdListByType = postCheckedProblemService.getDeptIdListByType(type);
49
+        if (deptIdListByType!=null && deptIdListByType.size()>0){
50
+            for (Map<String, Object> map : deptIdListByType) {
51
+                FunctionDeptProblemContrastView data = new FunctionDeptProblemContrastView();
52
+                data.setDeptId(Long.parseLong(map.get("deptId").toString()));
53
+                data.setDeptName(String.valueOf(map.get("deptName")));
54
+                postCheckedProblemService.functionDeptProblemContrast(data);
55
+                list.add(data);
56
+            }
57
+        }
85 58
 
86
-        data2.setProblemCategoryOne(1);
87
-//        data2.setProblemCategoryTwo(1);
88
-        data2.setProblemCategoryThree(1);
89
-//        data2.setProblemCategoryFour(1);
90
-        data2.setProblemCategoryFive(1);
91
-        data2.setProblemCategorySix(4);
92
-        list.add(data2);
93 59
         return success(list);
94 60
     }
95 61
 
@@ -97,19 +63,8 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
97 63
     @ApiOperation("2-岗检覆盖率")
98 64
     @GetMapping("/coverageRateView")
99 65
     public AjaxResult coverageRateView(CoverageRateView notParam) { //notParam不是参数-是返回信息-方便接口联调
100
-//         查询问题表
101
-//        select * from "public"."post_checked_problem";
102
-//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
103
-//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
104
-
105
-
106
-        List<CoverageRateView> list = new ArrayList<>();
107
-        CoverageRateView data = new CoverageRateView();
108
-        data.setProblemTotal(6);
109
-        data.setProblemComplete(5);
110
-
111
-        list.add(data);
112
-        return success(list);
66
+        Integer type = 1;
67
+        return success(postCheckedProblemService.coverageRateView(type));
113 68
     }
114 69
 
115 70
     @ApiOperation("3-岗检问题职责类别占比")
@@ -120,15 +75,8 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
120 75
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
121 76
 
122 77
 
123
-        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
124
-        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
125
-        data.setDutyTypeOne(1);
126
-        data.setDutyTypeTwo(2);
127
-        data.setDutyTypeThree(3);
128
-        data.setDutyTypeFour(4);
129
-
130
-        list.add(data);
131
-        return success(list);
78
+        Integer type = 1;
79
+        return success(postCheckedProblemService.dutyTypeProblemStatisticsView(type));
132 80
     }
133 81
 
134 82
     @ApiOperation("4-岗检问题级别占比")
@@ -138,40 +86,17 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
138 86
 //        select * from "public"."post_checked_problem";
139 87
 //        group by problem_level   问题等级(一般、重要)
140 88
 
141
-        List<ProblemLevelView> list = new ArrayList<>();
142
-        ProblemLevelView data = new ProblemLevelView();
143
-        data.setProblemLeveOne(2);
144
-        data.setProblemLeveTwo(1);
145
-
146
-
147
-        list.add(data);
148
-        return success(list);
89
+        Integer type = 1;
90
+        return success(postCheckedProblemService.problemLevelView(type));
149 91
     }
150 92
 
151 93
 
152 94
     @ApiOperation("5-岗检问题属性及类别整改占比")
153 95
     @GetMapping("/problemAttributeCategoryView")
154 96
     public AjaxResult problemAttributeCategoryView(ProblemAttributeCategoryView notParam) { //notParam不是参数-是返回信息-方便接口联调
155
-//         查询问题表
156
-//        select * from "public"."post_checked_problem";
157
-//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
158
-//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
159
-
160
-
161
-        List<ProblemAttributeCategoryView> list = new ArrayList<>();
162
-        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
163
-//        data.set完成性
164
-//        data.set适宜性
165
-//        data.set有效性
166
-//        data.set职责权限
167
-//        data.set工作内容
168
-//        data.set工作标准
169
-//        data.set考核奖励
170
-//        data.set任职资格
171
-//        data.set其他
172 97
 
173
-        list.add(data);
174
-        return success(list);
98
+        Integer type = 1;
99
+        return success(postCheckedProblemService.problemAttributeCategoryView(type));
175 100
     }
176 101
 
177 102
 

+ 22 - 50
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java

@@ -14,6 +14,16 @@ import org.springframework.web.bind.annotation.RestController;
14 14
 import java.util.ArrayList;
15 15
 import java.util.Date;
16 16
 import java.util.List;
17
+import java.util.Map;
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
17 27
 
18 28
 /**
19 29
  * 岗检问题表Controller
@@ -31,62 +41,24 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
31 41
 
32 42
     @ApiOperation("1-职能部各部门问题数量对比")
33 43
     @GetMapping("/functionDeptProblemContrast")
34
-    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
44
+    public AjaxResult functionDeptProblemContrast() { //notParam不是参数-是返回信息-方便接口联调
35 45
 //         查询问题表
36 46
 //        select * from "public"."post_checked_problem";
37 47
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
38 48
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
39 49
 
40 50
         List<FunctionDeptProblemContrastView> list = new ArrayList<>();
41
-        FunctionDeptProblemContrastView data = new FunctionDeptProblemContrastView();
42
-        data.setDeptId(100l);
43
-        data.setDeptName("测试部门1");
44
-        data.setProblemTotal(6);
45
-        data.setProblemComplete(1);
46
-        data.setProblemSuitable(2);
47
-        data.setProblemEffective(3);
48
-
49
-        data.setProblemCategoryOne(1);
50
-        data.setProblemCategoryTwo(1);
51
-        data.setProblemCategoryThree(1);
52
-        data.setProblemCategoryFour(1);
53
-        data.setProblemCategoryFive(1);
54
-        data.setProblemCategorySix(1);
55
-        list.add(data);
56
-
57
-
58
-        FunctionDeptProblemContrastView data1 = new FunctionDeptProblemContrastView();
59
-        data1.setDeptId(101l);
60
-        data1.setDeptName("测试部门2");
61
-//        data1.setProblemTotal(6);
62
-//        data1.setProblemComplete(1);
63
-//        data1.setProblemSuitable(2);
64
-        data1.setProblemEffective(3);
65
-        data1.setProblemCategoryOne(1);
66
-        data1.setProblemCategoryTwo(1);
67
-        data1.setProblemCategoryThree(2);
68
-        data1.setProblemCategoryFour(1);
69
-        data1.setProblemCategoryFive(4);
70
-        data1.setProblemCategorySix(1);
71
-        list.add(data1);
72
-
73
-        FunctionDeptProblemContrastView data2 = new FunctionDeptProblemContrastView();
74
-        data2.setDeptId(102l);
75
-        data2.setDeptName("测试部门3");
76
-        data2.setProblemTotal(6);
77
-        data2.setProblemComplete(1);
78
-//        data2.setProblemSuitable(2);
79
-        data2.setProblemEffective(3);
80
-
81
-        data2.setProblemCategoryOne(1);
82
-//        data2.setProblemCategoryTwo(1);
83
-        data2.setProblemCategoryThree(1);
84
-//        data2.setProblemCategoryFour(1);
85
-        data2.setProblemCategoryFive(1);
86
-        data2.setProblemCategorySix(4);
87
-        list.add(data2);
88
-
89
-
51
+        Integer type = 2;
52
+        List<Map<String, Object>> deptIdListByType = postCheckedProblemService.getDeptIdListByType(type);
53
+        if (deptIdListByType!=null && deptIdListByType.size()>0){
54
+            for (Map<String, Object> map : deptIdListByType) {
55
+                FunctionDeptProblemContrastView data = new FunctionDeptProblemContrastView();
56
+                data.setDeptId(Long.parseLong(map.get("deptId").toString()));
57
+                data.setDeptName(String.valueOf(map.get("deptName")));
58
+                postCheckedProblemService.functionDeptProblemContrast(data);
59
+                list.add(data);
60
+            }
61
+        }
90 62
         return success(list);
91 63
     }
92 64
 

+ 12 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostAssessmentRatingService.java

@@ -3,6 +3,16 @@ package com.ruoyi.postCheck.service;
3 3
 import java.util.List;
4 4
 import com.ruoyi.postCheck.domain.PostAssessmentRating;
5 5
 import com.baomidou.mybatisplus.extension.service.IService;
6
+import com.ruoyi.postCheck.domain.PostCheckedProblem;
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
6 16
 
7 17
 /**
8 18
  * 考核评比Service接口
@@ -59,4 +69,6 @@ public interface IPostAssessmentRatingService extends IService<PostAssessmentRat
59 69
      * @return 结果
60 70
      */
61 71
     public int deletePostAssessmentRatingById(Long id);
72
+
73
+    List<PostCheckedProblem> getProblemByDeptId(Long id);
62 74
 }

+ 26 - 8
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostCheckedProblemService.java

@@ -5,21 +5,27 @@ import java.util.Date;
5 5
 import java.util.List;
6 6
 import java.util.Map;
7 7
 
8
-import com.ruoyi.common.annotation.Log;
9
-import com.ruoyi.common.core.domain.AjaxResult;
10
-import com.ruoyi.common.enums.BusinessType;
11 8
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
12 9
 import com.baomidou.mybatisplus.extension.service.IService;
13 10
 import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
14 11
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
15 12
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
16 13
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
17
-import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
14
+import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
15
+import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
16
+import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
17
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemAttributeCategoryView;
18
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemLevelView;
18 19
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
19
-import io.swagger.annotations.ApiImplicitParam;
20
-import io.swagger.annotations.ApiImplicitParams;
21
-import io.swagger.annotations.ApiOperation;
22
-import org.springframework.web.bind.annotation.PutMapping;
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
23 29
 
24 30
 /**
25 31
  * 岗检问题表Service接口
@@ -179,4 +185,16 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
179 185
      * @return
180 186
      */
181 187
     List<ProblemCategory> problemCategoryByAttribute();
188
+
189
+    List<Map<String, Object>> getDeptIdListByType(Integer type);
190
+
191
+    void functionDeptProblemContrast(FunctionDeptProblemContrastView data);
192
+
193
+    List<CoverageRateView>  coverageRateView(Integer type);
194
+
195
+    List<DutyTypeProblemStatisticsView> dutyTypeProblemStatisticsView(Integer type);
196
+
197
+    List<ProblemLevelView>  problemLevelView(Integer type);
198
+
199
+    List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type);
182 200
 }

+ 7 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostAssessmentRatingServiceImpl.java

@@ -196,4 +196,11 @@ public class PostAssessmentRatingServiceImpl extends ServiceImpl<PostAssessmentR
196 196
     public int deletePostAssessmentRatingById(Long id) {
197 197
         return postAssessmentRatingMapper.deletePostAssessmentRatingById(id);
198 198
     }
199
+
200
+    @Override
201
+    public List<PostCheckedProblem> getProblemByDeptId(Long id) {
202
+        return postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
203
+            .eq(PostCheckedProblem::getCheckedDeptId,id)
204
+        );
205
+    }
199 206
 }

+ 248 - 27
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java

@@ -1,6 +1,5 @@
1 1
 package com.ruoyi.postCheck.service.impl;
2 2
 
3
-import java.awt.dnd.DropTarget;
4 3
 import java.math.BigDecimal;
5 4
 import java.math.RoundingMode;
6 5
 import java.util.ArrayList;
@@ -26,16 +25,21 @@ import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
26 25
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
27 26
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
28 27
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
29
-import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
28
+import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
29
+import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
30
+import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
31
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemAttributeCategoryView;
32
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemLevelView;
30 33
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
31 34
 import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
35
+import com.ruoyi.postCheck.mapper.PostAssessmentRatingOtherMapper;
32 36
 import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
33 37
 import com.ruoyi.postCheck.mapper.PostListMapper;
34 38
 import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
35 39
 import com.ruoyi.postCheck.mapper.PostPlanMapper;
36 40
 import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
41
+//import io.swagger.annotations.ApiModelProperty;
37 42
 import io.swagger.annotations.ApiModelProperty;
38
-import lombok.Data;
39 43
 import org.apache.commons.lang3.StringUtils;
40 44
 import org.springframework.beans.factory.annotation.Autowired;
41 45
 import org.springframework.stereotype.Service;
@@ -47,6 +51,14 @@ import org.springframework.transaction.annotation.Transactional;
47 51
 import org.springframework.util.CollectionUtils;
48 52
 
49 53
 
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
50 62
 /**
51 63
  * 岗检问题表Service业务层处理
52 64
  *
@@ -69,6 +81,9 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
69 81
     private IPostPlanJoinProblemService postPlanJoinProblemService;
70 82
     @Autowired
71 83
     private PostListMapper postListMapper;
84
+    @Autowired
85
+    private PostAssessmentRatingOtherMapper postAssessmentRatingOtherMapper;
86
+
72 87
     /**
73 88
      * 查询岗检问题表
74 89
      *
@@ -515,11 +530,11 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
515 530
         //(1-完整问题;2-有效性问题;3-适宜性问题;)
516 531
         if (!postCheckedProblems.isEmpty())
517 532
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
518
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 1)
533
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 1)
519 534
                     problemComplete++;
520
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 3)
535
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 3)
521 536
                     problemEffective++;
522
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 2)
537
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 2)
523 538
                     problemSuitable++;
524 539
             }
525 540
         PostCheckedProblemView post = new PostCheckedProblemView();
@@ -549,34 +564,34 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
549 564
         //(1-完整问题;2-有效性问题;3-适宜性问题;4 总数)
550 565
         if (!postCheckedProblems.isEmpty())
551 566
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
552
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 1) {
567
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 1) {
553 568
                     problemComplete++;
554
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
569
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
555 570
                         overproblemComplete++;
556 571
                     }
557 572
                 }
558
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 3) {
573
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 3) {
559 574
                     problemEffective++;
560
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
575
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
561 576
                         overproblemEffective++;
562 577
                     }
563 578
                 }
564
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 2) {
579
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 2) {
565 580
                     problemSuitable++;
566
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
581
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
567 582
                         overproblemSuitable++;
568 583
                     }
569 584
                 }
570 585
                 total++;
571
-                if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
586
+                if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
572 587
                     overtotal++;
573 588
                 }
574 589
             }
575 590
         Map<Integer, BigDecimal> map = new HashMap<>();
576
-        map.put(1, new BigDecimal(overproblemComplete).divide(new BigDecimal(problemComplete),4, RoundingMode.HALF_UP));
577
-        map.put(2, new BigDecimal(overproblemSuitable).divide(new BigDecimal(problemSuitable),4, RoundingMode.HALF_UP));
578
-        map.put(3, new BigDecimal(overproblemEffective).divide(new BigDecimal(problemEffective),4, RoundingMode.HALF_UP));
579
-        map.put(4, new BigDecimal(overtotal).divide(new BigDecimal(total),4, RoundingMode.HALF_UP));
591
+        map.put(1, new BigDecimal(overproblemComplete).divide(new BigDecimal(problemComplete), 4, RoundingMode.HALF_UP));
592
+        map.put(2, new BigDecimal(overproblemSuitable).divide(new BigDecimal(problemSuitable), 4, RoundingMode.HALF_UP));
593
+        map.put(3, new BigDecimal(overproblemEffective).divide(new BigDecimal(problemEffective), 4, RoundingMode.HALF_UP));
594
+        map.put(4, new BigDecimal(overtotal).divide(new BigDecimal(total), 4, RoundingMode.HALF_UP));
580 595
         return map;
581 596
 
582 597
     }
@@ -585,7 +600,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
585 600
     public List<DeptProblemRectificationView> deptProblemRectification() {
586 601
         List<DeptProblemRectificationView> dataList = new ArrayList<>();
587 602
         List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
588
-        if (!postCheckedProblems.isEmpty()){
603
+        if (!postCheckedProblems.isEmpty()) {
589 604
             Map<Long, List<PostCheckedProblem>> postMapListMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
590 605
             for (Map.Entry<Long, List<PostCheckedProblem>> entry : postMapListMap.entrySet()) {
591 606
                 DeptProblemRectificationView data1 = new DeptProblemRectificationView();
@@ -595,13 +610,13 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
595 610
                 Integer problemComplete = 0;
596 611
                 for (PostCheckedProblem postCheckedProblem : entry.getValue()) {
597 612
                     problemTotal++;
598
-                    if (postCheckedProblem.getIsRectificationCompleted()!=null&&postCheckedProblem.getIsRectificationCompleted() == 1){
613
+                    if (postCheckedProblem.getIsRectificationCompleted() != null && postCheckedProblem.getIsRectificationCompleted() == 1) {
599 614
                         problemComplete++;
600 615
                     }
601 616
                 }
602 617
                 data1.setProblemTotal(problemTotal);
603 618
                 data1.setProblemComplete(problemComplete);
604
-                data1.setProblemRectificationRate(new BigDecimal(problemComplete).divide(new BigDecimal(problemTotal),4, RoundingMode.HALF_UP));
619
+                data1.setProblemRectificationRate(new BigDecimal(problemComplete).divide(new BigDecimal(problemTotal), 4, RoundingMode.HALF_UP));
605 620
                 dataList.add(data1);
606 621
             }
607 622
         }
@@ -625,19 +640,19 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
625 640
      */
626 641
     @Override
627 642
     public List<ProblemCategory> problemCategoryByAttribute() {
628
-//        @ApiModelProperty("职责权限问题")
643
+////        @ApiModelProperty("职责权限问题")
629 644
 //        private Integer problemCategoryOne;
630
-//        @ApiModelProperty("工作内容问题")
645
+////        @ApiModelProperty("工作内容问题")
631 646
 //        private Integer problemCategoryTwo;
632
-//        @ApiModelProperty("工作标准问题")
647
+////        @ApiModelProperty("工作标准问题")
633 648
 //        private Integer problemCategoryThree;
634
-//        @ApiModelProperty("考核奖励问题")
649
+////        @ApiModelProperty("考核奖励问题")
635 650
 //        private Integer problemCategoryFour;
636
-//        @ApiModelProperty("任职资格问题")
651
+////        @ApiModelProperty("任职资格问题")
637 652
 //        private Integer problemCategoryFive;
638
-//        @ApiModelProperty("其他")
653
+////        @ApiModelProperty("其他")
639 654
 //        private Integer problemCategorySix;
640
-//        @ApiModelProperty("总数量")
655
+////        @ApiModelProperty("总数量")
641 656
 //        private Integer problemTotal;
642 657
 
643 658
         List<ProblemCategory> list = postCheckedProblemMapper.problemCategoryByAttribute();
@@ -690,5 +705,211 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
690 705
         list.add(totalData);
691 706
         return list;
692 707
     }
708
+
709
+    @Override
710
+    public List<Map<String, Object>> getDeptIdListByType(Integer type) {
711
+        return postAssessmentRatingOtherMapper.getDeptIdListByType(type);
712
+    }
713
+
714
+    @Override
715
+    public void functionDeptProblemContrast(FunctionDeptProblemContrastView data) {
716
+//         查询问题表
717
+//        select * from "public"."post_checked_problem";
718
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
719
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
720
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
721
+                .eq(PostCheckedProblem::getCheckedDeptId, data.getDeptId())
722
+        );
723
+//        @ApiModelProperty("总数量")
724
+        int problemTotal = 0;
725
+//        @ApiModelProperty("完整性数量")
726
+        int problemComplete = 0;
727
+//        @ApiModelProperty("适宜性数量")
728
+        int problemSuitable = 0;
729
+//        @ApiModelProperty("有效性数量")
730
+        int problemEffective = 0;
731
+//        @ApiModelProperty("职责权限问题")
732
+        int problemCategoryOne = 0;
733
+//        @ApiModelProperty("工作内容问题")
734
+        int problemCategoryTwo = 0;
735
+//        @ApiModelProperty("工作标准问题")
736
+        int problemCategoryThree = 0;
737
+//        @ApiModelProperty("考核奖励问题")
738
+        int problemCategoryFour = 0;
739
+//        @ApiModelProperty("任职资格问题")
740
+        int problemCategoryFive = 0;
741
+//        @ApiModelProperty("其他")
742
+        int problemCategorySix = 0;
743
+        if (postCheckedProblems != null && postCheckedProblems.size() > 0) {
744
+            for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
745
+                problemTotal++;
746
+                if (postCheckedProblem.getProblemAttribute() == 1){
747
+                    problemComplete++;
748
+                }
749
+                if (postCheckedProblem.getProblemAttribute() == 2){
750
+                    problemEffective++;
751
+                }
752
+                if (postCheckedProblem.getProblemAttribute() == 3){
753
+                    problemSuitable++;
754
+                }
755
+                if (postCheckedProblem.getProblemCategory() == null )
756
+                    continue;
757
+                if (postCheckedProblem.getProblemCategory().equals("1"))
758
+                    problemCategoryOne++;
759
+                if (postCheckedProblem.getProblemCategory().equals("2"))
760
+                    problemCategoryTwo++;
761
+                if (postCheckedProblem.getProblemCategory().equals("3"))
762
+                    problemCategoryThree++;
763
+                if (postCheckedProblem.getProblemCategory().equals("4"))
764
+                    problemCategoryFour++;
765
+                if (postCheckedProblem.getProblemCategory().equals("5"))
766
+                    problemCategoryFive++;
767
+                if (postCheckedProblem.getProblemCategory().equals("6"))
768
+                    problemCategorySix++;
769
+            }
770
+        }
771
+        data.setProblemTotal(problemTotal);
772
+        data.setProblemComplete(problemComplete);
773
+        data.setProblemSuitable(problemSuitable);
774
+        data.setProblemEffective(problemEffective);
775
+        data.setProblemCategoryOne(problemCategoryOne);
776
+        data.setProblemCategoryTwo(problemCategoryTwo);
777
+        data.setProblemCategoryThree(problemCategoryThree);
778
+        data.setProblemCategoryFour(problemCategoryFour);
779
+        data.setProblemCategoryFive(problemCategoryFive);
780
+        data.setProblemCategorySix(problemCategorySix);
781
+    }
782
+
783
+    @Override
784
+    public List<CoverageRateView> coverageRateView(Integer type) {
785
+        //         查询问题表
786
+//        select * from "public"."post_checked_problem";
787
+//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
788
+//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
789
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
790
+        if (deptIdListByType == null && deptIdListByType.size() == 0){
791
+            throw new IllegalArgumentException("查询职能部门个数为:0");
792
+        }
793
+        List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
794
+        // 查询职能问题数量
795
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
796
+                .in(PostCheckedProblem::getCheckedDeptId, deptIds)
797
+        );
798
+        List<CoverageRateView> list = new ArrayList<>();
799
+        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
800
+            CoverageRateView data = new CoverageRateView();
801
+            data.setProblemTotal(postCheckedProblems.size());
802
+            List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getIsRectificationCompleted().equals(1)).collect(Collectors.toList());
803
+            data.setProblemComplete(collect.size());
804
+            list.add(data);
805
+        }
806
+        return list;
807
+    }
808
+
809
+    @Override
810
+    public List<DutyTypeProblemStatisticsView> dutyTypeProblemStatisticsView(Integer type) {
811
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
812
+        if (deptIdListByType == null && deptIdListByType.size() == 0){
813
+            throw new IllegalArgumentException("查询职能部门个数为:0");
814
+        }
815
+        List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
816
+        // 查询职能问题数量
817
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
818
+                .in(PostCheckedProblem::getCheckedDeptId, deptIds)
819
+        );
820
+        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
821
+        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
822
+//            @ApiModelProperty("业务职责")
823
+             Integer dutyTypeOne = 0;
824
+
825
+//            @ApiModelProperty("党建及党风廉政")
826
+             Integer dutyTypeTwo = 0;
827
+
828
+//            @ApiModelProperty("安全环保职责")
829
+             Integer dutyTypeThree = 0;
830
+
831
+//            @ApiModelProperty("合规保密职")
832
+             Integer dutyTypeFour = 0;
833
+            for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
834
+                if (postCheckedProblem.getDutyType() == 1)
835
+                    dutyTypeOne++;
836
+                if (postCheckedProblem.getDutyType() == 2)
837
+                    dutyTypeTwo++;
838
+                if (postCheckedProblem.getDutyType() == 3)
839
+                    dutyTypeThree++;
840
+                if (postCheckedProblem.getDutyType() == 4)
841
+                    dutyTypeFour++;
842
+            }
843
+            DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
844
+            data.setDutyTypeOne(dutyTypeOne);
845
+            data.setDutyTypeTwo(dutyTypeTwo);
846
+            data.setDutyTypeThree(dutyTypeThree);
847
+            data.setDutyTypeFour(dutyTypeFour);
848
+            list.add(data);
849
+        }
850
+
851
+
852
+        return list;
853
+    }
854
+
855
+    @Override
856
+    public List<ProblemLevelView> problemLevelView(Integer type) {
857
+        //         查询问题表
858
+//        select * from "public"."post_checked_problem";
859
+//        group by problem_level   问题等级(一般、重要)
860
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
861
+        if (deptIdListByType == null && deptIdListByType.size() == 0){
862
+            throw new IllegalArgumentException("查询职能部门个数为:0");
863
+        }
864
+        List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
865
+        // 查询职能问题数量
866
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
867
+                .in(PostCheckedProblem::getCheckedDeptId, deptIds)
868
+        );
869
+        List<ProblemLevelView> list = new ArrayList<>();
870
+        if (postCheckedProblems!=null && postCheckedProblems.size()>0){
871
+            List<PostCheckedProblem> collect = postCheckedProblems.stream().filter(d -> d.getProblemLevel() != null && d.getProblemLevel().equals("2")).collect(Collectors.toList());
872
+            ProblemLevelView data = new ProblemLevelView();
873
+            data.setProblemLeveOne(collect.size());
874
+            data.setProblemLeveTwo(postCheckedProblems.size() - collect.size());
875
+            list.add(data);
876
+        }
877
+
878
+        return list;
879
+    }
880
+
881
+    @Override
882
+    public  List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type) {
883
+        //         查询问题表
884
+//        select * from "public"."post_checked_problem";
885
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
886
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
887
+
888
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(type);
889
+        if (deptIdListByType == null && deptIdListByType.size() == 0){
890
+            throw new IllegalArgumentException("查询职能部门个数为:0");
891
+        }
892
+        List<String> deptIds = deptIdListByType.stream().map(d -> d.get("deptId").toString()).distinct().collect(Collectors.toList());
893
+        // 查询职能问题数量
894
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
895
+                .in(PostCheckedProblem::getCheckedDeptId, deptIds)
896
+        );
897
+
898
+
899
+        List<ProblemAttributeCategoryView> list = new ArrayList<>();
900
+        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
901
+//        data.set完成性
902
+//        data.set适宜性
903
+//        data.set有效性
904
+//        data.set职责权限
905
+//        data.set工作内容
906
+//        data.set工作标准
907
+//        data.set考核奖励
908
+//        data.set任职资格
909
+//        data.set其他
910
+
911
+        list.add(data);
912
+        return null;
913
+    }
693 914
 }
694 915