Directive60.java
5.12 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
package com.bsth.vehicle.directive.entity;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.bsth.entity.realcontrol.ScheduleRealInfo;
import com.bsth.entity.sys.SysUser;
/**
*
* @ClassName: Directive
* @Description: TODO(调度指令)
* @author PanZhao
* @date 2016年6月7日 上午10:21:59
*
*/
@Entity
@Table(name = "bsth_v_directive_60")
public class Directive60 {
@Id
@GeneratedValue
private Integer id;
/**
* 一级协议
*/
private short operCode;
/**
* 数据
*/
private DirectiveData data;
/**
* 设备号
*/
@Transient
private String deviceId;
/**
* 时间戳
*/
@Transient
private Long timestamp;
/**
* 唯一标识
*/
@Transient
private Integer msgId;
/**
* 46上行
*/
private Short reply46 = -1;
/**
* 47上行
*/
private Short reply47 = -1;
/**
* 是否是调度指令
* 目前调度指令和消息短语都是短语下发,所以从协议上无法区分
*/
private boolean isDispatch;
/**
* 如果是调度指令,则关联到相关的班次
*/
@ManyToOne
private ScheduleRealInfo sch;
/**
* 发送人
*/
@ManyToOne
private SysUser sender;
@Transient
private boolean persistent;
@Embeddable
public static class DirectiveData {
// 公司代码
private short companyCode;
// 设备号
private String deviceId;
// 时间戳
private Long timestamp;
// 保留 默认0
private short instructType = 0;
/*
* 调度指令 调度指令。
* 0X00表示信息短语
* 0X01表示取消上次指令+调度指令(闹钟有效)
* 0x02表示为调度指令(闹钟有效)
* 0x03表示运营状态指令(闹钟无效)
* 0x04表示其他指令
*/
private Short dispatchInstruct;
// 唯一标识
private int msgId;
// 闹钟
private Long alarmTime;
// 多个运营状态字节
private Long serviceState;
// 消息文本
private String txtContent;
public short getCompanyCode() {
return companyCode;
}
public void setCompanyCode(short companyCode) {
this.companyCode = companyCode;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public short getInstructType() {
return instructType;
}
public void setInstructType(short instructType) {
this.instructType = instructType;
}
public Short getDispatchInstruct() {
return dispatchInstruct;
}
public void setDispatchInstruct(Short dispatchInstruct) {
this.dispatchInstruct = dispatchInstruct;
}
public int getMsgId() {
return msgId;
}
public void setMsgId(int msgId) {
this.msgId = msgId;
}
public Long getAlarmTime() {
return alarmTime;
}
public void setAlarmTime(Long alarmTime) {
this.alarmTime = alarmTime;
}
public Long getServiceState() {
return serviceState;
}
public void setServiceState(Long serviceState) {
this.serviceState = serviceState;
}
public String getTxtContent() {
return txtContent;
}
public void setTxtContent(String txtContent) {
this.txtContent = txtContent;
}
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public short getOperCode() {
return operCode;
}
public void setOperCode(short operCode) {
this.operCode = operCode;
}
public DirectiveData getData() {
return data;
}
public void setData(DirectiveData data) {
this.data = data;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public Integer getMsgId() {
return msgId;
}
public void setMsgId(Integer msgId) {
this.msgId = msgId;
}
public Short getReply46() {
return reply46;
}
public void setReply46(Short reply46) {
this.reply46 = reply46;
}
public Short getReply47() {
return reply47;
}
public void setReply47(Short reply47) {
this.reply47 = reply47;
}
public boolean isDispatch() {
return isDispatch;
}
public void setDispatch(boolean isDispatch) {
this.isDispatch = isDispatch;
}
public ScheduleRealInfo getSch() {
return sch;
}
public void setSch(ScheduleRealInfo sch) {
this.sch = sch;
}
public SysUser getSender() {
return sender;
}
public void setSender(SysUser sender) {
this.sender = sender;
}
public boolean isPersistent() {
return persistent;
}
public void setPersistent(boolean persistent) {
this.persistent = persistent;
}
}