Procházet zdrojové kódy

岗位报告审核

zwj před 10 měsíci
rodič
revize
cc44b013af

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

@@ -3,6 +3,14 @@ package com.ruoyi.postCheck.controller;
3 3
 import java.util.Date;
4 4
 import java.util.List;
5 5
 import javax.servlet.http.HttpServletResponse;
6
+
7
+import com.ruoyi.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 14
 import org.springframework.security.access.prepost.PreAuthorize;
7 15
 import org.springframework.beans.factory.annotation.Autowired;
8 16
 import org.springframework.web.bind.annotation.GetMapping;
@@ -40,6 +48,13 @@ public class PostCheckedReportController extends BaseController
40 48
     @Autowired
41 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 226
     @Log(title = "岗检报告审核", businessType = BusinessType.UPDATE)
212 227
     @PutMapping("/statusApprove")
213 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 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 6
 import com.ruoyi.common.constant.PostCheckedProblemEnum;
7 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 10
 import com.ruoyi.common.utils.DateUtils;
9 11
 import com.ruoyi.common.utils.SecurityUtils;
10 12
 import com.ruoyi.postCheck.domain.PostCheckedProblem;
@@ -135,17 +137,13 @@ public class PostCheckedReportServiceImpl extends ServiceImpl<PostCheckedReportM
135 137
         if (status == PostCheckedReportEnum.STATUS_BACK.getValue() && StringUtils.isBlank(statusReason)) {
136 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 142
         PostCheckedReport data = new PostCheckedReport();
147 143
         data.setId(id);
148 144
         data.setStatus(status);
145
+        data.setStatusByUserId(sysUser.getUserId());
146
+        data.setStatusByUserName(sysUser.getUserName());
149 147
         data.setStatusApproveTime(new Date());
150 148
         data.setStatusReason(statusReason);
151 149
         return postCheckedReportMapper.updatePostCheckedReport(data);