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
59
package com.vci.dto;
 
import com.vci.common.qt.object.ConditionItem;
import lombok.Data;
 
import java.util.Iterator;
import java.util.Map;
 
/**
 * 条件传输对象
 * @author yuxc
 * @date 2024/9/4
 */
@Data
public class ConditionDTO {
    private String rootCIName;
    private Map<String, ConditionItemDTO> ciMap;
 
    public ConditionDTO() {
    }
 
    public String getRootCIName() {
        return this.rootCIName;
    }
 
    public void setRootCIName(String rootCIName) {
        this.rootCIName = rootCIName;
    }
 
    public String getRootCINameByCIMap(Map<String, ConditionItem> ciMap) {
        String rootCIName = "";
        if (ciMap != null) {
            Iterator<String> i = ciMap.keySet().iterator();
 
            while(i.hasNext()) {
                String ciName = (String)i.next();
                if (rootCIName.equals("")) {
                    rootCIName = ciName;
                } else {
                    int rootInt = Integer.valueOf(rootCIName.substring(2));
                    int ciInt = Integer.valueOf(ciName.substring(2));
                    if (ciInt > rootInt) {
                        rootCIName = ciName;
                    }
                }
            }
        }
 
        return rootCIName;
    }
 
    public Map<String, ConditionItemDTO> getCIMap() {
        return this.ciMap;
    }
 
    public void setCIMap(Map<String, ConditionItemDTO> cIMap) {
        this.ciMap = cIMap;
    }
}