wlzboy
1 天以前 08f95b2f159b56fa3bd4f4b348855989de8aa456
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.ruoyi.common.utils;
 
import java.util.HashMap;
import java.util.Map;
 
public class UserUtil {
    /**
     * 用户ID和分公司ID的映射关系
     */
    private static final Map<Long,Long> userIdBranchMap = new HashMap<>();
    public static void addUserIdBranch(Long userId,Long branchId){
        if(userId != null && branchId != null && !userIdBranchMap.containsKey(userId)) {
            userIdBranchMap.put(userId, branchId);
        }
    }
    public static Long getBranchIdByUserId(Long userId){
        return userIdBranchMap.get(userId);
    }
 
 
}