mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 21:52:07 +08:00
system微服务暂时移除datapermission
This commit is contained in:
@@ -58,10 +58,6 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-organ</artifactId>
|
||||||
@@ -264,10 +260,6 @@
|
|||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-banner</artifactId>
|
<artifactId>cf-spring-boot-starter-banner</artifactId>
|
||||||
</include>
|
</include>
|
||||||
<include>
|
|
||||||
<groupId>com.cf.imes</groupId>
|
|
||||||
<artifactId>cf-spring-boot-starter-biz-data-permission</artifactId>
|
|
||||||
</include>
|
|
||||||
<include>
|
<include>
|
||||||
<groupId>com.cf.imes</groupId>
|
<groupId>com.cf.imes</groupId>
|
||||||
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
<artifactId>cf-spring-boot-starter-biz-dict</artifactId>
|
||||||
|
|||||||
-2
@@ -2,7 +2,6 @@ package com.cf.imes.module.system.controller.admin.user;
|
|||||||
|
|
||||||
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
||||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||||
import com.cf.imes.framework.datapermission.core.annotation.DataPermission;
|
|
||||||
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserMobileUpdateReqVO;
|
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserMobileUpdateReqVO;
|
||||||
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserProfileRespVO;
|
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserProfileRespVO;
|
||||||
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
|
import com.cf.imes.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
|
||||||
@@ -56,7 +55,6 @@ public class UserProfileController {
|
|||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得登录用户信息")
|
@Operation(summary = "获得登录用户信息")
|
||||||
@DataPermission(enable = false) // 关闭数据权限,避免只查看自己时,查询不到部门。
|
|
||||||
public CommonResult<UserProfileRespVO> getUserProfile() {
|
public CommonResult<UserProfileRespVO> getUserProfile() {
|
||||||
// 获得用户基本信息
|
// 获得用户基本信息
|
||||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||||
|
|||||||
+28
-28
@@ -1,28 +1,28 @@
|
|||||||
package com.cf.imes.module.system.framework.datapermission.config;
|
//package com.cf.imes.module.system.framework.datapermission.config;
|
||||||
|
//
|
||||||
import com.cf.imes.module.system.dal.dataobject.dept.DeptDO;
|
//import com.cf.imes.module.system.dal.dataobject.dept.DeptDO;
|
||||||
import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
//import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.cf.imes.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
|
//import com.cf.imes.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
|
||||||
import org.springframework.context.annotation.Bean;
|
//import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
//import org.springframework.context.annotation.Configuration;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* system 模块的数据权限 Configuration
|
// * system 模块的数据权限 Configuration
|
||||||
*
|
// *
|
||||||
* @author 晨丰科技
|
// * @author 晨丰科技
|
||||||
*/
|
// */
|
||||||
@Configuration(proxyBeanMethods = false)
|
//@Configuration(proxyBeanMethods = false)
|
||||||
public class DataPermissionConfiguration {
|
//public class DataPermissionConfiguration {
|
||||||
|
//
|
||||||
@Bean
|
// @Bean
|
||||||
public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() {
|
// public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() {
|
||||||
return rule -> {
|
// return rule -> {
|
||||||
// dept
|
// // dept
|
||||||
rule.addDeptColumn(AdminUserDO.class);
|
// rule.addDeptColumn(AdminUserDO.class);
|
||||||
rule.addDeptColumn(DeptDO.class, "id");
|
// rule.addDeptColumn(DeptDO.class, "id");
|
||||||
// user
|
// // user
|
||||||
rule.addUserColumn(AdminUserDO.class, "id");
|
// rule.addUserColumn(AdminUserDO.class, "id");
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
-2
@@ -8,7 +8,6 @@ import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
|||||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||||
import com.cf.imes.framework.datapermission.core.annotation.DataPermission;
|
|
||||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
import com.cf.imes.framework.security.core.LoginUser;
|
import com.cf.imes.framework.security.core.LoginUser;
|
||||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
@@ -286,7 +285,6 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false) // 禁用数据权限,避免建立不正确的缓存
|
|
||||||
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
|
@Cacheable(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, key = "#id")
|
||||||
public Set<Long> getChildDeptIdListFromCache(Long id) {
|
public Set<Long> getChildDeptIdListFromCache(Long id) {
|
||||||
List<DeptDO> children = getChildDeptList(id);
|
List<DeptDO> children = getChildDeptList(id);
|
||||||
|
|||||||
-2
@@ -9,7 +9,6 @@ import com.cf.imes.framework.common.exception.ServiceException;
|
|||||||
import com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants;
|
import com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||||
import com.cf.imes.framework.common.util.collection.CollectionUtils;
|
import com.cf.imes.framework.common.util.collection.CollectionUtils;
|
||||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||||
import com.cf.imes.framework.datapermission.core.annotation.DataPermission;
|
|
||||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
import com.cf.imes.framework.organ.core.aop.OrganIgnore;
|
||||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||||
@@ -649,7 +648,6 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false) // 关闭数据权限,不然就会出现递归获取数据权限的问题
|
|
||||||
public DeptDataPermissionRespDTO getDeptDataPermission(Long userId) {
|
public DeptDataPermissionRespDTO getDeptDataPermission(Long userId) {
|
||||||
// 获得用户的角色
|
// 获得用户的角色
|
||||||
List<RoleDO> roles = getEnableUserRoleListByUserIdFromCache(userId);
|
List<RoleDO> roles = getEnableUserRoleListByUserIdFromCache(userId);
|
||||||
|
|||||||
-2
@@ -7,7 +7,6 @@ import cn.hutool.core.lang.Pair;
|
|||||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||||
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
import com.cf.imes.framework.common.enums.UserTypeEnum;
|
||||||
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
import com.cf.imes.framework.common.exception.util.ServiceExceptionUtil;
|
||||||
import com.cf.imes.framework.datapermission.core.annotation.DataPermission;
|
|
||||||
import com.cf.imes.framework.sms.core.client.SmsClient;
|
import com.cf.imes.framework.sms.core.client.SmsClient;
|
||||||
import com.cf.imes.framework.sms.core.client.dto.SmsReceiveRespDTO;
|
import com.cf.imes.framework.sms.core.client.dto.SmsReceiveRespDTO;
|
||||||
import com.cf.imes.framework.sms.core.client.dto.SmsSendRespDTO;
|
import com.cf.imes.framework.sms.core.client.dto.SmsSendRespDTO;
|
||||||
@@ -56,7 +55,6 @@ public class SmsSendServiceImpl implements SmsSendService {
|
|||||||
private List<SmsSendAfterSendHandler> smsSendAfterSendHandlers;
|
private List<SmsSendAfterSendHandler> smsSendAfterSendHandlers;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false) // 发送短信时,无需考虑数据权限
|
|
||||||
public Long sendSingleSmsToAdmin(String mobile, Long userId, String templateCode, Map<String, Object> templateParams) {
|
public Long sendSingleSmsToAdmin(String mobile, Long userId, String templateCode, Map<String, Object> templateParams) {
|
||||||
// 如果 mobile 为空,则加载用户编号对应的手机号
|
// 如果 mobile 为空,则加载用户编号对应的手机号
|
||||||
if (StringUtils.isEmpty(mobile)) {
|
if (StringUtils.isEmpty(mobile)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user