作者 朱兆平

8204解析BUG修复

... ... @@ -12,7 +12,7 @@
</parent>
<groupId>com.tianbo</groupId>
<artifactId>analysis</artifactId>
<version>1.13-Realese</version>
<version>1.16-Realese</version>
<name>customAnalysis</name>
<description>Analysis waybill recept</description>
<properties>
... ... @@ -101,7 +101,6 @@
<groupId>com.tianbo</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!--util依赖-->
... ...
... ... @@ -2,6 +2,7 @@ package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.CustomMessageService;
import com.tianbo.analysis.service.SendLogService;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.XML.XMLXPath;
... ... @@ -15,6 +16,7 @@ import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.xml.sax.SAXParseException;
... ... @@ -54,6 +56,9 @@ public class CustomXmlHandleThread implements Runnable{
@Value("${custom.delTechnologyReceptMatch}")
private String delTechnologyReceptMatch;
@Autowired
SendLogService sendLogService;
private File xmlfile;
private static CustomXmlHandleThread customXmlHandle;
... ... @@ -112,6 +117,7 @@ public class CustomXmlHandleThread implements Runnable{
customXmlHandle.delTechnologyReceptMatch = this.delTechnologyReceptMatch;
customXmlHandle.transmitDir = this.transmitDir;
customXmlHandle.sendLogService = this.sendLogService;
// 初使化时将已静态化的testService实例化
}
... ... @@ -144,7 +150,7 @@ public class CustomXmlHandleThread implements Runnable{
}catch (FileExistsException e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
}catch (Exception e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
log.error("解析出错,备份报文",e);
errBak(xmlfile);
e.printStackTrace();
}
... ... @@ -186,17 +192,19 @@ public class CustomXmlHandleThread implements Runnable{
List<Node> ConsignmentNodes = XMLXPath.getPathValues(document,Consignment);
String awbA = "",awbH="",resCode="",resText="";
String awbA=null ,awbH=null,resCode=null,resText= null;
//说明有带运单的回执
if (!ConsignmentNodes.isEmpty()){
for (Node node: ConsignmentNodes ) {
awbA = node.selectSingleNode(WaybillMaster_NODE).getStringValue();
//全格式的分单 如 17212345678_ADBD
awbH = node.selectSingleNode(WaybillSecond_NODE).getStringValue();
resCode = node.selectSingleNode(ResponseCode_NODE).getStringValue();
resText = node.selectSingleNode(ResponseText_NODE).getStringValue();
log.info("主单:{}-分单:{}-回执代码:{}-回执内容:{}",awbA,awbH,resCode,resText);
awbH = XMLXPath.getSingleValueByNodePath(node,WaybillSecond_NODE);
awbA = XMLXPath.getSingleValueByNodePath(node,WaybillMaster_NODE);
resCode = XMLXPath.getSingleValueByNodePath(node,ResponseCode_NODE);
resText = XMLXPath.getSingleValueByNodePath(node,ResponseText_NODE);
log.info("主单:{}-分单:{}-回执代码:{}-回执内容:{}",awbA, awbH,resCode,resText);
i =+ normalXmlHandel(msgType,
flightNo,
flightDate,
... ... @@ -400,9 +408,10 @@ public class CustomXmlHandleThread implements Runnable{
MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
i= manifestlostchange.secondAnalysisReception();
break;
case "MT8024":
case "MT8204":
PREPAREMASTER preparemaster1201= new PREPAREMASTER(customReception);
i = preparemaster1201.masterAnalysisReception();
preparemaster1201.masterAnalysisReception();
i = customXmlHandle.sendLogService .updateMT8204(customReception);
break;
default:
break;
... ...
... ... @@ -52,7 +52,7 @@ public class SendLogServiceImp implements SendLogService{
@Override
public int updateMT8204(CustomReception customReception) {
MANIFEST_AIR_CHANGE manifest_air_change = new MANIFEST_AIR_CHANGE();
manifest_air_change.setWaybillnomaster(customReception.getWayBillMaster());
manifest_air_change.setWaybillnomaster(AWBTools.awbFormat(customReception.getWayBillMaster()));
manifest_air_change.setFlightno(customReception.getFlightNo());
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
manifest_air_change.setFlightDate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
... ...
... ... @@ -56,9 +56,11 @@
SELECT
RECEIPTION,
MESSAGEAUTOID,
MESSAGETYPE,
ROW_NUMBER () OVER ( PARTITION BY MESSAGEAUTOID ORDER BY CREATEDATE DESC ) rn
FROM
SENDLOG
where MESSAGETYPE = 'MT8204'
) t2 ON t1.AUTOID = t2.MESSAGEAUTOID
AND t2.rn = 1
) t3
... ...