BlackAreaWarnRequest.java
4.69 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package cn.com.glsx.schedulerjob.model;
import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
/**
* 黑区数据消息队列请求实体类
* 对应文档:黑区数据消息队列格式(字段名/大小写/数据类型严格匹配)
*/
public class BlackAreaWarnRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 黑区预警id,自动生成
*/
@JSONField(name = "Id")
private String Id;
/**
* 设备号
*/
@JSONField(name = "DeviceNumber")
private String DeviceNumber;
/**
* 预警类型:黑区(固定值44)
*/
@JSONField(name = "MessDataType")
private Integer MessDataType;
/**
* 有线无线属性:1-无线 2-有线
*/
@JSONField(name = "DeviceType")
private String DeviceType;
/**
* 车架号
*/
@JSONField(name = "VinNumber")
private String VinNumber;
/**
* 纬度
*/
@JSONField(name = "inDeviceLat")
private double inDeviceLat;
/**
* 经度
*/
@JSONField(name = "inDeviceLng")
private double inDeviceLng;
/**
* 风险等级:1-低级 2-中级 3-高级
*/
@JSONField(name = "riskPlaceLevel")
private Integer riskPlaceLevel;
// 无参构造:JSON反序列化、消息队列消费/框架实例化必备
public BlackAreaWarnRequest() {
}
// 全参构造:测试/业务手动构建对象时快速赋值
public BlackAreaWarnRequest(String Id, String DeviceNumber, Integer MessDataType, String DeviceType,
String VinNumber, double inDeviceLat, double inDeviceLng, Integer riskPlaceLevel) {
this.Id = Id;
this.DeviceNumber = DeviceNumber;
this.MessDataType = MessDataType;
this.DeviceType = DeviceType;
this.VinNumber = VinNumber;
this.inDeviceLat = inDeviceLat;
this.inDeviceLng = inDeviceLng;
this.riskPlaceLevel = riskPlaceLevel;
}
// Getter & Setter:JSON序列化/反序列化、消息队列解析、业务取值必备
public String getId() {
return Id;
}
public void setId(String Id) {
this.Id = Id;
}
public String getDeviceNumber() {
return DeviceNumber;
}
public void setDeviceNumber(String DeviceNumber) {
this.DeviceNumber = DeviceNumber;
}
public Integer getMessDataType() {
return MessDataType;
}
public void setMessDataType(Integer MessDataType) {
this.MessDataType = MessDataType;
}
public String getDeviceType() {
return DeviceType;
}
public void setDeviceType(String DeviceType) {
this.DeviceType = DeviceType;
}
public String getVinNumber() {
return VinNumber;
}
public void setVinNumber(String VinNumber) {
this.VinNumber = VinNumber;
}
public double getInDeviceLat() {
return inDeviceLat;
}
public void setInDeviceLat(double inDeviceLat) {
this.inDeviceLat = inDeviceLat;
}
public double getInDeviceLng() {
return inDeviceLng;
}
public void setInDeviceLng(double inDeviceLng) {
this.inDeviceLng = inDeviceLng;
}
public Integer getRiskPlaceLevel() {
return riskPlaceLevel;
}
public void setRiskPlaceLevel(Integer riskPlaceLevel) {
this.riskPlaceLevel = riskPlaceLevel;
}
// toString:日志打印、消息队列调试必备,直观展示对象完整数据
@Override
public String toString() {
return "BlackAreaWarnRequest{" +
"Id='" + Id + '\'' +
", DeviceNumber='" + DeviceNumber + '\'' +
", MessDataType=" + MessDataType +
", DeviceType='" + DeviceType + '\'' +
", VinNumber='" + VinNumber + '\'' +
", inDeviceLat=" + inDeviceLat +
", inDeviceLng=" + inDeviceLng +
", riskPlaceLevel=" + riskPlaceLevel +
'}';
}
// 业务常量:避免魔法值,提升代码可读性和可维护性(与文档固定值完全一致)
/**
* 预警类型-黑区预警固定值
*/
public static final Integer MESS_DATA_TYPE_BLACK_AREA = 44;
/**
* 设备属性-无线
*/
public static final String DEVICE_TYPE_WIRELESS = "1";
/**
* 设备属性-有线
*/
public static final String DEVICE_TYPE_WIRED = "2";
/**
* 风险等级-低级
*/
public static final Integer RISK_LEVEL_LOW = 1;
/**
* 风险等级-中级
*/
public static final Integer RISK_LEVEL_MIDDLE = 2;
/**
* 风险等级-高级
*/
public static final Integer RISK_LEVEL_HIGH = 3;
}