Merge branch 'test' into test-dsc
* test: 修复BUG710,添加文件下载次数统计 修改私服地址,把 seata-dm 项目从 dsc挪过来 feat(gateway): 添加API客户端凭证加密功能支持 bmp 已挪到 ztcloud-dist 仓库 修改发布信息 增加快照仓库 恢复 erp 模块数据权限 从maven模块中移除 zt-server 修改版本号 feat:登陆用户的部门数据权限接口增加角色参数;获取当前用户可访问的顶级部门列表不校验数据权限 no message
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
<module>zt-spring-boot-starter-job</module>
|
||||
<module>zt-spring-boot-starter-mq</module>
|
||||
<module>zt-spring-boot-starter-rpc</module>
|
||||
|
||||
<module>zt-spring-boot-starter-seata-dm</module>
|
||||
<module>zt-spring-boot-starter-excel</module>
|
||||
<module>zt-spring-boot-starter-test</module>
|
||||
|
||||
|
||||
@@ -40,4 +40,11 @@ public interface PermissionCommonApi {
|
||||
@Parameter(name = "userId", description = "用户编号", example = "2", required = true)
|
||||
CommonResult<DeptDataPermissionRespDTO> getDeptDataPermission(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping(PREFIX + "/get-dept-data-permission-with-roleCodes")
|
||||
@Operation(summary = "获得登陆用户的部门数据权限")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", example = "2", required = true),
|
||||
@Parameter(name = "roleCodes", description = "角色编码", example = "2", required = true)
|
||||
})
|
||||
CommonResult<DeptDataPermissionRespDTO> getDeptDataPermissionWithRoleCodes(@RequestParam("userId") Long userId, @RequestParam("roleCodes") String roleCodes);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class BusinessDataPermissionEntityScanner {
|
||||
*/
|
||||
private static final Set<String> EXCLUDED_PACKAGE_PREFIXES = Set.of(
|
||||
"com.zt.plat.module.backendlogistics",
|
||||
"com.zt.plat.module.erp",
|
||||
// "com.zt.plat.module.erp",
|
||||
"com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO");
|
||||
|
||||
private final Set<String> basePackages;
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.zt.plat.framework.tenant.core.context;
|
||||
|
||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门上下文 Holder,使用 {@link TransmittableThreadLocal} 支持在线程池/异步场景下的上下文传递。
|
||||
*
|
||||
@@ -15,6 +17,8 @@ public class DeptContextHolder {
|
||||
private static final ThreadLocal<Long> COMPANY_ID = new TransmittableThreadLocal<>();
|
||||
/** 是否忽略部门数据权限 */
|
||||
private static final ThreadLocal<Boolean> IGNORE = new TransmittableThreadLocal<>();
|
||||
/** 角色编码列表 */
|
||||
private static final ThreadLocal<List<String>> ROLE_CODE_LIST = new TransmittableThreadLocal<>();
|
||||
|
||||
public static Long getDeptId() {
|
||||
return DEPT_ID.get();
|
||||
@@ -32,6 +36,12 @@ public class DeptContextHolder {
|
||||
COMPANY_ID.set(companyId);
|
||||
}
|
||||
|
||||
public static void setContext(Long deptId, Long companyId, List<String> roleCodeList) {
|
||||
DEPT_ID.set(deptId);
|
||||
COMPANY_ID.set(companyId);
|
||||
ROLE_CODE_LIST.set(roleCodeList);
|
||||
}
|
||||
|
||||
public static void setDeptId(Long deptId) {
|
||||
DEPT_ID.set(deptId);
|
||||
}
|
||||
@@ -53,9 +63,20 @@ public class DeptContextHolder {
|
||||
return Boolean.TRUE.equals(IGNORE.get());
|
||||
}
|
||||
|
||||
public static void setRoleCodeList(List<String> roleCodeList) {
|
||||
ROLE_CODE_LIST.set(roleCodeList);
|
||||
}
|
||||
public static List<String> getRoleCodeList() {
|
||||
return ROLE_CODE_LIST.get();
|
||||
}
|
||||
public static void clearRoleCodeList(){
|
||||
ROLE_CODE_LIST.remove();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
DEPT_ID.remove();
|
||||
COMPANY_ID.remove();
|
||||
IGNORE.remove();
|
||||
ROLE_CODE_LIST.remove();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user