CUSTOM_RESPONSE.java
9.3 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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
package com.tianbo.messagebus.model;
import com.tianbo.messagebus.dao.CUSTOM_RESPONSEMapper;
import com.tianbo.messagebus.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class CUSTOM_RESPONSE {
private String id;
private Date flightdate;
private String flightno;
private String carrier;
private String awbano;
private String awbhno;
private String bustype;
private Date busdate;
private BigDecimal busweight;
private Integer buspiece;
private String opertype;
private String cusmsgid;
private String cussenderid;
private String cusreciverid;
private String cusversion;
private String cusfunctioncode;
private Date cusresrcvtime;
private Date cusressendtime;
private String cusrescode;
private String cusresstatus;
private String operusername;
private String opersystemname;
private String operreason;
private String operperson;
private String opertel;
private String cusrestext;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getAwbano() {
return awbano;
}
public void setAwbano(String awbano) {
this.awbano = awbano == null ? null : awbano.trim();
}
public String getAwbhno() {
return awbhno;
}
public void setAwbhno(String awbhno) {
this.awbhno = awbhno == null ? null : awbhno.trim();
}
public String getBustype() {
return bustype;
}
public void setBustype(String bustype) {
this.bustype = bustype == null ? null : bustype.trim();
}
public Date getBusdate() {
return busdate;
}
public void setBusdate(Date busdate) {
this.busdate = busdate;
}
public BigDecimal getBusweight() {
return busweight;
}
public void setBusweight(BigDecimal busweight) {
this.busweight = busweight;
}
public Integer getBuspiece() {
return buspiece;
}
public void setBuspiece(Integer buspiece) {
this.buspiece = buspiece;
}
public String getOpertype() {
return opertype;
}
public void setOpertype(String opertype) {
this.opertype = opertype == null ? null : opertype.trim();
}
public String getCusmsgid() {
return cusmsgid;
}
public void setCusmsgid(String cusmsgid) {
this.cusmsgid = cusmsgid == null ? null : cusmsgid.trim();
}
public String getCussenderid() {
return cussenderid;
}
public void setCussenderid(String cussenderid) {
this.cussenderid = cussenderid == null ? null : cussenderid.trim();
}
public String getCusreciverid() {
return cusreciverid;
}
public void setCusreciverid(String cusreciverid) {
this.cusreciverid = cusreciverid == null ? null : cusreciverid.trim();
}
public String getCusversion() {
return cusversion;
}
public void setCusversion(String cusversion) {
this.cusversion = cusversion == null ? null : cusversion.trim();
}
public String getCusfunctioncode() {
return cusfunctioncode;
}
public void setCusfunctioncode(String cusfunctioncode) {
this.cusfunctioncode = cusfunctioncode == null ? null : cusfunctioncode.trim();
}
public Date getCusresrcvtime() {
return cusresrcvtime;
}
public void setCusresrcvtime(Date cusresrcvtime) {
this.cusresrcvtime = cusresrcvtime;
}
public Date getCusressendtime() {
return cusressendtime;
}
public void setCusressendtime(Date cusressendtime) {
this.cusressendtime = cusressendtime;
}
public String getCusrescode() {
return cusrescode;
}
public void setCusrescode(String cusrescode) {
this.cusrescode = cusrescode == null ? null : cusrescode.trim();
}
public String getCusresstatus() {
return cusresstatus;
}
public void setCusresstatus(String cusresstatus) {
this.cusresstatus = cusresstatus == null ? null : cusresstatus.trim();
}
public String getOperusername() {
return operusername;
}
public void setOperusername(String operusername) {
this.operusername = operusername == null ? null : operusername.trim();
}
public String getOpersystemname() {
return opersystemname;
}
public void setOpersystemname(String opersystemname) {
this.opersystemname = opersystemname == null ? null : opersystemname.trim();
}
public String getOperreason() {
return operreason;
}
public void setOperreason(String operreason) {
this.operreason = operreason == null ? null : operreason.trim();
}
public String getOperperson() {
return operperson;
}
public void setOperperson(String operperson) {
this.operperson = operperson == null ? null : operperson.trim();
}
public String getOpertel() {
return opertel;
}
public void setOpertel(String opertel) {
this.opertel = opertel == null ? null : opertel.trim();
}
public String getCusrestext() {
return cusrestext;
}
public void setCusrestext(String cusrestext) {
this.cusrestext = cusrestext == null ? null : cusrestext.trim();
}
public CUSTOM_RESPONSE() {
}
/**
* 海关回执实体与系统回执实体转换
* @param customReception
*/
public CUSTOM_RESPONSE(CustomReception customReception) {
this.id = UUID.randomUUID().toString();
this.awbano = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
if (!StringUtils.isEmpty(customReception.getWayBillSecond())){
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.awbhno = awbhArr[1];
}
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
this.setFlightno(flightInfo[1]);
this.setCarrier(flightInfo[0]);
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
}
this.cusrestext = customReception.getResponseText();
this.cusrescode = customReception.getResponseCode();
this.bustype = customReception.getMessageType();
this.cusfunctioncode = customReception.getFunctionCode();
this.operusername = "SYSTEM";
this.cusmsgid = customReception.getMessageID();
this.opertype = "回执";
this.cussenderid = customReception.getSenderID();
this.cusreciverid = customReception.getReceiverID();
this.cusresrcvtime = new Date();
this.cusressendtime = DateUtil.formatByyyyyMMddHHmmss(customReception.getSendTime());
this.cusversion = customReception.getVersion();
//单独存储下回执内容中的回执业务代码
if(this.cusrescode!= "0" && this.cusrestext!= null && this.cusrestext.length()>5){
this.cusresstatus = customReception.getResponseText().substring(0,5);
}
}
@Override
public String toString() {
return "CUSTOM_RESPONSE{" +
"id='" + id + '\'' +
", flightdate=" + flightdate +
", flightno='" + flightno + '\'' +
", carrier='" + carrier + '\'' +
", awbano='" + awbano + '\'' +
", awbhno='" + awbhno + '\'' +
", bustype='" + bustype + '\'' +
", busdate=" + busdate +
", busweight=" + busweight +
", buspiece=" + buspiece +
", opertype='" + opertype + '\'' +
", cusmsgid='" + cusmsgid + '\'' +
", cussenderid='" + cussenderid + '\'' +
", cusreciverid='" + cusreciverid + '\'' +
", cusversion='" + cusversion + '\'' +
", cusfunctioncode='" + cusfunctioncode + '\'' +
", cusresrcvtime=" + cusresrcvtime +
", cusressendtime=" + cusressendtime +
", cusrescode='" + cusrescode + '\'' +
", cusresstatus='" + cusresstatus + '\'' +
", operusername='" + operusername + '\'' +
", opersystemname='" + opersystemname + '\'' +
", operreason='" + operreason + '\'' +
", operperson='" + operperson + '\'' +
", opertel='" + opertel + '\'' +
", cusrestext='" + cusrestext + '\'' +
'}';
}
}