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);
|
}
|
|
|
}
|