From 125487e1a99361df5e8de543f8b2c75602022590 Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: Mon, 16 Dec 2024 14:16:54 +0800
Subject: [PATCH] 修改业务逻辑
---
expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java b/expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java
index 63b845f..f404659 100644
--- a/expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java
+++ b/expert-system/src/main/java/com/gkhy/system/service/impl/ProjectManagementServiceImpl.java
@@ -238,12 +238,12 @@
@Override
public int deleteProjectManagementByIds(Long[] ids) {
// 校验
-// for (Long id : ids) {
-// checkDataPer(id);
-// }
- if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) ){
- throw new ServiceException("无权操作!");
+ for (Long id : ids) {
+ checkDelData(id);
}
+// if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) ){
+// throw new ServiceException("无权操作!");
+// }
return projectManagementMapper.deleteProjectManagementByIds(ids);
}
@@ -554,7 +554,7 @@
Long deptId = projectManagement.getDeptId();
// 本部门审批?
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) && deptId.intValue() != SecurityUtils.getDeptId().intValue()){
- throw new ServiceException("非本部门数据,无权操作!");
+ throw new ServiceException("非本处室数据,无权操作!");
}
if (projectManagement.getState() == 4){
throw new ServiceException("已结项,无权操作!");
@@ -563,6 +563,15 @@
}
+ private void checkDelData(Long id){
+ ProjectManagement projectManagement = checkData(id);
+ Long deptId = projectManagement.getDeptId();
+ // 本部门审批?
+ if (!SecurityUtils.isAdmin(SecurityUtils.getUserId()) && deptId.intValue() != SecurityUtils.getDeptId().intValue()){
+ throw new ServiceException("非本处室数据,无权操作!");
+ }
+ }
+
}
\ No newline at end of file
--
Gitblit v1.9.2