MANIFESTLOAD.java
4.8 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
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
@Slf4j
public class MANIFESTLOAD extends WlptBaseModel {
private String id;
private Date createdate;
private String flightno;
private String waybillnomaster;
private Date flightdate;
private String waybillnosecondary;
private String remark;
private String status;
private String receiption;
private String customcode;
private String reason;
private String contactname;
private String contacttel;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption == null ? null : receiption.trim();
}
public String getCustomcode() {
return customcode;
}
public void setCustomcode(String customcode) {
this.customcode = customcode == null ? null : customcode.trim();
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason == null ? null : reason.trim();
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname == null ? null : contactname.trim();
}
public String getContacttel() {
return contacttel;
}
public void setContacttel(String contacttel) {
this.contacttel = contacttel == null ? null : contacttel.trim();
}
public MANIFESTLOAD() {
}
public MANIFESTLOAD(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
if(!customReception.getWayBillSecond().isEmpty()){
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.waybillnosecondary = awbhArr[1];
}
this.flightno = customReception.getFlightNo();
this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
}
@Override
public int secondAnalysisReception(){
//更新分单回执
int i = manifestloadMapper.updateRECEIPTION(this);
//获取分单autoid
List<MANIFESTLOAD> secondaryList = manifestloadMapper.selectAutoIdByawbAawbH(this);
if(!secondaryList.isEmpty()){
MANIFESTLOAD arrivedSecond = secondaryList.get(0);
String autoId = arrivedSecond.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
int ii = sendLogService.insertSendlog("MT8202",receiption,autoId);
//todo:同时更新发送日志表的回执信息
if (i>0 && ii>0 ){
log.info("运单号 {} 落装分单回执更新成功",waybillnosecondary);
return 1;
}
}else {
//todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
}
return 0;
}
}