1. 临时排除物流模块的数据权限
This commit is contained in:
@@ -28,6 +28,13 @@ import java.util.*;
|
||||
@Slf4j
|
||||
public class BusinessDataPermissionEntityScanner {
|
||||
|
||||
/**
|
||||
* 临时排除的包前缀(物流模块 DO,不参与数据权限扫描)
|
||||
*/
|
||||
private static final Set<String> EXCLUDED_PACKAGE_PREFIXES = Collections.unmodifiableSet(
|
||||
new LinkedHashSet<>(Collections.singletonList("com.zt.plat.module.backendlogistics.dal.dataobject"))
|
||||
);
|
||||
|
||||
private final Set<String> basePackages;
|
||||
private final ClassLoader classLoader;
|
||||
|
||||
@@ -70,6 +77,9 @@ public class BusinessDataPermissionEntityScanner {
|
||||
if (!StringUtils.hasText(className)) {
|
||||
continue;
|
||||
}
|
||||
if (isExcludedPackage(className)) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
Class<?> clazz = ClassUtils.forName(className, classLoader);
|
||||
if (clazz == BusinessBaseDO.class || !BusinessBaseDO.class.isAssignableFrom(clazz)) {
|
||||
@@ -92,6 +102,15 @@ public class BusinessDataPermissionEntityScanner {
|
||||
return new ArrayList<>(metadataMap.values());
|
||||
}
|
||||
|
||||
private boolean isExcludedPackage(String className) {
|
||||
for (String prefix : EXCLUDED_PACKAGE_PREFIXES) {
|
||||
if (className.startsWith(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private EntityMetadata buildMetadata(Class<? extends BusinessBaseDO> entityClass) {
|
||||
String tableName = resolveTableName(entityClass);
|
||||
if (!StringUtils.hasText(tableName)) {
|
||||
|
||||
Reference in New Issue
Block a user