mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	🐛 BPM:多租户的工作流隔离
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
package cn.iocoder.yudao.framework.tenant.core.context;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.enums.DocumentEnum;
 | 
			
		||||
import com.alibaba.ttl.TransmittableThreadLocal;
 | 
			
		||||
 | 
			
		||||
@@ -21,7 +22,7 @@ public class TenantContextHolder {
 | 
			
		||||
    private static final ThreadLocal<Boolean> IGNORE = new TransmittableThreadLocal<>();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得租户编号。
 | 
			
		||||
     * 获得租户编号
 | 
			
		||||
     *
 | 
			
		||||
     * @return 租户编号
 | 
			
		||||
     */
 | 
			
		||||
@@ -29,6 +30,16 @@ public class TenantContextHolder {
 | 
			
		||||
        return TENANT_ID.get();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得租户编号 String
 | 
			
		||||
     *
 | 
			
		||||
     * @return 租户编号
 | 
			
		||||
     */
 | 
			
		||||
    public static String getTenantIdStr() {
 | 
			
		||||
        Long tenantId = getTenantId();
 | 
			
		||||
        return StrUtil.toStringOrNull(tenantId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得租户编号。如果不存在,则抛出 NullPointerException 异常
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user