Parcourir la source

添加超级管理员权限

zwj il y a 10 mois
Parent
commit
94c069a676

+ 11 - 0
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostAssessmentRulesController.java

@@ -186,6 +186,9 @@ public class PostAssessmentRulesController extends BaseController
186 186
 
187 187
         // 判断审核的权限
188 188
         LoginUser loginUser = SecurityUtils.getLoginUser();
189
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
190
+            return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
191
+        }
189 192
         // 当前登录用户的部门id 查询岗位id是否在内
190 193
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
191 194
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
@@ -214,6 +217,10 @@ public class PostAssessmentRulesController extends BaseController
214 217
 
215 218
         // 判断审核的权限
216 219
         LoginUser loginUser = SecurityUtils.getLoginUser();
220
+        if (SecurityUtils.isAdmin(loginUser.getUserId())){
221
+            return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
222
+        }
223
+
217 224
         // 当前登录用户的部门id 查询岗位id是否在内
218 225
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
219 226
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
@@ -241,6 +248,10 @@ public class PostAssessmentRulesController extends BaseController
241 248
 
242 249
         // 判断审核的权限
243 250
         LoginUser loginUser = SecurityUtils.getLoginUser();
251
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
252
+            return toAjax(postAssessmentRulesService.statusApprove(id, status,  statusReason));
253
+        }
254
+
244 255
         // 当前登录用户的部门id 查询岗位id是否在内
245 256
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
246 257
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {

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

@@ -230,6 +230,10 @@ public class PostCheckedReportController extends BaseController
230 230
 
231 231
         // 判断审核的权限
232 232
         LoginUser loginUser = SecurityUtils.getLoginUser();
233
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
234
+            return toAjax(postCheckedReportService.statusApprove(id, status,  statusReason));
235
+        }
236
+
233 237
         // 当前登录用户的部门id 查询岗位id是否在内
234 238
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
235 239
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {

+ 11 - 3
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostPlanController.java

@@ -219,14 +219,18 @@ public class PostPlanController extends BaseController {
219 219
     @Log(title = "岗检计划审核-Icfa", businessType = BusinessType.UPDATE)
220 220
     @PutMapping("/approveIcfa")
221 221
     public AjaxResult approveIcfa(Long id, Integer statusIcfa, String reasonIcfa) {
222
+        // 判断审核的权限
223
+        LoginUser loginUser = SecurityUtils.getLoginUser();
224
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
225
+            return toAjax(postPlanService.approveIcfa(id, statusIcfa, reasonIcfa));
226
+        }
222 227
         // 判断当前状态
223 228
         PostPlan postPlan = postPlanService.selectPostPlanById(id);
224 229
         // 审核过得不在审核
225 230
         if (postPlan.getStatusIcfa() == PostPlanEnum.STATUS_ICFA_PASS.getValue()) {
226 231
             return AjaxResult.error("审核失败,请勿重复审核!");
227 232
         }
228
-        // 判断审核的权限
229
-        LoginUser loginUser = SecurityUtils.getLoginUser();
233
+
230 234
         // 当前登录用户的部门id 查询岗位id是否在内
231 235
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
232 236
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
@@ -253,6 +257,11 @@ public class PostPlanController extends BaseController {
253 257
     @Log(title = "岗检计划审核-HR", businessType = BusinessType.UPDATE)
254 258
     @PutMapping("/approveHr")
255 259
     public AjaxResult approveHr(Long id, Integer statusHr, String reasonHr) {
260
+        // 判断审核的权限
261
+        LoginUser loginUser = SecurityUtils.getLoginUser();
262
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
263
+            return toAjax(postPlanService.approveHr(id, statusHr, reasonHr));
264
+        }
256 265
         // 判断当前状态
257 266
         PostPlan postPlan = postPlanService.selectPostPlanById(id);
258 267
         // 审核过得不在审核
@@ -265,7 +274,6 @@ public class PostPlanController extends BaseController {
265 274
             return AjaxResult.error(HttpStatus.WARN,"审核失败,审核流程有误!!");
266 275
         }
267 276
         // 判断审核的权限
268
-        LoginUser loginUser = SecurityUtils.getLoginUser();
269 277
         // 当前登录用户的部门id 查询岗位id是否在内
270 278
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
271 279
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {

+ 10 - 5
ruoyi-postcheck/src/main/java/com/ruoyi/postCheck/controller/PostProgrammeController.java

@@ -206,6 +206,10 @@ public class PostProgrammeController extends BaseController {
206 206
     @Log(title = "岗检方案审核-HR", businessType = BusinessType.UPDATE)
207 207
     @PutMapping("/approveHr")
208 208
     public AjaxResult approveHr(Long id, Integer statusHr, String reasonHr) {
209
+        LoginUser loginUser = SecurityUtils.getLoginUser();
210
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
211
+            return toAjax(postProgrammeService.approveHr(id, statusHr, reasonHr));
212
+        }
209 213
         // 判断当前状态
210 214
         PostProgramme postProgramme = postProgrammeService.selectPostProgrammeById(id);
211 215
         // 审核过得不在审核
@@ -213,8 +217,6 @@ public class PostProgrammeController extends BaseController {
213 217
         if (postProgramme.getStatusHr() == PostProgrammeEnum.STATUS_HR_PASS.getValue()) {
214 218
             return AjaxResult.error("审核失败,请勿重复审核!");
215 219
         }
216
-        // 判断审核的权限
217
-        LoginUser loginUser = SecurityUtils.getLoginUser();
218 220
         // 当前登录用户的部门id 查询岗位id是否在内
219 221
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
220 222
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_HR.getCode())) {
@@ -239,6 +241,11 @@ public class PostProgrammeController extends BaseController {
239 241
     @Log(title = "岗检方案审核-Icfa", businessType = BusinessType.UPDATE)
240 242
     @PutMapping("/approveIcfa")
241 243
     public AjaxResult approveIcfa(Long id, Integer statusIcfa, String reasonIcfa) {
244
+        // 判断审核的权限
245
+        LoginUser loginUser = SecurityUtils.getLoginUser();
246
+        if (SecurityUtils.isAdmin(loginUser.getUserId())) {
247
+           return toAjax(postProgrammeService.approveIcfa(id, statusIcfa, reasonIcfa));
248
+        }
242 249
         // 判断当前状态
243 250
         PostProgramme postProgramme = postProgrammeService.selectPostProgrammeById(id);
244 251
         // 审核过得不在审核
@@ -250,8 +257,7 @@ public class PostProgrammeController extends BaseController {
250 257
         if (postProgramme.getStatusIcfa() == PostProgrammeEnum.STATUS_ICFA_PASS.getValue()) {
251 258
             return AjaxResult.error("审核失败,请勿重复审核!");
252 259
         }
253
-        // 判断审核的权限
254
-        LoginUser loginUser = SecurityUtils.getLoginUser();
260
+
255 261
         // 当前登录用户的部门id 查询岗位id是否在内
256 262
         SysDept sysDept = sysDeptService.selectDeptById(loginUser.getDeptId());
257 263
         if (!sysDept.getDeptCode().equals(DeptCode.DEPT_ICFA.getCode())) {
@@ -262,7 +268,6 @@ public class PostProgrammeController extends BaseController {
262 268
         if (sysPost.getPostLevel() != 1) {
263 269
             return AjaxResult.error(HttpStatus.FORBIDDEN, "没有权限,请联系管理员授权");
264 270
         }
265
-
266 271
         return toAjax(postProgrammeService.approveIcfa(id, statusIcfa, reasonIcfa));
267 272
     }
268 273
 }