ny
昨天 b6f169fe43a2b13f351aefc152374fc7f0bc8cb7
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
46
47
48
package jnpf.flowable.model.util;
 
import jnpf.util.JsonUtil;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
public class FlowOperatorHolder {
 
    // 审批人
    private static final ThreadLocal<List<FlowOperatorModel>> LIST = new ThreadLocal<>();
 
 
    /**
     * 获取审批人
     */
    public static List<FlowOperatorModel> getOperatorList() {
        List<FlowOperatorModel> list = LIST.get() != null ? LIST.get() : new ArrayList<>();
        return list;
    }
 
    /**
     * 添加审批人
     */
    public static void addOperator(FlowOperatorModel model, Map<String, Map<String, Object>> allData) {
        Map<String, Map<String, Object>> data = new HashMap<>();
        for (String key : allData.keySet()) {
            Map<String, Object> dataValue = JsonUtil.entityToMap(allData.get(key));
            data.put(key, dataValue);
        }
        model.setAllData(data);
        List<FlowOperatorModel> list = LIST.get() != null ? LIST.get() : new ArrayList<>();
        list.add(model);
        LIST.set(list);
    }
 
 
    /**
     * 清除数据
     */
    public static void clear() {
        LIST.remove();
    }
 
 
}