吉安感知网项目-后端
xiebin
2026-01-06 d207a86cdf1ab52ef8cb7cd83bad8fceab8038cf
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
41
42
43
44
45
package org.sxkj.common.cache;
 
import org.sxkj.common.enums.RefreshStatusEnum;
 
import java.util.concurrent.ConcurrentHashMap;
 
/**
 * 本地状态机缓存数据
 */
public class CurrentCacheUtils {
    /**
     * 实时更新设备的状态
     */
    private static final ConcurrentHashMap<String, String> STATUS_MAP = new ConcurrentHashMap<String, String>();
 
 
    public static void setValue(String key, String value) {
        STATUS_MAP.put(key, value);
    }
 
    public static String getValue(String key) {
        return STATUS_MAP.get(key);
    }
 
    /**
     * 设备状态key
     *
     * @param deviceSn
     * @return
     */
    public static String getDeviceKey(String deviceSn) {
        return RefreshStatusEnum.DEVICE_REFRESH+ deviceSn;
    }
 
    /**
     * 任务状态
     *
     * @return
     */
    public static String getJobKey(String areaCode) {
        return RefreshStatusEnum.JOB_REFRESH + areaCode;
    }
 
 
}