cuikaidong
2025-06-12 44e283b774bb1168d0c17dfe5070a1ca8e2274cd
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
package org.jeecg.common.util.jsonschema.validate;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.jeecg.common.system.vo.DictModel;
import org.jeecg.common.util.jsonschema.CommonProperty;
 
import com.alibaba.fastjson.JSONObject;
 
public class NumberProperty extends CommonProperty {
 
    private static final long serialVersionUID = -558615331436437200L;
    
    /**
     * 倍数
     * 验证实例是否为此数值的倍数
     * “multipleOf”的值必须是一个数字,严格大于0。
     */
    private Integer multipleOf;
    
    /**
     * 小于等于
     * “maximum”的值必须是一个数字,表示数字实例的包含上限。
     *    如果实例是数字,则仅当实例小于或等于“最大”时,此关键字才会生效。
     */
    private Integer maxinum;
    
    /**
     * 小于
     * “exclusiveMaximum”的值必须是数字,表示数字实例的独占上限。
     * 如果实例是数字,则实例仅在其值严格小于(不等于)“exclusiveMaximum”时才有效。
     */
    private Integer exclusiveMaximum;
    
    /**
     * 大于等于
     */
    private Integer minimum;
    
    /**
     * 大于等于
     */
    private Integer exclusiveMinimum;
    
    private String pattern;
 
    public Integer getMultipleOf() {
        return multipleOf;
    }
 
    public void setMultipleOf(Integer multipleOf) {
        this.multipleOf = multipleOf;
    }
 
    public Integer getMaxinum() {
        return maxinum;
    }
 
    public void setMaxinum(Integer maxinum) {
        this.maxinum = maxinum;
    }
 
    public Integer getExclusiveMaximum() {
        return exclusiveMaximum;
    }
 
    public void setExclusiveMaximum(Integer exclusiveMaximum) {
        this.exclusiveMaximum = exclusiveMaximum;
    }
 
    public Integer getMinimum() {
        return minimum;
    }
 
    public void setMinimum(Integer minimum) {
        this.minimum = minimum;
    }
 
    public Integer getExclusiveMinimum() {
        return exclusiveMinimum;
    }
 
    public void setExclusiveMinimum(Integer exclusiveMinimum) {
        this.exclusiveMinimum = exclusiveMinimum;
    }
    
    public String getPattern() {
        return pattern;
    }
 
    public void setPattern(String pattern) {
        this.pattern = pattern;
    }
 
    public NumberProperty() {}
    
    /**
      *  构造器
     * @param key 字段名
     * @param title 字段备注 
     * @param type number和integer
     */
    public NumberProperty(String key,String title,String type) {
        this.key = key;
        this.type = type;
        this.title = title;
        this.view = "number";
    }
    
    /**
      * 列表类型的走这个构造器  字典里存储的都是字符串 没法走这个构造器
     * @param key
     * @param type
     * @param view list-checkbox-radio
     * @param include
     */
    public NumberProperty(String key,String title,String view,List<DictModel> include) {
        this.type = "integer";
        this.key = key;
        this.view = view;
        this.title = title;
        this.include = include;
    }
    
    @Override
    public Map<String,Object> getPropertyJson() {
        Map<String,Object> map = new HashMap<>();
        map.put("key",getKey());
        JSONObject prop = getCommonJson();
        if(multipleOf!=null) {
            prop.put("multipleOf",multipleOf);
        }
        if(maxinum!=null) {
            prop.put("maxinum",maxinum);
        }
        if(exclusiveMaximum!=null) {
            prop.put("exclusiveMaximum",exclusiveMaximum);
        }
        if(minimum!=null) {
            prop.put("minimum",minimum);
        }
        if(exclusiveMinimum!=null) {
            prop.put("exclusiveMinimum",exclusiveMinimum);
        }
        if(pattern!=null) {
            prop.put("pattern",pattern);
        }
        map.put("prop",prop);
        return map;
    }
}