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
49
50
51
52
53
54
55
56
57
58
package jnpf.permission.model;
 
import jnpf.constant.DataInterfaceVarConst;
import jnpf.util.StringUtil;
import lombok.Data;
 
import java.util.*;
import java.util.stream.Collectors;
 
@Data
public class SystemParamModel {
 
    public static final Set<String> MARKERS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
            DataInterfaceVarConst.CURRENTTIME,
            DataInterfaceVarConst.ORGANDSUB,
            DataInterfaceVarConst.ORGANIZEANDPROGENY,
            DataInterfaceVarConst.USERANDSUB,
            DataInterfaceVarConst.USERANDPROGENY,
            DataInterfaceVarConst.POSITIONANDSUB,
            DataInterfaceVarConst.POSITIONANDPROGENY,
            DataInterfaceVarConst.USER,
            DataInterfaceVarConst.POSITIONID,
            DataInterfaceVarConst.ORG
    )));
 
    private String str;
    private List<String> list;
 
    /**
     * 全量系统参数查询
     */
    public SystemParamModel() {
        this.list = new ArrayList<>(MARKERS);
    }
 
    /**
     * 字符串过滤查询
     * @param str 字符串
     */
    public SystemParamModel(String str) {
        this.list = StringUtil.isNotEmpty(str) ?
                MARKERS.stream().filter(str::contains).collect(Collectors.toList())
                : new ArrayList<>();
    }
 
    /**
     * 集合过滤查询
     * @param list 字符串集合
     */
    public SystemParamModel(List<String> list) {
        List<String> needList=new ArrayList<>();
        for (String string : list) {
            needList.addAll(MARKERS.stream().filter(string::contains).collect(Collectors.toList()));
        }
        this.list = needList.stream().distinct().collect(Collectors.toList());
    }
 
}