|
@@ -2,6 +2,7 @@ package com.tianbo.analysis.handle; |
|
@@ -2,6 +2,7 @@ package com.tianbo.analysis.handle; |
2
|
|
2
|
|
3
|
import com.tianbo.analysis.model.*;
|
3
|
import com.tianbo.analysis.model.*;
|
4
|
import com.tianbo.analysis.service.CustomMessageService;
|
4
|
import com.tianbo.analysis.service.CustomMessageService;
|
|
|
5
|
+import com.tianbo.analysis.service.SendLogService;
|
5
|
import com.tianbo.analysis.tools.AWBTools;
|
6
|
import com.tianbo.analysis.tools.AWBTools;
|
6
|
import com.tianbo.util.Date.DateUtil;
|
7
|
import com.tianbo.util.Date.DateUtil;
|
7
|
import com.tianbo.util.XML.XMLXPath;
|
8
|
import com.tianbo.util.XML.XMLXPath;
|
|
@@ -15,6 +16,7 @@ import org.dom4j.DocumentException; |
|
@@ -15,6 +16,7 @@ import org.dom4j.DocumentException; |
15
|
import org.dom4j.Element;
|
16
|
import org.dom4j.Element;
|
16
|
import org.dom4j.Node;
|
17
|
import org.dom4j.Node;
|
17
|
import org.dom4j.io.SAXReader;
|
18
|
import org.dom4j.io.SAXReader;
|
|
|
19
|
+import org.springframework.beans.factory.annotation.Autowired;
|
18
|
import org.springframework.beans.factory.annotation.Value;
|
20
|
import org.springframework.beans.factory.annotation.Value;
|
19
|
import org.springframework.stereotype.Component;
|
21
|
import org.springframework.stereotype.Component;
|
20
|
import org.xml.sax.SAXParseException;
|
22
|
import org.xml.sax.SAXParseException;
|
|
@@ -54,6 +56,9 @@ public class CustomXmlHandleThread implements Runnable{ |
|
@@ -54,6 +56,9 @@ public class CustomXmlHandleThread implements Runnable{ |
54
|
@Value("${custom.delTechnologyReceptMatch}")
|
56
|
@Value("${custom.delTechnologyReceptMatch}")
|
55
|
private String delTechnologyReceptMatch;
|
57
|
private String delTechnologyReceptMatch;
|
56
|
|
58
|
|
|
|
59
|
+ @Autowired
|
|
|
60
|
+ SendLogService sendLogService;
|
|
|
61
|
+
|
57
|
private File xmlfile;
|
62
|
private File xmlfile;
|
58
|
|
63
|
|
59
|
private static CustomXmlHandleThread customXmlHandle;
|
64
|
private static CustomXmlHandleThread customXmlHandle;
|
|
@@ -112,6 +117,7 @@ public class CustomXmlHandleThread implements Runnable{ |
|
@@ -112,6 +117,7 @@ public class CustomXmlHandleThread implements Runnable{ |
112
|
customXmlHandle.delTechnologyReceptMatch = this.delTechnologyReceptMatch;
|
117
|
customXmlHandle.delTechnologyReceptMatch = this.delTechnologyReceptMatch;
|
113
|
|
118
|
|
114
|
customXmlHandle.transmitDir = this.transmitDir;
|
119
|
customXmlHandle.transmitDir = this.transmitDir;
|
|
|
120
|
+ customXmlHandle.sendLogService = this.sendLogService;
|
115
|
|
121
|
|
116
|
// 初使化时将已静态化的testService实例化
|
122
|
// 初使化时将已静态化的testService实例化
|
117
|
}
|
123
|
}
|
|
@@ -144,7 +150,7 @@ public class CustomXmlHandleThread implements Runnable{ |
|
@@ -144,7 +150,7 @@ public class CustomXmlHandleThread implements Runnable{ |
144
|
}catch (FileExistsException e){
|
150
|
}catch (FileExistsException e){
|
145
|
log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
|
151
|
log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
|
146
|
}catch (Exception e){
|
152
|
}catch (Exception e){
|
147
|
- log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
|
153
|
+ log.error("解析出错,备份报文",e);
|
148
|
errBak(xmlfile);
|
154
|
errBak(xmlfile);
|
149
|
e.printStackTrace();
|
155
|
e.printStackTrace();
|
150
|
}
|
156
|
}
|
|
@@ -186,17 +192,19 @@ public class CustomXmlHandleThread implements Runnable{ |
|
@@ -186,17 +192,19 @@ public class CustomXmlHandleThread implements Runnable{ |
186
|
|
192
|
|
187
|
List<Node> ConsignmentNodes = XMLXPath.getPathValues(document,Consignment);
|
193
|
List<Node> ConsignmentNodes = XMLXPath.getPathValues(document,Consignment);
|
188
|
|
194
|
|
189
|
- String awbA = "",awbH="",resCode="",resText="";
|
195
|
+ String awbA=null ,awbH=null,resCode=null,resText= null;
|
190
|
|
196
|
|
191
|
//说明有带运单的回执
|
197
|
//说明有带运单的回执
|
192
|
if (!ConsignmentNodes.isEmpty()){
|
198
|
if (!ConsignmentNodes.isEmpty()){
|
193
|
for (Node node: ConsignmentNodes ) {
|
199
|
for (Node node: ConsignmentNodes ) {
|
194
|
- awbA = node.selectSingleNode(WaybillMaster_NODE).getStringValue();
|
200
|
+
|
195
|
//全格式的分单 如 17212345678_ADBD
|
201
|
//全格式的分单 如 17212345678_ADBD
|
196
|
- awbH = node.selectSingleNode(WaybillSecond_NODE).getStringValue();
|
|
|
197
|
- resCode = node.selectSingleNode(ResponseCode_NODE).getStringValue();
|
|
|
198
|
- resText = node.selectSingleNode(ResponseText_NODE).getStringValue();
|
|
|
199
|
- log.info("主单:{}-分单:{}-回执代码:{}-回执内容:{}",awbA,awbH,resCode,resText);
|
202
|
+ awbH = XMLXPath.getSingleValueByNodePath(node,WaybillSecond_NODE);
|
|
|
203
|
+ awbA = XMLXPath.getSingleValueByNodePath(node,WaybillMaster_NODE);
|
|
|
204
|
+ resCode = XMLXPath.getSingleValueByNodePath(node,ResponseCode_NODE);
|
|
|
205
|
+ resText = XMLXPath.getSingleValueByNodePath(node,ResponseText_NODE);
|
|
|
206
|
+
|
|
|
207
|
+ log.info("主单:{}-分单:{}-回执代码:{}-回执内容:{}",awbA, awbH,resCode,resText);
|
200
|
i =+ normalXmlHandel(msgType,
|
208
|
i =+ normalXmlHandel(msgType,
|
201
|
flightNo,
|
209
|
flightNo,
|
202
|
flightDate,
|
210
|
flightDate,
|
|
@@ -400,9 +408,10 @@ public class CustomXmlHandleThread implements Runnable{ |
|
@@ -400,9 +408,10 @@ public class CustomXmlHandleThread implements Runnable{ |
400
|
MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
|
408
|
MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
|
401
|
i= manifestlostchange.secondAnalysisReception();
|
409
|
i= manifestlostchange.secondAnalysisReception();
|
402
|
break;
|
410
|
break;
|
403
|
- case "MT8024":
|
411
|
+ case "MT8204":
|
404
|
PREPAREMASTER preparemaster1201= new PREPAREMASTER(customReception);
|
412
|
PREPAREMASTER preparemaster1201= new PREPAREMASTER(customReception);
|
405
|
- i = preparemaster1201.masterAnalysisReception();
|
413
|
+ preparemaster1201.masterAnalysisReception();
|
|
|
414
|
+ i = customXmlHandle.sendLogService .updateMT8204(customReception);
|
406
|
break;
|
415
|
break;
|
407
|
default:
|
416
|
default:
|
408
|
break;
|
417
|
break;
|