|
@@ -2,11 +2,18 @@ package com.jeeplus.config;
|
|
|
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.common.constant.CommonConstants;
|
|
|
+import com.jeeplus.sys.feign.IRoleApi;
|
|
|
import com.jeeplus.sys.feign.ITenantApi;
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
+import com.jeeplus.sys.service.dto.RoleDTO;
|
|
|
+import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
import net.sf.jsqlparser.expression.Expression;
|
|
|
import net.sf.jsqlparser.expression.StringValue;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* 租户拦截器
|
|
|
*/
|
|
@@ -36,12 +43,44 @@ public class TenantLineHandlerImpl implements TenantLineHandler {
|
|
|
case "sys_tenant":
|
|
|
case "sys_language":
|
|
|
case "plugin_datasource_link":
|
|
|
+
|
|
|
+ case "help":
|
|
|
+ case "my_notice_list":
|
|
|
+ case "position":
|
|
|
+ case "rank":
|
|
|
+ case "sys_cert":
|
|
|
+ case "sys_parameter":
|
|
|
+ case "sys_parameter_value":
|
|
|
+ case "sys_serialnum_tpl":
|
|
|
+ case "testreimbursement":
|
|
|
return true;
|
|
|
}
|
|
|
// flowable工作流系统表(排除扩展表)采用自身saas方案实现租户模式,在这里做忽略处理
|
|
|
if ( (tableName.startsWith ( "act_" ) || tableName.startsWith ( "ACT_" )) ) {
|
|
|
return true;
|
|
|
}
|
|
|
+ // 业务表 采用自身saas方案实现租户模式,在这里做忽略处理
|
|
|
+ if ( (tableName.startsWith ( "finance_" ))
|
|
|
+ || (tableName.startsWith ( "changes_" ))
|
|
|
+ || (tableName.startsWith ( "cw_" ))
|
|
|
+ || (tableName.startsWith ( "help_" ))
|
|
|
+ || (tableName.startsWith ( "job_" ))
|
|
|
+ || (tableName.startsWith ( "klg_" ))
|
|
|
+ || (tableName.startsWith ( "knowledge_" ))
|
|
|
+ || (tableName.startsWith ( "lucky_" ))
|
|
|
+ || (tableName.startsWith ( "material_" ))
|
|
|
+ || (tableName.startsWith ( "position_" ))
|
|
|
+ || (tableName.startsWith ( "project_" ))
|
|
|
+ || (tableName.startsWith ( "proofread_" ))
|
|
|
+ || (tableName.startsWith ( "rank_" ))
|
|
|
+ || (tableName.startsWith ( "reimbursement_" ))
|
|
|
+ || (tableName.startsWith ( "roster_" ))
|
|
|
+ || (tableName.startsWith ( "sys_user_" ))
|
|
|
+ || (tableName.startsWith ( "work_" ))
|
|
|
+ || (tableName.startsWith ( "zs_reimbursement_" ))
|
|
|
+ || (tableName.startsWith ( "program_" ))) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
// 如果默认租户是平台租户, 角色,用户等系统表不过滤
|
|
|
if ( SpringUtil.getBean ( ITenantApi.class ).getCurrentTenantId ( ).equals ( CommonConstants.DEFAULT_TENANT_ID ) ) {
|
|
@@ -53,6 +92,14 @@ public class TenantLineHandlerImpl implements TenantLineHandler {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
+ // 如果当前租户是综合管理租户, 部门,用户表进行过滤
|
|
|
+ if ( SpringUtil.getBean ( ITenantApi.class ).getCurrentTenantId ( ).equals (CommonConstants.INTEGRATED_MANAGEMENT_TENANT_ID ) ) {
|
|
|
+ switch (tableName) {
|
|
|
+ case "sys_user":
|
|
|
+ case "sys_office":
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
}
|