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 = new ThreadLocal<>(); /** * 获取审批人 */ public static List getOperatorList() { List list = LIST.get() != null ? LIST.get() : new ArrayList<>(); return list; } /** * 添加审批人 */ public static void addOperator(FlowOperatorModel model, Map> allData) { Map> data = new HashMap<>(); for (String key : allData.keySet()) { Map dataValue = JsonUtil.entityToMap(allData.get(key)); data.put(key, dataValue); } model.setAllData(data); List list = LIST.get() != null ? LIST.get() : new ArrayList<>(); list.add(model); LIST.set(list); } /** * 清除数据 */ public static void clear() { LIST.remove(); } }