浏览代码

Merge remote-tracking branch 'origin/master'

zwj 10 月之前
父节点
当前提交
bbb73a9ada
共有 41 个文件被更改,包括 2194 次插入258 次删除
  1. 16 0
      ruoyi-admin/src/test/java/com/post/Test01.java
  2. 37 49
      ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
  3. 2 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
  4. 24 22
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedController.java
  5. 247 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java
  6. 42 93
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedHomePageController.java
  7. 20 1
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProblemController.java
  8. 253 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java
  9. 259 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationFunctionProblemStatisticsController.java
  10. 259 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationProductionProblemStatisticsController.java
  11. 2 3
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostListController.java
  12. 1 1
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostTeamController.java
  13. 18 18
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostTeamUserController.java
  14. 4 1
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/PostCheckedProblem.java
  15. 1 1
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/PostTeamUser.java
  16. 13 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/join/PostPlanJoinChecked.java
  17. 3 3
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/join/PostPlanJoinProblem.java
  18. 99 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CheckedProblemDeptDetaailView.java
  19. 25 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CoverageRateView.java
  20. 90 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/DeptDetaailView.java
  21. 54 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/DutyTypeProblemStatisticsView.java
  22. 25 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/FunctionDeptProblemContrastView.java
  23. 19 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/HistoryProblemNumberView.java
  24. 15 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemAttributeCategoryView.java
  25. 29 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemLevelView.java
  26. 46 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemNumberBase.java
  27. 66 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/tools/ProblemCategory.java
  28. 1 1
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostAssessmentRatingOtherMapper.java
  29. 8 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostCheckedProblemMapper.java
  30. 7 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostListMapper.java
  31. 25 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostCheckedProblemService.java
  32. 4 4
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostTeamUserService.java
  33. 16 10
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostAssessmentRatingServiceImpl.java
  34. 210 22
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java
  35. 2 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedServiceImpl.java
  36. 89 24
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostTeamUserServiceImpl.java
  37. 1 1
      ruoyi-postcheck/src/main/resources/mapper/postCheck/PostAssessmentRatingOtherMapper.xml
  38. 55 1
      ruoyi-postcheck/src/main/resources/mapper/postCheck/PostCheckedProblemMapper.xml
  39. 26 0
      ruoyi-postcheck/src/main/resources/mapper/postCheck/PostListMapper.xml
  40. 25 0
      ruoyi-postcheck/src/main/resources/mapper/postCheck/PostPlanMapper.xml
  41. 56 2
      ruoyi-postcheck/src/main/resources/mapper/postCheck/PostProgrammeMapper.xml

+ 16 - 0
ruoyi-admin/src/test/java/com/post/Test01.java

@@ -0,0 +1,16 @@
1
+package com.post;
2
+
3
+import com.ruoyi.common.utils.Arith;
4
+
5
+import java.math.BigDecimal;
6
+
7
+public class Test01 {
8
+    public static void main(String[] args) {
9
+        double round = Arith.round(new BigDecimal(99.98).doubleValue(), 2);
10
+        System.out.println(round);
11
+        System.out.println(new BigDecimal(round).doubleValue());
12
+    }
13
+    public void ss(){
14
+
15
+    }
16
+}

+ 37 - 49
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -3,6 +3,7 @@ package com.ruoyi.common.core.controller;
3 3
 import java.beans.PropertyEditorSupport;
4 4
 import java.util.Date;
5 5
 import java.util.List;
6
+
6 7
 import org.slf4j.Logger;
7 8
 import org.slf4j.LoggerFactory;
8 9
 import org.springframework.web.bind.WebDataBinder;
@@ -23,25 +24,21 @@ import com.ruoyi.common.utils.sql.SqlUtil;
23 24
 
24 25
 /**
25 26
  * web层通用数据处理
26
- * 
27
+ *
27 28
  * @author ruoyi
28 29
  */
29
-public class BaseController
30
-{
30
+public class BaseController {
31 31
     protected final Logger logger = LoggerFactory.getLogger(this.getClass());
32 32
 
33 33
     /**
34 34
      * 将前台传递过来的日期格式的字符串,自动转化为Date类型
35 35
      */
36 36
     @InitBinder
37
-    public void initBinder(WebDataBinder binder)
38
-    {
37
+    public void initBinder(WebDataBinder binder) {
39 38
         // Date 类型转换
40
-        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
41
-        {
39
+        binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
42 40
             @Override
43
-            public void setAsText(String text)
44
-            {
41
+            public void setAsText(String text) {
45 42
                 setValue(DateUtils.parseDate(text));
46 43
             }
47 44
         });
@@ -50,19 +47,25 @@ public class BaseController
50 47
     /**
51 48
      * 设置请求分页数据
52 49
      */
53
-    protected void startPage()
54
-    {
50
+    protected void startPage() {
55 51
         PageUtils.startPage();
56 52
     }
57 53
 
54
+    protected void startPage(String isAsc, String orderByColumn) {
55
+        PageDomain pageDomain = TableSupport.buildPageRequest();
56
+        Integer pageNum = pageDomain.getPageNum();
57
+        Integer pageSize = pageDomain.getPageSize();
58
+        String orderBy = SqlUtil.escapeOrderBySql(orderByColumn + " " + isAsc);
59
+        Boolean reasonable = pageDomain.getReasonable();
60
+        PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
61
+    }
62
+
58 63
     /**
59 64
      * 设置请求排序数据
60 65
      */
61
-    protected void startOrderBy()
62
-    {
66
+    protected void startOrderBy() {
63 67
         PageDomain pageDomain = TableSupport.buildPageRequest();
64
-        if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
65
-        {
68
+        if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
66 69
             String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
67 70
             PageHelper.orderBy(orderBy);
68 71
         }
@@ -71,17 +74,15 @@ public class BaseController
71 74
     /**
72 75
      * 清理分页的线程变量
73 76
      */
74
-    protected void clearPage()
75
-    {
77
+    protected void clearPage() {
76 78
         PageUtils.clearPage();
77 79
     }
78 80
 
79 81
     /**
80 82
      * 响应请求分页数据
81 83
      */
82
-    @SuppressWarnings({ "rawtypes", "unchecked" })
83
-    protected TableDataInfo getDataTable(List<?> list)
84
-    {
84
+    @SuppressWarnings({"rawtypes", "unchecked"})
85
+    protected TableDataInfo getDataTable(List<?> list) {
85 86
         TableDataInfo rspData = new TableDataInfo();
86 87
         rspData.setCode(HttpStatus.SUCCESS);
87 88
         rspData.setMsg("查询成功");
@@ -93,110 +94,97 @@ public class BaseController
93 94
     /**
94 95
      * 返回成功
95 96
      */
96
-    public AjaxResult success()
97
-    {
97
+    public AjaxResult success() {
98 98
         return AjaxResult.success();
99 99
     }
100 100
 
101 101
     /**
102 102
      * 返回失败消息
103 103
      */
104
-    public AjaxResult error()
105
-    {
104
+    public AjaxResult error() {
106 105
         return AjaxResult.error();
107 106
     }
108 107
 
109 108
     /**
110 109
      * 返回成功消息
111 110
      */
112
-    public AjaxResult success(String message)
113
-    {
111
+    public AjaxResult success(String message) {
114 112
         return AjaxResult.success(message);
115 113
     }
116
-    
114
+
117 115
     /**
118 116
      * 返回成功消息
119 117
      */
120
-    public AjaxResult success(Object data)
121
-    {
118
+    public AjaxResult success(Object data) {
122 119
         return AjaxResult.success(data);
123 120
     }
124 121
 
125 122
     /**
126 123
      * 返回失败消息
127 124
      */
128
-    public AjaxResult error(String message)
129
-    {
125
+    public AjaxResult error(String message) {
130 126
         return AjaxResult.error(message);
131 127
     }
132 128
 
133 129
     /**
134 130
      * 返回警告消息
135 131
      */
136
-    public AjaxResult warn(String message)
137
-    {
132
+    public AjaxResult warn(String message) {
138 133
         return AjaxResult.warn(message);
139 134
     }
140 135
 
141 136
     /**
142 137
      * 响应返回结果
143
-     * 
138
+     *
144 139
      * @param rows 影响行数
145 140
      * @return 操作结果
146 141
      */
147
-    protected AjaxResult toAjax(int rows)
148
-    {
142
+    protected AjaxResult toAjax(int rows) {
149 143
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
150 144
     }
151 145
 
152 146
     /**
153 147
      * 响应返回结果
154
-     * 
148
+     *
155 149
      * @param result 结果
156 150
      * @return 操作结果
157 151
      */
158
-    protected AjaxResult toAjax(boolean result)
159
-    {
152
+    protected AjaxResult toAjax(boolean result) {
160 153
         return result ? success() : error();
161 154
     }
162 155
 
163 156
     /**
164 157
      * 页面跳转
165 158
      */
166
-    public String redirect(String url)
167
-    {
159
+    public String redirect(String url) {
168 160
         return StringUtils.format("redirect:{}", url);
169 161
     }
170 162
 
171 163
     /**
172 164
      * 获取用户缓存信息
173 165
      */
174
-    public LoginUser getLoginUser()
175
-    {
166
+    public LoginUser getLoginUser() {
176 167
         return SecurityUtils.getLoginUser();
177 168
     }
178 169
 
179 170
     /**
180 171
      * 获取登录用户id
181 172
      */
182
-    public Long getUserId()
183
-    {
173
+    public Long getUserId() {
184 174
         return getLoginUser().getUserId();
185 175
     }
186 176
 
187 177
     /**
188 178
      * 获取登录部门id
189 179
      */
190
-    public Long getDeptId()
191
-    {
180
+    public Long getDeptId() {
192 181
         return getLoginUser().getDeptId();
193 182
     }
194 183
 
195 184
     /**
196 185
      * 获取登录用户名
197 186
      */
198
-    public String getUsername()
199
-    {
187
+    public String getUsername() {
200 188
         return getLoginUser().getUsername();
201 189
     }
202 190
 }

+ 2 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java

@@ -7,7 +7,7 @@ import com.ruoyi.common.utils.sql.SqlUtil;
7 7
 
8 8
 /**
9 9
  * 分页工具类
10
- * 
10
+ *
11 11
  * @author ruoyi
12 12
  */
13 13
 public class PageUtils extends PageHelper
@@ -25,6 +25,7 @@ public class PageUtils extends PageHelper
25 25
         PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
26 26
     }
27 27
 
28
+
28 29
     /**
29 30
      * 清理分页的线程变量
30 31
      */

+ 24 - 22
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedController.java

@@ -148,29 +148,31 @@ public class PostCheckedController extends BaseController {
148 148
 
149 149
     /**
150 150
      * 修改岗检表管理
151
-     @ApiOperation("修改岗检表管理")
152
-     @ApiImplicitParams({
153
-     @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Long", dataTypeClass = Long.class),
154
-     @ApiImplicitParam(name = "checkWorkgroupId", value = "检查工作组ID", dataType = "Long", dataTypeClass = Long.class),
155
-     @ApiImplicitParam(name = "checkGroupId", value = "检查小组ID", dataType = "Long", dataTypeClass = Long.class),
156
-     @ApiImplicitParam(name = "checkedDeptId", value = "被检查部门ID", dataType = "Long", dataTypeClass = Long.class),
157
-     @ApiImplicitParam(name = "checkedPostId", value = "被检查岗位ID", dataType = "Long", dataTypeClass = Long.class),
158
-     @ApiImplicitParam(name = "printUserId", value = "打印人ID", dataType = "Long", dataTypeClass = Long.class),
159
-     @ApiImplicitParam(name = "printTime", value = "打印时间", dataType = "Date", dataTypeClass = Date.class),
160
-     @ApiImplicitParam(name = "checkedImg", value = "上传:检查后的检查表照片或PDF,磁盘相对路径", dataType = "String", dataTypeClass = String.class),
161
-     @ApiImplicitParam(name = "checkedUserName", value = "上传:检查人中文姓名(上传页面设置的值)", dataType = "String", dataTypeClass = String.class),
162
-     @ApiImplicitParam(name = "checkedTime", value = "上传:检查时间(上传页面设置的值)", dataType = "Date", dataTypeClass = Date.class),
163
-     @ApiImplicitParam(name = "uploadUserId", value = "上传:检查表上传人ID", dataType = "Long", dataTypeClass = Long.class),
164
-     @ApiImplicitParam(name = "uploadTime", value = "上传:检查表上传时间", dataType = "Date", dataTypeClass = Date.class),
165
-     @ApiImplicitParam(name = "delFlag", value = "删除标志(0代表存在 2代表删除)", dataType = "Integer", dataTypeClass = Integer.class),
166
-     @ApiImplicitParam(name = "createUserId", value = "创建者用户ID", dataType = "Long", dataTypeClass = Long.class),
167
-     })
168
-     @PreAuthorize("@ss.hasPermi('postCheck:postChecked:edit')")
169
-     @Log(title = "岗检表管理", businessType = BusinessType.UPDATE)
170
-     @PutMapping public AjaxResult edit(@RequestBody PostChecked postChecked) {
171
-     return toAjax(postCheckedService.updatePostChecked(postChecked));
172
-     }
173 151
      */
152
+    @ApiOperation("修改岗检表管理")
153
+    @ApiImplicitParams({
154
+            @ApiImplicitParam(name = "id", value = "主键ID", dataType = "Long", dataTypeClass = Long.class),
155
+            @ApiImplicitParam(name = "checkWorkgroupId", value = "检查工作组ID", dataType = "Long", dataTypeClass = Long.class),
156
+            @ApiImplicitParam(name = "checkGroupId", value = "检查小组ID", dataType = "Long", dataTypeClass = Long.class),
157
+            @ApiImplicitParam(name = "checkedDeptId", value = "被检查部门ID", dataType = "Long", dataTypeClass = Long.class),
158
+            @ApiImplicitParam(name = "checkedPostId", value = "被检查岗位ID", dataType = "Long", dataTypeClass = Long.class),
159
+//     @ApiImplicitParam(name = "printUserId", value = "打印人ID", dataType = "Long", dataTypeClass = Long.class),
160
+//     @ApiImplicitParam(name = "printTime", value = "打印时间", dataType = "Date", dataTypeClass = Date.class),
161
+//     @ApiImplicitParam(name = "checkedImg", value = "上传:检查后的检查表照片或PDF,磁盘相对路径", dataType = "String", dataTypeClass = String.class),
162
+//     @ApiImplicitParam(name = "checkedUserName", value = "上传:检查人中文姓名(上传页面设置的值)", dataType = "String", dataTypeClass = String.class),
163
+//     @ApiImplicitParam(name = "checkedTime", value = "上传:检查时间(上传页面设置的值)", dataType = "Date", dataTypeClass = Date.class),
164
+//     @ApiImplicitParam(name = "uploadUserId", value = "上传:检查表上传人ID", dataType = "Long", dataTypeClass = Long.class),
165
+//     @ApiImplicitParam(name = "uploadTime", value = "上传:检查表上传时间", dataType = "Date", dataTypeClass = Date.class),
166
+//     @ApiImplicitParam(name = "delFlag", value = "删除标志(0代表存在 2代表删除)", dataType = "Integer", dataTypeClass = Integer.class),
167
+//     @ApiImplicitParam(name = "createUserId", value = "创建者用户ID", dataType = "Long", dataTypeClass = Long.class),
168
+            @ApiImplicitParam(name = "children", value = "检查表明细数组", dataType = "List", dataTypeClass = PostCheckedItems.class),
169
+    })
170
+    @PreAuthorize("@ss.hasPermi('postCheck:postChecked:edit')")
171
+    @Log(title = "岗检表管理", businessType = BusinessType.UPDATE)
172
+    @PutMapping
173
+    public AjaxResult edit(@RequestBody PostChecked postChecked) {
174
+        return toAjax(postCheckedService.updatePostChecked(postChecked));
175
+    }
174 176
 
175 177
     /**
176 178
      * 删除岗检表管理

+ 247 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java

@@ -0,0 +1,247 @@
1
+package com.ruoyi.postCheck.controller;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.postCheck.domain.homePage.AssessmentRatingView;
6
+import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
7
+import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
8
+import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
9
+import com.ruoyi.postCheck.domain.problemStatistics.*;
10
+import com.ruoyi.postCheck.service.IPostCheckedProblemService;
11
+import io.swagger.annotations.Api;
12
+import io.swagger.annotations.ApiImplicitParam;
13
+import io.swagger.annotations.ApiImplicitParams;
14
+import io.swagger.annotations.ApiOperation;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.web.bind.annotation.GetMapping;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RestController;
19
+
20
+import java.math.BigDecimal;
21
+import java.util.*;
22
+
23
+/**
24
+ * 岗检问题表Controller
25
+ *
26
+ * @author csg
27
+ * @date 2023-12-23
28
+ */
29
+@Api(tags = "5.1.1-统计分析-检查统计-问题统计(职能管理)")
30
+@RestController
31
+@RequestMapping("/postCheck/functionProblemStatistics")
32
+public class PostCheckedFunctionProblemStatisticsController extends BaseController {
33
+    @Autowired
34
+    private IPostCheckedProblemService postCheckedProblemService;
35
+
36
+
37
+    @ApiOperation("1-职能部各部门问题数量对比")
38
+    @GetMapping("/functionDeptProblemContrast")
39
+//    @ApiImplicitParam(name = "notParam", value = "V2方便接口联调-这是返回信息", dataType = "FunctionDeptProblemContrastView", dataTypeClass = FunctionDeptProblemContrastView.class)
40
+    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
41
+//         查询问题表
42
+//        select * from "public"."post_checked_problem";
43
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
44
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
45
+
46
+        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
+        return success(list);
64
+    }
65
+
66
+
67
+    @ApiOperation("2-岗检覆盖率")
68
+    @GetMapping("/coverageRateView")
69
+    public AjaxResult coverageRateView(CoverageRateView notParam) { //notParam不是参数-是返回信息-方便接口联调
70
+//         查询问题表
71
+//        select * from "public"."post_checked_problem";
72
+//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
73
+//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
74
+
75
+
76
+        List<CoverageRateView> list = new ArrayList<>();
77
+        CoverageRateView data = new CoverageRateView();
78
+        data.setProblemTotal(6);
79
+        data.setProblemComplete(5);
80
+
81
+        list.add(data);
82
+        return success(list);
83
+    }
84
+
85
+    @ApiOperation("3-岗检问题职责类别占比")
86
+    @GetMapping("/dutyTypeProblemStatisticsView")
87
+    public AjaxResult dutyTypeProblemStatisticsView(DutyTypeProblemStatisticsView notParam) { //notParam不是参数-是返回信息-方便接口联调
88
+//         查询问题表
89
+//        select * from "public"."post_checked_problem";
90
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
91
+
92
+
93
+        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
94
+        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
95
+        data.setDutyTypeOne(1);
96
+        data.setDutyTypeTwo(2);
97
+        data.setDutyTypeThree(3);
98
+        data.setDutyTypeFour(4);
99
+
100
+        list.add(data);
101
+        return success(list);
102
+    }
103
+
104
+    @ApiOperation("4-岗检问题级别占比")
105
+    @GetMapping("/problemLevelView")
106
+    public AjaxResult problemLevelView(ProblemLevelView notParam) { //notParam不是参数-是返回信息-方便接口联调
107
+//         查询问题表
108
+//        select * from "public"."post_checked_problem";
109
+//        group by problem_level   问题等级(一般、重要)
110
+
111
+        List<ProblemLevelView> list = new ArrayList<>();
112
+        ProblemLevelView data = new ProblemLevelView();
113
+        data.setProblemLeveOne(2);
114
+        data.setProblemLeveTwo(1);
115
+
116
+
117
+        list.add(data);
118
+        return success(list);
119
+    }
120
+
121
+
122
+    @ApiOperation("5-岗检问题属性及类别整改占比")
123
+    @GetMapping("/problemAttributeCategoryView")
124
+    public AjaxResult problemAttributeCategoryView(ProblemAttributeCategoryView notParam) { //notParam不是参数-是返回信息-方便接口联调
125
+//         查询问题表
126
+//        select * from "public"."post_checked_problem";
127
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
128
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
129
+
130
+
131
+        List<ProblemAttributeCategoryView> list = new ArrayList<>();
132
+        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
133
+//        data.set完成性
134
+//        data.set适宜性
135
+//        data.set有效性
136
+//        data.set职责权限
137
+//        data.set工作内容
138
+//        data.set工作标准
139
+//        data.set考核奖励
140
+//        data.set任职资格
141
+//        data.set其他
142
+
143
+        list.add(data);
144
+        return success(list);
145
+    }
146
+
147
+
148
+    @ApiOperation("6-历年岗检问题数量")
149
+    @GetMapping("/historyProblemNumberView")
150
+    public AjaxResult historyProblemNumberView(HistoryProblemNumberView notParam) { //notParam不是参数-是返回信息-方便接口联调
151
+//         查询问题表
152
+//        select * from "public"."post_checked_problem";
153
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
154
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
155
+
156
+
157
+        List<HistoryProblemNumberView> list = new ArrayList<>();
158
+        HistoryProblemNumberView data = new HistoryProblemNumberView();
159
+        data.setCheckYear(new Date());
160
+//        data.set问题总数
161
+//        data.set完成性
162
+//        data.set适宜性
163
+//        data.set有效性
164
+//        data.set职责权限
165
+//        data.set工作内容
166
+//        data.set工作标准
167
+//        data.set考核奖励
168
+//        data.set任职资格
169
+//        data.set其他
170
+
171
+        list.add(data);
172
+        return success(list);
173
+    }
174
+
175
+/*
176
+    @ApiOperation("7-部门详情")
177
+    @GetMapping("/deptDetaailView")
178
+    public AjaxResult deptDetaailView() {
179
+//         查询问题表
180
+//        select * from "public"."post_checked_problem";
181
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
182
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
183
+
184
+
185
+        List<DeptDetaailView> list = new ArrayList<>();
186
+
187
+        //TODO 第一步:得到4个职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
188
+        //TODO 第二步:遍历职责类别 -> (总数和已完成数)设置问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
189
+        DeptDetaailView data1 = new DeptDetaailView();
190
+//        data4.setdutyTypeOne //业务职责
191
+        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
192
+        DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
193
+//        child1.set完整性数量") private Integer problemComplete;
194
+//        child1.set适宜性数量") private Integer problemSuitable;
195
+//        child1.set有效性数量") private Integer problemEffective;
196
+//        child1.set已完成完整性数量") private Integer problemCompleteChecked;
197
+//        child1.set已完成适宜性数量") private Integer problemSuitableChecked;
198
+//        child1.set已完成有效性数量") private Integer problemEffectiveChecked;
199
+        children1.add(child1);
200
+        data1.setChildren(children1);
201
+        list.add(data1);
202
+
203
+        DeptDetaailView data2 = new DeptDetaailView();
204
+//        data4.setdutyTypeTwo 党建及党风廉政
205
+        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
206
+        DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
207
+//        child2.set完整性数量") private Integer problemComplete;
208
+//        child2.set适宜性数量") private Integer problemSuitable;
209
+//        child2.set有效性数量") private Integer problemEffective;
210
+//        child2.set已完成完整性数量") private Integer problemCompleteChecked;
211
+//        child2.set已完成适宜性数量") private Integer problemSuitableChecked;
212
+//        child2.set已完成有效性数量") private Integer problemEffectiveChecked;
213
+        children1.add(child2);
214
+        data2.setChildren(children2);
215
+        list.add(data2);
216
+
217
+        DeptDetaailView data3 = new DeptDetaailView();
218
+//        data4.setdutyTypeThree 安全环保职责
219
+        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
220
+        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
221
+//        child3.set完整性数量") private Integer problemComplete;
222
+//        child3.set适宜性数量") private Integer problemSuitable;
223
+//        child3.set有效性数量") private Integer problemEffective;
224
+//        child3.set已完成完整性数量") private Integer problemCompleteChecked;
225
+//        child3.set已完成适宜性数量") private Integer problemSuitableChecked;
226
+//        child3.set已完成有效性数量") private Integer problemEffectiveChecked;
227
+        children1.add(child3);
228
+        data3.setChildren(children3);
229
+        list.add(data3);
230
+
231
+        DeptDetaailView data4 = new DeptDetaailView();
232
+//        data4.setdutyTypeFour 合规保密职
233
+        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
234
+        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
235
+//        child4.set完整性数量") private Integer problemComplete;
236
+//        child4.set适宜性数量") private Integer problemSuitable;
237
+//        child4.set有效性数量") private Integer problemEffective;
238
+//        child4.set已完成完整性数量") private Integer problemCompleteChecked;
239
+//        child4.set已完成适宜性数量") private Integer problemSuitableChecked;
240
+//        child4.set已完成有效性数量") private Integer problemEffectiveChecked;
241
+        children1.add(child4);
242
+        data4.setChildren(children4);
243
+        list.add(data4);
244
+        return success(list);
245
+    }
246
+    */
247
+}

+ 42 - 93
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedHomePageController.java

@@ -3,7 +3,9 @@ package com.ruoyi.postCheck.controller;
3 3
 import com.ruoyi.common.core.controller.BaseController;
4 4
 import com.ruoyi.common.core.domain.AjaxResult;
5 5
 import com.ruoyi.common.utils.Arith;
6
+import com.ruoyi.postCheck.domain.PostAssessmentRating;
6 7
 import com.ruoyi.postCheck.domain.homePage.*;
8
+import com.ruoyi.postCheck.service.IPostAssessmentRatingService;
7 9
 import com.ruoyi.postCheck.service.IPostCheckedProblemService;
8 10
 import io.swagger.annotations.Api;
9 11
 import io.swagger.annotations.ApiImplicitParam;
@@ -14,6 +16,16 @@ import org.springframework.web.bind.annotation.*;
14 16
 
15 17
 import java.math.BigDecimal;
16 18
 import java.util.*;
19
+import java.util.stream.Collectors;
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
17 29
 
18 30
 /**
19 31
  * 岗检问题表Controller
@@ -27,7 +39,8 @@ import java.util.*;
27 39
 public class PostCheckedHomePageController extends BaseController {
28 40
     @Autowired
29 41
     private IPostCheckedProblemService postCheckedProblemService;
30
-
42
+    @Autowired
43
+    private IPostAssessmentRatingService postAssessmentRatingService;
31 44
     /**
32 45
      * 1、责任制清单:post_list表
33 46
      * 2、检查出的问题:post_checked_problem表
@@ -58,61 +71,21 @@ public class PostCheckedHomePageController extends BaseController {
58 71
     @GetMapping("/checkedProblem")
59 72
     public AjaxResult checkedProblem() {
60 73
 //        检查出的问题:post_checked_problem表 按 problem_attribute-问题属性(1-完整问题;2-有效性问题;3-适宜性问题;) 分组 count(id)
61
-        List<PostCheckedProblemView> list = new ArrayList<>();
62
-        PostCheckedProblemView data = new PostCheckedProblemView();
63
-//        data.set
64
-//        data.set
65
-//        data.set
66
-        list.add(data);
67
-        return success(list);
74
+        return success(postCheckedProblemService.checkedProblem());
68 75
     }
69 76
 
70 77
 
71 78
     @ApiOperation("3-人员数量")
72 79
     @GetMapping("/userTotal")
73 80
     public AjaxResult userTotal() {
74
-//        查询人员表:sys_users
75
-        int userCount = 999;
76
-        return success(userCount);
81
+        return success(postCheckedProblemService.userTotal());
77 82
     }
78 83
 
79 84
 
80 85
     @ApiOperation("4-岗检问题整改率(中间饼状图 统计的 岗检问题整改率 和 岗检部门整改率 tab 切换时前端自己计算,不需要提供接口)")
81 86
     @GetMapping("/problemRectification")
82 87
     public AjaxResult problemRectification() {
83
-//        查询问题表:post_checked_problem
84
-//        group by problem_attribute 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
85
-//        最好给前端定义一个对象,用Map也可以
86
-        List<Map<Integer, BigDecimal>> dataList = new ArrayList<>();
87
-        Map<Integer, BigDecimal> data1 = new HashMap<>();
88
-        data1.put(0, new BigDecimal(Arith.round(new BigDecimal(0.9).doubleValue(), 2)));
89
-//        data1.put(1, new BigDecimal(0.95));//完整问题
90
-//        data1.put(2, new BigDecimal(0.88));//有效性问题
91
-//        data1.put(3, new BigDecimal(0.86));//适宜性问题
92
-        dataList.add(data1);
93
-
94
-        Map<Integer, BigDecimal> data2 = new HashMap<>();
95
-//        data2.put(0, new BigDecimal(0.9));
96
-        data2.put(1, new BigDecimal(Arith.round(new BigDecimal(0.95).doubleValue(), 2)));//完整问题
97
-//        data2.put(2, new BigDecimal(0.88));//有效性问题
98
-//        data2.put(3, new BigDecimal(0.86));//适宜性问题
99
-        dataList.add(data2);
100
-
101
-
102
-        Map<Integer, BigDecimal> data3 = new HashMap<>();
103
-//        data3.put(0, new BigDecimal(0.9));
104
-//        data3.put(1, new BigDecimal(0.95));//完整问题
105
-        data3.put(2, new BigDecimal(Arith.round(new BigDecimal(0.88).doubleValue(), 2)));//有效性问题
106
-//        data3.put(3, new BigDecimal(0.86));//适宜性问题
107
-        dataList.add(data3);
108
-
109
-        Map<Integer, BigDecimal> data4 = new HashMap<>();
110
-//        data4.put(0, new BigDecimal(0.9));
111
-//        data4.put(1, new BigDecimal(0.95));//完整问题
112
-//        data4.put(2, new BigDecimal(0.88));//有效性问题
113
-        data4.put(3, new BigDecimal(Arith.round(new BigDecimal(0.86).doubleValue(), 2)));//适宜性问题
114
-        dataList.add(data4);
115
-        return success(dataList);
88
+        return success(postCheckedProblemService.problemRectification());
116 89
     }
117 90
 
118 91
 
@@ -122,25 +95,7 @@ public class PostCheckedHomePageController extends BaseController {
122 95
 //        查询问题表:post_checked_problem
123 96
 //        group by checked_dept_id 整改责任部门ID(被检查部门ID)
124 97
 //        最好给前端定义一个对象,用Map也可以
125
-        List<DeptProblemRectificationView> dataList = new ArrayList<>();
126
-        DeptProblemRectificationView data1 = new DeptProblemRectificationView();
127
-        data1.setDeptId(100l);
128
-        data1.setDeptName("测试部门V1");
129
-        data1.setProblemTotal(10);
130
-        data1.setProblemComplete(9);
131
-        data1.setProblemRectificationRate(new BigDecimal(Arith.round(new BigDecimal(0.9).doubleValue(), 2)));
132
-        dataList.add(data1);
133
-
134
-
135
-        DeptProblemRectificationView data2 = new DeptProblemRectificationView();
136
-        data2.setDeptId(101l);
137
-        data2.setDeptName("测试部门V2");
138
-        data2.setProblemTotal(8);
139
-        data2.setProblemComplete(4);
140
-        data2.setProblemRectificationRate(new BigDecimal(Arith.round(new BigDecimal(0.5).doubleValue(), 2)));
141
-        dataList.add(data2);
142
-
143
-        return success(dataList);
98
+        return success(postCheckedProblemService.deptProblemRectification());
144 99
     }
145 100
 
146 101
 
@@ -163,15 +118,7 @@ public class PostCheckedHomePageController extends BaseController {
163 118
 //        select * from "public"."sys_users";
164 119
 //        select * from "public"."sys_user_post";
165 120
 
166
-        List<PostCheckedUnCheckedView> dataList = new ArrayList<>();
167
-        PostCheckedUnCheckedView data1 = new PostCheckedUnCheckedView();
168
-        data1.setDeptId(100l);
169
-        data1.setDeptName("测试部门V1");
170
-        data1.setPostId(1l);
171
-        data1.setPostName("内操岗位");
172
-        data1.setUserCount(99);
173
-        dataList.add(data1);
174
-        return success(dataList);
121
+        return success(postCheckedProblemService.postChecked(1));
175 122
     }
176 123
 
177 124
 
@@ -194,15 +141,7 @@ public class PostCheckedHomePageController extends BaseController {
194 141
 //        select * from "public"."sys_users";
195 142
 //        select * from "public"."sys_user_post";
196 143
 
197
-        List<PostCheckedUnCheckedView> dataList = new ArrayList<>();
198
-        PostCheckedUnCheckedView data1 = new PostCheckedUnCheckedView();
199
-        data1.setDeptId(100l);
200
-        data1.setDeptName("测试部门V1");
201
-        data1.setPostId(1l);
202
-        data1.setPostName("内操岗位");
203
-        data1.setUserCount(99);
204
-        dataList.add(data1);
205
-        return success(dataList);
144
+        return success(postCheckedProblemService.postChecked(2));
206 145
     }
207 146
 
208 147
 
@@ -218,18 +157,28 @@ public class PostCheckedHomePageController extends BaseController {
218 157
 
219 158
 //      部门得分 = (岗检分数 * 0.5 + 互评分数 * 0.5  )
220 159
 //      根据部门得分进行排名计算
221
-
222
-
160
+        PostAssessmentRating postAssessmentRating1 = new PostAssessmentRating();
161
+        postAssessmentRating1.setType(1);
162
+        List<PostAssessmentRating> postAssessmentRatings1 = postAssessmentRatingService.selectPostAssessmentRatingList(postAssessmentRating1);
163
+        PostAssessmentRating postAssessmentRating2 = new PostAssessmentRating();
164
+        postAssessmentRating2.setType(2);
165
+        List<PostAssessmentRating> postAssessmentRatings2 = postAssessmentRatingService.selectPostAssessmentRatingList(postAssessmentRating2);
166
+        postAssessmentRatings1.addAll(postAssessmentRatings2);
223 167
         List<AssessmentRatingView> dataList = new ArrayList<>();
224
-        AssessmentRatingView data1 = new AssessmentRatingView();
225
-        data1.setRating(1);
226
-        data1.setDeptId(100l);
227
-        data1.setDeptName("测试部门V1");
228
-//        data1.setPostId(1l);
229
-//        data1.setPostName("内操岗位");
230
-        data1.setPostCount(6);
231
-        data1.setScore(new BigDecimal(Arith.round(new BigDecimal(99.98).doubleValue(), 2)));
232
-        dataList.add(data1);
233
-        return success(dataList);
168
+        postAssessmentRatings1.forEach(x->{
169
+            AssessmentRatingView data1 = new AssessmentRatingView();
170
+            data1.setDeptId(x.getDeptId());
171
+            data1.setDeptName(x.getDeptIdStr());
172
+            data1.setPostCount(postCheckedProblemService.getPostCountByDeptId(x.getDeptId()));
173
+            data1.setScore(x.getDepartmentScore());
174
+            dataList.add(data1);
175
+        });
176
+        List<AssessmentRatingView> collect = dataList.stream().sorted(Comparator.comparing(AssessmentRatingView::getScore).reversed()).collect(Collectors.toList());
177
+        Integer i = 1;
178
+        for (AssessmentRatingView x : collect) {
179
+            x.setRating(i);
180
+            i++;
181
+        }
182
+        return success(collect);
234 183
     }
235 184
 }

+ 20 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProblemController.java

@@ -3,6 +3,9 @@ package com.ruoyi.postCheck.controller;
3 3
 import java.util.Date;
4 4
 import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6
+
7
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
8
+import com.ruoyi.postCheck.domain.tools.ProblemCategory;
6 9
 import io.swagger.annotations.*;
7 10
 import org.springframework.security.access.prepost.PreAuthorize;
8 11
 import org.springframework.beans.factory.annotation.Autowired;
@@ -84,7 +87,9 @@ public class PostCheckedProblemController extends BaseController {
84 87
     @PreAuthorize("@ss.hasPermi('postCheck:postCheckedProblem:list')")
85 88
     @GetMapping("/list")
86 89
     public TableDataInfo list(PostCheckedProblem postCheckedProblem) {
87
-        startPage();
90
+
91
+//        startPage();
92
+        startPage("desc","t1.create_time");
88 93
         List<PostCheckedProblem> list = postCheckedProblemService.selectPostCheckedProblemList(postCheckedProblem);
89 94
         return getDataTable(list);
90 95
     }
@@ -361,4 +366,18 @@ public class PostCheckedProblemController extends BaseController {
361 366
         return toAjax(postCheckedProblemService.setReviewDepartmentReviewerTime(id, status, reviewConclusion, reason));
362 367
     }
363 368
 
369
+
370
+
371
+    @ApiOperation("Tools-1、按问题属性分组统计问题类别")
372
+    @GetMapping("/problemCategoryByAttribute")
373
+    public AjaxResult problemCategoryByAttribute(ProblemCategory noParam) {
374
+
375
+// GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
376
+// GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
377
+
378
+        List<ProblemCategory> problemCategoryByAttributeList = postCheckedProblemService.problemCategoryByAttribute();
379
+
380
+        return success(problemCategoryByAttributeList);
381
+    }
382
+
364 383
 }

+ 253 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java

@@ -0,0 +1,253 @@
1
+package com.ruoyi.postCheck.controller;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.postCheck.domain.problemStatistics.*;
6
+import com.ruoyi.postCheck.service.IPostCheckedProblemService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.web.bind.annotation.GetMapping;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import java.util.ArrayList;
15
+import java.util.Date;
16
+import java.util.List;
17
+
18
+/**
19
+ * 岗检问题表Controller
20
+ *
21
+ * @author csg
22
+ * @date 2023-12-23
23
+ */
24
+@Api(tags = "5.1.2-统计分析-检查统计-问题统计(生产运营)")
25
+@RestController
26
+@RequestMapping("/postCheck/productionProblemStatistics")
27
+public class PostCheckedProductionProblemStatisticsController extends BaseController {
28
+    @Autowired
29
+    private IPostCheckedProblemService postCheckedProblemService;
30
+
31
+
32
+    @ApiOperation("1-职能部各部门问题数量对比")
33
+    @GetMapping("/functionDeptProblemContrast")
34
+    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
35
+//         查询问题表
36
+//        select * from "public"."post_checked_problem";
37
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
38
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
39
+
40
+        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
+
56
+        list.add(data);
57
+        return success(list);
58
+    }
59
+
60
+
61
+    @ApiOperation("2-岗检覆盖率")
62
+    @GetMapping("/coverageRateView")
63
+    public AjaxResult coverageRateView(CoverageRateView notParam) { //notParam不是参数-是返回信息-方便接口联调
64
+//         查询问题表
65
+//        select * from "public"."post_checked_problem";
66
+//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
67
+//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
68
+
69
+
70
+        List<CoverageRateView> list = new ArrayList<>();
71
+        CoverageRateView data = new CoverageRateView();
72
+        data.setProblemTotal(6);
73
+        data.setProblemComplete(5);
74
+
75
+        list.add(data);
76
+        return success(list);
77
+    }
78
+
79
+    @ApiOperation("3-岗检问题职责类别占比")
80
+    @GetMapping("/dutyTypeProblemStatisticsView")
81
+    public AjaxResult dutyTypeProblemStatisticsView(DutyTypeProblemStatisticsView notParam) { //notParam不是参数-是返回信息-方便接口联调
82
+//         查询问题表
83
+//        select * from "public"."post_checked_problem";
84
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
85
+
86
+
87
+        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
88
+        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
89
+        data.setDutyTypeOne(1);
90
+        data.setDutyTypeTwo(2);
91
+        data.setDutyTypeThree(3);
92
+        data.setDutyTypeFour(4);
93
+
94
+        list.add(data);
95
+        return success(list);
96
+    }
97
+
98
+    @ApiOperation("4-岗检问题级别占比")
99
+    @GetMapping("/problemLevelView")
100
+    public AjaxResult problemLevelView(ProblemLevelView notParam) { //notParam不是参数-是返回信息-方便接口联调
101
+//         查询问题表
102
+//        select * from "public"."post_checked_problem";
103
+//        group by problem_level   问题等级(一般、重要)
104
+
105
+        List<ProblemLevelView> list = new ArrayList<>();
106
+        ProblemLevelView data = new ProblemLevelView();
107
+        data.setProblemLeveOne(2);
108
+        data.setProblemLeveTwo(1);
109
+
110
+
111
+        list.add(data);
112
+        return success(list);
113
+    }
114
+
115
+
116
+    @ApiOperation("5-岗检问题属性及类别整改占比")
117
+    @GetMapping("/problemAttributeCategoryView")
118
+    public AjaxResult problemAttributeCategoryView(ProblemAttributeCategoryView notParam) { //notParam不是参数-是返回信息-方便接口联调
119
+//         查询问题表
120
+//        select * from "public"."post_checked_problem";
121
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
122
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
123
+
124
+
125
+        List<ProblemAttributeCategoryView> list = new ArrayList<>();
126
+        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
127
+//        data.set完成性
128
+//        data.set适宜性
129
+//        data.set有效性
130
+//        data.set职责权限
131
+//        data.set工作内容
132
+//        data.set工作标准
133
+//        data.set考核奖励
134
+//        data.set任职资格
135
+//        data.set其他
136
+
137
+        list.add(data);
138
+        return success(list);
139
+    }
140
+
141
+
142
+    @ApiOperation("6-历年岗检问题数量")
143
+    @GetMapping("/historyProblemNumberView")
144
+    public AjaxResult historyProblemNumberView(HistoryProblemNumberView notParam) { //notParam不是参数-是返回信息-方便接口联调
145
+//         查询问题表
146
+//        select * from "public"."post_checked_problem";
147
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
148
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
149
+
150
+
151
+        List<HistoryProblemNumberView> list = new ArrayList<>();
152
+        HistoryProblemNumberView data = new HistoryProblemNumberView();
153
+        data.setCheckYear(new Date());
154
+//        data.set问题总数
155
+//        data.set完成性
156
+//        data.set适宜性
157
+//        data.set有效性
158
+//        data.set职责权限
159
+//        data.set工作内容
160
+//        data.set工作标准
161
+//        data.set考核奖励
162
+//        data.set任职资格
163
+//        data.set其他
164
+
165
+        list.add(data);
166
+        return success(list);
167
+    }
168
+
169
+
170
+    @ApiOperation("7-部门详情")
171
+    @GetMapping("/deptDetaailView")
172
+    public AjaxResult deptDetaailView(CheckedProblemDeptDetaailView notParam) { //notParam不是参数-是返回信息-方便接口联调
173
+//         查询问题表
174
+//        select * from "public"."post_checked_problem";
175
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
176
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
177
+
178
+
179
+        List<CheckedProblemDeptDetaailView> list = new ArrayList<>();
180
+
181
+        //TODO 第一步:得到各个部门ID、部门名称、问题总数量、重要问题数量、一般问题数量、统计时间
182
+        //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
183
+        //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
184
+
185
+
186
+
187
+        CheckedProblemDeptDetaailView data1 = new CheckedProblemDeptDetaailView();
188
+//        data1.setdeptId 部门ID
189
+//        data1.setdeptName 部门名称
190
+//        data1.setproblemTotal 问题数量
191
+//        data1.setproblemLeveTwo 重要问题
192
+//        data1.setproblemLeveOne 一般问题
193
+//        data1.setstatisticsTime 统计时间
194
+
195
+        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
196
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
197
+//        child1.set完整性数量") private Integer problemComplete;
198
+//        child1.set适宜性数量") private Integer problemSuitable;
199
+//        child1.set有效性数量") private Integer problemEffective;
200
+        children1.add(child1);
201
+        data1.setChildren(children1);
202
+        list.add(data1);
203
+
204
+        CheckedProblemDeptDetaailView data2 = new CheckedProblemDeptDetaailView();
205
+//        data2.setdeptId 部门ID
206
+//        data2.setdeptName 部门名称
207
+//        data2.setproblemTotal 问题数量
208
+//        data2.setproblemLeveTwo 重要问题
209
+//        data2.setproblemLeveOne 一般问题
210
+//        data2.setstatisticsTime 统计时间
211
+        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
212
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child2 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
213
+//        child2.set完整性数量") private Integer problemComplete;
214
+//        child2.set适宜性数量") private Integer problemSuitable;
215
+//        child2.set有效性数量") private Integer problemEffective;
216
+        children1.add(child2);
217
+        data2.setChildren(children2);
218
+        list.add(data2);
219
+
220
+        CheckedProblemDeptDetaailView data3 = new CheckedProblemDeptDetaailView();
221
+//        data3.setdeptId 部门ID
222
+//        data3.setdeptName 部门名称
223
+//        data3.setproblemTotal 问题数量
224
+//        data3.setproblemLeveTwo 重要问题
225
+//        data3.setproblemLeveOne 一般问题
226
+//        data3.setstatisticsTime 统计时间
227
+        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
228
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child3 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
229
+//        child3.set完整性数量") private Integer problemComplete;
230
+//        child3.set适宜性数量") private Integer problemSuitable;
231
+//        child3.set有效性数量") private Integer problemEffective;
232
+        children1.add(child3);
233
+        data3.setChildren(children3);
234
+        list.add(data3);
235
+
236
+        CheckedProblemDeptDetaailView data4 = new CheckedProblemDeptDetaailView();
237
+//        data4.setdeptId 部门ID
238
+//        data4.setdeptName 部门名称
239
+//        data4.setproblemTotal 问题数量
240
+//        data4.setproblemLeveTwo 重要问题
241
+//        data4.setproblemLeveOne 一般问题
242
+//        data4.setstatisticsTime 统计时间
243
+        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
244
+        CheckedProblemDeptDetaailView.ProblemAttributeInner child4 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
245
+//        child4.set完整性数量") private Integer problemComplete;
246
+//        child4.set适宜性数量") private Integer problemSuitable;
247
+//        child4.set有效性数量") private Integer problemEffective;
248
+        children1.add(child4);
249
+        data4.setChildren(children4);
250
+        list.add(data4);
251
+        return success(list);
252
+    }
253
+}

+ 259 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationFunctionProblemStatisticsController.java

@@ -0,0 +1,259 @@
1
+package com.ruoyi.postCheck.controller;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.postCheck.domain.problemStatistics.*;
6
+import com.ruoyi.postCheck.service.IPostCheckedProblemService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.web.bind.annotation.GetMapping;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import java.util.ArrayList;
15
+import java.util.Date;
16
+import java.util.List;
17
+
18
+/**
19
+ * 岗检问题表Controller
20
+ *
21
+ * @author csg
22
+ * @date 2023-12-23
23
+ */
24
+@Api(tags = "5.2.1-统计分析-整改统计-整改统计(职能管理)")
25
+@RestController
26
+@RequestMapping("/postCheck/rectificationFunctionProblemStatistics")
27
+public class PostCheckedRectificationFunctionProblemStatisticsController extends BaseController {
28
+    @Autowired
29
+    private IPostCheckedProblemService postCheckedProblemService;
30
+
31
+
32
+    @ApiOperation("1-职能部各部门问题数量对比")
33
+    @GetMapping("/functionDeptProblemContrast")
34
+    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
35
+//         查询问题表
36
+//        select * from "public"."post_checked_problem";
37
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
38
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
39
+
40
+        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
+
56
+        list.add(data);
57
+        return success(list);
58
+    }
59
+
60
+
61
+    @ApiOperation("2-岗检覆盖率")
62
+    @GetMapping("/coverageRateView")
63
+    public AjaxResult coverageRateView(CoverageRateView notParam) { //notParam不是参数-是返回信息-方便接口联调
64
+//         查询问题表
65
+//        select * from "public"."post_checked_problem";
66
+//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
67
+//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
68
+
69
+
70
+        List<CoverageRateView> list = new ArrayList<>();
71
+        CoverageRateView data = new CoverageRateView();
72
+        data.setProblemTotal(6);
73
+        data.setProblemComplete(5);
74
+
75
+        list.add(data);
76
+        return success(list);
77
+    }
78
+
79
+    @ApiOperation("3-岗检问题职责类别占比")
80
+    @GetMapping("/dutyTypeProblemStatisticsView")
81
+    public AjaxResult dutyTypeProblemStatisticsView(DutyTypeProblemStatisticsView notParam) { //notParam不是参数-是返回信息-方便接口联调
82
+//         查询问题表
83
+//        select * from "public"."post_checked_problem";
84
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
85
+
86
+
87
+        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
88
+        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
89
+        data.setDutyTypeOne(1);
90
+        data.setDutyTypeTwo(2);
91
+        data.setDutyTypeThree(3);
92
+        data.setDutyTypeFour(4);
93
+
94
+        list.add(data);
95
+        return success(list);
96
+    }
97
+
98
+    @ApiOperation("4-岗检问题级别占比")
99
+    @GetMapping("/problemLevelView")
100
+    public AjaxResult problemLevelView(ProblemLevelView notParam) { //notParam不是参数-是返回信息-方便接口联调
101
+//         查询问题表
102
+//        select * from "public"."post_checked_problem";
103
+//        group by problem_level   问题等级(一般、重要)
104
+
105
+        List<ProblemLevelView> list = new ArrayList<>();
106
+        ProblemLevelView data = new ProblemLevelView();
107
+        data.setProblemLeveOne(2);
108
+        data.setProblemLeveTwo(1);
109
+
110
+
111
+        list.add(data);
112
+        return success(list);
113
+    }
114
+
115
+
116
+    @ApiOperation("5-岗检问题属性及类别整改占比")
117
+    @GetMapping("/problemAttributeCategoryView")
118
+    public AjaxResult problemAttributeCategoryView(ProblemAttributeCategoryView notParam) { //notParam不是参数-是返回信息-方便接口联调
119
+//         查询问题表
120
+//        select * from "public"."post_checked_problem";
121
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
122
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
123
+
124
+
125
+        List<ProblemAttributeCategoryView> list = new ArrayList<>();
126
+        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
127
+//        data.set完成性
128
+//        data.set适宜性
129
+//        data.set有效性
130
+//        data.set职责权限
131
+//        data.set工作内容
132
+//        data.set工作标准
133
+//        data.set考核奖励
134
+//        data.set任职资格
135
+//        data.set其他
136
+
137
+        list.add(data);
138
+        return success(list);
139
+    }
140
+
141
+
142
+    @ApiOperation("6-历年岗检问题数量")
143
+    @GetMapping("/historyProblemNumberView")
144
+    public AjaxResult historyProblemNumberView(HistoryProblemNumberView notParam) { //notParam不是参数-是返回信息-方便接口联调
145
+//         查询问题表
146
+//        select * from "public"."post_checked_problem";
147
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
148
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
149
+
150
+
151
+        List<HistoryProblemNumberView> list = new ArrayList<>();
152
+        HistoryProblemNumberView data = new HistoryProblemNumberView();
153
+        data.setCheckYear(new Date());
154
+//        data.set问题总数
155
+//        data.set完成性
156
+//        data.set适宜性
157
+//        data.set有效性
158
+//        data.set职责权限
159
+//        data.set工作内容
160
+//        data.set工作标准
161
+//        data.set考核奖励
162
+//        data.set任职资格
163
+//        data.set其他
164
+
165
+        list.add(data);
166
+        return success(list);
167
+    }
168
+
169
+
170
+    @ApiOperation("7-部门详情")
171
+    @GetMapping("/deptDetaailView")
172
+    public AjaxResult deptDetaailView(DeptDetaailView notParam) { //notParam不是参数-是返回信息-方便接口联调
173
+//         查询问题表
174
+//        select * from "public"."post_checked_problem";
175
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
176
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
177
+
178
+
179
+        List<DeptDetaailView> list = new ArrayList<>();
180
+
181
+        //TODO 第一步:得到各个部门ID和部门名称及统计时间
182
+        //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
183
+        //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
184
+
185
+        DeptDetaailView data1 = new DeptDetaailView();
186
+//        data1.setdeptId 部门ID
187
+//        data1.setdeptName 部门名称
188
+//        data1.setproblemRectificationRate 整改率
189
+//        data1.setstatisticsTime 统计时间
190
+
191
+        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
192
+        DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
193
+//        child1.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
194
+//        child1.set完整性数量 private Integer problemComplete;
195
+//        child1.set适宜性数量 private Integer problemSuitable;
196
+//        child1.set有效性数量 private Integer problemEffective;
197
+//        child1.set已完成完整性数量 private Integer problemCompleteChecked;
198
+//        child1.set已完成适宜性数量 private Integer problemSuitableChecked;
199
+//        child1.set已完成有效性数量 private Integer problemEffectiveChecked;
200
+        children1.add(child1);
201
+        data1.setChildren(children1);
202
+        list.add(data1);
203
+
204
+        DeptDetaailView data2 = new DeptDetaailView();
205
+//        data2.setdeptId 部门ID
206
+//        data2.setdeptName 部门名称
207
+//        data2.setproblemRectificationRate 整改率
208
+//        data2.setstatisticsTime 统计时间
209
+        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
210
+        DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
211
+//        child2.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
212
+//        child2.set完整性数量  private Integer problemComplete;
213
+//        child2.set适宜性数量  private Integer problemSuitable;
214
+//        child2.set有效性数量  private Integer problemEffective;
215
+//        child2.set已完成完整性数量 private Integer problemCompleteChecked;
216
+//        child2.set已完成适宜性数量 private Integer problemSuitableChecked;
217
+//        child2.set已完成有效性数量 private Integer problemEffectiveChecked;
218
+        children1.add(child2);
219
+        data2.setChildren(children2);
220
+        list.add(data2);
221
+
222
+        DeptDetaailView data3 = new DeptDetaailView();
223
+//        data3.setdeptId 部门ID
224
+//        data3.setdeptName 部门名称
225
+//        data3.setproblemRectificationRate 整改率
226
+//        data3.setstatisticsTime 统计时间
227
+        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
228
+        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
229
+//        child3.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
230
+//        child3.set完整性数量  private Integer problemComplete;
231
+//        child3.set适宜性数量  private Integer problemSuitable;
232
+//        child3.set有效性数量  private Integer problemEffective;
233
+//        child3.set已完成完整性数量 private Integer problemCompleteChecked;
234
+//        child3.set已完成适宜性数量 private Integer problemSuitableChecked;
235
+//        child3.set已完成有效性数量 private Integer problemEffectiveChecked;
236
+        children1.add(child3);
237
+        data3.setChildren(children3);
238
+        list.add(data3);
239
+
240
+        DeptDetaailView data4 = new DeptDetaailView();
241
+//        data4.setdeptId 部门ID
242
+//        data4.setdeptName 部门名称
243
+//        data4.setproblemRectificationRate 整改率
244
+//        data4.setstatisticsTime 统计时间
245
+        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
246
+        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
247
+//        child4.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
248
+//        child4.set完整性数量 private Integer problemComplete;
249
+//        child4.set适宜性数量 private Integer problemSuitable;
250
+//        child4.set有效性数量 private Integer problemEffective;
251
+//        child4.set已完成完整性数量 private Integer problemCompleteChecked;
252
+//        child4.set已完成适宜性数量 private Integer problemSuitableChecked;
253
+//        child4.set已完成有效性数量 private Integer problemEffectiveChecked;
254
+        children1.add(child4);
255
+        data4.setChildren(children4);
256
+        list.add(data4);
257
+        return success(list);
258
+    }
259
+}

+ 259 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationProductionProblemStatisticsController.java

@@ -0,0 +1,259 @@
1
+package com.ruoyi.postCheck.controller;
2
+
3
+import com.ruoyi.common.core.controller.BaseController;
4
+import com.ruoyi.common.core.domain.AjaxResult;
5
+import com.ruoyi.postCheck.domain.problemStatistics.*;
6
+import com.ruoyi.postCheck.service.IPostCheckedProblemService;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiOperation;
9
+import org.springframework.beans.factory.annotation.Autowired;
10
+import org.springframework.web.bind.annotation.GetMapping;
11
+import org.springframework.web.bind.annotation.RequestMapping;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import java.util.ArrayList;
15
+import java.util.Date;
16
+import java.util.List;
17
+
18
+/**
19
+ * 岗检问题表Controller
20
+ *
21
+ * @author csg
22
+ * @date 2023-12-23
23
+ */
24
+@Api(tags = "5.2.2-统计分析-整改统计-整改统计(生产运营)")
25
+@RestController
26
+@RequestMapping("/postCheck/rectificationProductionProblemStatistics")
27
+public class PostCheckedRectificationProductionProblemStatisticsController extends BaseController {
28
+    @Autowired
29
+    private IPostCheckedProblemService postCheckedProblemService;
30
+
31
+
32
+    @ApiOperation("1-职能部各部门问题数量对比")
33
+    @GetMapping("/functionDeptProblemContrast")
34
+    public AjaxResult functionDeptProblemContrast(FunctionDeptProblemContrastView notParam) { //notParam不是参数-是返回信息-方便接口联调
35
+//         查询问题表
36
+//        select * from "public"."post_checked_problem";
37
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
38
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
39
+
40
+        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
+
56
+        list.add(data);
57
+        return success(list);
58
+    }
59
+
60
+
61
+    @ApiOperation("2-岗检覆盖率")
62
+    @GetMapping("/coverageRateView")
63
+    public AjaxResult coverageRateView(CoverageRateView notParam) { //notParam不是参数-是返回信息-方便接口联调
64
+//         查询问题表
65
+//        select * from "public"."post_checked_problem";
66
+//        status = 40    状态:1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);3-方案填写完成;10-部门审核通过;11-部门审核驳回;20-专业部门人审核(非必填)通过;21-专业部门人审核驳回(非必填);30-整改人待上传实施(整改人上传实施图片);31-上传实施照片完成;40-复查部门人审核通过;41-复查部门人审核驳回
67
+//        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
68
+
69
+
70
+        List<CoverageRateView> list = new ArrayList<>();
71
+        CoverageRateView data = new CoverageRateView();
72
+        data.setProblemTotal(6);
73
+        data.setProblemComplete(5);
74
+
75
+        list.add(data);
76
+        return success(list);
77
+    }
78
+
79
+    @ApiOperation("3-岗检问题职责类别占比")
80
+    @GetMapping("/dutyTypeProblemStatisticsView")
81
+    public AjaxResult dutyTypeProblemStatisticsView(DutyTypeProblemStatisticsView notParam) { //notParam不是参数-是返回信息-方便接口联调
82
+//         查询问题表
83
+//        select * from "public"."post_checked_problem";
84
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
85
+
86
+
87
+        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
88
+        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
89
+        data.setDutyTypeOne(1);
90
+        data.setDutyTypeTwo(2);
91
+        data.setDutyTypeThree(3);
92
+        data.setDutyTypeFour(4);
93
+
94
+        list.add(data);
95
+        return success(list);
96
+    }
97
+
98
+    @ApiOperation("4-岗检问题级别占比")
99
+    @GetMapping("/problemLevelView")
100
+    public AjaxResult problemLevelView(ProblemLevelView notParam) { //notParam不是参数-是返回信息-方便接口联调
101
+//         查询问题表
102
+//        select * from "public"."post_checked_problem";
103
+//        group by problem_level   问题等级(一般、重要)
104
+
105
+        List<ProblemLevelView> list = new ArrayList<>();
106
+        ProblemLevelView data = new ProblemLevelView();
107
+        data.setProblemLeveOne(2);
108
+        data.setProblemLeveTwo(1);
109
+
110
+
111
+        list.add(data);
112
+        return success(list);
113
+    }
114
+
115
+
116
+    @ApiOperation("5-岗检问题属性及类别整改占比")
117
+    @GetMapping("/problemAttributeCategoryView")
118
+    public AjaxResult problemAttributeCategoryView(ProblemAttributeCategoryView notParam) { //notParam不是参数-是返回信息-方便接口联调
119
+//         查询问题表
120
+//        select * from "public"."post_checked_problem";
121
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
122
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
123
+
124
+
125
+        List<ProblemAttributeCategoryView> list = new ArrayList<>();
126
+        ProblemAttributeCategoryView data = new ProblemAttributeCategoryView();
127
+//        data.set完成性
128
+//        data.set适宜性
129
+//        data.set有效性
130
+//        data.set职责权限
131
+//        data.set工作内容
132
+//        data.set工作标准
133
+//        data.set考核奖励
134
+//        data.set任职资格
135
+//        data.set其他
136
+
137
+        list.add(data);
138
+        return success(list);
139
+    }
140
+
141
+
142
+    @ApiOperation("6-历年岗检问题数量")
143
+    @GetMapping("/historyProblemNumberView")
144
+    public AjaxResult historyProblemNumberView(HistoryProblemNumberView notParam) { //notParam不是参数-是返回信息-方便接口联调
145
+//         查询问题表
146
+//        select * from "public"."post_checked_problem";
147
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
148
+//        GROUP BY problem_category -- 问题类别(职责权限问题、工作内容问题、工作标准问题、考核奖励问题、任职资格问题、其他)
149
+
150
+
151
+        List<HistoryProblemNumberView> list = new ArrayList<>();
152
+        HistoryProblemNumberView data = new HistoryProblemNumberView();
153
+        data.setCheckYear(new Date());
154
+//        data.set问题总数
155
+//        data.set完成性
156
+//        data.set适宜性
157
+//        data.set有效性
158
+//        data.set职责权限
159
+//        data.set工作内容
160
+//        data.set工作标准
161
+//        data.set考核奖励
162
+//        data.set任职资格
163
+//        data.set其他
164
+
165
+        list.add(data);
166
+        return success(list);
167
+    }
168
+
169
+
170
+    @ApiOperation("7-部门详情")
171
+    @GetMapping("/deptDetaailView")
172
+    public AjaxResult deptDetaailView(DeptDetaailView notParam) { //notParam不是参数-是返回信息-方便接口联调
173
+//         查询问题表
174
+//        select * from "public"."post_checked_problem";
175
+//        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
176
+//        GROUP BY problem_attribute -- 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)
177
+
178
+
179
+        List<DeptDetaailView> list = new ArrayList<>();
180
+
181
+        //TODO 第一步:得到各个部门ID和部门名称及统计时间
182
+        //TODO 第二步:得到4个职责类别的问题数量及整改完成数量(1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;)
183
+        //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
184
+
185
+        DeptDetaailView data1 = new DeptDetaailView();
186
+//        data1.setdeptId 部门ID
187
+//        data1.setdeptName 部门名称
188
+//        data1.setproblemRectificationRate 整改率
189
+//        data1.setstatisticsTime 统计时间
190
+
191
+        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
192
+        DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
193
+//        child1.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
194
+//        child1.set完整性数量 private Integer problemComplete;
195
+//        child1.set适宜性数量 private Integer problemSuitable;
196
+//        child1.set有效性数量 private Integer problemEffective;
197
+//        child1.set已完成完整性数量 private Integer problemCompleteChecked;
198
+//        child1.set已完成适宜性数量 private Integer problemSuitableChecked;
199
+//        child1.set已完成有效性数量 private Integer problemEffectiveChecked;
200
+        children1.add(child1);
201
+        data1.setChildren(children1);
202
+        list.add(data1);
203
+
204
+        DeptDetaailView data2 = new DeptDetaailView();
205
+//        data2.setdeptId 部门ID
206
+//        data2.setdeptName 部门名称
207
+//        data2.setproblemRectificationRate 整改率
208
+//        data2.setstatisticsTime 统计时间
209
+        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
210
+        DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
211
+//        child2.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
212
+//        child2.set完整性数量  private Integer problemComplete;
213
+//        child2.set适宜性数量  private Integer problemSuitable;
214
+//        child2.set有效性数量  private Integer problemEffective;
215
+//        child2.set已完成完整性数量 private Integer problemCompleteChecked;
216
+//        child2.set已完成适宜性数量 private Integer problemSuitableChecked;
217
+//        child2.set已完成有效性数量 private Integer problemEffectiveChecked;
218
+        children1.add(child2);
219
+        data2.setChildren(children2);
220
+        list.add(data2);
221
+
222
+        DeptDetaailView data3 = new DeptDetaailView();
223
+//        data3.setdeptId 部门ID
224
+//        data3.setdeptName 部门名称
225
+//        data3.setproblemRectificationRate 整改率
226
+//        data3.setstatisticsTime 统计时间
227
+        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
228
+        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
229
+//        child3.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
230
+//        child3.set完整性数量  private Integer problemComplete;
231
+//        child3.set适宜性数量  private Integer problemSuitable;
232
+//        child3.set有效性数量  private Integer problemEffective;
233
+//        child3.set已完成完整性数量 private Integer problemCompleteChecked;
234
+//        child3.set已完成适宜性数量 private Integer problemSuitableChecked;
235
+//        child3.set已完成有效性数量 private Integer problemEffectiveChecked;
236
+        children1.add(child3);
237
+        data3.setChildren(children3);
238
+        list.add(data3);
239
+
240
+        DeptDetaailView data4 = new DeptDetaailView();
241
+//        data4.setdeptId 部门ID
242
+//        data4.setdeptName 部门名称
243
+//        data4.setproblemRectificationRate 整改率
244
+//        data4.setstatisticsTime 统计时间
245
+        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
246
+        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
247
+//        child4.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
248
+//        child4.set完整性数量 private Integer problemComplete;
249
+//        child4.set适宜性数量 private Integer problemSuitable;
250
+//        child4.set有效性数量 private Integer problemEffective;
251
+//        child4.set已完成完整性数量 private Integer problemCompleteChecked;
252
+//        child4.set已完成适宜性数量 private Integer problemSuitableChecked;
253
+//        child4.set已完成有效性数量 private Integer problemEffectiveChecked;
254
+        children1.add(child4);
255
+        data4.setChildren(children4);
256
+        list.add(data4);
257
+        return success(list);
258
+    }
259
+}

+ 2 - 3
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostListController.java

@@ -181,8 +181,8 @@ public class PostListController extends BaseController {
181 181
     @ApiOperation("2、检查内容:参数是检查项目下拉框")
182 182
     @GetMapping("/contentListByType")
183 183
     @ApiImplicitParams({
184
-            @ApiImplicitParam(name = "deptId", value = "参数->部门ID", dataType = "Integer", dataTypeClass = Integer.class),
185
-            @ApiImplicitParam(name = "postId", value = "参数->岗位ID", dataType = "Integer", dataTypeClass = Integer.class),
184
+            @ApiImplicitParam(name = "deptId", value = "参数->部门ID", dataType = "Long", dataTypeClass = Long.class),
185
+            @ApiImplicitParam(name = "postId", value = "参数->岗位ID", dataType = "Long", dataTypeClass = Long.class),
186 186
             @ApiImplicitParam(name = "type", value = "参数->检查项目(业务职责、党建党风、安全环保……)", dataType = "Integer", dataTypeClass = Integer.class),
187 187
             @ApiImplicitParam(name = "postCheckedContent", value = "返回->检查内容", dataType = "String", dataTypeClass = String.class),
188 188
             @ApiImplicitParam(name = "postCheckedStandard", value = "返回->检查标准", dataType = "String", dataTypeClass = String.class),
@@ -266,7 +266,6 @@ public class PostListController extends BaseController {
266 266
                 item.setPostCheckedStandard("按照要求做好保密教育、不发生重大泄密事件;不发生大规模群访闹访事件,限时办结信访事项->伪代码返回-检查标准");  //检查标准 ->  工作标准(work_standard)  要求2(requirement)
267 267
                 itemsList.add(item);
268 268
 
269
-
270 269
             }
271 270
 
272 271
             // 按类型

+ 1 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostTeamController.java

@@ -83,7 +83,6 @@ public class PostTeamController extends BaseController {
83 83
 
84 84
     /**
85 85
      * 导出岗检小组列表
86
-     */
87 86
     @ApiOperation("导出岗检小组列表")
88 87
     @PreAuthorize("@ss.hasPermi('postCheck:team:export')")
89 88
     @Log(title = "岗检小组", businessType = BusinessType.EXPORT)
@@ -93,6 +92,7 @@ public class PostTeamController extends BaseController {
93 92
         ExcelUtil<PostTeam> util = new ExcelUtil<PostTeam>(PostTeam.class);
94 93
         util.exportExcel(response, list, "岗检小组数据");
95 94
     }
95
+     */
96 96
 
97 97
     /**
98 98
      * 获取岗检小组详细信息

+ 18 - 18
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostTeamUserController.java

@@ -54,16 +54,15 @@ public class PostTeamUserController extends BaseController {
54 54
 
55 55
     /**
56 56
      * 导出岗检小组关联成员列表
57
+     @ApiOperation("导出岗检小组关联成员列表")
58
+     @PreAuthorize("@ss.hasPermi('postCheck:teamUser:export')")
59
+     @Log(title = "岗检小组关联成员", businessType = BusinessType.EXPORT)
60
+     @PostMapping("/export") public void export(HttpServletResponse response, PostTeamUser postTeamUser) {
61
+     List<PostTeamUser> list = postTeamUserService.selectPostTeamUserList(postTeamUser);
62
+     ExcelUtil<PostTeamUser> util = new ExcelUtil<PostTeamUser>(PostTeamUser.class);
63
+     util.exportExcel(response, list, "岗检小组关联成员数据");
64
+     }
57 65
      */
58
-    @ApiOperation("导出岗检小组关联成员列表")
59
-    @PreAuthorize("@ss.hasPermi('postCheck:teamUser:export')")
60
-    @Log(title = "岗检小组关联成员", businessType = BusinessType.EXPORT)
61
-    @PostMapping("/export")
62
-    public void export(HttpServletResponse response, PostTeamUser postTeamUser) {
63
-        List<PostTeamUser> list = postTeamUserService.selectPostTeamUserList(postTeamUser);
64
-        ExcelUtil<PostTeamUser> util = new ExcelUtil<PostTeamUser>(PostTeamUser.class);
65
-        util.exportExcel(response, list, "岗检小组关联成员数据");
66
-    }
67 66
 
68 67
     /**
69 68
      * 获取岗检小组关联成员详细信息
@@ -90,20 +89,21 @@ public class PostTeamUserController extends BaseController {
90 89
     @PreAuthorize("@ss.hasPermi('postCheck:teamUser:add')")
91 90
     @Log(title = "岗检小组关联成员", businessType = BusinessType.INSERT)
92 91
     @PostMapping
93
-    public AjaxResult add(@RequestBody PostTeamUser postTeamUser) {
94
-        return toAjax(postTeamUserService.insertPostTeamUser(postTeamUser));
92
+    public AjaxResult add(@RequestBody List<PostTeamUser> postTeamUserList) {
93
+        return toAjax(postTeamUserService.insertPostTeamUser(postTeamUserList));
95 94
     }
96 95
 
97 96
     /**
97
+     * 前端使用使用添加新增,不使用修改,新增接口始终传全量数据
98 98
      * 修改岗检小组关联成员
99
+     *
100
+     @ApiOperation("修改岗检小组关联成员")
101
+     @PreAuthorize("@ss.hasPermi('postCheck:teamUser:edit')")
102
+     @Log(title = "岗检小组关联成员", businessType = BusinessType.UPDATE)
103
+     @PutMapping public AjaxResult edit(@RequestBody List<PostTeamUser> postTeamUserList) {
104
+     return toAjax(postTeamUserService.updatePostTeamUser(postTeamUserList));
105
+     }
99 106
      */
100
-    @ApiOperation("修改岗检小组关联成员")
101
-    @PreAuthorize("@ss.hasPermi('postCheck:teamUser:edit')")
102
-    @Log(title = "岗检小组关联成员", businessType = BusinessType.UPDATE)
103
-    @PutMapping
104
-    public AjaxResult edit(@RequestBody PostTeamUser postTeamUser) {
105
-        return toAjax(postTeamUserService.updatePostTeamUser(postTeamUser));
106
-    }
107 107
 
108 108
     /**
109 109
      * 删除岗检小组关联成员

+ 4 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/PostCheckedProblem.java

@@ -199,11 +199,14 @@ public class PostCheckedProblem extends BaseEntity {
199 199
     private Date checkTime;
200 200
 
201 201
 
202
-//    ==================显示字段==============
202
+    //    ==================显示字段==============
203 203
     @ApiModelProperty("整改责任部门名称")
204 204
     @TableField(exist = false)
205 205
     private String checkedDeptName;
206 206
     @ApiModelProperty("整改责任岗位名称")
207 207
     @TableField(exist = false)
208 208
     private String checkedPostName;
209
+    @ApiModelProperty("整改责任人名称")
210
+    @TableField(exist = false)
211
+    private String rectificationResponsibleUserName;
209 212
 }

+ 1 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/PostTeamUser.java

@@ -40,7 +40,7 @@ public class PostTeamUser extends BaseEntity
40 40
     @ApiModelProperty("类型(1-组长;2-成员;)")
41 41
     @TableField(value = "type")
42 42
     @Excel(name = "类型", readConverterExp = "类型(1-组长;2-成员;)")
43
-    private Long type;
43
+    private Integer type;
44 44
 
45 45
     @ApiModelProperty("创建者用户ID")
46 46
     @TableField(value = "create_user_id")

+ 13 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/join/PostPlanJoinChecked.java

@@ -23,12 +23,20 @@ public class PostPlanJoinChecked implements Serializable {
23 23
 //    @TableField(value = "check_group_id")
24 24
     @Excel(name = "检查工作组ID")
25 25
     private Long checkGroupId;
26
+    @ApiModelProperty("检查工作组名称")
27
+    private String checkGroupName;
26 28
 
27 29
     @ApiModelProperty("检查小组")
28 30
 //    @TableField(value = "check_team_id")
29 31
     @Excel(name = "检查小组")
30 32
     private Long checkTeamId;
31 33
 
34
+    @ApiModelProperty("检查小组名称")
35
+    private String checkTeamName;
36
+
37
+    @ApiModelProperty("检查人员中文名称逗号拼接")
38
+    private String checkedUserNames;
39
+
32 40
     @ApiModelProperty("上传:检查人ID")
33 41
 //    @TableField(value = "checked_user_id")
34 42
     @Excel(name = "检查人ID")
@@ -38,12 +46,17 @@ public class PostPlanJoinChecked implements Serializable {
38 46
 //    @TableField(value = "checked_dept_id")
39 47
     @Excel(name = "被检查部门ID")
40 48
     private Long checkedDeptId;
49
+    @ApiModelProperty("被检查部门名称")
50
+    private String checkedDeptName;
41 51
 
42 52
     @ApiModelProperty("被检查岗位ID")
43 53
 //    @TableField(value = "checked_post_id")
44 54
     @Excel(name = "被检查岗位ID")
45 55
     private Long checkedPostId;
46 56
 
57
+    @ApiModelProperty("被检查岗位名称(多个拼接)")
58
+    private String checkedPostNames;
59
+
47 60
     @ApiModelProperty("岗检状态:1-未检;2-已检;")
48 61
 //    @TableField(value = "status")
49 62
     @Excel(name = "岗检状态")

+ 3 - 3
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/join/PostPlanJoinProblem.java

@@ -34,12 +34,12 @@ public class PostPlanJoinProblem implements Serializable {
34 34
     @Excel(name = "检查小组")
35 35
     private Long checkTeamId;
36 36
 
37
-    @ApiModelProperty("检查人员中文名称逗号拼接")
38
-    private String checkedUserNames;
39
-
40 37
     @ApiModelProperty("检查小组名称")
41 38
     private String checkTeamName;
42 39
 
40
+    @ApiModelProperty("检查人员中文名称逗号拼接")
41
+    private String checkedUserNames;
42
+
43 43
     @ApiModelProperty("被检查部门ID")
44 44
 //    @TableField(value = "checked_dept_id")
45 45
     @Excel(name = "被检查部门ID")

+ 99 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CheckedProblemDeptDetaailView.java

@@ -0,0 +1,99 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.math.BigDecimal;
10
+import java.util.ArrayList;
11
+import java.util.Date;
12
+import java.util.List;
13
+
14
+@EqualsAndHashCode
15
+@Data
16
+@ApiModel(value = "统计分析-部门详情(职能管理)")
17
+//extends DutyTypeProblemStatisticsView
18
+public class CheckedProblemDeptDetaailView extends  ProblemLevelView implements Serializable {
19
+
20
+    private static final long serialVersionUID = 5666890687691604123L;
21
+    @ApiModelProperty("部门ID")
22
+    private Long deptId;
23
+    @ApiModelProperty("部门名称")
24
+    private String deptName;
25
+
26
+
27
+    @ApiModelProperty("总数量")
28
+    private Integer problemTotal;
29
+
30
+//    @ApiModelProperty("一般")
31
+//    private Integer problemLeveOne;
32
+
33
+//    @ApiModelProperty("重要")
34
+//    private Integer problemLeveTwo;
35
+
36
+
37
+    @ApiModelProperty("统计时间")
38
+    private Date statisticsTime;
39
+
40
+    @ApiModelProperty("duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
41
+    private List<ProblemAttributeInner> children = new ArrayList<>();
42
+
43
+
44
+    /**
45
+     * 按业务职责归类存放问题整改的情况
46
+     */
47
+//            extends ProblemNumberBase {
48
+    public static class ProblemAttributeInner implements Serializable {
49
+
50
+        private static final long serialVersionUID = 3140695152506065277L;
51
+
52
+        @ApiModelProperty("业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
53
+        private Integer dutyType;
54
+
55
+
56
+        @ApiModelProperty("完整性数量")
57
+        private Integer problemComplete;
58
+        @ApiModelProperty("适宜性数量")
59
+        private Integer problemSuitable;
60
+        @ApiModelProperty("有效性数量")
61
+        private Integer problemEffective;
62
+
63
+        @ApiModelProperty("已完成完整性数量")
64
+        private Integer problemCompleteChecked;
65
+        @ApiModelProperty("已完成适宜性数量")
66
+        private Integer problemSuitableChecked;
67
+        @ApiModelProperty("已完成有效性数量")
68
+        private Integer problemEffectiveChecked;
69
+
70
+    }
71
+
72
+
73
+/**
74
+ * 业务职责类型
75
+ */
76
+//    public static class ProblemDutyType {
77
+//        @ApiModelProperty("业务职责字典值:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
78
+//        private Integer dutyType;
79
+//
80
+//        @ApiModelProperty("业务职责字典值显示名称(后台可以不设置值,让前端做):duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
81
+//        private Integer dutyView;
82
+//
83
+//
84
+//        /**
85
+//         * @ApiModelProperty("完整性数量") private Integer problemComplete;
86
+//         * @ApiModelProperty("适宜性数量") private Integer problemSuitable;
87
+//         * @ApiModelProperty("有效性数量") private Integer problemEffective;
88
+//         * @ApiModelProperty("已完成完整性数量") private Integer problemCompleteChecked;
89
+//         * @ApiModelProperty("已完成适宜性数量") private Integer problemSuitableChecked;
90
+//         * @ApiModelProperty("已完成有效性数量") private Integer problemEffectiveChecked;
91
+//         */
92
+//        @ApiModelProperty("problem_attribute 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)")
93
+//        private List<DutyTypeProblemStatisticsView.ProblemAttributeInner> children = new ArrayList<>();
94
+//
95
+//
96
+//    }
97
+
98
+
99
+}

+ 25 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CoverageRateView.java

@@ -0,0 +1,25 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+
10
+@EqualsAndHashCode
11
+@Data
12
+@ApiModel(value = "统计分析-岗检覆盖率(职能管理)")
13
+public class CoverageRateView implements Serializable {
14
+
15
+
16
+    private static final long serialVersionUID = 84061080800486249L;
17
+
18
+    @ApiModelProperty("总数量")
19
+    private Integer problemTotal;
20
+
21
+    @ApiModelProperty("问题整改数")
22
+    private Integer problemComplete;
23
+
24
+
25
+}

+ 90 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/DeptDetaailView.java

@@ -0,0 +1,90 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.math.BigDecimal;
10
+import java.util.ArrayList;
11
+import java.util.Date;
12
+import java.util.List;
13
+
14
+@EqualsAndHashCode
15
+@Data
16
+@ApiModel(value = "统计分析-检查统计-问题统计(生产运用)-部门详情")
17
+//extends DutyTypeProblemStatisticsView
18
+public class DeptDetaailView implements Serializable {
19
+
20
+    private static final long serialVersionUID = 5666890687691604123L;
21
+    @ApiModelProperty("部门ID")
22
+    private Long deptId;
23
+    @ApiModelProperty("部门名称")
24
+    private String deptName;
25
+
26
+    @ApiModelProperty("整改率")
27
+    private BigDecimal problemRectificationRate;
28
+    @ApiModelProperty("统计时间")
29
+    private Date statisticsTime;
30
+
31
+    @ApiModelProperty("duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
32
+    private List<ProblemAttributeInner> children = new ArrayList<>();
33
+
34
+
35
+    /**
36
+     * 按业务职责归类存放问题整改的情况
37
+     */
38
+//            extends ProblemNumberBase {
39
+    public static class ProblemAttributeInner implements Serializable {
40
+
41
+        private static final long serialVersionUID = 3140695152506065277L;
42
+
43
+        @ApiModelProperty("业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
44
+        private Integer dutyType;
45
+
46
+
47
+        @ApiModelProperty("完整性数量")
48
+        private Integer problemComplete;
49
+        @ApiModelProperty("适宜性数量")
50
+        private Integer problemSuitable;
51
+        @ApiModelProperty("有效性数量")
52
+        private Integer problemEffective;
53
+
54
+        @ApiModelProperty("已完成完整性数量")
55
+        private Integer problemCompleteChecked;
56
+        @ApiModelProperty("已完成适宜性数量")
57
+        private Integer problemSuitableChecked;
58
+        @ApiModelProperty("已完成有效性数量")
59
+        private Integer problemEffectiveChecked;
60
+
61
+    }
62
+
63
+
64
+/**
65
+ * 业务职责类型
66
+ */
67
+//    public static class ProblemDutyType {
68
+//        @ApiModelProperty("业务职责字典值:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
69
+//        private Integer dutyType;
70
+//
71
+//        @ApiModelProperty("业务职责字典值显示名称(后台可以不设置值,让前端做):duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
72
+//        private Integer dutyView;
73
+//
74
+//
75
+//        /**
76
+//         * @ApiModelProperty("完整性数量") private Integer problemComplete;
77
+//         * @ApiModelProperty("适宜性数量") private Integer problemSuitable;
78
+//         * @ApiModelProperty("有效性数量") private Integer problemEffective;
79
+//         * @ApiModelProperty("已完成完整性数量") private Integer problemCompleteChecked;
80
+//         * @ApiModelProperty("已完成适宜性数量") private Integer problemSuitableChecked;
81
+//         * @ApiModelProperty("已完成有效性数量") private Integer problemEffectiveChecked;
82
+//         */
83
+//        @ApiModelProperty("problem_attribute 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)")
84
+//        private List<DutyTypeProblemStatisticsView.ProblemAttributeInner> children = new ArrayList<>();
85
+//
86
+//
87
+//    }
88
+
89
+
90
+}

+ 54 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/DutyTypeProblemStatisticsView.java

@@ -0,0 +1,54 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.util.ArrayList;
10
+import java.util.List;
11
+
12
+@EqualsAndHashCode
13
+@Data
14
+@ApiModel(value = "统计分析-岗检问题职责类别占比(职能管理)")
15
+public class DutyTypeProblemStatisticsView implements Serializable {
16
+
17
+
18
+    private static final long serialVersionUID = -6982314157222524166L;
19
+    @ApiModelProperty("业务职责")
20
+    private Integer dutyTypeOne;
21
+
22
+    @ApiModelProperty("党建及党风廉政")
23
+    private Integer dutyTypeTwo;
24
+
25
+    @ApiModelProperty("安全环保职责")
26
+    private Integer dutyTypeThree;
27
+
28
+    @ApiModelProperty("合规保密职")
29
+    private Integer dutyTypeFour;
30
+
31
+    /**
32
+     * @ApiModelProperty("完整性数量") private Integer problemComplete;
33
+     * @ApiModelProperty("适宜性数量") private Integer problemSuitable;
34
+     * @ApiModelProperty("有效性数量") private Integer problemEffective;
35
+     * @ApiModelProperty("已完成完整性数量") private Integer problemCompleteChecked;
36
+     * @ApiModelProperty("已完成适宜性数量") private Integer problemSuitableChecked;
37
+     * @ApiModelProperty("已完成有效性数量") private Integer problemEffectiveChecked;
38
+     */
39
+    @ApiModelProperty("problem_attribute 问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)")
40
+    private List<ProblemAttributeInner> children = new ArrayList<>();
41
+
42
+    public static class ProblemAttributeInner extends ProblemNumberBase {
43
+
44
+        private static final long serialVersionUID = -5709957331615760177L;
45
+        @ApiModelProperty("已完成完整性数量")
46
+        private Integer problemCompleteChecked;
47
+        @ApiModelProperty("已完成适宜性数量")
48
+        private Integer problemSuitableChecked;
49
+        @ApiModelProperty("已完成有效性数量")
50
+        private Integer problemEffectiveChecked;
51
+
52
+    }
53
+
54
+}

+ 25 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/FunctionDeptProblemContrastView.java

@@ -0,0 +1,25 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+
10
+@EqualsAndHashCode
11
+@Data
12
+@ApiModel(value = "统计分析-职能部各部门问题数量对比(职能管理)")
13
+public class FunctionDeptProblemContrastView extends ProblemNumberBase{
14
+
15
+
16
+    private static final long serialVersionUID = -757039503238827630L;
17
+    @ApiModelProperty("部门ID")
18
+    private Long deptId;
19
+
20
+    @ApiModelProperty("部门名称")
21
+    private String deptName;
22
+
23
+
24
+
25
+}

+ 19 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/HistoryProblemNumberView.java

@@ -0,0 +1,19 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.util.Date;
9
+
10
+@EqualsAndHashCode
11
+@Data
12
+@ApiModel(value = "统计分析-历年岗检问题数量(职能管理)")
13
+public class HistoryProblemNumberView extends ProblemNumberBase{
14
+
15
+
16
+    private static final long serialVersionUID = -7993733278042449361L;
17
+    @ApiModelProperty("年份")
18
+    private Date checkYear;
19
+}

+ 15 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemAttributeCategoryView.java

@@ -0,0 +1,15 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+
10
+@EqualsAndHashCode
11
+@Data
12
+@ApiModel(value = "统计分析-岗检问题属性及类别整改占比(职能管理)")
13
+public class ProblemAttributeCategoryView extends ProblemNumberBase {
14
+    private static final long serialVersionUID = -5776997032261242866L;
15
+}

+ 29 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemLevelView.java

@@ -0,0 +1,29 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+import java.util.Date;
10
+
11
+@EqualsAndHashCode
12
+@Data
13
+@ApiModel(value = "统计分析-岗检问题职责类别占比(职能管理)")
14
+public class ProblemLevelView implements Serializable {
15
+
16
+
17
+    private static final long serialVersionUID = -6982314157222524166L;
18
+
19
+    @ApiModelProperty("一般")
20
+    private Integer problemLeveOne;
21
+
22
+    @ApiModelProperty("重要")
23
+    private Integer problemLeveTwo;
24
+
25
+
26
+
27
+
28
+
29
+}

+ 46 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemNumberBase.java

@@ -0,0 +1,46 @@
1
+package com.ruoyi.postCheck.domain.problemStatistics;
2
+
3
+import io.swagger.annotations.ApiModel;
4
+import io.swagger.annotations.ApiModelProperty;
5
+import lombok.Data;
6
+import lombok.EqualsAndHashCode;
7
+
8
+import java.io.Serializable;
9
+
10
+@EqualsAndHashCode
11
+@Data
12
+@ApiModel(value = "统计分析-问题属性&问题类别")
13
+public class ProblemNumberBase implements Serializable {
14
+
15
+    private static final long serialVersionUID = 796035754641326823L;
16
+
17
+
18
+    @ApiModelProperty("总数量")
19
+    private Integer problemTotal;
20
+
21
+
22
+    @ApiModelProperty("完整性数量")
23
+    private Integer problemComplete;
24
+    @ApiModelProperty("适宜性数量")
25
+    private Integer problemSuitable;
26
+    @ApiModelProperty("有效性数量")
27
+    private Integer problemEffective;
28
+
29
+
30
+    @ApiModelProperty("职责权限问题")
31
+    private Integer problemCategoryOne;
32
+    @ApiModelProperty("工作内容问题")
33
+    private Integer problemCategoryTwo;
34
+    @ApiModelProperty("工作标准问题")
35
+    private Integer problemCategoryThree;
36
+    @ApiModelProperty("考核奖励问题")
37
+    private Integer problemCategoryFour;
38
+    @ApiModelProperty("任职资格问题")
39
+    private Integer problemCategoryFive;
40
+    @ApiModelProperty("其他")
41
+    private Integer problemCategorySix;
42
+
43
+//==================================================
44
+
45
+
46
+}

+ 66 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/tools/ProblemCategory.java

@@ -0,0 +1,66 @@
1
+package com.ruoyi.postCheck.domain.tools;
2
+
3
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
4
+import io.swagger.annotations.ApiModel;
5
+import io.swagger.annotations.ApiModelProperty;
6
+import lombok.Data;
7
+
8
+@ApiModel(value = "按问题属性分组统计问题类别")
9
+@Data
10
+public class ProblemCategory extends ProblemNumberBase {
11
+
12
+    @ApiModelProperty("问题属性(1-完整问题;2-有效性问题;3-适宜性问题;)")
13
+    private Integer problemAttribute;
14
+    @ApiModelProperty("问题属性显示名称")
15
+    private String problemAttributeView;
16
+
17
+//        @ApiModelProperty("职责权限问题")
18
+//        private Integer problemCategoryOne;
19
+
20
+//        @ApiModelProperty("工作内容问题")
21
+//        private Integer problemCategoryTwo;
22
+
23
+//        @ApiModelProperty("工作标准问题")
24
+//        private Integer problemCategoryThree;
25
+
26
+//        @ApiModelProperty("考核奖励问题")
27
+//        private Integer problemCategoryFour;
28
+
29
+//        @ApiModelProperty("任职资格问题")
30
+//        private Integer problemCategoryFive;
31
+
32
+//        @ApiModelProperty("其他")
33
+//        private Integer problemCategorySix;
34
+
35
+//        @ApiModelProperty("总数量")
36
+//        private Integer problemTotal;
37
+
38
+    public void setProblemAttribute(Integer problemAttribute) {
39
+        this.problemAttribute = problemAttribute;
40
+
41
+        if (problemAttribute != null)
42
+            switch (problemAttribute) {
43
+                case 1: {
44
+                    setProblemAttributeView("完整问题");
45
+
46
+                    break;
47
+                }
48
+                case 2: {
49
+                    setProblemAttributeView("有效性问题");
50
+
51
+                    break;
52
+                }
53
+                case 3: {
54
+                    setProblemAttributeView("适宜性问题");
55
+
56
+                    break;
57
+                }
58
+
59
+                default:
60
+                    setProblemAttributeView("Other");
61
+                    break;
62
+            }
63
+    }
64
+
65
+
66
+}

+ 1 - 1
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostAssessmentRatingOtherMapper.java

@@ -69,6 +69,6 @@ public interface PostAssessmentRatingOtherMapper extends BaseMapper<PostAssessme
69 69
 
70 70
     List<Long> getDeptIdList(Long id);
71 71
 
72
-    List<Map<String,String>> getDeptIdListByType(Integer type);
72
+    List<Map<String,Object>> getDeptIdListByType(Integer type);
73 73
 
74 74
 }

+ 8 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostCheckedProblemMapper.java

@@ -4,6 +4,8 @@ import java.math.BigDecimal;
4 4
 import java.util.List;
5 5
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
6 6
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
8
+import com.ruoyi.postCheck.domain.tools.ProblemCategory;
7 9
 
8 10
 /**
9 11
  * 岗检问题表Mapper接口
@@ -64,4 +66,10 @@ public interface PostCheckedProblemMapper extends BaseMapper<PostCheckedProblem>
64 66
     BigDecimal getPostTotalByDeptId(Long deptId);
65 67
 
66 68
     Integer selectCheckedPostCount(int status);
69
+
70
+    /**
71
+     * 按问题属性分组统计问题类别
72
+     * @return
73
+     */
74
+    List<ProblemCategory> problemCategoryByAttribute();
67 75
 }

+ 7 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/mapper/PostListMapper.java

@@ -6,6 +6,7 @@ import com.ruoyi.postCheck.domain.PostCheckedItems;
6 6
 import com.ruoyi.postCheck.domain.PostList;
7 7
 import com.ruoyi.postCheck.domain.PostListInfo;
8 8
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
9
+import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
9 10
 import org.apache.ibatis.annotations.Param;
10 11
 
11 12
 /**
@@ -89,4 +90,10 @@ public interface PostListMapper extends BaseMapper<PostList> {
89 90
     public int deletePostListInfoByPostListId(Long id);
90 91
 
91 92
     List<PostCheckedItems> contentListByType(@Param("deptId")Long deptId, @Param("postId")Long postId, @Param("type")Integer type);
93
+
94
+    Integer userTotal();
95
+
96
+    List<PostCheckedUnCheckedView> postChecked(Integer status);
97
+
98
+    Integer getPostCountByDeptId(Long deptId);
92 99
 }

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

@@ -1,14 +1,21 @@
1 1
 package com.ruoyi.postCheck.service;
2 2
 
3
+import java.math.BigDecimal;
3 4
 import java.util.Date;
4 5
 import java.util.List;
6
+import java.util.Map;
5 7
 
6 8
 import com.ruoyi.common.annotation.Log;
7 9
 import com.ruoyi.common.core.domain.AjaxResult;
8 10
 import com.ruoyi.common.enums.BusinessType;
9 11
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
10 12
 import com.baomidou.mybatisplus.extension.service.IService;
13
+import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
14
+import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
15
+import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
11 16
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
17
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
18
+import com.ruoyi.postCheck.domain.tools.ProblemCategory;
12 19
 import io.swagger.annotations.ApiImplicitParam;
13 20
 import io.swagger.annotations.ApiImplicitParams;
14 21
 import io.swagger.annotations.ApiOperation;
@@ -154,4 +161,22 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
154 161
 
155 162
 
156 163
     PostTotalView totalView();
164
+
165
+    PostCheckedProblemView checkedProblem();
166
+
167
+    Integer userTotal();
168
+
169
+    Map<Integer, BigDecimal> problemRectification();
170
+
171
+    List<DeptProblemRectificationView>  deptProblemRectification();
172
+
173
+    List<PostCheckedUnCheckedView> postChecked(Integer i);
174
+
175
+    Integer getPostCountByDeptId(Long deptId);
176
+
177
+    /**
178
+     * 按问题属性分组统计问题类别
179
+     * @return
180
+     */
181
+    List<ProblemCategory> problemCategoryByAttribute();
157 182
 }

+ 4 - 4
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostTeamUserService.java

@@ -31,18 +31,18 @@ public interface IPostTeamUserService extends IService<PostTeamUser>
31 31
     /**
32 32
      * 新增岗检小组关联成员
33 33
      *
34
-     * @param postTeamUser 岗检小组关联成员
34
+     * @param postTeamUserList 岗检小组关联成员数组
35 35
      * @return 结果
36 36
      */
37
-    public int insertPostTeamUser(PostTeamUser postTeamUser);
37
+    public int insertPostTeamUser(List<PostTeamUser> postTeamUserList);
38 38
 
39 39
     /**
40 40
      * 修改岗检小组关联成员
41 41
      *
42
-     * @param postTeamUser 岗检小组关联成员
42
+     * @param postTeamUserList 岗检小组关联成员数组
43 43
      * @return 结果
44
+    public int updatePostTeamUser(List<PostTeamUser> postTeamUserList);
44 45
      */
45
-    public int updatePostTeamUser(PostTeamUser postTeamUser);
46 46
 
47 47
     /**
48 48
      * 批量删除岗检小组关联成员

+ 16 - 10
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostAssessmentRatingServiceImpl.java

@@ -1,7 +1,9 @@
1 1
 package com.ruoyi.postCheck.service.impl;
2 2
 
3 3
 import java.math.BigDecimal;
4
+import java.math.RoundingMode;
4 5
 import java.util.ArrayList;
6
+import java.util.Comparator;
5 7
 import java.util.List;
6 8
 import java.util.Map;
7 9
 import java.util.Optional;
@@ -77,11 +79,11 @@ public class PostAssessmentRatingServiceImpl extends ServiceImpl<PostAssessmentR
77 79
             type = 2;
78 80
         }
79 81
         List<PostAssessmentRating> postAssessmentRatings = new ArrayList<>();
80
-        List<Map<String, String>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(postAssessmentRating.getType());
82
+        List<Map<String, Object>> deptIdListByType = postAssessmentRatingOtherMapper.getDeptIdListByType(postAssessmentRating.getType());
81 83
         List<PostAssessmentRules> postAssessmentRules = postAssessmentRulesMapper.selectList(Wrappers.lambdaQuery());
82
-        for (Map<String, String> map : deptIdListByType) {
84
+        for (Map<String, Object> map : deptIdListByType) {
83 85
             PostAssessmentRating post = new PostAssessmentRating();
84
-            post.setDeptId(Long.parseLong(map.get("deptId")));
86
+            post.setDeptId(Long.parseLong(map.get("deptId").toString()));
85 87
             post.setDeptIdStr(String.valueOf(map.get("deptName")));
86 88
             // 计算一个部门的岗检得分
87 89
             // 1 先查询问题
@@ -98,14 +100,17 @@ public class PostAssessmentRatingServiceImpl extends ServiceImpl<PostAssessmentR
98 100
                     Optional<PostAssessmentRules> first = postAssessmentRules.stream().filter(d ->d.getType() == type && d.getDutyType().equals(postCheckedProblem.getDutyType())).findFirst();
99 101
                     if (first.isPresent()){
100 102
                         if (postCheckedProblem.getProblemLevel().equals("1")){
101
-                            postAfter = postAfter.subtract(new BigDecimal(String.valueOf(first.get().getProblemLevelOne())));
103
+                            postAfter = postAfter.subtract(new BigDecimal(String.valueOf(first.get().getProblemLevelOne()!=null?first.get().getProblemLevelOne():"0")));
102 104
                         }else{
103
-                            postAfter = postAfter.subtract(new BigDecimal(String.valueOf(first.get().getProblemLevelTwo())));
105
+                            postAfter = postAfter.subtract(new BigDecimal(String.valueOf(first.get().getProblemLevelTwo()!=null?first.get().getProblemLevelTwo():"0")));
104 106
                         }
105 107
                     }
106 108
                 }
109
+                BigDecimal divide = new BigDecimal("0");
110
+                if (postTotal != null){
111
+                    divide =  new BigDecimal(postCheckedProblems.size()).divide(postTotal.multiply(new BigDecimal(collect.size())),4, RoundingMode.HALF_UP);
112
+                }
107 113
                 // 计算系数 1-问题总数/需要查的问题数
108
-                BigDecimal divide = new BigDecimal(postCheckedProblems.size()).divide(postTotal.multiply(new BigDecimal(collect.size())));
109 114
                 if (divide.compareTo(new BigDecimal("1")) < 0 && divide.compareTo(new BigDecimal("0")) > 0 ){
110 115
                     postSouce = postAfter.multiply(new BigDecimal("1").subtract(divide));
111 116
                 }else{
@@ -119,7 +124,7 @@ public class PostAssessmentRatingServiceImpl extends ServiceImpl<PostAssessmentR
119 124
 
120 125
             List<PostAssessmentRatingOtherInfo> postAssessmentRatingOtherInfos = postAssessmentRatingOtherInfoMapper.selectList(Wrappers.<PostAssessmentRatingOtherInfo>lambdaQuery()
121 126
                     .eq(PostAssessmentRatingOtherInfo::getByDeptId,post.getDeptId())
122
-                    .apply("and \"rating_other_id\" in (SELECT \"id\" FROM \"public\".\"post_assessment_rating_other\" WHERE \"type\"  = 1\n)")
127
+                    .apply(" \"rating_other_id\" in (SELECT \"id\" FROM \"public\".\"post_assessment_rating_other\" WHERE \"type\"  = 1\n)")
123 128
                     .orderByAsc(PostAssessmentRatingOtherInfo::getByDeptScore)
124 129
             );
125 130
             BigDecimal peerEvaluationScore = new BigDecimal("100");
@@ -128,17 +133,18 @@ public class PostAssessmentRatingServiceImpl extends ServiceImpl<PostAssessmentR
128 133
                 postAssessmentRatingOtherInfos.remove(0);
129 134
                 BigDecimal sum = new BigDecimal("0");
130 135
                 postAssessmentRatingOtherInfos.forEach(x -> {
131
-                    sum.add(x.getByDeptScore());
136
+                    sum.add(x.getByDeptScore()!=null?x.getByDeptScore():new BigDecimal("0"));
132 137
                 });
133
-                peerEvaluationScore = sum.divide(new BigDecimal(postAssessmentRatingOtherInfos.size()));
138
+                peerEvaluationScore = sum.divide(new BigDecimal(postAssessmentRatingOtherInfos.size()),4, RoundingMode.HALF_UP);
134 139
             }
135 140
             post.setPeerEvaluationScore(peerEvaluationScore);
136 141
             postAssessmentRatings.add(post);
137 142
             // 计算总得分
138 143
             post.setDepartmentScore(post.getPositionScore().add(post.getPeerEvaluationScore()).divide(new BigDecimal("2")));
139 144
         }
145
+        List<PostAssessmentRating> collect = postAssessmentRatings.stream().sorted(Comparator.comparing(PostAssessmentRating::getDepartmentScore).reversed()).collect(Collectors.toList());
140 146
         // 计算  岗检得分
141
-        return postAssessmentRatings;
147
+        return collect;
142 148
     }
143 149
 
144 150
     /**

+ 210 - 22
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java

@@ -2,9 +2,14 @@ package com.ruoyi.postCheck.service.impl;
2 2
 
3 3
 import java.awt.dnd.DropTarget;
4 4
 import java.math.BigDecimal;
5
+import java.math.RoundingMode;
6
+import java.util.ArrayList;
5 7
 import java.util.Date;
8
+import java.util.HashMap;
6 9
 import java.util.List;
10
+import java.util.Map;
7 11
 import java.util.Optional;
12
+import java.util.stream.Collectors;
8 13
 
9 14
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
10 15
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -16,14 +21,20 @@ import com.ruoyi.postCheck.domain.PostAssessmentRules;
16 21
 import com.ruoyi.postCheck.domain.PostList;
17 22
 import com.ruoyi.postCheck.domain.PostPlan;
18 23
 import com.ruoyi.postCheck.domain.PostPlanInfo;
24
+import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
25
+import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
26
+import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
19 27
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
20 28
 import com.ruoyi.postCheck.domain.join.PostPlanJoinProblem;
29
+import com.ruoyi.postCheck.domain.problemStatistics.ProblemNumberBase;
30
+import com.ruoyi.postCheck.domain.tools.ProblemCategory;
21 31
 import com.ruoyi.postCheck.mapper.PostAssessmentRatingMapper;
22 32
 import com.ruoyi.postCheck.mapper.PostAssessmentRulesMapper;
23 33
 import com.ruoyi.postCheck.mapper.PostListMapper;
24 34
 import com.ruoyi.postCheck.mapper.PostPlanInfoMapper;
25 35
 import com.ruoyi.postCheck.mapper.PostPlanMapper;
26 36
 import com.ruoyi.postCheck.service.IPostPlanJoinProblemService;
37
+import io.swagger.annotations.ApiModelProperty;
27 38
 import lombok.Data;
28 39
 import org.apache.commons.lang3.StringUtils;
29 40
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,14 +47,6 @@ import org.springframework.transaction.annotation.Transactional;
36 47
 import org.springframework.util.CollectionUtils;
37 48
 
38 49
 
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47 50
 /**
48 51
  * 岗检问题表Service业务层处理
49 52
  *
@@ -157,7 +160,7 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
157 160
         PostPlanInfo postPlanInfo = postPlanInfoMapper.selectById(planInfoId);
158 161
         PostPlan postPlan = postPlanMapper.selectById(postPlanInfo.getPostPlanId());
159 162
         List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.<PostCheckedProblem>lambdaQuery()
160
-                        .eq(PostCheckedProblem::getCheckedDeptId,departmentId)
163
+                .eq(PostCheckedProblem::getCheckedDeptId, departmentId)
161 164
                 .between(PostCheckedProblem::getCreateTime, postPlan.getStartTime(), postPlan.getEndTime())
162 165
 
163 166
         );
@@ -173,37 +176,37 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
173 176
             Optional<PostAssessmentRules> first = postAssessmentRules.stream().filter(d -> d.getDutyType().equals(postCheckedProblem.getDutyType())).findFirst();
174 177
             if (first.isPresent() && score.compareTo(new BigDecimal("0")) > 0) {
175 178
                 // 计算岗检得分
176
-                if (postCheckedProblem.getProblemLevel().equals("1")){
179
+                if (postCheckedProblem.getProblemLevel().equals("1")) {
177 180
                     score = score.subtract(first.get().getProblemLevelOne());
178
-                }else if(postCheckedProblem.getProblemLevel().equals("2")){
181
+                } else if (postCheckedProblem.getProblemLevel().equals("2")) {
179 182
                     score = score.subtract(first.get().getProblemLevelTwo());
180 183
                 }
181 184
             }
182 185
         }
183 186
 
184 187
         // todo 公式计算
185
-        if (postCheckedProblems.size()>0){
188
+        if (postCheckedProblems.size() > 0) {
186 189
             BigDecimal bigDecimal = new BigDecimal("1");
187 190
             List<PostPlanInfo> postPlanInfos = postPlanInfoMapper.selectList(Wrappers.<PostPlanInfo>lambdaQuery()
188
-                    .eq(PostPlanInfo::getPostPlanId,postPlan.getId())
191
+                    .eq(PostPlanInfo::getPostPlanId, postPlan.getId())
189 192
             );
190
-            if (postPlanInfos.size() <= 0){
193
+            if (postPlanInfos.size() <= 0) {
191 194
                 score = new BigDecimal("0");
192
-            }else{
195
+            } else {
193 196
                 BigDecimal divide = new BigDecimal(postCheckedProblems.size()).divide(new BigDecimal(postPlanInfos.size()).multiply(new BigDecimal("6")));
194
-                if (divide.compareTo(new BigDecimal("0"))<=0 || divide.compareTo(new BigDecimal("1")) > 0){
197
+                if (divide.compareTo(new BigDecimal("0")) <= 0 || divide.compareTo(new BigDecimal("1")) > 0) {
195 198
                     score = new BigDecimal("0");
196
-                }else{
199
+                } else {
197 200
                     score = bigDecimal.subtract(divide);
198 201
                 }
199 202
             }
200
-        }else{
203
+        } else {
201 204
             score = new BigDecimal("0");
202 205
         }
203
-        postAssessmentRatingMapper.update(null,Wrappers.<PostAssessmentRating>lambdaUpdate()
204
-                .set(PostAssessmentRating::getPositionScore,score)
205
-                .eq(PostAssessmentRating::getDeptId,departmentId)
206
-                .eq(PostAssessmentRating::getPlanId,postPlan.getId())
206
+        postAssessmentRatingMapper.update(null, Wrappers.<PostAssessmentRating>lambdaUpdate()
207
+                .set(PostAssessmentRating::getPositionScore, score)
208
+                .eq(PostAssessmentRating::getDeptId, departmentId)
209
+                .eq(PostAssessmentRating::getPlanId, postPlan.getId())
207 210
         );
208 211
     }
209 212
 
@@ -502,5 +505,190 @@ public class PostCheckedProblemServiceImpl extends ServiceImpl<PostCheckedProble
502 505
         postTotalView.setUncheckedPostCount(uncheckedPostCount);
503 506
         return postTotalView;
504 507
     }
508
+
509
+    @Override
510
+    public PostCheckedProblemView checkedProblem() {
511
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
512
+        Integer problemComplete = 0;
513
+        Integer problemSuitable = 0;
514
+        Integer problemEffective = 0;
515
+        //(1-完整问题;2-有效性问题;3-适宜性问题;)
516
+        if (!postCheckedProblems.isEmpty())
517
+            for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
518
+                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 1)
519
+                    problemComplete++;
520
+                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 3)
521
+                    problemEffective++;
522
+                if (postCheckedProblem.getProblemAttribute()!=null && postCheckedProblem.getProblemAttribute() == 2)
523
+                    problemSuitable++;
524
+            }
525
+        PostCheckedProblemView post = new PostCheckedProblemView();
526
+        post.setProblemTotal(postCheckedProblems.size());
527
+        post.setProblemComplete(problemComplete);
528
+        post.setProblemSuitable(problemSuitable);
529
+        post.setProblemEffective(problemEffective);
530
+        return post;
531
+    }
532
+
533
+    @Override
534
+    public Integer userTotal() {
535
+        return postListMapper.userTotal();
536
+    }
537
+
538
+    @Override
539
+    public Map<Integer, BigDecimal> problemRectification() {
540
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
541
+        Integer problemComplete = 0;
542
+        Integer overproblemComplete = 0;
543
+        Integer problemSuitable = 0;
544
+        Integer overproblemSuitable = 0;
545
+        Integer problemEffective = 0;
546
+        Integer overproblemEffective = 0;
547
+        Integer total = 0;
548
+        Integer overtotal = 0;
549
+        //(1-完整问题;2-有效性问题;3-适宜性问题;4 总数)
550
+        if (!postCheckedProblems.isEmpty())
551
+            for (PostCheckedProblem postCheckedProblem : postCheckedProblems) {
552
+                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 1) {
553
+                    problemComplete++;
554
+                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
555
+                        overproblemComplete++;
556
+                    }
557
+                }
558
+                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 3) {
559
+                    problemEffective++;
560
+                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
561
+                        overproblemEffective++;
562
+                    }
563
+                }
564
+                if (postCheckedProblem.getProblemAttribute()!=null&&postCheckedProblem.getProblemAttribute() == 2) {
565
+                    problemSuitable++;
566
+                    if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
567
+                        overproblemSuitable++;
568
+                    }
569
+                }
570
+                total++;
571
+                if (postCheckedProblem.getIsImmediatelyCorrected()!=null&&postCheckedProblem.getIsImmediatelyCorrected() == 1) {
572
+                    overtotal++;
573
+                }
574
+            }
575
+        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));
580
+        return map;
581
+
582
+    }
583
+
584
+    @Override
585
+    public List<DeptProblemRectificationView> deptProblemRectification() {
586
+        List<DeptProblemRectificationView> dataList = new ArrayList<>();
587
+        List<PostCheckedProblem> postCheckedProblems = postCheckedProblemMapper.selectList(Wrappers.lambdaQuery());
588
+        if (!postCheckedProblems.isEmpty()){
589
+            Map<Long, List<PostCheckedProblem>> postMapListMap = postCheckedProblems.stream().collect(Collectors.groupingBy(PostCheckedProblem::getCheckedDeptId));
590
+            for (Map.Entry<Long, List<PostCheckedProblem>> entry : postMapListMap.entrySet()) {
591
+                DeptProblemRectificationView data1 = new DeptProblemRectificationView();
592
+                data1.setDeptId(entry.getKey());
593
+                data1.setDeptName(postAssessmentRatingMapper.getSysDeptName(entry.getKey()));
594
+                Integer problemTotal = 0;
595
+                Integer problemComplete = 0;
596
+                for (PostCheckedProblem postCheckedProblem : entry.getValue()) {
597
+                    problemTotal++;
598
+                    if (postCheckedProblem.getIsRectificationCompleted()!=null&&postCheckedProblem.getIsRectificationCompleted() == 1){
599
+                        problemComplete++;
600
+                    }
601
+                }
602
+                data1.setProblemTotal(problemTotal);
603
+                data1.setProblemComplete(problemComplete);
604
+                data1.setProblemRectificationRate(new BigDecimal(problemComplete).divide(new BigDecimal(problemTotal),4, RoundingMode.HALF_UP));
605
+                dataList.add(data1);
606
+            }
607
+        }
608
+        return dataList;
609
+    }
610
+
611
+    @Override
612
+    public List<PostCheckedUnCheckedView> postChecked(Integer i) {
613
+        return postListMapper.postChecked(i);
614
+    }
615
+
616
+    @Override
617
+    public Integer getPostCountByDeptId(Long deptId) {
618
+        return postListMapper.getPostCountByDeptId(deptId);
619
+    }
620
+
621
+    /**
622
+     * 按问题属性分组统计问题类别
623
+     *
624
+     * @return
625
+     */
626
+    @Override
627
+    public List<ProblemCategory> problemCategoryByAttribute() {
628
+//        @ApiModelProperty("职责权限问题")
629
+//        private Integer problemCategoryOne;
630
+//        @ApiModelProperty("工作内容问题")
631
+//        private Integer problemCategoryTwo;
632
+//        @ApiModelProperty("工作标准问题")
633
+//        private Integer problemCategoryThree;
634
+//        @ApiModelProperty("考核奖励问题")
635
+//        private Integer problemCategoryFour;
636
+//        @ApiModelProperty("任职资格问题")
637
+//        private Integer problemCategoryFive;
638
+//        @ApiModelProperty("其他")
639
+//        private Integer problemCategorySix;
640
+//        @ApiModelProperty("总数量")
641
+//        private Integer problemTotal;
642
+
643
+        List<ProblemCategory> list = postCheckedProblemMapper.problemCategoryByAttribute();
644
+        ProblemCategory totalData = new ProblemCategory();
645
+        totalData.setProblemAttribute(999);
646
+        totalData.setProblemAttributeView("总计");
647
+        int problemCategoryOne = 0;
648
+        int problemCategoryTwo = 0;
649
+        int problemCategoryThree = 0;
650
+        int problemCategoryFour = 0;
651
+        int problemCategoryFive = 0;
652
+        int problemCategorySix = 0;
653
+        for (ProblemCategory data : list) {
654
+//            Integer problemAttribute = data.getProblemAttribute();
655
+//            switch (problemAttribute) {
656
+//                case 1: {
657
+//                    setProblemAttributeView("完整问题");
658
+//
659
+//                    break;
660
+//                }
661
+//                case 2: {
662
+//                    setProblemAttributeView("有效性问题");
663
+//
664
+//                    break;
665
+//                }
666
+//                case 3: {
667
+//                    setProblemAttributeView("适宜性问题");
668
+//
669
+//                    break;
670
+//                }
671
+//
672
+//                default:
673
+//                    setProblemAttributeView("Other");
674
+//                    break;
675
+//            }
676
+
677
+            problemCategoryOne += data.getProblemCategoryOne();
678
+            problemCategoryTwo += data.getProblemCategoryTwo();
679
+            problemCategoryThree += data.getProblemCategoryThree();
680
+            problemCategoryFour += data.getProblemCategoryFour();
681
+            problemCategoryFive += data.getProblemCategoryFive();
682
+            problemCategorySix += data.getProblemCategorySix();
683
+        }
684
+        totalData.setProblemCategoryOne(problemCategoryOne);
685
+        totalData.setProblemCategoryTwo(problemCategoryTwo);
686
+        totalData.setProblemCategoryThree(problemCategoryThree);
687
+        totalData.setProblemCategoryFour(problemCategoryFour);
688
+        totalData.setProblemCategoryFive(problemCategoryFive);
689
+        totalData.setProblemCategorySix(problemCategorySix);
690
+        list.add(totalData);
691
+        return list;
692
+    }
505 693
 }
506 694
 

+ 2 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedServiceImpl.java

@@ -107,6 +107,7 @@ public class PostCheckedServiceImpl extends ServiceImpl<PostCheckedMapper, PostC
107 107
         if (row > 0) {
108 108
             for (PostCheckedItems child : children) {
109 109
                 child.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
110
+                child.setPostCheckedId(postChecked.getId());
110 111
                 child.setCreateDefault();
111 112
             }
112 113
             postCheckedItemsService.saveBatch(children);
@@ -147,6 +148,7 @@ public class PostCheckedServiceImpl extends ServiceImpl<PostCheckedMapper, PostC
147 148
             //插入明细
148 149
             for (PostCheckedItems child : children) {
149 150
                 child.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
151
+                child.setPostCheckedId(postChecked.getId());
150 152
                 child.setCreateDefault();
151 153
             }
152 154
             postCheckedItemsService.saveBatch(children);

+ 89 - 24
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostTeamUserServiceImpl.java

@@ -1,8 +1,12 @@
1 1
 package com.ruoyi.postCheck.service.impl;
2 2
 
3 3
 import java.util.List;
4
+import java.util.stream.Collectors;
4 5
 
6
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
7
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 8
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
9
+import com.ruoyi.common.exception.base.BaseException;
6 10
 import com.ruoyi.common.utils.DateUtils;
7 11
 import org.springframework.beans.factory.annotation.Autowired;
8 12
 import org.springframework.stereotype.Service;
@@ -10,6 +14,7 @@ import com.ruoyi.postCheck.mapper.PostTeamUserMapper;
10 14
 import com.ruoyi.postCheck.domain.PostTeamUser;
11 15
 import com.ruoyi.postCheck.service.IPostTeamUserService;
12 16
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
17
+import org.springframework.util.CollectionUtils;
13 18
 
14 19
 /**
15 20
  * 岗检小组关联成员Service业务层处理
@@ -18,8 +23,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
18 23
  * @date 2023-12-19
19 24
  */
20 25
 @Service
21
-public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, PostTeamUser> implements IPostTeamUserService
22
-{
26
+public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, PostTeamUser> implements IPostTeamUserService {
23 27
     @Autowired
24 28
     private PostTeamUserMapper postTeamUserMapper;
25 29
 
@@ -30,8 +34,7 @@ public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, Pos
30 34
      * @return 岗检小组关联成员
31 35
      */
32 36
     @Override
33
-    public PostTeamUser selectPostTeamUserById(Long id)
34
-    {
37
+    public PostTeamUser selectPostTeamUserById(Long id) {
35 38
         return postTeamUserMapper.selectPostTeamUserById(id);
36 39
     }
37 40
 
@@ -42,40 +45,104 @@ public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, Pos
42 45
      * @return 岗检小组关联成员
43 46
      */
44 47
     @Override
45
-    public List<PostTeamUser> selectPostTeamUserList(PostTeamUser postTeamUser)
46
-    {
48
+    public List<PostTeamUser> selectPostTeamUserList(PostTeamUser postTeamUser) {
47 49
         return postTeamUserMapper.selectPostTeamUserList(postTeamUser);
48 50
     }
49 51
 
50 52
     /**
51 53
      * 新增岗检小组关联成员
52 54
      *
53
-     * @param postTeamUser 岗检小组关联成员
55
+     * @param postTeamUserList 岗检小组关联成员数组
54 56
      * @return 结果
55 57
      */
56 58
     @Override
57
-    public int insertPostTeamUser(PostTeamUser postTeamUser)
58
-    {
59
-        //TODO 自增主键修改为-MyBatis-Plus雪花算法(截取5位解决VUE精度丢失BUG)-系统登录日志
60
-        if (postTeamUser.getId() == null)
59
+    public int insertPostTeamUser(List<PostTeamUser> postTeamUserList) {
60
+        if (CollectionUtils.isEmpty(postTeamUserList)) {
61
+            return 0;
62
+        }
63
+
64
+        List<Long> postTeamIdList = postTeamUserList.stream().map(t -> t.getPostTeamId()).collect(Collectors.toList());
65
+        if (CollectionUtils.isEmpty(postTeamIdList)) {
66
+            throw new BaseException("postTeamId为空,请检查!");
67
+        }
68
+
69
+        //删除原来的用户
70
+        LambdaQueryWrapper<PostTeamUser> wrapper = new LambdaQueryWrapper<>();
71
+        wrapper.in(PostTeamUser::getPostTeamId, postTeamIdList);
72
+        postTeamUserMapper.delete(wrapper);
73
+
74
+        //新增用户
75
+        int count = 0;
76
+        int index = 0;
77
+        for (PostTeamUser postTeamUser : postTeamUserList) {
78
+            //类型(1-组长;2-成员;)
79
+            if (index++ == 0) {
80
+                postTeamUser.setType(1);
81
+            } else {
82
+                postTeamUser.setType(2);
83
+            }
84
+            Long postTeamId = postTeamUser.getPostTeamId();
85
+            if (postTeamId == null) {
86
+                throw new BaseException("postTeamId为空,请检查!");
87
+            }
88
+
89
+            //TODO 自增主键修改为-MyBatis-Plus雪花算法(截取5位解决VUE精度丢失BUG)-系统登录日志
90
+//        if (postTeamUser.getId() == null)
61 91
             postTeamUser.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
62
-        postTeamUser.setCreateDefault();
63
-        return postTeamUserMapper.insertPostTeamUser(postTeamUser);
92
+            postTeamUser.setCreateDefault();
93
+            count += postTeamUserMapper.insertPostTeamUser(postTeamUser);
94
+        }
95
+        return count;
64 96
     }
65 97
 
66 98
     /**
67 99
      * 修改岗检小组关联成员
68 100
      *
69
-     * @param postTeamUser 岗检小组关联成员
101
+     * @param postTeamUserList 岗检小组关联成员数组
70 102
      * @return 结果
71 103
      */
72
-    @Override
73
-    public int updatePostTeamUser(PostTeamUser postTeamUser)
74
-    {
75
-        postTeamUser.setUpdateDefault();
76
-        return postTeamUserMapper.updatePostTeamUser(postTeamUser);
77
-    }
104
+  /*  @Override
105
+    public int updatePostTeamUser(List<PostTeamUser> postTeamUserList) {
106
+        if (CollectionUtils.isEmpty(postTeamUserList)) {
107
+            return 0;
108
+        }
109
+
110
+        List<Long> postTeamIdList = postTeamUserList.stream().map(t -> t.getPostTeamId()).collect(Collectors.toList());
111
+        if (CollectionUtils.isEmpty(postTeamIdList)) {
112
+            throw new BaseException("postTeamId为空,请检查!");
113
+        }
114
+        //删除原来的用户
115
+        LambdaQueryWrapper<PostTeamUser> wrapper = new LambdaQueryWrapper<>();
116
+        wrapper.in(PostTeamUser::getPostTeamId, postTeamIdList);
117
+        postTeamUserMapper.delete(wrapper);
118
+
119
+        //新增用户
120
+        int count = 0;
121
+        int index = 0;
122
+        for (PostTeamUser postTeamUser : postTeamUserList) {
123
+            //类型(1-组长;2-成员;)
124
+            if (index++ == 0) {
125
+                postTeamUser.setType(1);
126
+            } else {
127
+                postTeamUser.setType(2);
128
+            }
78 129
 
130
+            Long postTeamId = postTeamUser.getPostTeamId();
131
+            if (postTeamId == null) {
132
+                throw new BaseException("postTeamId为空,请检查!");
133
+            }
134
+            //TODO 自增主键修改为-MyBatis-Plus雪花算法(截取5位解决VUE精度丢失BUG)-系统登录日志
135
+//        if (postTeamUser.getId() == null)
136
+            postTeamUser.setId(Long.parseLong(IdWorker.getIdStr().substring(4)));
137
+            postTeamUser.setCreateDefault();
138
+            count += postTeamUserMapper.insertPostTeamUser(postTeamUser);
139
+        }
140
+        return count;
141
+
142
+//        postTeamUser.setUpdateDefault();
143
+//        return postTeamUserMapper.updatePostTeamUser(postTeamUser);
144
+    }
145
+*/
79 146
     /**
80 147
      * 批量删除岗检小组关联成员
81 148
      *
@@ -83,8 +150,7 @@ public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, Pos
83 150
      * @return 结果
84 151
      */
85 152
     @Override
86
-    public int deletePostTeamUserByIds(Long[] ids)
87
-    {
153
+    public int deletePostTeamUserByIds(Long[] ids) {
88 154
         return postTeamUserMapper.deletePostTeamUserByIds(ids);
89 155
     }
90 156
 
@@ -95,8 +161,7 @@ public class PostTeamUserServiceImpl extends ServiceImpl<PostTeamUserMapper, Pos
95 161
      * @return 结果
96 162
      */
97 163
     @Override
98
-    public int deletePostTeamUserById(Long id)
99
-    {
164
+    public int deletePostTeamUserById(Long id) {
100 165
         return postTeamUserMapper.deletePostTeamUserById(id);
101 166
     }
102 167
 }

+ 1 - 1
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostAssessmentRatingOtherMapper.xml

@@ -178,6 +178,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
178 178
     </select>
179 179
 
180 180
     <select id="getDeptIdListByType" resultType="java.util.Map">
181
-        SELECT "dept_id" as deptId,"dept_name" as deptName FROM "public"."sys_dept" where "type" = #{type};
181
+        SELECT "dept_id" as deptId,"dept_name" as deptName FROM "public"."sys_dept" where "type" = #{type} group by "dept_id","dept_name"
182 182
     </select>
183 183
 </mapper>

+ 55 - 1
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostCheckedProblemMapper.xml

@@ -92,10 +92,12 @@
92 92
             t1.duty_type,
93 93
 
94 94
             t2."dept_name" as checkedDeptName,
95
-            t3."post_name" as checkedPostName
95
+            t3."post_name" as checkedPostName,
96
+            t4."nick_name" AS rectificationResponsibleUserName
96 97
         from post_checked_problem t1
97 98
         LEFT JOIN "sys_dept" t2 ON t2."dept_id" = t1."checked_dept_id"
98 99
         LEFT JOIN "sys_post" t3 ON t3."post_id" = t1."checked_post_id"
100
+        LEFT JOIN "public"."sys_users" t4 ON  t4."user_id" = t1."rectification_responsible_user_id"
99 101
     </sql>
100 102
 
101 103
     <select id="selectPostCheckedProblemList" parameterType="PostCheckedProblem" resultMap="PostCheckedProblemResult">
@@ -305,4 +307,56 @@
305 307
         FROM "public"."post_plan" a INNER JOIN "public"."post_plan_info" ppi ON a."id"  = ppi."post_plan_id" WHERE ppi."status" = #{status}
306 308
 
307 309
     </select>
310
+
311
+    <!--按问题属性分组统计问题类别-->
312
+    <select id="problemCategoryByAttribute" resultType="ProblemCategory">
313
+        SELECT
314
+            problem_attribute,
315
+            COUNT(t1.id) AS problemTotal,
316
+            SUM(
317
+                 case
318
+                    when t1.problem_category = 1 then 1
319
+                    else 0
320
+                 END
321
+            ) AS problemCategoryOne,
322
+
323
+            SUM(
324
+                 case
325
+                    when t1.problem_category = 2 then 1
326
+                    else 0
327
+                 END
328
+            ) AS problemCategoryTwo,
329
+
330
+            SUM(
331
+                 case
332
+                    when t1.problem_category = 3 then 1
333
+                    else 0
334
+                 END
335
+            ) AS problemCategoryThree,
336
+
337
+
338
+            SUM(
339
+                 case
340
+                    when t1.problem_category = 4 then 1
341
+                    else 0
342
+                 END
343
+            ) AS problemCategoryFour,
344
+
345
+            SUM(
346
+                 case
347
+                    when t1.problem_category = 5 then 1
348
+                    else 0
349
+                 END
350
+            ) AS problemCategoryFive,
351
+
352
+            SUM(
353
+                 case
354
+                    when t1.problem_category = 6 then 1
355
+                    else 0
356
+                 END
357
+            ) AS problemCategorySix
358
+        FROM post_checked_problem t1
359
+        GROUP BY problem_attribute
360
+        ORDER BY t1.problem_attribute
361
+    </select>
308 362
 </mapper>

+ 26 - 0
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostListMapper.xml

@@ -265,6 +265,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
265 265
 
266 266
     <select id="contentListByType" resultType="PostCheckedItems">
267 267
         SELECT
268
+            t2.id,
268 269
             t2.type,
269 270
             t2.level_one  as levelOne,
270 271
             t2.level_two as levelTwo,
@@ -293,4 +294,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
293 294
         AND t1."post_id" = #{postId}
294 295
         AND t2."type" = #{type}
295 296
     </select>
297
+
298
+    <select id="userTotal" resultType="java.lang.Integer">
299
+        SELECT count(0) FROM "public"."sys_users"
300
+    </select>
301
+
302
+    <select id="postChecked" resultType="com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView">
303
+        SELECT
304
+            t2."checked_dept_id" deptId ,
305
+            t2.checked_post_id postId,
306
+            (select a."post_name" from "public"."sys_post" a WHERE a."post_id" = t2.checked_post_id) AS postName,
307
+            (select aa."dept_name" from "public"."sys_dept" aa WHERE aa."dept_id" = t2.checked_dept_id) AS deptName,
308
+            (select count(0) from "public"."sys_user_post" a LEFT JOIN "public"."sys_users" b ON a."user_id" = b."user_id" WHERE a."post_id" = t2."checked_post_id") AS "userCount"
309
+        FROM "post_plan" t1
310
+                 INNER JOIN "post_plan_info" t2 ON t2."post_plan_id" = t1."id"
311
+        WHERE t1.status = 3 -- 状态:1-待审核;2-审核中;3-通过;4-驳回;
312
+          AND t2."status" = #{status} -- 岗检状态:1-未检;2-已检;
313
+        GROUP BY t2."checked_dept_id", t2."checked_post_id"
314
+        ORDER BY t2."checked_dept_id"
315
+    </select>
316
+
317
+    <select id="getPostCountByDeptId" resultType="java.lang.Integer">
318
+        SELECT COUNT(0) FROM "public"."sys_user_post" sup LEFT JOIN "public"."sys_user_role" sur ON sup."user_id" = sur."user_id"
319
+                                                          LEFT JOIN "public"."sys_role_dept" srd ON sur."role_id" = srd."role_id"
320
+        WHERE srd."dept_id" = #{deptId}
321
+    </select>
296 322
 </mapper>

+ 25 - 0
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostPlanMapper.xml

@@ -199,6 +199,7 @@
199 199
 
200 200
     <!--从岗检计划中查询,岗检记录上传的列表-->
201 201
     <select id="selectPostPlanJoinCheckedList" parameterType="PostPlanJoinChecked" resultType="PostPlanJoinChecked">
202
+       <!--
202 203
         SELECT
203 204
             t1.check_group_id AS checkGroupId,
204 205
             t1.check_team_id AS checkTeamId,
@@ -211,6 +212,30 @@
211 212
         INNER JOIN post_plan_info t2 ON t2."post_plan_id"  = t1.id
212 213
         GROUP BY t2.checked_dept_id
213 214
         ORDER BY t1.start_time, t1.create_time, t2.create_time, t2.id
215
+        -->
216
+        SELECT
217
+            t1.check_group_id AS checkGroupId,
218
+            t1.check_team_id AS checkTeamId,
219
+            t2.id AS planInfoId,
220
+            t2.checked_user_id AS checkedUserId,
221
+            t2.checked_dept_id AS checkedDeptId,
222
+            t2.checked_post_id AS checkedPostId,
223
+            t2.status AS status,
224
+            pt1.name AS checkGroupName,
225
+            pt2.name AS checkTeamName,
226
+            sd.dept_name AS checkedDeptName,
227
+            GROUP_CONCAT (DISTINCT sp.post_name) AS checkedPostNames,
228
+            GROUP_CONCAT (DISTINCT su."nick_name") AS checkedUserNames
229
+        FROM post_plan t1
230
+        INNER JOIN post_plan_info t2 ON t2."post_plan_id"  = t1.id
231
+        LEFT JOIN post_plan_check_user t3 ON t3.post_plan_id  = t1.id
232
+        LEFT JOIN "public"."sys_users" su ON su."user_id" = t3."checked_user_id"
233
+        LEFT JOIN post_team pt1 ON pt1.id = t1.check_group_id
234
+        LEFT JOIN post_team pt2 ON pt2.id = t1.check_team_id
235
+        LEFT JOIN sys_dept sd ON sd.dept_id = t2.checked_dept_id
236
+        LEFT JOIN sys_post sp ON sp.post_id = t2.checked_post_id
237
+        GROUP BY t2.checked_dept_id
238
+        ORDER BY t1.start_time, t1.create_time, t2.create_time, t2.id
214 239
     </select>
215 240
 
216 241
     <!--从岗检计划中查询,岗检问题录入的列表-->

+ 56 - 2
ruoyi-postcheck/src/main/resources/mapper/postCheck/PostProgrammeMapper.xml

@@ -29,11 +29,65 @@
29 29
         <result property="statusUserId"    column="status_user_id"    />
30 30
         <result property="statusIcfaUserId"    column="status_icfa_user_id"    />
31 31
         <result property="statusHrUserId"    column="status_hr_user_id"    />
32
-        <result property="step" column="step" />
33 32
     </resultMap>
34 33
 
35 34
     <sql id="selectPostProgrammeVo">
36
-        select id, name, submit_date, status_hr, date_hr, reason_hr, status_icfa, date_icfa, reason_icfa, remark, del_flag, create_time, create_by, update_time, update_by, create_user_id, disk_path, dept_id, dept_name, status, status_time, status_user_id, status_icfa_user_id, status_hr_user_id, step from post_programme
35
+        <!--
36
+        select
37
+            id,
38
+            name,
39
+            submit_date,
40
+            status_hr,
41
+            date_hr,
42
+            reason_hr,
43
+            status_icfa,
44
+            date_icfa,
45
+            reason_icfa,
46
+            remark,
47
+            del_flag,
48
+            create_time,
49
+            create_by,
50
+            update_time,
51
+            update_by,
52
+            create_user_id,
53
+            disk_path,
54
+            dept_id,
55
+            dept_name,
56
+            status,
57
+            status_time,
58
+            status_user_id,
59
+            status_icfa_user_id,
60
+            status_hr_user_id,
61
+            step
62
+        from post_programme
63
+        -->
64
+        select
65
+            t1.id,
66
+            t1.name,
67
+            t1.submit_date,
68
+            t1.status_hr,
69
+            t1.date_hr,
70
+            t1.reason_hr,
71
+            t1.status_icfa,
72
+            t1.date_icfa,
73
+            t1.reason_icfa,
74
+            t1.remark,
75
+            t1.del_flag,
76
+            t1.create_time,
77
+            t1.create_by,
78
+            t1.update_time,
79
+            t1.update_by,
80
+            t1.create_user_id,
81
+            t1.disk_path,
82
+            t1.dept_id,
83
+            t1.dept_name,
84
+            t1.status,
85
+            t1.status_time,
86
+            t1.status_user_id,
87
+            t1.status_icfa_user_id,
88
+            t1.status_hr_user_id,
89
+            step
90
+        from post_programme t1
37 91
     </sql>
38 92
 
39 93
     <select id="selectPostProgrammeList" parameterType="PostProgramme" resultMap="PostProgrammeResult">