Browse Source

岗位报告审核

zwj 10 months ago
parent
commit
cc44b013af

+ 28 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostCheckedReportController.java

@@ -3,6 +3,14 @@ package com.ruoyi.postCheck.controller;
3
 import java.util.Date;
3
 import java.util.Date;
4
 import java.util.List;
4
 import java.util.List;
5
 import javax.servlet.http.HttpServletResponse;
5
 import javax.servlet.http.HttpServletResponse;
6
+
7
+import com.ruoyi.common.core.domain.entity.SysDept;
8
+import com.ruoyi.common.core.domain.model.LoginUser;
9
+import com.ruoyi.common.enums.DeptCode;
10
+import com.ruoyi.common.utils.SecurityUtils;
11
+import com.ruoyi.system.domain.SysPost;
12
+import com.ruoyi.system.service.ISysDeptService;
13
+import com.ruoyi.system.service.ISysPostService;
6
 import org.springframework.security.access.prepost.PreAuthorize;
14
 import org.springframework.security.access.prepost.PreAuthorize;
7
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.web.bind.annotation.GetMapping;
16
 import org.springframework.web.bind.annotation.GetMapping;
@@ -40,6 +48,13 @@ public class PostCheckedReportController extends BaseController
40
     @Autowired
48
     @Autowired
41
     private IPostCheckedReportService postCheckedReportService;
49
     private IPostCheckedReportService postCheckedReportService;
42
 
50
 
51
+    @Autowired
52
+    private ISysDeptService sysDeptService;
53
+
54
+    @Autowired
55
+    private ISysPostService sysPostService;
56
+
57
+
43
     /**
58
     /**
44
      * 查询岗检报告管理列表
59
      * 查询岗检报告管理列表
45
      */
60
      */
@@ -211,6 +226,19 @@ public class PostCheckedReportController extends BaseController
211
     @Log(title = "岗检报告审核", businessType = BusinessType.UPDATE)
226
     @Log(title = "岗检报告审核", businessType = BusinessType.UPDATE)
212
     @PutMapping("/statusApprove")
227
     @PutMapping("/statusApprove")
213
     public AjaxResult statusApprove(Long id, Integer status, String statusReason) {
228
     public AjaxResult statusApprove(Long id, Integer status, String statusReason) {
229
+
230
+        // 判断审核的权限
231
+        LoginUser loginUser = SecurityUtils.getLoginUser();
232
+        // 当前登录用户的部门id 查询岗位id是否在内
233
+        SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
234
+        if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
235
+            return error("审核权限有误,请联系管理员!");
236
+        }
237
+        // 判断岗位是否在权限范围内
238
+        SysPost sysPost = sysPostService.selectPostByDeptId(loginUser.getDeptId());
239
+        if (sysPost.getPostLevel() != 1) {
240
+            return error("审核权限有误,请联系管理员!");
241
+        }
214
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
242
         return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
215
     }
243
     }
216
 
244
 

+ 6 - 8
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/service/impl/PostCheckedReportServiceImpl.java

@@ -5,6 +5,8 @@ import java.util.List;
5
 
5
 
6
 import com.ruoyi.common.constant.PostCheckedProblemEnum;
6
 import com.ruoyi.common.constant.PostCheckedProblemEnum;
7
 import com.ruoyi.common.constant.PostCheckedReportEnum;
7
 import com.ruoyi.common.constant.PostCheckedReportEnum;
8
+import com.ruoyi.common.core.domain.entity.SysUser;
9
+import com.ruoyi.common.core.domain.model.LoginUser;
8
 import com.ruoyi.common.utils.DateUtils;
10
 import com.ruoyi.common.utils.DateUtils;
9
 import com.ruoyi.common.utils.SecurityUtils;
11
 import com.ruoyi.common.utils.SecurityUtils;
10
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
12
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
@@ -135,17 +137,13 @@ public class PostCheckedReportServiceImpl extends ServiceImpl<PostCheckedReportM
135
         if (status == PostCheckedReportEnum.STATUS_BACK.getValue() && StringUtils.isBlank(statusReason)) {
137
         if (status == PostCheckedReportEnum.STATUS_BACK.getValue() && StringUtils.isBlank(statusReason)) {
136
             return 0;
138
             return 0;
137
         }
139
         }
138
-
139
-        //TODO 权限判断
140
-        //1、内控法务部审核->部门下的3个经理级别的岗位(部门经理(1个)、部门副经理(2个)、党总支部副书记(1个))下面的人员(4个人):
141
-        //
142
-        //
143
-        //
144
-
145
-
140
+        LoginUser loginUser = SecurityUtils.getLoginUser();
141
+        SysUser sysUser = loginUser.getUser();
146
         PostCheckedReport data = new PostCheckedReport();
142
         PostCheckedReport data = new PostCheckedReport();
147
         data.setId(id);
143
         data.setId(id);
148
         data.setStatus(status);
144
         data.setStatus(status);
145
+        data.setStatusByUserId(sysUser.getUserId());
146
+        data.setStatusByUserName(sysUser.getUserName());
149
         data.setStatusApproveTime(new Date());
147
         data.setStatusApproveTime(new Date());
150
         data.setStatusReason(statusReason);
148
         data.setStatusReason(statusReason);
151
         return postCheckedReportMapper.updatePostCheckedReport(data);
149
         return postCheckedReportMapper.updatePostCheckedReport(data);