Bläddra i källkod

Merge remote-tracking branch 'origin/master'

zwj 10 månader sedan
förälder
incheckning
5b76997666
18 ändrade filer med 1115 tillägg och 711 borttagningar
  1. 26 33
      ruoyi-common/src/main/java/com/ruoyi/common/constant/PostCheckedProblemEnum.java
  2. 55 72
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java
  3. 6 9
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProblemController.java
  4. 46 86
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java
  5. 29 64
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationFunctionProblemStatisticsController.java
  6. 29 65
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationProductionProblemStatisticsController.java
  7. 13 12
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CheckedProblemDeptDetaailView.java
  8. 1 0
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/DeptDetaailView.java
  9. 2 2
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/ProblemLevelView.java
  10. 8 2
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/IPostCheckedProblemService.java
  11. 620 97
      ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java
  12. 24 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/UserPostAuthority.java
  13. 19 14
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
  14. 28 12
      ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
  15. 56 88
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
  16. 73 44
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
  17. 60 111
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
  18. 20 0
      ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

+ 26 - 33
ruoyi-common/src/main/java/com/ruoyi/common/constant/PostCheckedProblemEnum.java

@@ -4,39 +4,32 @@ package com.ruoyi.common.constant;
4 4
  * 岗检问题状态枚举
5 5
  */
6 6
 public enum PostCheckedProblemEnum {
7
-    //状态:
8
-    // 1-待指定整改人(问题录入完成时);
9
-    // 2-待填写方案(部门管理员指定整改人后);
10
-//            3-方案填写完成;
11
-    // 10-部门审核通过;
12
-    // 11-部门审核驳回;
13
-    // 20-专业部门人审核(非必填)通过;
14
-    // 21-专业部门人审核驳回(非必填);
15
-    // 30-整改人待上传实施(整改人上传实施图片)
16
-//            31-上传实施照片完成;
17
-    // 40-复查部门人审核通过;
18
-    // 41-复查部门人审核驳回
19
-
20
-
21
-
22
-
23
-
24
-
25
-    ADD("待指定整改人(问题录入完成时);", 1),
26
-    EDIT_ONE("待填写方案(部门管理员指定整改人后);", 2),
27
-    EDIT_ONE_OVER("方案填写完成", 2),
28
-
29
-    DEPT_PASS("部门审核通过;", 10),
30
-    DEPT_BACK("部门审核驳回;", 11),
31
-
32
-    ZHUAN_YE_PASS("专业部门人审核(非必填)通过;", 20),
33
-    ZHUAN_YE_BACK("专业部门人审核驳回(非必填);", 21),
34
-
35
-    EDIT_TWO("整改人待上传实施(整改人上传实施图片)", 30),
36
-    EDIT_TWO_OVER("上传实施照片完成", 30),
37
-
38
-    FU_CHA_PASS("复查部门人审核通过;", 40),
39
-    FU_CHA_BACK("复查部门人审核驳回", 41);
7
+//	  1-待指定整改人(问题录入完成时);2-待填写方案(部门管理员指定整改人后);
8
+//    10-待部门审核;11-部门审核驳回;
9
+//    20-待专业部门人审核(非必填);21-专业部门人审核驳回(非必填);
10
+//    30-待整改人待上传实施(整改人上传实施图片);
11
+//    40-待复查部门人审核;41-复查部门人审核通过;42-复查部门人审核驳回
12
+
13
+    ADD("待指定整改人(问题录入完成时)", 1),
14
+    EDIT_WAIT_ONR("待填写方案(部门管理员指定整改人后)", 2),
15
+//    EDIT_ONE_OVER("方案填写完成", 2),
16
+
17
+    DEPT_WAIT("待部门审核", 10),
18
+    //TODO 前台传过来的审核状态,数据库并不保存,部门审核通过后,单据流转到专业部门待审核或者方案待填写
19
+    DEPT_PASS("部门审核通过", 11),
20
+    DEPT_BACK("部门审核驳回", 12),
21
+
22
+    ZHUAN_ZY_WAIT("待专业部门人审核(非必填)", 20),
23
+    //TODO 前台传过来的审核状态,数据库并不保存,专业部门审核通过后,单据流转到待整改人待上传实施
24
+    ZHUAN_ZY_PASS("专业部门人审核通过(非必填)", 21),
25
+    ZHUAN_ZY_BACK("专业部门人审核驳回(非必填);", 22),
26
+
27
+    EDIT_WAIT_TWO("待整改人待上传实施(整改人上传实施图片)", 30),
28
+    EDIT_TWO_OVER("上传实施照片完成", 31),
29
+
30
+    FU_CHA_WAIT("待复查部门人审核;", 40),
31
+    FU_CHA_PASS("复查部门人审核通过;", 41),
32
+    FU_CHA_BACK("复查部门人审核驳回", 42);
40 33
 
41 34
     private String name;
42 35
     private Integer value;

+ 55 - 72
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedFunctionProblemStatisticsController.java

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

+ 6 - 9
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProblemController.java

@@ -89,7 +89,7 @@ public class PostCheckedProblemController extends BaseController {
89 89
     public TableDataInfo list(PostCheckedProblem postCheckedProblem) {
90 90
 
91 91
 //        startPage();
92
-        startPage("desc","t1.create_time");
92
+        startPage("desc", "t1.create_time");
93 93
         List<PostCheckedProblem> list = postCheckedProblemService.selectPostCheckedProblemList(postCheckedProblem);
94 94
         return getDataTable(list);
95 95
     }
@@ -277,13 +277,13 @@ public class PostCheckedProblemController extends BaseController {
277 277
             @ApiImplicitParam(name = "problemCause", value = "问题原因", dataType = "String", dataTypeClass = String.class),
278 278
             @ApiImplicitParam(name = "isImmediatelyCorrected", value = "是否立行立改(1-Yes;2-No;)", dataType = "Integer", dataTypeClass = Integer.class),
279 279
             @ApiImplicitParam(name = "rectificationMeasure", value = "整改措施/建议", dataType = "String", dataTypeClass = String.class),
280
-            @ApiImplicitParam(name = "rectificationResponsibleUserId", value = "整改责任人ID", dataType = "Long", dataTypeClass = Long.class),
280
+//            @ApiImplicitParam(name = "rectificationResponsibleUserId", value = "整改责任人ID", dataType = "Long", dataTypeClass = Long.class),
281 281
             @ApiImplicitParam(name = "rectificationPeriod", value = "整改期限", dataType = "Date", dataTypeClass = Date.class),
282 282
     })
283 283
     @Log(title = "方案整改", businessType = BusinessType.UPDATE)
284 284
     @PutMapping("/updateRectificationMeasure")
285
-    public AjaxResult updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Long rectificationResponsibleUserId, Date rectificationPeriod) {
286
-        return toAjax(postCheckedProblemService.updateRectificationMeasure(id, problemCause, isImmediatelyCorrected, rectificationMeasure, rectificationResponsibleUserId, rectificationPeriod));
285
+    public AjaxResult updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Date rectificationPeriod) {
286
+        return toAjax(postCheckedProblemService.updateRectificationMeasure(id, problemCause, isImmediatelyCorrected, rectificationMeasure, rectificationPeriod));
287 287
     }
288 288
 
289 289
 
@@ -299,7 +299,6 @@ public class PostCheckedProblemController extends BaseController {
299 299
     }
300 300
 
301 301
 
302
-
303 302
     @ApiOperation("步骤4->审核1:部门经理审核")
304 303
     @ApiImplicitParams({
305 304
             @ApiImplicitParam(name = "id", value = "主键", dataType = "Long", dataTypeClass = Long.class),
@@ -309,11 +308,10 @@ public class PostCheckedProblemController extends BaseController {
309 308
     @Log(title = "审核1:部门经理审核", businessType = BusinessType.UPDATE)
310 309
     @PutMapping("/setDeptApproveTime")
311 310
     public AjaxResult setDeptApproveTime(Long id, Integer status, String reason) {
312
-        return toAjax(postCheckedProblemService.setDeptApproveTime(id, status,  reason));
311
+        return toAjax(postCheckedProblemService.setDeptApproveTime(id, status, reason));
313 312
     }
314 313
 
315 314
 
316
-
317 315
     @ApiOperation("步骤5->审核2:专业部门审核人审核")
318 316
     @ApiImplicitParams({
319 317
             @ApiImplicitParam(name = "id", value = "主键", dataType = "Long", dataTypeClass = Long.class),
@@ -323,7 +321,7 @@ public class PostCheckedProblemController extends BaseController {
323 321
     @Log(title = "审核2:专业部门审核人审核", businessType = BusinessType.UPDATE)
324 322
     @PutMapping("/setSpecialityDepartmentReviewTime")
325 323
     public AjaxResult setSpecialityDepartmentReviewTime(Long id, Integer status, String reason) {
326
-        return toAjax(postCheckedProblemService.setSpecialityDepartmentReviewTime(id, status,  reason));
324
+        return toAjax(postCheckedProblemService.setSpecialityDepartmentReviewTime(id, status, reason));
327 325
     }
328 326
 
329 327
 
@@ -367,7 +365,6 @@ public class PostCheckedProblemController extends BaseController {
367 365
     }
368 366
 
369 367
 
370
-
371 368
     @ApiOperation("Tools-1、按问题属性分组统计问题类别")
372 369
     @GetMapping("/problemCategoryByAttribute")
373 370
     public AjaxResult problemCategoryByAttribute(ProblemCategory noParam) {

+ 46 - 86
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedProductionProblemStatisticsController.java

@@ -17,14 +17,6 @@ import java.util.List;
17 17
 import java.util.Map;
18 18
 
19 19
 
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28 20
 /**
29 21
  * 岗检问题表Controller
30 22
  *
@@ -50,7 +42,7 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
50 42
         List<FunctionDeptProblemContrastView> list = new ArrayList<>();
51 43
         Integer type = 2;
52 44
         List<Map<String, Object>> deptIdListByType = postCheckedProblemService.getDeptIdListByType(type);
53
-        if (deptIdListByType!=null && deptIdListByType.size()>0){
45
+        if (deptIdListByType != null && deptIdListByType.size() > 0) {
54 46
             for (Map<String, Object> map : deptIdListByType) {
55 47
                 FunctionDeptProblemContrastView data = new FunctionDeptProblemContrastView();
56 48
                 data.setDeptId(Long.parseLong(map.get("deptId").toString()));
@@ -72,13 +64,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
72 64
 //        is_rectification_completed = 1 整改情况-是否完成(1-Yes;2-No;)
73 65
 
74 66
 
75
-        List<CoverageRateView> list = new ArrayList<>();
76
-        CoverageRateView data = new CoverageRateView();
77
-        data.setProblemTotal(6);
78
-        data.setProblemComplete(5);
79
-
80
-        list.add(data);
81
-        return success(list);
67
+        Integer type = 2;
68
+        return success(postCheckedProblemService.coverageRateView(type));
82 69
     }
83 70
 
84 71
     @ApiOperation("3-岗检问题职责类别占比")
@@ -89,15 +76,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
89 76
 //        group by duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
90 77
 
91 78
 
92
-        List<DutyTypeProblemStatisticsView> list = new ArrayList<>();
93
-        DutyTypeProblemStatisticsView data = new DutyTypeProblemStatisticsView();
94
-        data.setDutyTypeOne(1);
95
-        data.setDutyTypeTwo(2);
96
-        data.setDutyTypeThree(3);
97
-        data.setDutyTypeFour(4);
98
-
99
-        list.add(data);
100
-        return success(list);
79
+        Integer type = 2;
80
+        return success(postCheckedProblemService.dutyTypeProblemStatisticsView(type));
101 81
     }
102 82
 
103 83
     @ApiOperation("4-岗检问题级别占比")
@@ -107,14 +87,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
107 87
 //        select * from "public"."post_checked_problem";
108 88
 //        group by problem_level   问题等级(一般、重要)
109 89
 
110
-        List<ProblemLevelView> list = new ArrayList<>();
111
-        ProblemLevelView data = new ProblemLevelView();
112
-        data.setProblemLeveOne(2);
113
-        data.setProblemLeveTwo(1);
114
-
115
-
116
-        list.add(data);
117
-        return success(list);
90
+        Integer type = 2;
91
+        return success(postCheckedProblemService.problemLevelView(type));
118 92
     }
119 93
 
120 94
 
@@ -205,7 +179,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
205 179
         list.add(data6);
206 180
 
207 181
 
208
-        return success(list);
182
+        Integer type = 2;
183
+        return success(postCheckedProblemService.problemAttributeCategoryView(type));
209 184
     }
210 185
 
211 186
 
@@ -232,8 +207,8 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
232 207
 //        data.set任职资格
233 208
 //        data.set其他
234 209
 
235
-        list.add(data);
236
-        return success(list);
210
+        Integer type = 2;
211
+        return success(postCheckedProblemService.historyProblemNumberView(type));
237 212
     }
238 213
 
239 214
 
@@ -253,70 +228,55 @@ public class PostCheckedProductionProblemStatisticsController extends BaseContro
253 228
         //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
254 229
 
255 230
 
256
-
257 231
         CheckedProblemDeptDetaailView data1 = new CheckedProblemDeptDetaailView();
258
-//        data1.setdeptId 部门ID
259
-//        data1.setdeptName 部门名称
260
-//        data1.setproblemTotal 问题数量
261
-//        data1.setproblemLeveTwo 重要问题
262
-//        data1.setproblemLeveOne 一般问题
263
-//        data1.setstatisticsTime 统计时间
264
-
265
-        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
232
+        data1.setDeptId(1l); //部门ID
233
+        data1.setDeptName("测试部门名称1");// 部门名称
234
+        data1.setProblemTotal(10); //问题数量
235
+        data1.setProblemLeveTwo(2); //重要问题
236
+        data1.setProblemLeveOne(8); //一般问题
237
+        data1.setStatisticsTime(new Date());// 统计时间
238
+
239
+//        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
266 240
         CheckedProblemDeptDetaailView.ProblemAttributeInner child1 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
267
-//        child1.set完整性数量") private Integer problemComplete;
268
-//        child1.set适宜性数量") private Integer problemSuitable;
269
-//        child1.set有效性数量") private Integer problemEffective;
270
-        children1.add(child1);
271
-        data1.setChildren(children1);
241
+        child1.setProblemComplete(1); //child1.set完整性数量
242
+        child1.setProblemSuitable(2); //child1.set适宜性数量
243
+        child1.setProblemEffective(3);//child1.set有效性数量
244
+        //children1.add(child1);
245
+        //data1.setChildren(children1);
246
+        data1.getChildren().add(child1);
272 247
         list.add(data1);
273 248
 
274 249
         CheckedProblemDeptDetaailView data2 = new CheckedProblemDeptDetaailView();
275
-//        data2.setdeptId 部门ID
276
-//        data2.setdeptName 部门名称
277
-//        data2.setproblemTotal 问题数量
278
-//        data2.setproblemLeveTwo 重要问题
279
-//        data2.setproblemLeveOne 一般问题
280
-//        data2.setstatisticsTime 统计时间
281
-        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
250
+        data2.setDeptId(2l); //部门ID
251
+        data2.setDeptName("测试部门名称2");// 部门名称
252
+        data2.setProblemTotal(9); //问题数量
253
+        data2.setProblemLeveTwo(2); //重要问题
254
+        data2.setProblemLeveOne(7); //一般问题
255
+        data2.setStatisticsTime(new Date());// 统计时间
282 256
         CheckedProblemDeptDetaailView.ProblemAttributeInner child2 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
283
-//        child2.set完整性数量") private Integer problemComplete;
284
-//        child2.set适宜性数量") private Integer problemSuitable;
285
-//        child2.set有效性数量") private Integer problemEffective;
286
-        children1.add(child2);
287
-        data2.setChildren(children2);
257
+        data2.getChildren().add(child2);
288 258
         list.add(data2);
289 259
 
290 260
         CheckedProblemDeptDetaailView data3 = new CheckedProblemDeptDetaailView();
291
-//        data3.setdeptId 部门ID
292
-//        data3.setdeptName 部门名称
293
-//        data3.setproblemTotal 问题数量
294
-//        data3.setproblemLeveTwo 重要问题
295
-//        data3.setproblemLeveOne 一般问题
296
-//        data3.setstatisticsTime 统计时间
297
-        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
261
+        data3.setDeptId(3l); //部门ID
262
+        data3.setDeptName("测试部门名称3");// 部门名称
263
+        data3.setProblemTotal(8); //问题数量
264
+        data3.setProblemLeveTwo(3); //重要问题
265
+        data3.setProblemLeveOne(5); //一般问题
266
+        data3.setStatisticsTime(new Date());// 统计时间
298 267
         CheckedProblemDeptDetaailView.ProblemAttributeInner child3 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
299
-//        child3.set完整性数量") private Integer problemComplete;
300
-//        child3.set适宜性数量") private Integer problemSuitable;
301
-//        child3.set有效性数量") private Integer problemEffective;
302
-        children1.add(child3);
303
-        data3.setChildren(children3);
268
+        data3.getChildren().add(child3);
304 269
         list.add(data3);
305 270
 
306 271
         CheckedProblemDeptDetaailView data4 = new CheckedProblemDeptDetaailView();
307
-//        data4.setdeptId 部门ID
308
-//        data4.setdeptName 部门名称
309
-//        data4.setproblemTotal 问题数量
310
-//        data4.setproblemLeveTwo 重要问题
311
-//        data4.setproblemLeveOne 一般问题
312
-//        data4.setstatisticsTime 统计时间
313
-        List<CheckedProblemDeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
272
+        data4.setDeptId(4l); //部门ID
273
+        data4.setDeptName("测试部门名称4");// 部门名称
274
+        data4.setProblemTotal(6); //问题数量
275
+        data4.setProblemLeveTwo(1); //重要问题
276
+        data4.setProblemLeveOne(5); //一般问题
277
+        data4.setStatisticsTime(new Date());// 统计时间
314 278
         CheckedProblemDeptDetaailView.ProblemAttributeInner child4 = new CheckedProblemDeptDetaailView.ProblemAttributeInner();
315
-//        child4.set完整性数量") private Integer problemComplete;
316
-//        child4.set适宜性数量") private Integer problemSuitable;
317
-//        child4.set有效性数量") private Integer problemEffective;
318
-        children1.add(child4);
319
-        data4.setChildren(children4);
279
+        data4.getChildren().add(child4);
320 280
         list.add(data4);
321 281
         return success(list);
322 282
     }

+ 29 - 64
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationFunctionProblemStatisticsController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
11 11
 import org.springframework.web.bind.annotation.RequestMapping;
12 12
 import org.springframework.web.bind.annotation.RestController;
13 13
 
14
+import java.math.BigDecimal;
14 15
 import java.util.ArrayList;
15 16
 import java.util.Date;
16 17
 import java.util.List;
@@ -277,77 +278,41 @@ public class PostCheckedRectificationFunctionProblemStatisticsController extends
277 278
         //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
278 279
 
279 280
         DeptDetaailView data1 = new DeptDetaailView();
280
-//        data1.setdeptId 部门ID
281
-//        data1.setdeptName 部门名称
282
-//        data1.setproblemRectificationRate 整改率
283
-//        data1.setstatisticsTime 统计时间
284
-
285
-        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
281
+        data1.setDeptId(1l); //部门ID
282
+        data1.setDeptName("测试部门名称1");// 部门名称
283
+        data1.setProblemRectificationRate(new BigDecimal(0.9)); //整改率
284
+        data1.setStatisticsTime(new Date());// 统计时间
285
+//        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
286 286
         DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
287
-//        child1.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
288
-//        child1.set完整性数量 private Integer problemComplete;
289
-//        child1.set适宜性数量 private Integer problemSuitable;
290
-//        child1.set有效性数量 private Integer problemEffective;
291
-//        child1.set已完成完整性数量 private Integer problemCompleteChecked;
292
-//        child1.set已完成适宜性数量 private Integer problemSuitableChecked;
293
-//        child1.set已完成有效性数量 private Integer problemEffectiveChecked;
294
-        children1.add(child1);
295
-        data1.setChildren(children1);
287
+        //业务职责字典值 private Integer ; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
288
+        child1.setDutyType(1);
289
+        child1.setProblemComplete(1);//完整性数量
290
+        child1.setProblemSuitable(2);//适宜性数量
291
+        child1.setProblemEffective(3);//有效性数量
292
+        child1.setProblemCompleteChecked(0);//已完成完整性数量
293
+        child1.setProblemSuitableChecked(1);//已完成适宜性数量
294
+        child1.setProblemEffectiveChecked(2);//已完成有效性数量
295
+        // children1.add(child1);
296
+        // data1.setChildren(children1);
297
+        data1.getChildren().add(child1);
296 298
         list.add(data1);
297 299
 
298 300
         DeptDetaailView data2 = new DeptDetaailView();
299
-//        data2.setdeptId 部门ID
300
-//        data2.setdeptName 部门名称
301
-//        data2.setproblemRectificationRate 整改率
302
-//        data2.setstatisticsTime 统计时间
303
-        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
301
+        data2.setDeptId(2l); //部门ID
302
+        data2.setDeptName("测试部门名称2");// 部门名称
303
+        data2.setProblemRectificationRate(new BigDecimal(0.9)); //整改率
304
+        data2.setStatisticsTime(new Date());// 统计时间
304 305
         DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
305
-//        child2.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
306
-//        child2.set完整性数量  private Integer problemComplete;
307
-//        child2.set适宜性数量  private Integer problemSuitable;
308
-//        child2.set有效性数量  private Integer problemEffective;
309
-//        child2.set已完成完整性数量 private Integer problemCompleteChecked;
310
-//        child2.set已完成适宜性数量 private Integer problemSuitableChecked;
311
-//        child2.set已完成有效性数量 private Integer problemEffectiveChecked;
312
-        children1.add(child2);
313
-        data2.setChildren(children2);
306
+        child2.setDutyType(1);
307
+        child2.setProblemComplete(1);//完整性数量
308
+        child2.setProblemSuitable(2);//适宜性数量
309
+        child2.setProblemEffective(3);//有效性数量
310
+        child2.setProblemCompleteChecked(0);//已完成完整性数量
311
+        child2.setProblemSuitableChecked(1);//已完成适宜性数量
312
+        child2.setProblemEffectiveChecked(2);//已完成有效性数量
313
+        data2.getChildren().add(child2);
314 314
         list.add(data2);
315 315
 
316
-        DeptDetaailView data3 = new DeptDetaailView();
317
-//        data3.setdeptId 部门ID
318
-//        data3.setdeptName 部门名称
319
-//        data3.setproblemRectificationRate 整改率
320
-//        data3.setstatisticsTime 统计时间
321
-        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
322
-        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
323
-//        child3.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
324
-//        child3.set完整性数量  private Integer problemComplete;
325
-//        child3.set适宜性数量  private Integer problemSuitable;
326
-//        child3.set有效性数量  private Integer problemEffective;
327
-//        child3.set已完成完整性数量 private Integer problemCompleteChecked;
328
-//        child3.set已完成适宜性数量 private Integer problemSuitableChecked;
329
-//        child3.set已完成有效性数量 private Integer problemEffectiveChecked;
330
-        children1.add(child3);
331
-        data3.setChildren(children3);
332
-        list.add(data3);
333
-
334
-        DeptDetaailView data4 = new DeptDetaailView();
335
-//        data4.setdeptId 部门ID
336
-//        data4.setdeptName 部门名称
337
-//        data4.setproblemRectificationRate 整改率
338
-//        data4.setstatisticsTime 统计时间
339
-        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
340
-        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
341
-//        child4.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
342
-//        child4.set完整性数量 private Integer problemComplete;
343
-//        child4.set适宜性数量 private Integer problemSuitable;
344
-//        child4.set有效性数量 private Integer problemEffective;
345
-//        child4.set已完成完整性数量 private Integer problemCompleteChecked;
346
-//        child4.set已完成适宜性数量 private Integer problemSuitableChecked;
347
-//        child4.set已完成有效性数量 private Integer problemEffectiveChecked;
348
-        children1.add(child4);
349
-        data4.setChildren(children4);
350
-        list.add(data4);
351 316
         return success(list);
352 317
     }
353 318
 }

+ 29 - 65
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedRectificationProductionProblemStatisticsController.java

@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping;
11 11
 import org.springframework.web.bind.annotation.RequestMapping;
12 12
 import org.springframework.web.bind.annotation.RestController;
13 13
 
14
+import java.math.BigDecimal;
14 15
 import java.util.ArrayList;
15 16
 import java.util.Date;
16 17
 import java.util.List;
@@ -277,77 +278,40 @@ public class PostCheckedRectificationProductionProblemStatisticsController exten
277 278
         //TODO 第三步:设置部门的整改率:遍历职责类别计算整改率
278 279
 
279 280
         DeptDetaailView data1 = new DeptDetaailView();
280
-//        data1.setdeptId 部门ID
281
-//        data1.setdeptName 部门名称
282
-//        data1.setproblemRectificationRate 整改率
283
-//        data1.setstatisticsTime 统计时间
284
-
285
-        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
281
+        data1.setDeptId(1l); //部门ID
282
+        data1.setDeptName("测试部门名称1111");// 部门名称
283
+        data1.setProblemRectificationRate(new BigDecimal(0.9)); //整改率
284
+        data1.setStatisticsTime(new Date());// 统计时间
285
+//        List<DeptDetaailView.ProblemAttributeInner> children1 = new ArrayList<>();
286 286
         DeptDetaailView.ProblemAttributeInner child1 = new DeptDetaailView.ProblemAttributeInner();
287
-//        child1.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
288
-//        child1.set完整性数量 private Integer problemComplete;
289
-//        child1.set适宜性数量 private Integer problemSuitable;
290
-//        child1.set有效性数量 private Integer problemEffective;
291
-//        child1.set已完成完整性数量 private Integer problemCompleteChecked;
292
-//        child1.set已完成适宜性数量 private Integer problemSuitableChecked;
293
-//        child1.set已完成有效性数量 private Integer problemEffectiveChecked;
294
-        children1.add(child1);
295
-        data1.setChildren(children1);
287
+        //业务职责字典值 private Integer ; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
288
+        child1.setDutyType(1);
289
+        child1.setProblemComplete(1);//完整性数量
290
+        child1.setProblemSuitable(2);//适宜性数量
291
+        child1.setProblemEffective(3);//有效性数量
292
+        child1.setProblemCompleteChecked(0);//已完成完整性数量
293
+        child1.setProblemSuitableChecked(1);//已完成适宜性数量
294
+        child1.setProblemEffectiveChecked(2);//已完成有效性数量
295
+        // children1.add(child1);
296
+        // data1.setChildren(children1);
297
+        data1.getChildren().add(child1);
296 298
         list.add(data1);
297 299
 
298 300
         DeptDetaailView data2 = new DeptDetaailView();
299
-//        data2.setdeptId 部门ID
300
-//        data2.setdeptName 部门名称
301
-//        data2.setproblemRectificationRate 整改率
302
-//        data2.setstatisticsTime 统计时间
303
-        List<DeptDetaailView.ProblemAttributeInner> children2 = new ArrayList<>();
301
+        data2.setDeptId(2l); //部门ID
302
+        data2.setDeptName("测试部门名称2222");// 部门名称
303
+        data2.setProblemRectificationRate(new BigDecimal(0.9)); //整改率
304
+        data2.setStatisticsTime(new Date());// 统计时间
304 305
         DeptDetaailView.ProblemAttributeInner child2 = new DeptDetaailView.ProblemAttributeInner();
305
-//        child2.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
306
-//        child2.set完整性数量  private Integer problemComplete;
307
-//        child2.set适宜性数量  private Integer problemSuitable;
308
-//        child2.set有效性数量  private Integer problemEffective;
309
-//        child2.set已完成完整性数量 private Integer problemCompleteChecked;
310
-//        child2.set已完成适宜性数量 private Integer problemSuitableChecked;
311
-//        child2.set已完成有效性数量 private Integer problemEffectiveChecked;
312
-        children1.add(child2);
313
-        data2.setChildren(children2);
306
+        child2.setDutyType(1);
307
+        child2.setProblemComplete(1);//完整性数量
308
+        child2.setProblemSuitable(2);//适宜性数量
309
+        child2.setProblemEffective(3);//有效性数量
310
+        child2.setProblemCompleteChecked(0);//已完成完整性数量
311
+        child2.setProblemSuitableChecked(1);//已完成适宜性数量
312
+        child2.setProblemEffectiveChecked(2);//已完成有效性数量
313
+        data2.getChildren().add(child2);
314 314
         list.add(data2);
315
-
316
-        DeptDetaailView data3 = new DeptDetaailView();
317
-//        data3.setdeptId 部门ID
318
-//        data3.setdeptName 部门名称
319
-//        data3.setproblemRectificationRate 整改率
320
-//        data3.setstatisticsTime 统计时间
321
-        List<DeptDetaailView.ProblemAttributeInner> children3 = new ArrayList<>();
322
-        DeptDetaailView.ProblemAttributeInner child3 = new DeptDetaailView.ProblemAttributeInner();
323
-//        child3.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
324
-//        child3.set完整性数量  private Integer problemComplete;
325
-//        child3.set适宜性数量  private Integer problemSuitable;
326
-//        child3.set有效性数量  private Integer problemEffective;
327
-//        child3.set已完成完整性数量 private Integer problemCompleteChecked;
328
-//        child3.set已完成适宜性数量 private Integer problemSuitableChecked;
329
-//        child3.set已完成有效性数量 private Integer problemEffectiveChecked;
330
-        children1.add(child3);
331
-        data3.setChildren(children3);
332
-        list.add(data3);
333
-
334
-        DeptDetaailView data4 = new DeptDetaailView();
335
-//        data4.setdeptId 部门ID
336
-//        data4.setdeptName 部门名称
337
-//        data4.setproblemRectificationRate 整改率
338
-//        data4.setstatisticsTime 统计时间
339
-        List<DeptDetaailView.ProblemAttributeInner> children4 = new ArrayList<>();
340
-        DeptDetaailView.ProblemAttributeInner child4 = new DeptDetaailView.ProblemAttributeInner();
341
-//        child4.set业务职责字典值 private Integer dutyType; 业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;
342
-//        child4.set完整性数量 private Integer problemComplete;
343
-//        child4.set适宜性数量 private Integer problemSuitable;
344
-//        child4.set有效性数量 private Integer problemEffective;
345
-//        child4.set已完成完整性数量 private Integer problemCompleteChecked;
346
-//        child4.set已完成适宜性数量 private Integer problemSuitableChecked;
347
-//        child4.set已完成有效性数量 private Integer problemEffectiveChecked;
348
-        children1.add(child4);
349
-        data4.setChildren(children4);
350
-        list.add(data4);
351 315
         return success(list);
352 316
     }
353 317
 }

+ 13 - 12
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/domain/problemStatistics/CheckedProblemDeptDetaailView.java

@@ -15,9 +15,10 @@ import java.util.List;
15 15
 @Data
16 16
 @ApiModel(value = "统计分析-部门详情(职能管理)")
17 17
 //extends DutyTypeProblemStatisticsView
18
-public class CheckedProblemDeptDetaailView extends  ProblemLevelView implements Serializable {
18
+public class CheckedProblemDeptDetaailView extends ProblemLevelView {
19 19
 
20
-    private static final long serialVersionUID = 5666890687691604123L;
20
+
21
+    private static final long serialVersionUID = -1417514493751943760L;
21 22
     @ApiModelProperty("部门ID")
22 23
     private Long deptId;
23 24
     @ApiModelProperty("部门名称")
@@ -25,7 +26,7 @@ public class CheckedProblemDeptDetaailView extends  ProblemLevelView implements
25 26
 
26 27
 
27 28
     @ApiModelProperty("总数量")
28
-    private Integer problemTotal;
29
+    private int problemTotal;
29 30
 
30 31
 //    @ApiModelProperty("一般")
31 32
 //    private Integer problemLeveOne;
@@ -45,27 +46,27 @@ public class CheckedProblemDeptDetaailView extends  ProblemLevelView implements
45 46
      * 按业务职责归类存放问题整改的情况
46 47
      */
47 48
 //            extends ProblemNumberBase {
48
-    public static class ProblemAttributeInner implements Serializable {
49
-
50
-        private static final long serialVersionUID = 3140695152506065277L;
49
+    @Data
50
+    public static class ProblemAttributeInner implements Serializable{
51 51
 
52
+        private static final long serialVersionUID = 1635970865375548967L;
52 53
         @ApiModelProperty("业务职责字典值-前端自己显示中文名称:duty_type 职责类别:1-业务职责;2-党建及党风廉政;3-安全环保职责;4-合规保密职;")
53 54
         private Integer dutyType;
54 55
 
55 56
 
56 57
         @ApiModelProperty("完整性数量")
57
-        private Integer problemComplete;
58
+        private int problemComplete;
58 59
         @ApiModelProperty("适宜性数量")
59
-        private Integer problemSuitable;
60
+        private int problemSuitable;
60 61
         @ApiModelProperty("有效性数量")
61
-        private Integer problemEffective;
62
+        private int problemEffective;
62 63
 
63 64
         @ApiModelProperty("已完成完整性数量")
64
-        private Integer problemCompleteChecked;
65
+        private int problemCompleteChecked;
65 66
         @ApiModelProperty("已完成适宜性数量")
66
-        private Integer problemSuitableChecked;
67
+        private int problemSuitableChecked;
67 68
         @ApiModelProperty("已完成有效性数量")
68
-        private Integer problemEffectiveChecked;
69
+        private int problemEffectiveChecked;
69 70
 
70 71
     }
71 72
 

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

@@ -36,6 +36,7 @@ public class DeptDetaailView implements Serializable {
36 36
      * 按业务职责归类存放问题整改的情况
37 37
      */
38 38
 //            extends ProblemNumberBase {
39
+    @Data
39 40
     public static class ProblemAttributeInner implements Serializable {
40 41
 
41 42
         private static final long serialVersionUID = 3140695152506065277L;

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

@@ -17,10 +17,10 @@ public class ProblemLevelView implements Serializable {
17 17
     private static final long serialVersionUID = -6982314157222524166L;
18 18
 
19 19
     @ApiModelProperty("一般")
20
-    private Integer problemLeveOne;
20
+    private int problemLeveOne;
21 21
 
22 22
     @ApiModelProperty("重要")
23
-    private Integer problemLeveTwo;
23
+    private int problemLeveTwo;
24 24
 
25 25
 
26 26
 

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

@@ -11,9 +11,11 @@ import com.ruoyi.postCheck.domain.homePage.DeptProblemRectificationView;
11 11
 import com.ruoyi.postCheck.domain.homePage.PostCheckedProblemView;
12 12
 import com.ruoyi.postCheck.domain.homePage.PostCheckedUnCheckedView;
13 13
 import com.ruoyi.postCheck.domain.homePage.PostTotalView;
14
+import com.ruoyi.postCheck.domain.problemStatistics.CheckedProblemDeptDetaailView;
14 15
 import com.ruoyi.postCheck.domain.problemStatistics.CoverageRateView;
15 16
 import com.ruoyi.postCheck.domain.problemStatistics.DutyTypeProblemStatisticsView;
16 17
 import com.ruoyi.postCheck.domain.problemStatistics.FunctionDeptProblemContrastView;
18
+import com.ruoyi.postCheck.domain.problemStatistics.HistoryProblemNumberView;
17 19
 import com.ruoyi.postCheck.domain.problemStatistics.ProblemAttributeCategoryView;
18 20
 import com.ruoyi.postCheck.domain.problemStatistics.ProblemLevelView;
19 21
 import com.ruoyi.postCheck.domain.tools.ProblemCategory;
@@ -99,11 +101,11 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
99 101
      * @param problemCause                   问题原因
100 102
      * @param isImmediatelyCorrected         是否立行立改(1-Yes;2-No;)
101 103
      * @param rectificationMeasure           整改措施/建议
102
-     * @param rectificationResponsibleUserId 整改责任人ID
104
+     * param rectificationResponsibleUserId 整改责任人ID
103 105
      * @param rectificationPeriod            整改期限
104 106
      * @return
105 107
      */
106
-    int updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure, Long rectificationResponsibleUserId, Date rectificationPeriod);
108
+    int updateRectificationMeasure(Long id, String problemCause, Integer isImmediatelyCorrected, String rectificationMeasure,Date rectificationPeriod);
107 109
 
108 110
     /**
109 111
      * 指定专业部门的审核人
@@ -197,4 +199,8 @@ public interface IPostCheckedProblemService extends IService<PostCheckedProblem>
197 199
     List<ProblemLevelView>  problemLevelView(Integer type);
198 200
 
199 201
     List<ProblemAttributeCategoryView> problemAttributeCategoryView(Integer type);
202
+
203
+    List<HistoryProblemNumberView>  historyProblemNumberView(Integer type);
204
+
205
+    List<CheckedProblemDeptDetaailView>  deptDetaailView(Integer type);
200 206
 }

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 620 - 97
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedProblemServiceImpl.java


+ 24 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserPostAuthority.java

@@ -0,0 +1,24 @@
1
+package com.ruoyi.system.domain;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 用户岗位权限实体类
7
+ */
8
+@Data
9
+public class UserPostAuthority {
10
+
11
+   private Long userId;
12
+   private String userName;
13
+   private String nickName;
14
+
15
+   private Long postId;
16
+   private String postCode;
17
+   private String postName;
18
+    /**
19
+     * 岗位级别:0-不设置;1-经理;
20
+     */
21
+   private Integer postLevel;
22
+
23
+
24
+}

+ 19 - 14
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java

@@ -1,18 +1,20 @@
1 1
 package com.ruoyi.system.mapper;
2 2
 
3 3
 import java.util.List;
4
+
4 5
 import com.ruoyi.system.domain.SysPost;
6
+import com.ruoyi.system.domain.UserPostAuthority;
7
+import org.apache.ibatis.annotations.Param;
5 8
 
6 9
 /**
7 10
  * 岗位信息 数据层
8
- * 
11
+ *
9 12
  * @author ruoyi
10 13
  */
11
-public interface SysPostMapper
12
-{
14
+public interface SysPostMapper {
13 15
     /**
14 16
      * 查询岗位数据集合
15
-     * 
17
+     *
16 18
      * @param post 岗位信息
17 19
      * @return 岗位数据集合
18 20
      */
@@ -20,14 +22,14 @@ public interface SysPostMapper
20 22
 
21 23
     /**
22 24
      * 查询所有岗位
23
-     * 
25
+     *
24 26
      * @return 岗位列表
25 27
      */
26 28
     public List<SysPost> selectPostAll();
27 29
 
28 30
     /**
29 31
      * 通过岗位ID查询岗位信息
30
-     * 
32
+     *
31 33
      * @param postId 岗位ID
32 34
      * @return 角色对象信息
33 35
      */
@@ -35,7 +37,7 @@ public interface SysPostMapper
35 37
 
36 38
     /**
37 39
      * 根据用户ID获取岗位选择框列表
38
-     * 
40
+     *
39 41
      * @param userId 用户ID
40 42
      * @return 选中岗位ID列表
41 43
      */
@@ -43,7 +45,7 @@ public interface SysPostMapper
43 45
 
44 46
     /**
45 47
      * 查询用户所属岗位组
46
-     * 
48
+     *
47 49
      * @param userName 用户名
48 50
      * @return 结果
49 51
      */
@@ -51,7 +53,7 @@ public interface SysPostMapper
51 53
 
52 54
     /**
53 55
      * 删除岗位信息
54
-     * 
56
+     *
55 57
      * @param postId 岗位ID
56 58
      * @return 结果
57 59
      */
@@ -59,7 +61,7 @@ public interface SysPostMapper
59 61
 
60 62
     /**
61 63
      * 批量删除岗位信息
62
-     * 
64
+     *
63 65
      * @param postIds 需要删除的岗位ID
64 66
      * @return 结果
65 67
      */
@@ -67,7 +69,7 @@ public interface SysPostMapper
67 69
 
68 70
     /**
69 71
      * 修改岗位信息
70
-     * 
72
+     *
71 73
      * @param post 岗位信息
72 74
      * @return 结果
73 75
      */
@@ -75,7 +77,7 @@ public interface SysPostMapper
75 77
 
76 78
     /**
77 79
      * 新增岗位信息
78
-     * 
80
+     *
79 81
      * @param post 岗位信息
80 82
      * @return 结果
81 83
      */
@@ -83,7 +85,7 @@ public interface SysPostMapper
83 85
 
84 86
     /**
85 87
      * 校验岗位名称
86
-     * 
88
+     *
87 89
      * @param postName 岗位名称
88 90
      * @return 结果
89 91
      */
@@ -91,7 +93,7 @@ public interface SysPostMapper
91 93
 
92 94
     /**
93 95
      * 校验岗位编码
94
-     * 
96
+     *
95 97
      * @param postCode 岗位编码
96 98
      * @return 结果
97 99
      */
@@ -99,8 +101,11 @@ public interface SysPostMapper
99 101
 
100 102
     /**
101 103
      * 根据部门查询岗位
104
+     *
102 105
      * @param deptId
103 106
      * @return
104 107
      */
105 108
     public SysPost selectPostByDeptId(Long deptId);
109
+
110
+    List<UserPostAuthority> userPostAuthorityList(@Param("deptId") Long deptId, @Param("postLevel") Integer postLevel);
106 111
 }

+ 28 - 12
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java

@@ -3,17 +3,18 @@ package com.ruoyi.system.service;
3 3
 import java.util.List;
4 4
 
5 5
 import com.ruoyi.system.domain.SysPost;
6
+import com.ruoyi.system.domain.UserPostAuthority;
6 7
 
7 8
 /**
8 9
  * 岗位信息 服务层
9
- * 
10
+ *
10 11
  * @author ruoyi
11 12
  */
12 13
 public interface ISysPostService
13 14
 {
14 15
     /**
15 16
      * 查询岗位信息集合
16
-     * 
17
+     *
17 18
      * @param post 岗位信息
18 19
      * @return 岗位列表
19 20
      */
@@ -21,14 +22,14 @@ public interface ISysPostService
21 22
 
22 23
     /**
23 24
      * 查询所有岗位
24
-     * 
25
+     *
25 26
      * @return 岗位列表
26 27
      */
27 28
     public List<SysPost> selectPostAll();
28 29
 
29 30
     /**
30 31
      * 通过岗位ID查询岗位信息
31
-     * 
32
+     *
32 33
      * @param postId 岗位ID
33 34
      * @return 角色对象信息
34 35
      */
@@ -36,7 +37,7 @@ public interface ISysPostService
36 37
 
37 38
     /**
38 39
      * 根据用户ID获取岗位选择框列表
39
-     * 
40
+     *
40 41
      * @param userId 用户ID
41 42
      * @return 选中岗位ID列表
42 43
      */
@@ -44,7 +45,7 @@ public interface ISysPostService
44 45
 
45 46
     /**
46 47
      * 校验岗位名称
47
-     * 
48
+     *
48 49
      * @param post 岗位信息
49 50
      * @return 结果
50 51
      */
@@ -52,7 +53,7 @@ public interface ISysPostService
52 53
 
53 54
     /**
54 55
      * 校验岗位编码
55
-     * 
56
+     *
56 57
      * @param post 岗位信息
57 58
      * @return 结果
58 59
      */
@@ -60,7 +61,7 @@ public interface ISysPostService
60 61
 
61 62
     /**
62 63
      * 通过岗位ID查询岗位使用数量
63
-     * 
64
+     *
64 65
      * @param postId 岗位ID
65 66
      * @return 结果
66 67
      */
@@ -68,7 +69,7 @@ public interface ISysPostService
68 69
 
69 70
     /**
70 71
      * 删除岗位信息
71
-     * 
72
+     *
72 73
      * @param postId 岗位ID
73 74
      * @return 结果
74 75
      */
@@ -76,7 +77,7 @@ public interface ISysPostService
76 77
 
77 78
     /**
78 79
      * 批量删除岗位信息
79
-     * 
80
+     *
80 81
      * @param postIds 需要删除的岗位ID
81 82
      * @return 结果
82 83
      */
@@ -84,7 +85,7 @@ public interface ISysPostService
84 85
 
85 86
     /**
86 87
      * 新增保存岗位信息
87
-     * 
88
+     *
88 89
      * @param post 岗位信息
89 90
      * @return 结果
90 91
      */
@@ -92,7 +93,7 @@ public interface ISysPostService
92 93
 
93 94
     /**
94 95
      * 修改保存岗位信息
95
-     * 
96
+     *
96 97
      * @param post 岗位信息
97 98
      * @return 结果
98 99
      */
@@ -104,4 +105,19 @@ public interface ISysPostService
104 105
      * @return
105 106
      */
106 107
     public SysPost selectPostByDeptId(Long deptId);
108
+
109
+    /**
110
+     * 查询部门经理级别岗位下的人员列表
111
+     * @param deptId 部门ID
112
+     * @param postLevel 岗位级别:0-不设置;1-经理;
113
+     * @return
114
+     */
115
+    List<UserPostAuthority> userPostAuthorityList(Long deptId,Integer postLevel);
116
+
117
+    /**
118
+     * 当前登录用户是否为部门经理级别
119
+     * @param deptId 部门ID
120
+     * @return
121
+     */
122
+   boolean userHaveAuthority(Long deptId);
107 123
 }

+ 56 - 88
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
4 4
 import java.util.Iterator;
5 5
 import java.util.List;
6 6
 import java.util.stream.Collectors;
7
+
8
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
7 9
 import org.springframework.beans.factory.annotation.Autowired;
8 10
 import org.springframework.stereotype.Service;
9 11
 import com.ruoyi.common.annotation.DataScope;
@@ -23,12 +25,11 @@ import com.ruoyi.system.service.ISysDeptService;
23 25
 
24 26
 /**
25 27
  * 部门管理 服务实现
26
- * 
28
+ *
27 29
  * @author ruoyi
28 30
  */
29 31
 @Service
30
-public class SysDeptServiceImpl implements ISysDeptService
31
-{
32
+public class SysDeptServiceImpl implements ISysDeptService {
32 33
     @Autowired
33 34
     private SysDeptMapper deptMapper;
34 35
 
@@ -37,52 +38,46 @@ public class SysDeptServiceImpl implements ISysDeptService
37 38
 
38 39
     /**
39 40
      * 查询部门管理数据
40
-     * 
41
+     *
41 42
      * @param dept 部门信息
42 43
      * @return 部门信息集合
43 44
      */
44 45
     @Override
45 46
     @DataScope(deptAlias = "d")
46
-    public List<SysDept> selectDeptList(SysDept dept)
47
-    {
47
+    public List<SysDept> selectDeptList(SysDept dept) {
48 48
         return deptMapper.selectDeptList(dept);
49 49
     }
50 50
 
51 51
     /**
52 52
      * 查询部门树结构信息
53
-     * 
53
+     *
54 54
      * @param dept 部门信息
55 55
      * @return 部门树信息集合
56 56
      */
57 57
     @Override
58
-    public List<TreeSelect> selectDeptTreeList(SysDept dept)
59
-    {
58
+    public List<TreeSelect> selectDeptTreeList(SysDept dept) {
60 59
         List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
61 60
         return buildDeptTreeSelect(depts);
62 61
     }
63 62
 
64 63
     /**
65 64
      * 构建前端所需要树结构
66
-     * 
65
+     *
67 66
      * @param depts 部门列表
68 67
      * @return 树结构列表
69 68
      */
70 69
     @Override
71
-    public List<SysDept> buildDeptTree(List<SysDept> depts)
72
-    {
70
+    public List<SysDept> buildDeptTree(List<SysDept> depts) {
73 71
         List<SysDept> returnList = new ArrayList<SysDept>();
74 72
         List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList());
75
-        for (SysDept dept : depts)
76
-        {
73
+        for (SysDept dept : depts) {
77 74
             // 如果是顶级节点, 遍历该父节点的所有子节点
78
-            if (!tempList.contains(dept.getParentId()))
79
-            {
75
+            if (!tempList.contains(dept.getParentId())) {
80 76
                 recursionFn(depts, dept);
81 77
                 returnList.add(dept);
82 78
             }
83 79
         }
84
-        if (returnList.isEmpty())
85
-        {
80
+        if (returnList.isEmpty()) {
86 81
             returnList = depts;
87 82
         }
88 83
         return returnList;
@@ -90,93 +85,85 @@ public class SysDeptServiceImpl implements ISysDeptService
90 85
 
91 86
     /**
92 87
      * 构建前端所需要下拉树结构
93
-     * 
88
+     *
94 89
      * @param depts 部门列表
95 90
      * @return 下拉树结构列表
96 91
      */
97 92
     @Override
98
-    public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts)
99
-    {
93
+    public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) {
100 94
         List<SysDept> deptTrees = buildDeptTree(depts);
101 95
         return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList());
102 96
     }
103 97
 
104 98
     /**
105 99
      * 根据角色ID查询部门树信息
106
-     * 
100
+     *
107 101
      * @param roleId 角色ID
108 102
      * @return 选中部门列表
109 103
      */
110 104
     @Override
111
-    public List<Long> selectDeptListByRoleId(Long roleId)
112
-    {
105
+    public List<Long> selectDeptListByRoleId(Long roleId) {
113 106
         SysRole role = roleMapper.selectRoleById(roleId);
114 107
         return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly());
115 108
     }
116 109
 
117 110
     /**
118 111
      * 根据部门ID查询信息
119
-     * 
112
+     *
120 113
      * @param deptId 部门ID
121 114
      * @return 部门信息
122 115
      */
123 116
     @Override
124
-    public SysDept selectDeptById(Long deptId)
125
-    {
117
+    public SysDept selectDeptById(Long deptId) {
126 118
         return deptMapper.selectDeptById(deptId);
127 119
     }
128 120
 
129 121
     /**
130 122
      * 根据ID查询所有子部门(正常状态)
131
-     * 
123
+     *
132 124
      * @param deptId 部门ID
133 125
      * @return 子部门数
134 126
      */
135 127
     @Override
136
-    public int selectNormalChildrenDeptById(Long deptId)
137
-    {
128
+    public int selectNormalChildrenDeptById(Long deptId) {
138 129
         return deptMapper.selectNormalChildrenDeptById(deptId);
139 130
     }
140 131
 
141 132
     /**
142 133
      * 是否存在子节点
143
-     * 
134
+     *
144 135
      * @param deptId 部门ID
145 136
      * @return 结果
146 137
      */
147 138
     @Override
148
-    public boolean hasChildByDeptId(Long deptId)
149
-    {
139
+    public boolean hasChildByDeptId(Long deptId) {
150 140
         int result = deptMapper.hasChildByDeptId(deptId);
151 141
         return result > 0;
152 142
     }
153 143
 
154 144
     /**
155 145
      * 查询部门是否存在用户
156
-     * 
146
+     *
157 147
      * @param deptId 部门ID
158 148
      * @return 结果 true 存在 false 不存在
159 149
      */
160 150
     @Override
161
-    public boolean checkDeptExistUser(Long deptId)
162
-    {
151
+    public boolean checkDeptExistUser(Long deptId) {
163 152
         int result = deptMapper.checkDeptExistUser(deptId);
164 153
         return result > 0;
165 154
     }
166 155
 
167 156
     /**
168 157
      * 校验部门名称是否唯一
169
-     * 
158
+     *
170 159
      * @param dept 部门信息
171 160
      * @return 结果
172 161
      */
173 162
     @Override
174
-    public boolean checkDeptNameUnique(SysDept dept)
175
-    {
163
+    public boolean checkDeptNameUnique(SysDept dept) {
176 164
         Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId();
177 165
         SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
178
-        if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
179
-        {
166
+        if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) {
180 167
             return UserConstants.NOT_UNIQUE;
181 168
         }
182 169
         return UserConstants.UNIQUE;
@@ -184,19 +171,16 @@ public class SysDeptServiceImpl implements ISysDeptService
184 171
 
185 172
     /**
186 173
      * 校验部门是否有数据权限
187
-     * 
174
+     *
188 175
      * @param deptId 部门id
189 176
      */
190 177
     @Override
191
-    public void checkDeptDataScope(Long deptId)
192
-    {
193
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
194
-        {
178
+    public void checkDeptDataScope(Long deptId) {
179
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
195 180
             SysDept dept = new SysDept();
196 181
             dept.setDeptId(deptId);
197 182
             List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
198
-            if (StringUtils.isEmpty(depts))
199
-            {
183
+            if (StringUtils.isEmpty(depts)) {
200 184
                 throw new ServiceException("没有权限访问部门数据!");
201 185
             }
202 186
         }
@@ -204,36 +188,33 @@ public class SysDeptServiceImpl implements ISysDeptService
204 188
 
205 189
     /**
206 190
      * 新增保存部门信息
207
-     * 
191
+     *
208 192
      * @param dept 部门信息
209 193
      * @return 结果
210 194
      */
211 195
     @Override
212
-    public int insertDept(SysDept dept)
213
-    {
196
+    public int insertDept(SysDept dept) {
214 197
         SysDept info = deptMapper.selectDeptById(dept.getParentId());
215 198
         // 如果父节点不为正常状态,则不允许新增子节点
216
-        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
217
-        {
199
+        if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
218 200
             throw new ServiceException("部门停用,不允许新增");
219 201
         }
220 202
         dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
203
+        dept.setDeptId(Long.parseLong(IdWorker.getIdStr().substring(4)));
221 204
         return deptMapper.insertDept(dept);
222 205
     }
223 206
 
224 207
     /**
225 208
      * 修改保存部门信息
226
-     * 
209
+     *
227 210
      * @param dept 部门信息
228 211
      * @return 结果
229 212
      */
230 213
     @Override
231
-    public int updateDept(SysDept dept)
232
-    {
214
+    public int updateDept(SysDept dept) {
233 215
         SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
234 216
         SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());
235
-        if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept))
236
-        {
217
+        if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
237 218
             String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
238 219
             String oldAncestors = oldDept.getAncestors();
239 220
             dept.setAncestors(newAncestors);
@@ -241,8 +222,7 @@ public class SysDeptServiceImpl implements ISysDeptService
241 222
         }
242 223
         int result = deptMapper.updateDept(dept);
243 224
         if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
244
-                && !StringUtils.equals("0", dept.getAncestors()))
245
-        {
225
+                && !StringUtils.equals("0", dept.getAncestors())) {
246 226
             // 如果该部门是启用状态,则启用该部门的所有上级部门
247 227
             updateParentDeptStatusNormal(dept);
248 228
         }
@@ -251,11 +231,10 @@ public class SysDeptServiceImpl implements ISysDeptService
251 231
 
252 232
     /**
253 233
      * 修改该部门的父级部门状态
254
-     * 
234
+     *
255 235
      * @param dept 当前部门
256 236
      */
257
-    private void updateParentDeptStatusNormal(SysDept dept)
258
-    {
237
+    private void updateParentDeptStatusNormal(SysDept dept) {
259 238
         String ancestors = dept.getAncestors();
260 239
         Long[] deptIds = Convert.toLongArray(ancestors);
261 240
         deptMapper.updateDeptStatusNormal(deptIds);
@@ -263,48 +242,41 @@ public class SysDeptServiceImpl implements ISysDeptService
263 242
 
264 243
     /**
265 244
      * 修改子元素关系
266
-     * 
267
-     * @param deptId 被修改的部门ID
245
+     *
246
+     * @param deptId       被修改的部门ID
268 247
      * @param newAncestors 新的父ID集合
269 248
      * @param oldAncestors 旧的父ID集合
270 249
      */
271
-    public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors)
272
-    {
250
+    public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
273 251
         List<SysDept> children = deptMapper.selectChildrenDeptById(deptId);
274
-        for (SysDept child : children)
275
-        {
252
+        for (SysDept child : children) {
276 253
             child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
277 254
         }
278
-        if (children.size() > 0)
279
-        {
255
+        if (children.size() > 0) {
280 256
             deptMapper.updateDeptChildren(children);
281 257
         }
282 258
     }
283 259
 
284 260
     /**
285 261
      * 删除部门管理信息
286
-     * 
262
+     *
287 263
      * @param deptId 部门ID
288 264
      * @return 结果
289 265
      */
290 266
     @Override
291
-    public int deleteDeptById(Long deptId)
292
-    {
267
+    public int deleteDeptById(Long deptId) {
293 268
         return deptMapper.deleteDeptById(deptId);
294 269
     }
295 270
 
296 271
     /**
297 272
      * 递归列表
298 273
      */
299
-    private void recursionFn(List<SysDept> list, SysDept t)
300
-    {
274
+    private void recursionFn(List<SysDept> list, SysDept t) {
301 275
         // 得到子节点列表
302 276
         List<SysDept> childList = getChildList(list, t);
303 277
         t.setChildren(childList);
304
-        for (SysDept tChild : childList)
305
-        {
306
-            if (hasChild(list, tChild))
307
-            {
278
+        for (SysDept tChild : childList) {
279
+            if (hasChild(list, tChild)) {
308 280
                 recursionFn(list, tChild);
309 281
             }
310 282
         }
@@ -313,15 +285,12 @@ public class SysDeptServiceImpl implements ISysDeptService
313 285
     /**
314 286
      * 得到子节点列表
315 287
      */
316
-    private List<SysDept> getChildList(List<SysDept> list, SysDept t)
317
-    {
288
+    private List<SysDept> getChildList(List<SysDept> list, SysDept t) {
318 289
         List<SysDept> tlist = new ArrayList<SysDept>();
319 290
         Iterator<SysDept> it = list.iterator();
320
-        while (it.hasNext())
321
-        {
291
+        while (it.hasNext()) {
322 292
             SysDept n = (SysDept) it.next();
323
-            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue())
324
-            {
293
+            if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) {
325 294
                 tlist.add(n);
326 295
             }
327 296
         }
@@ -331,8 +300,7 @@ public class SysDeptServiceImpl implements ISysDeptService
331 300
     /**
332 301
      * 判断是否有子节点
333 302
      */
334
-    private boolean hasChild(List<SysDept> list, SysDept t)
335
-    {
303
+    private boolean hasChild(List<SysDept> list, SysDept t) {
336 304
         return getChildList(list, t).size() > 0;
337 305
     }
338 306
 }

+ 73 - 44
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java

@@ -1,6 +1,12 @@
1 1
 package com.ruoyi.system.service.impl;
2 2
 
3 3
 import java.util.List;
4
+import java.util.stream.Collectors;
5
+
6
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
7
+import com.ruoyi.common.exception.base.BaseException;
8
+import com.ruoyi.common.utils.SecurityUtils;
9
+import com.ruoyi.system.domain.UserPostAuthority;
4 10
 import org.springframework.beans.factory.annotation.Autowired;
5 11
 import org.springframework.stereotype.Service;
6 12
 import com.ruoyi.common.constant.UserConstants;
@@ -10,15 +16,15 @@ import com.ruoyi.system.domain.SysPost;
10 16
 import com.ruoyi.system.mapper.SysPostMapper;
11 17
 import com.ruoyi.system.mapper.SysUserPostMapper;
12 18
 import com.ruoyi.system.service.ISysPostService;
19
+import org.springframework.util.CollectionUtils;
13 20
 
14 21
 /**
15 22
  * 岗位信息 服务层处理
16
- * 
23
+ *
17 24
  * @author ruoyi
18 25
  */
19 26
 @Service
20
-public class SysPostServiceImpl implements ISysPostService
21
-{
27
+public class SysPostServiceImpl implements ISysPostService {
22 28
     @Autowired
23 29
     private SysPostMapper postMapper;
24 30
 
@@ -27,64 +33,58 @@ public class SysPostServiceImpl implements ISysPostService
27 33
 
28 34
     /**
29 35
      * 查询岗位信息集合
30
-     * 
36
+     *
31 37
      * @param post 岗位信息
32 38
      * @return 岗位信息集合
33 39
      */
34 40
     @Override
35
-    public List<SysPost> selectPostList(SysPost post)
36
-    {
41
+    public List<SysPost> selectPostList(SysPost post) {
37 42
         return postMapper.selectPostList(post);
38 43
     }
39 44
 
40 45
     /**
41 46
      * 查询所有岗位
42
-     * 
47
+     *
43 48
      * @return 岗位列表
44 49
      */
45 50
     @Override
46
-    public List<SysPost> selectPostAll()
47
-    {
51
+    public List<SysPost> selectPostAll() {
48 52
         return postMapper.selectPostAll();
49 53
     }
50 54
 
51 55
     /**
52 56
      * 通过岗位ID查询岗位信息
53
-     * 
57
+     *
54 58
      * @param postId 岗位ID
55 59
      * @return 角色对象信息
56 60
      */
57 61
     @Override
58
-    public SysPost selectPostById(Long postId)
59
-    {
62
+    public SysPost selectPostById(Long postId) {
60 63
         return postMapper.selectPostById(postId);
61 64
     }
62 65
 
63 66
     /**
64 67
      * 根据用户ID获取岗位选择框列表
65
-     * 
68
+     *
66 69
      * @param userId 用户ID
67 70
      * @return 选中岗位ID列表
68 71
      */
69 72
     @Override
70
-    public List<Long> selectPostListByUserId(Long userId)
71
-    {
73
+    public List<Long> selectPostListByUserId(Long userId) {
72 74
         return postMapper.selectPostListByUserId(userId);
73 75
     }
74 76
 
75 77
     /**
76 78
      * 校验岗位名称是否唯一
77
-     * 
79
+     *
78 80
      * @param post 岗位信息
79 81
      * @return 结果
80 82
      */
81 83
     @Override
82
-    public boolean checkPostNameUnique(SysPost post)
83
-    {
84
+    public boolean checkPostNameUnique(SysPost post) {
84 85
         Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
85 86
         SysPost info = postMapper.checkPostNameUnique(post.getPostName());
86
-        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
87
-        {
87
+        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
88 88
             return UserConstants.NOT_UNIQUE;
89 89
         }
90 90
         return UserConstants.UNIQUE;
@@ -92,17 +92,15 @@ public class SysPostServiceImpl implements ISysPostService
92 92
 
93 93
     /**
94 94
      * 校验岗位编码是否唯一
95
-     * 
95
+     *
96 96
      * @param post 岗位信息
97 97
      * @return 结果
98 98
      */
99 99
     @Override
100
-    public boolean checkPostCodeUnique(SysPost post)
101
-    {
100
+    public boolean checkPostCodeUnique(SysPost post) {
102 101
         Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId();
103 102
         SysPost info = postMapper.checkPostCodeUnique(post.getPostCode());
104
-        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue())
105
-        {
103
+        if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) {
106 104
             return UserConstants.NOT_UNIQUE;
107 105
         }
108 106
         return UserConstants.UNIQUE;
@@ -110,42 +108,37 @@ public class SysPostServiceImpl implements ISysPostService
110 108
 
111 109
     /**
112 110
      * 通过岗位ID查询岗位使用数量
113
-     * 
111
+     *
114 112
      * @param postId 岗位ID
115 113
      * @return 结果
116 114
      */
117 115
     @Override
118
-    public int countUserPostById(Long postId)
119
-    {
116
+    public int countUserPostById(Long postId) {
120 117
         return userPostMapper.countUserPostById(postId);
121 118
     }
122 119
 
123 120
     /**
124 121
      * 删除岗位信息
125
-     * 
122
+     *
126 123
      * @param postId 岗位ID
127 124
      * @return 结果
128 125
      */
129 126
     @Override
130
-    public int deletePostById(Long postId)
131
-    {
127
+    public int deletePostById(Long postId) {
132 128
         return postMapper.deletePostById(postId);
133 129
     }
134 130
 
135 131
     /**
136 132
      * 批量删除岗位信息
137
-     * 
133
+     *
138 134
      * @param postIds 需要删除的岗位ID
139 135
      * @return 结果
140 136
      */
141 137
     @Override
142
-    public int deletePostByIds(Long[] postIds)
143
-    {
144
-        for (Long postId : postIds)
145
-        {
138
+    public int deletePostByIds(Long[] postIds) {
139
+        for (Long postId : postIds) {
146 140
             SysPost post = selectPostById(postId);
147
-            if (countUserPostById(postId) > 0)
148
-            {
141
+            if (countUserPostById(postId) > 0) {
149 142
                 throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
150 143
             }
151 144
         }
@@ -154,30 +147,30 @@ public class SysPostServiceImpl implements ISysPostService
154 147
 
155 148
     /**
156 149
      * 新增保存岗位信息
157
-     * 
150
+     *
158 151
      * @param post 岗位信息
159 152
      * @return 结果
160 153
      */
161 154
     @Override
162
-    public int insertPost(SysPost post)
163
-    {
155
+    public int insertPost(SysPost post) {
156
+        post.setPostId(Long.parseLong(IdWorker.getIdStr().substring(4)));
164 157
         return postMapper.insertPost(post);
165 158
     }
166 159
 
167 160
     /**
168 161
      * 修改保存岗位信息
169
-     * 
162
+     *
170 163
      * @param post 岗位信息
171 164
      * @return 结果
172 165
      */
173 166
     @Override
174
-    public int updatePost(SysPost post)
175
-    {
167
+    public int updatePost(SysPost post) {
176 168
         return postMapper.updatePost(post);
177 169
     }
178 170
 
179 171
     /**
180 172
      * 根据部门查询岗位
173
+     *
181 174
      * @param deptId
182 175
      * @return
183 176
      */
@@ -185,4 +178,40 @@ public class SysPostServiceImpl implements ISysPostService
185 178
     public SysPost selectPostByDeptId(Long deptId) {
186 179
         return postMapper.selectPostByDeptId(deptId);
187 180
     }
181
+
182
+    /**
183
+     * 查询部门经理级别岗位下的人员列表
184
+     *
185
+     * @param deptId    部门ID
186
+     * @param postLevel 岗位级别
187
+     * @return
188
+     */
189
+    @Override
190
+    public List<UserPostAuthority> userPostAuthorityList(Long deptId, Integer postLevel) {
191
+
192
+        return postMapper.userPostAuthorityList(deptId, postLevel);
193
+    }
194
+
195
+    /**
196
+     * 当前登录用户是否为部门经理级别
197
+     *
198
+     * @param deptId 部门ID
199
+     * @return
200
+     */
201
+    @Override
202
+    public boolean userHaveAuthority(Long deptId) {
203
+        Integer postLevel = 1;//岗位级别:0-不设置;1-经理;
204
+        Long userId = SecurityUtils.getUserId();
205
+
206
+        // 判断岗位是否在权限范围内
207
+        List<UserPostAuthority> userPostAuthorityList = userPostAuthorityList(deptId, postLevel);
208
+        if (CollectionUtils.isEmpty(userPostAuthorityList)) {
209
+            return false;
210
+        }
211
+        List<Long> haveAuthorityUserList = userPostAuthorityList.stream().map(t -> t.getUserId()).collect(Collectors.toList());
212
+        if (haveAuthorityUserList.contains(userId)) {
213
+            return true;
214
+        }
215
+        return false;
216
+    }
188 217
 }

+ 60 - 111
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.ArrayList;
4 4
 import java.util.List;
5 5
 import java.util.stream.Collectors;
6 6
 import javax.validation.Validator;
7
+
8
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
7 9
 import org.slf4j.Logger;
8 10
 import org.slf4j.LoggerFactory;
9 11
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,8 +38,7 @@ import com.ruoyi.system.service.ISysUserService;
36 38
  * @author ruoyi
37 39
  */
38 40
 @Service
39
-public class SysUserServiceImpl implements ISysUserService
40
-{
41
+public class SysUserServiceImpl implements ISysUserService {
41 42
     private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
42 43
 
43 44
     @Autowired
@@ -69,8 +70,7 @@ public class SysUserServiceImpl implements ISysUserService
69 70
      */
70 71
     @Override
71 72
     @DataScope(deptAlias = "d", userAlias = "u")
72
-    public List<SysUser> selectUserList(SysUser user)
73
-    {
73
+    public List<SysUser> selectUserList(SysUser user) {
74 74
         return userMapper.selectUserList(user);
75 75
     }
76 76
 
@@ -82,8 +82,7 @@ public class SysUserServiceImpl implements ISysUserService
82 82
      */
83 83
     @Override
84 84
     @DataScope(deptAlias = "d", userAlias = "u")
85
-    public List<SysUser> selectAllocatedList(SysUser user)
86
-    {
85
+    public List<SysUser> selectAllocatedList(SysUser user) {
87 86
         return userMapper.selectAllocatedList(user);
88 87
     }
89 88
 
@@ -95,8 +94,7 @@ public class SysUserServiceImpl implements ISysUserService
95 94
      */
96 95
     @Override
97 96
     @DataScope(deptAlias = "d", userAlias = "u")
98
-    public List<SysUser> selectUnallocatedList(SysUser user)
99
-    {
97
+    public List<SysUser> selectUnallocatedList(SysUser user) {
100 98
         return userMapper.selectUnallocatedList(user);
101 99
     }
102 100
 
@@ -107,8 +105,7 @@ public class SysUserServiceImpl implements ISysUserService
107 105
      * @return 用户对象信息
108 106
      */
109 107
     @Override
110
-    public SysUser selectUserByUserName(String userName)
111
-    {
108
+    public SysUser selectUserByUserName(String userName) {
112 109
         return userMapper.selectUserByUserName(userName);
113 110
     }
114 111
 
@@ -119,8 +116,7 @@ public class SysUserServiceImpl implements ISysUserService
119 116
      * @return 用户对象信息
120 117
      */
121 118
     @Override
122
-    public SysUser selectUserById(Long userId)
123
-    {
119
+    public SysUser selectUserById(Long userId) {
124 120
         return userMapper.selectUserById(userId);
125 121
     }
126 122
 
@@ -131,11 +127,9 @@ public class SysUserServiceImpl implements ISysUserService
131 127
      * @return 结果
132 128
      */
133 129
     @Override
134
-    public String selectUserRoleGroup(String userName)
135
-    {
130
+    public String selectUserRoleGroup(String userName) {
136 131
         List<SysRole> list = roleMapper.selectRolesByUserName(userName);
137
-        if (CollectionUtils.isEmpty(list))
138
-        {
132
+        if (CollectionUtils.isEmpty(list)) {
139 133
             return StringUtils.EMPTY;
140 134
         }
141 135
         return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(","));
@@ -148,11 +142,9 @@ public class SysUserServiceImpl implements ISysUserService
148 142
      * @return 结果
149 143
      */
150 144
     @Override
151
-    public String selectUserPostGroup(String userName)
152
-    {
145
+    public String selectUserPostGroup(String userName) {
153 146
         List<SysPost> list = postMapper.selectPostsByUserName(userName);
154
-        if (CollectionUtils.isEmpty(list))
155
-        {
147
+        if (CollectionUtils.isEmpty(list)) {
156 148
             return StringUtils.EMPTY;
157 149
         }
158 150
         return list.stream().map(SysPost::getPostName).collect(Collectors.joining(","));
@@ -165,12 +157,10 @@ public class SysUserServiceImpl implements ISysUserService
165 157
      * @return 结果
166 158
      */
167 159
     @Override
168
-    public boolean checkUserNameUnique(SysUser user)
169
-    {
160
+    public boolean checkUserNameUnique(SysUser user) {
170 161
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
171 162
         SysUser info = userMapper.checkUserNameUnique(user.getUserName());
172
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
173
-        {
163
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
174 164
             return UserConstants.NOT_UNIQUE;
175 165
         }
176 166
         return UserConstants.UNIQUE;
@@ -183,12 +173,10 @@ public class SysUserServiceImpl implements ISysUserService
183 173
      * @return
184 174
      */
185 175
     @Override
186
-    public boolean checkPhoneUnique(SysUser user)
187
-    {
176
+    public boolean checkPhoneUnique(SysUser user) {
188 177
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
189 178
         SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
190
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
191
-        {
179
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
192 180
             return UserConstants.NOT_UNIQUE;
193 181
         }
194 182
         return UserConstants.UNIQUE;
@@ -201,12 +189,10 @@ public class SysUserServiceImpl implements ISysUserService
201 189
      * @return
202 190
      */
203 191
     @Override
204
-    public boolean checkEmailUnique(SysUser user)
205
-    {
192
+    public boolean checkEmailUnique(SysUser user) {
206 193
         Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
207 194
         SysUser info = userMapper.checkEmailUnique(user.getEmail());
208
-        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
209
-        {
195
+        if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
210 196
             return UserConstants.NOT_UNIQUE;
211 197
         }
212 198
         return UserConstants.UNIQUE;
@@ -218,10 +204,8 @@ public class SysUserServiceImpl implements ISysUserService
218 204
      * @param user 用户信息
219 205
      */
220 206
     @Override
221
-    public void checkUserAllowed(SysUser user)
222
-    {
223
-        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
224
-        {
207
+    public void checkUserAllowed(SysUser user) {
208
+        if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
225 209
             throw new ServiceException("不允许操作超级管理员用户");
226 210
         }
227 211
     }
@@ -232,15 +216,12 @@ public class SysUserServiceImpl implements ISysUserService
232 216
      * @param userId 用户id
233 217
      */
234 218
     @Override
235
-    public void checkUserDataScope(Long userId)
236
-    {
237
-        if (!SysUser.isAdmin(SecurityUtils.getUserId()))
238
-        {
219
+    public void checkUserDataScope(Long userId) {
220
+        if (!SysUser.isAdmin(SecurityUtils.getUserId())) {
239 221
             SysUser user = new SysUser();
240 222
             user.setUserId(userId);
241 223
             List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user);
242
-            if (StringUtils.isEmpty(users))
243
-            {
224
+            if (StringUtils.isEmpty(users)) {
244 225
                 throw new ServiceException("没有权限访问用户数据!");
245 226
             }
246 227
         }
@@ -254,8 +235,8 @@ public class SysUserServiceImpl implements ISysUserService
254 235
      */
255 236
     @Override
256 237
     @Transactional
257
-    public int insertUser(SysUser user)
258
-    {
238
+    public int insertUser(SysUser user) {
239
+        user.setUserId(Long.parseLong(IdWorker.getIdStr().substring(4)));
259 240
         // 新增用户信息
260 241
         int rows = userMapper.insertUser(user);
261 242
         // 新增用户岗位关联
@@ -272,8 +253,7 @@ public class SysUserServiceImpl implements ISysUserService
272 253
      * @return 结果
273 254
      */
274 255
     @Override
275
-    public boolean registerUser(SysUser user)
276
-    {
256
+    public boolean registerUser(SysUser user) {
277 257
         return userMapper.insertUser(user) > 0;
278 258
     }
279 259
 
@@ -285,8 +265,7 @@ public class SysUserServiceImpl implements ISysUserService
285 265
      */
286 266
     @Override
287 267
     @Transactional
288
-    public int updateUser(SysUser user)
289
-    {
268
+    public int updateUser(SysUser user) {
290 269
         Long userId = user.getUserId();
291 270
         // 删除用户与角色关联
292 271
         userRoleMapper.deleteUserRoleByUserId(userId);
@@ -302,13 +281,12 @@ public class SysUserServiceImpl implements ISysUserService
302 281
     /**
303 282
      * 用户授权角色
304 283
      *
305
-     * @param userId 用户ID
284
+     * @param userId  用户ID
306 285
      * @param roleIds 角色组
307 286
      */
308 287
     @Override
309 288
     @Transactional
310
-    public void insertUserAuth(Long userId, Long[] roleIds)
311
-    {
289
+    public void insertUserAuth(Long userId, Long[] roleIds) {
312 290
         userRoleMapper.deleteUserRoleByUserId(userId);
313 291
         insertUserRole(userId, roleIds);
314 292
     }
@@ -320,8 +298,7 @@ public class SysUserServiceImpl implements ISysUserService
320 298
      * @return 结果
321 299
      */
322 300
     @Override
323
-    public int updateUserStatus(SysUser user)
324
-    {
301
+    public int updateUserStatus(SysUser user) {
325 302
         return userMapper.updateUser(user);
326 303
     }
327 304
 
@@ -332,8 +309,7 @@ public class SysUserServiceImpl implements ISysUserService
332 309
      * @return 结果
333 310
      */
334 311
     @Override
335
-    public int updateUserProfile(SysUser user)
336
-    {
312
+    public int updateUserProfile(SysUser user) {
337 313
         return userMapper.updateUser(user);
338 314
     }
339 315
 
@@ -341,12 +317,11 @@ public class SysUserServiceImpl implements ISysUserService
341 317
      * 修改用户头像
342 318
      *
343 319
      * @param userName 用户名
344
-     * @param avatar 头像地址
320
+     * @param avatar   头像地址
345 321
      * @return 结果
346 322
      */
347 323
     @Override
348
-    public boolean updateUserAvatar(String userName, String avatar)
349
-    {
324
+    public boolean updateUserAvatar(String userName, String avatar) {
350 325
         return userMapper.updateUserAvatar(userName, avatar) > 0;
351 326
     }
352 327
 
@@ -357,8 +332,7 @@ public class SysUserServiceImpl implements ISysUserService
357 332
      * @return 结果
358 333
      */
359 334
     @Override
360
-    public int resetPwd(SysUser user)
361
-    {
335
+    public int resetPwd(SysUser user) {
362 336
         return userMapper.updateUser(user);
363 337
     }
364 338
 
@@ -370,8 +344,7 @@ public class SysUserServiceImpl implements ISysUserService
370 344
      * @return 结果
371 345
      */
372 346
     @Override
373
-    public int resetUserPwd(String userName, String password)
374
-    {
347
+    public int resetUserPwd(String userName, String password) {
375 348
         return userMapper.resetUserPwd(userName, password);
376 349
     }
377 350
 
@@ -380,8 +353,7 @@ public class SysUserServiceImpl implements ISysUserService
380 353
      *
381 354
      * @param user 用户对象
382 355
      */
383
-    public void insertUserRole(SysUser user)
384
-    {
356
+    public void insertUserRole(SysUser user) {
385 357
         this.insertUserRole(user.getUserId(), user.getRoleIds());
386 358
     }
387 359
 
@@ -390,15 +362,12 @@ public class SysUserServiceImpl implements ISysUserService
390 362
      *
391 363
      * @param user 用户对象
392 364
      */
393
-    public void insertUserPost(SysUser user)
394
-    {
365
+    public void insertUserPost(SysUser user) {
395 366
         Long[] posts = user.getPostIds();
396
-        if (StringUtils.isNotEmpty(posts))
397
-        {
367
+        if (StringUtils.isNotEmpty(posts)) {
398 368
             // 新增用户与岗位管理
399
-            List<SysUserPost> list = new ArrayList<SysUserPost>(posts.length);
400
-            for (Long postId : posts)
401
-            {
369
+            List<SysUserPost> list = new ArrayList<>(posts.length);
370
+            for (Long postId : posts) {
402 371
                 SysUserPost up = new SysUserPost();
403 372
                 up.setUserId(user.getUserId());
404 373
                 up.setPostId(postId);
@@ -411,17 +380,14 @@ public class SysUserServiceImpl implements ISysUserService
411 380
     /**
412 381
      * 新增用户角色信息
413 382
      *
414
-     * @param userId 用户ID
383
+     * @param userId  用户ID
415 384
      * @param roleIds 角色组
416 385
      */
417
-    public void insertUserRole(Long userId, Long[] roleIds)
418
-    {
419
-        if (StringUtils.isNotEmpty(roleIds))
420
-        {
386
+    public void insertUserRole(Long userId, Long[] roleIds) {
387
+        if (StringUtils.isNotEmpty(roleIds)) {
421 388
             // 新增用户与角色管理
422 389
             List<SysUserRole> list = new ArrayList<SysUserRole>(roleIds.length);
423
-            for (Long roleId : roleIds)
424
-            {
390
+            for (Long roleId : roleIds) {
425 391
                 SysUserRole ur = new SysUserRole();
426 392
                 ur.setUserId(userId);
427 393
                 ur.setRoleId(roleId);
@@ -439,8 +405,7 @@ public class SysUserServiceImpl implements ISysUserService
439 405
      */
440 406
     @Override
441 407
     @Transactional
442
-    public int deleteUserById(Long userId)
443
-    {
408
+    public int deleteUserById(Long userId) {
444 409
         // 删除用户与角色关联
445 410
         userRoleMapper.deleteUserRoleByUserId(userId);
446 411
         // 删除用户与岗位表
@@ -456,10 +421,8 @@ public class SysUserServiceImpl implements ISysUserService
456 421
      */
457 422
     @Override
458 423
     @Transactional
459
-    public int deleteUserByIds(Long[] userIds)
460
-    {
461
-        for (Long userId : userIds)
462
-        {
424
+    public int deleteUserByIds(Long[] userIds) {
425
+        for (Long userId : userIds) {
463 426
             checkUserAllowed(new SysUser(userId));
464 427
             checkUserDataScope(userId);
465 428
         }
@@ -473,16 +436,14 @@ public class SysUserServiceImpl implements ISysUserService
473 436
     /**
474 437
      * 导入用户数据
475 438
      *
476
-     * @param userList 用户数据列表
439
+     * @param userList        用户数据列表
477 440
      * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
478
-     * @param operName 操作用户
441
+     * @param operName        操作用户
479 442
      * @return 结果
480 443
      */
481 444
     @Override
482
-    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
483
-    {
484
-        if (StringUtils.isNull(userList) || userList.size() == 0)
485
-        {
445
+    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
446
+        if (StringUtils.isNull(userList) || userList.size() == 0) {
486 447
             throw new ServiceException("导入用户数据不能为空!");
487 448
         }
488 449
         int successNum = 0;
@@ -490,23 +451,18 @@ public class SysUserServiceImpl implements ISysUserService
490 451
         StringBuilder successMsg = new StringBuilder();
491 452
         StringBuilder failureMsg = new StringBuilder();
492 453
         String password = configService.selectConfigByKey("sys.user.initPassword");
493
-        for (SysUser user : userList)
494
-        {
495
-            try
496
-            {
454
+        for (SysUser user : userList) {
455
+            try {
497 456
                 // 验证是否存在这个用户
498 457
                 SysUser u = userMapper.selectUserByUserName(user.getUserName());
499
-                if (StringUtils.isNull(u))
500
-                {
458
+                if (StringUtils.isNull(u)) {
501 459
                     BeanValidators.validateWithException(validator, user);
502 460
                     user.setPassword(SecurityUtils.encryptPassword(password));
503 461
                     user.setCreateBy(operName);
504 462
                     userMapper.insertUser(user);
505 463
                     successNum++;
506 464
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
507
-                }
508
-                else if (isUpdateSupport)
509
-                {
465
+                } else if (isUpdateSupport) {
510 466
                     BeanValidators.validateWithException(validator, user);
511 467
                     checkUserAllowed(u);
512 468
                     checkUserDataScope(u.getUserId());
@@ -515,28 +471,21 @@ public class SysUserServiceImpl implements ISysUserService
515 471
                     userMapper.updateUser(user);
516 472
                     successNum++;
517 473
                     successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
518
-                }
519
-                else
520
-                {
474
+                } else {
521 475
                     failureNum++;
522 476
                     failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
523 477
                 }
524
-            }
525
-            catch (Exception e)
526
-            {
478
+            } catch (Exception e) {
527 479
                 failureNum++;
528 480
                 String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
529 481
                 failureMsg.append(msg + e.getMessage());
530 482
                 log.error(msg, e);
531 483
             }
532 484
         }
533
-        if (failureNum > 0)
534
-        {
485
+        if (failureNum > 0) {
535 486
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
536 487
             throw new ServiceException(failureMsg.toString());
537
-        }
538
-        else
539
-        {
488
+        } else {
540 489
             successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
541 490
         }
542 491
         return successMsg.toString();
@@ -553,6 +502,6 @@ public class SysUserServiceImpl implements ISysUserService
553 502
     @Override
554 503
     public List<SysUser> postUserList(Long deptId, String postName) {
555 504
 
556
-        return userMapper.postUserList(deptId,postName);
505
+        return userMapper.postUserList(deptId, postName);
557 506
     }
558 507
 }

+ 20 - 0
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -136,4 +136,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
136 136
 		where p.dept_id = #{deptId}
137 137
 	</select>
138 138
 
139
+
140
+	<select id="userPostAuthorityList"  resultType="UserPostAuthority">
141
+		SELECT
142
+			su."user_id" as userId,
143
+			su."user_name" as userName,
144
+			su."nick_name" as nickName,
145
+			sp."post_id" as postId,
146
+			sp."post_code" as postCode,
147
+			sp."post_name" as postName,
148
+			sp."post_level" as postLevel
149
+		FROM sys_post sp
150
+		INNER JOIN "sys_dept" sd ON  sd."dept_id" = sp."dept_id"
151
+		INNER JOIN "sys_user_post" sup ON sup."post_id" = sp."post_id"
152
+		INNER JOIN "public"."sys_users" su  ON su."user_id"  = sup."user_id"
153
+		WHERE sd."dept_id" = #{dept_id}
154
+		<if test="postLevel != null">
155
+			AND sp."post_level" = #{postLevel}
156
+		</if>
157
+	</select>
158
+
139 159
 </mapper>