|
@@ -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
|
|