懒羊羊
2023-08-30 1ac2bc1590406d9babec036e154d8d08f34a6aa1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cn.stylefeng.guns.workflow.core.cache;
 
import cn.stylefeng.guns.base.auth.context.LoginContextHolder;
 
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
 
/**
 * 指定下一代办人的临时缓存
 *
 * @author fengshuonan
 * @date 2019-09-05-14:18
 */
public class TempAssignCache {
 
    private static Map<Long, String> map = new ConcurrentHashMap<>();
 
    /**
     * 设置代办人
     *
     * @author fengshuonan
     * @Date 2019-09-05 14:21
     */
    public static String set(String assign) {
        Long userId = LoginContextHolder.getContext().getUserId();
        return map.put(userId, assign);
    }
 
    /**
     * 获取代办人
     *
     * @author fengshuonan
     * @Date 2019-09-05 14:21
     */
    public static String get() {
        Long userId = LoginContextHolder.getContext().getUserId();
        return map.get(userId);
    }
 
}