From 3ca43826a747fda1447b2501901f84fc1a9019dd Mon Sep 17 00:00:00 2001
From: heheng <heheng@123456>
Date: 星期四, 07 十一月 2024 16:39:45 +0800
Subject: [PATCH] 修改验证及编码逻辑处理修改

---
 src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java |   51 +++++++++++++++++++++++++++------------------------
 1 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java
index 5791ded..ad49b92 100644
--- a/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java
+++ b/src/main/java/com/gkhy/labRiskManage/domain/riskReport/service/impl/RiskAssessPlanServiceImpl.java
@@ -100,14 +100,15 @@
         // 检查是否是实验管理者
         int roleTag = 0;
         UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
-        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
-            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
-                roleTag = 1;
-            }
-        }
-        if (roleTag ==0 ){
-            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划");
-        }
+        //20241107修改注释
+//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
+//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
+//                roleTag = 1;
+//            }
+//        }
+//        if (roleTag ==0 ){
+//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权添加实验评估计划");
+//        }
         if (ObjectUtils.isEmpty(user)){
             throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除");
         }
@@ -364,14 +365,15 @@
         // 检查是否是实验管理者
         int roleTag = 0;
         UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
-        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
-            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
-                roleTag = 1;
-            }
-        }
-        if (roleTag ==0 ){
-            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划");
-        }
+        //20241107修改注释
+//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
+//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
+//                roleTag = 1;
+//            }
+//        }
+//        if (roleTag ==0 ){
+//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权修改实验评估计划");
+//        }
         //参数校验
         if (ObjectUtils.isEmpty(updateParam)){
             throw new BusinessException(this.getClass(), ResultCode.PARAM_ERROR_NULL.getCode(), "要求改的参数为空");
@@ -473,14 +475,15 @@
         // 检查是否是实验管理者
         int roleTag = 0;
         UserInfoDomainDTO user = userDomainService.getUserById(currentUserId);
-        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
-            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
-                roleTag = 1;
-            }
-        }
-        if (roleTag ==0 ){
-            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划");
-        }
+        //20241107注释
+//        for (SysUserRoleBindDomainDTO role : user.getRoles()) {
+//            if (role.getRoleId() == UserRoleEnum.USER_ROLE_4.getCode().byteValue()){
+//                roleTag = 1;
+//            }
+//        }
+//        if (roleTag ==0 ){
+//            throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户无权删除实验评估计划");
+//        }
         UserInfoDomainDTO userInfoById = userDomainService.getUserInfoById(currentUserId);
         if (ObjectUtils.isEmpty(userInfoById)){
             throw new BusinessException(this.getClass(), ResultCode.BUSINESS_ERROR_NOT_ALLOWED.getCode() ,"当前用户不存在或已被删除");

--
Gitblit v1.9.2