Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java
csg6 10 months ago
parent
commit
b6252d074b

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

@@ -169,4 +169,15 @@ public class PostAssessmentRatingController extends BaseController {
169
     public AjaxResult remove(@PathVariable Long[] ids) {
169
     public AjaxResult remove(@PathVariable Long[] ids) {
170
         return toAjax(postAssessmentRatingService.deletePostAssessmentRatingByIds(ids));
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 - 70
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java

@@ -42,54 +42,20 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
42
 //        select * from "public"."post_checked_problem";
42
 //        select * from "public"."post_checked_problem";
43
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
43
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
44
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
44
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
45
-
46
         List<FunctionDeptProblemContrastView> list = new ArrayList<>();
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
 
46
 
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);
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
+        }
77
 
58
 
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);
85
-
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
         return success(list);
59
         return success(list);
94
     }
60
     }
95
 
61
 
@@ -103,13 +69,8 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
103
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
69
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
104
 
70
 
105
 
71
 
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);
72
+        Integer type = 1;
73
+        return success(postCheckedProblemService.coverageRateView(type));
113
     }
74
     }
114
 
75
 
115
     @ApiOperation("3-岗检问题职责类别占比")
76
     @ApiOperation("3-岗检问题职责类别占比")
@@ -120,15 +81,8 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
120
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
81
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
121
 
82
 
122
 
83
 
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);
84
+        Integer type = 1;
85
+        return success(postCheckedProblemService.dutyTypeProblemStatisticsView(type));
132
     }
86
     }
133
 
87
 
134
     @ApiOperation("4-岗检问题级别占比")
88
     @ApiOperation("4-岗检问题级别占比")
@@ -138,14 +92,8 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
138
 //        select * from "public"."post_checked_problem";
92
 //        select * from "public"."post_checked_problem";
139
 //        group by problem_level   问题等级(一般、重要)
93
 //        group by problem_level   问题等级(一般、重要)
140
 
94
 
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);
95
+        Integer type = 1;
96
+        return success(postCheckedProblemService.problemLevelView(type));
149
     }
97
     }
150
 
98
 
151
 
99
 
@@ -234,8 +182,10 @@ public class PostCheckedFunctionProblemStatisticsController extends BaseControll
234
         data6.setProblemSuitable(2);// 适宜性数量
182
         data6.setProblemSuitable(2);// 适宜性数量
235
         data6.setProblemEffective(3);// 有效性数量
183
         data6.setProblemEffective(3);// 有效性数量
236
         list.add(data6);
184
         list.add(data6);
185
+//=======================以上是模拟数据供参考=================
237
 
186
 
238
-        return success(list);
187
+        Integer type = 1;
188
+        return success(postCheckedProblemService.problemAttributeCategoryView(type));
239
     }
189
     }
240
 
190
 
241
 
191
 

+ 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
 import java.util.ArrayList;
14
 import java.util.ArrayList;
15
 import java.util.Date;
15
 import java.util.Date;
16
 import java.util.List;
16
 import java.util.List;
17
+import java.util.Map;
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
17
 
27
 
18
 /**
28
 /**
19
  * 岗检问题表Controller
29
  * 岗检问题表Controller
@@ -31,62 +41,24 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
31
 
41
 
32
     @ApiOperation("1-职能部各部门问题数量对比")
42
     @ApiOperation("1-职能部各部门问题数量对比")
33
     @GetMapping("/functionDeptProblemContrast")
43
     @GetMapping("/functionDeptProblemContrast")
34
-    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
44
+    public AjaxResult functionDeptProblemContrast() { //notParam不是参数-是返回信息-方便接口联调
35
 //         查询问题表
45
 //         查询问题表
36
 //        select * from "public"."post_checked_problem";
46
 //        select * from "public"."post_checked_problem";
37
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
47
 //        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
38
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
48
 //        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
39
 
49
 
40
         List<FunctionDeptProblemContrastView> list = new ArrayList<>();
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
         return success(list);
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
 import java.util.List;
3
 import java.util.List;
4
 import com.ruoyi.postCheck.domain.PostAssessmentRating;
4
 import com.ruoyi.postCheck.domain.PostAssessmentRating;
5
 import com.baomidou.mybatisplus.extension.service.IService;
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
  * 考核评比Service接口
18
  * 考核评比Service接口
@@ -59,4 +69,6 @@ public interface IPostAssessmentRatingService extends IService<PostAssessmentRat
59
      * @return 结果
69
      * @return 结果
60
      */
70
      */
61
     public int deletePostAssessmentRatingById(Long id);
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
 import java.util.List;
5
 import java.util.List;
6
 import java.util.Map;
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
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
8
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
12
 import com.baomidou.mybatisplus.extension.service.IService;
9
 import com.baomidou.mybatisplus.extension.service.IService;
13
 import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
10
 import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
14
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
11
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
15
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
12
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
16
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
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
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
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
  * 岗检问题表Service接口
31
  * 岗检问题表Service接口
@@ -179,4 +185,16 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
179
      * @return
185
      * @return
180
      */
186
      */
181
     List<ProblemCategory> problemCategoryByAttribute();
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
     public int deletePostAssessmentRatingById(Long id) {
196
     public int deletePostAssessmentRatingById(Long id) {
197
         return postAssessmentRatingMapper.deletePostAssessmentRatingById(id);
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
 package com.ruoyi.postCheck.service.impl;
1
 package com.ruoyi.postCheck.service.impl;
2
 
2
 
3
-import java.awt.dnd.DropTarget;
4
 import java.math.BigDecimal;
3
 import java.math.BigDecimal;
5
 import java.math.RoundingMode;
4
 import java.math.RoundingMode;
6
 import java.util.ArrayList;
5
 import java.util.ArrayList;
@@ -26,16 +25,21 @@ import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
26
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
25
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
27
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
26
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
28
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
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
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
33
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
31
 import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
34
 import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
35
+import com.ruoyi.postCheck.mapper.PostAssessmentRatingOtherMapper;
32
 import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
36
 import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
33
 import com.ruoyi.postCheck.mapper.PostListMapper;
37
 import com.ruoyi.postCheck.mapper.PostListMapper;
34
 import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
38
 import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
35
 import com.ruoyi.postCheck.mapper.PostPlanMapper;
39
 import com.ruoyi.postCheck.mapper.PostPlanMapper;
36
 import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
40
 import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
41
+//import io.swagger.annotations.ApiModelProperty;
37
 import io.swagger.annotations.ApiModelProperty;
42
 import io.swagger.annotations.ApiModelProperty;
38
-import lombok.Data;
39
 import org.apache.commons.lang3.StringUtils;
43
 import org.apache.commons.lang3.StringUtils;
40
 import org.springframework.beans.factory.annotation.Autowired;
44
 import org.springframework.beans.factory.annotation.Autowired;
41
 import org.springframework.stereotype.Service;
45
 import org.springframework.stereotype.Service;
@@ -47,6 +51,14 @@ import org.springframework.transaction.annotation.Transactional;
47
 import org.springframework.util.CollectionUtils;
51
 import org.springframework.util.CollectionUtils;
48
 
52
 
49
 
53
 
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
50
 /**
62
 /**
51
  * 岗检问题表Service业务层处理
63
  * 岗检问题表Service业务层处理
52
  *
64
  *
@@ -69,6 +81,9 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
69
     private IPostPlanJoinProblemService postPlanJoinProblemService;
81
     private IPostPlanJoinProblemService postPlanJoinProblemService;
70
     @Autowired
82
     @Autowired
71
     private PostListMapper postListMapper;
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
         //(1-完整问题;2-有效性问题;3-适宜性问题;)
530
         //(1-完整问题;2-有效性问题;3-适宜性问题;)
516
         if (!postCheckedProblems.isEmpty())
531
         if (!postCheckedProblems.isEmpty())
517
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
532
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
518
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 1)
533
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 1)
519
                     problemComplete++;
534
                     problemComplete++;
520
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 3)
535
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 3)
521
                     problemEffective++;
536
                     problemEffective++;
522
-                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 2)
537
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 2)
523
                     problemSuitable++;
538
                     problemSuitable++;
524
             }
539
             }
525
         PostCheckedProblemView post = new PostCheckedProblemView();
540
         PostCheckedProblemView post = new PostCheckedProblemView();
@@ -549,34 +564,34 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
549
         //(1-完整问题;2-有效性问题;3-适宜性问题;4 总数)
564
         //(1-完整问题;2-有效性问题;3-适宜性问题;4 总数)
550
         if (!postCheckedProblems.isEmpty())
565
         if (!postCheckedProblems.isEmpty())
551
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
566
             for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
552
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 1) {
567
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 1) {
553
                     problemComplete++;
568
                     problemComplete++;
554
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
569
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
555
                         overproblemComplete++;
570
                         overproblemComplete++;
556
                     }
571
                     }
557
                 }
572
                 }
558
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 3) {
573
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 3) {
559
                     problemEffective++;
574
                     problemEffective++;
560
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
575
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
561
                         overproblemEffective++;
576
                         overproblemEffective++;
562
                     }
577
                     }
563
                 }
578
                 }
564
-                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 2) {
579
+                if (postCheckedProblem.getProblemAttribute() != null && postCheckedProblem.getProblemAttribute() == 2) {
565
                     problemSuitable++;
580
                     problemSuitable++;
566
-                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
581
+                    if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
567
                         overproblemSuitable++;
582
                         overproblemSuitable++;
568
                     }
583
                     }
569
                 }
584
                 }
570
                 total++;
585
                 total++;
571
-                if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
586
+                if (postCheckedProblem.getIsImmediatelyCorrected() != null && postCheckedProblem.getIsImmediatelyCorrected() == 1) {
572
                     overtotal++;
587
                     overtotal++;
573
                 }
588
                 }
574
             }
589
             }
575
         Map<Integer, BigDecimal> map = new HashMap<>();
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
         return map;
595
         return map;
581
 
596
 
582
     }
597
     }
@@ -585,7 +600,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
585
     public List<DeptProblemRectificationView> deptProblemRectification() {
600
     public List<DeptProblemRectificationView> deptProblemRectification() {
586
         List<DeptProblemRectificationView> dataList = new ArrayList<>();
601
         List<DeptProblemRectificationView> dataList = new ArrayList<>();
587
         List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
602
         List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
588
-        if (!postCheckedProblems.isEmpty()){
603
+        if (!postCheckedProblems.isEmpty()) {
589
             Map<Long, List<PostCheckedProblem>> postMapListMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
604
             Map<Long, List<PostCheckedProblem>> postMapListMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
590
             for (Map.Entry<Long, List<PostCheckedProblem>> entry : postMapListMap.entrySet()) {
605
             for (Map.Entry<Long, List<PostCheckedProblem>> entry : postMapListMap.entrySet()) {
591
                 DeptProblemRectificationView data1 = new DeptProblemRectificationView();
606
                 DeptProblemRectificationView data1 = new DeptProblemRectificationView();
@@ -595,13 +610,13 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
595
                 Integer problemComplete = 0;
610
                 Integer problemComplete = 0;
596
                 for (PostCheckedProblem postCheckedProblem : entry.getValue()) {
611
                 for (PostCheckedProblem postCheckedProblem : entry.getValue()) {
597
                     problemTotal++;
612
                     problemTotal++;
598
-                    if (postCheckedProblem.getIsRectificationCompleted()!=null&&postCheckedProblem.getIsRectificationCompleted() == 1){
613
+                    if (postCheckedProblem.getIsRectificationCompleted() != null && postCheckedProblem.getIsRectificationCompleted() == 1) {
599
                         problemComplete++;
614
                         problemComplete++;
600
                     }
615
                     }
601
                 }
616
                 }
602
                 data1.setProblemTotal(problemTotal);
617
                 data1.setProblemTotal(problemTotal);
603
                 data1.setProblemComplete(problemComplete);
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
                 dataList.add(data1);
620
                 dataList.add(data1);
606
             }
621
             }
607
         }
622
         }
@@ -625,19 +640,19 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
625
      */
640
      */
626
     @Override
641
     @Override
627
     public List<ProblemCategory> problemCategoryByAttribute() {
642
     public List<ProblemCategory> problemCategoryByAttribute() {
628
-//        @ApiModelProperty("职责权限问题")
643
+////        @ApiModelProperty("职责权限问题")
629
 //        private Integer problemCategoryOne;
644
 //        private Integer problemCategoryOne;
630
-//        @ApiModelProperty("工作内容问题")
645
+////        @ApiModelProperty("工作内容问题")
631
 //        private Integer problemCategoryTwo;
646
 //        private Integer problemCategoryTwo;
632
-//        @ApiModelProperty("工作标准问题")
647
+////        @ApiModelProperty("工作标准问题")
633
 //        private Integer problemCategoryThree;
648
 //        private Integer problemCategoryThree;
634
-//        @ApiModelProperty("考核奖励问题")
649
+////        @ApiModelProperty("考核奖励问题")
635
 //        private Integer problemCategoryFour;
650
 //        private Integer problemCategoryFour;
636
-//        @ApiModelProperty("任职资格问题")
651
+////        @ApiModelProperty("任职资格问题")
637
 //        private Integer problemCategoryFive;
652
 //        private Integer problemCategoryFive;
638
-//        @ApiModelProperty("其他")
653
+////        @ApiModelProperty("其他")
639
 //        private Integer problemCategorySix;
654
 //        private Integer problemCategorySix;
640
-//        @ApiModelProperty("总数量")
655
+////        @ApiModelProperty("总数量")
641
 //        private Integer problemTotal;
656
 //        private Integer problemTotal;
642
 
657
 
643
         List<ProblemCategory> list = postCheckedProblemMapper.problemCategoryByAttribute();
658
         List<ProblemCategory> list = postCheckedProblemMapper.problemCategoryByAttribute();
@@ -690,5 +705,211 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
690
         list.add(totalData);
705
         list.add(totalData);
691
         return list;
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