作者 朱兆平

优化多线程全部业务ok

... ... @@ -132,7 +132,7 @@ jwt:
#自定义配置
custom:
#进港放行回执读取目录
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/20191018
#回执解析成功后的备份目录
receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
#解析错误报文的备份目录
... ...
... ... @@ -247,7 +247,7 @@ public class CustomXmlHandleThread implements Runnable{
i= allocatearrival.masterAnalysisReception();
break;
case "MT8205":
transXmlHandel(document,customReception);
i = transXmlHandel(document,customReception);
break;
default:
break;
... ...
... ... @@ -14,8 +14,6 @@ import java.util.List;
@Slf4j
public class ALLOCATEARRIVAL extends WlptBaseModel{
private String id;
private Date createdate;
... ... @@ -176,7 +174,7 @@ public class ALLOCATEARRIVAL extends WlptBaseModel{
String autoId = departuresloading1.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:"+waybillno+"->id="+id);
log.info("即将插入回执日志运单号为:"+waybillno+"->id="+autoId);
int ii =sendLogService.insertSendlog("MT3202",receiptinformation,autoId);
if (i>0 && ii>0){
... ...
... ... @@ -71,8 +71,7 @@ public class ARRIVEDMASTER extends WlptBaseModel {
}
public ARRIVEDMASTER(CustomReception customReception) {
init();
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
this.setFlightno(flightInfo[1]);
... ...
... ... @@ -297,7 +297,7 @@ public class ARRIVEDSECONDARY extends WlptBaseModel {
}
public ARRIVEDSECONDARY(CustomReception customReception) {
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.waybillnosecondary = awbhArr[1];
... ...
... ... @@ -187,7 +187,7 @@ public class DEPARTURESLOADING extends WlptBaseModel {
}
public DEPARTURESLOADING(CustomReception customReception) {
init();
this.waybillno = customReception.getWayBillMaster();
this.waybillno = AWBTools.awbFormat(customReception.getWayBillMaster());
this.flightno = customReception.getFlightNo();
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
... ...
... ... @@ -222,7 +222,7 @@ public class INTERNATIONALTRANSIT extends WlptBaseModel {
this.originalFlightdate = DateUtil.formatByyyyyMMdd(customReception.getImportFlightDate());
this.originalBillno = AWBTools.awbFormat(customReception.getImportWaybillMaster());
//TODO:碰见分单回执再解析
this.originalSubNumber = originalSubNumber;
this.originalSubNumber = customReception.getWayBillSecond();
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
... ...
... ... @@ -457,7 +457,7 @@ public class ORIGINMANIFESTMASTER extends WlptBaseModel {
}
public ORIGINMANIFESTMASTER(CustomReception customReception) {
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.flightno = customReception.getFlightNo();
this.receiptinformation = customReception.getResponseText();
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
... ...
... ... @@ -335,7 +335,7 @@ public class Originmanifestsecondary extends WlptBaseModel {
}
public Originmanifestsecondary(CustomReception customReception) {
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.waybillnosecondary = customReception.getWayBillSecond().split("_")[1];
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
... ...
... ... @@ -403,7 +403,7 @@ public class PREPAREMASTER extends WlptBaseModel {
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.flightdate=DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
}
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiptinformation = customReception.getResponseText();
}
... ...
... ... @@ -811,7 +811,7 @@ public class PREPARESECONDARY extends WlptBaseModel {
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
this.setFlightno(flightInfo[1]);
this.setCarrier(flightInfo[0]);
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.waybillnosecondary = customReception.getWayBillSecond().split("_")[1];
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.flightdate= DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
... ...
... ... @@ -319,7 +319,7 @@ public class TALLYMASTER extends WlptBaseModel {
}
public TALLYMASTER(CustomReception customReception) {
this.customReceptionT=customReception;
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.flightno = customReception.getFlightNo();
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.flightdate= DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
... ...
... ... @@ -207,7 +207,7 @@ public class TALLYSECONDARY extends WlptBaseModel {
}
public TALLYSECONDARY(CustomReception customReception) {
this.customReceptionT = customReception;
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.waybillnosecondary = customReception.getWayBillSecond().split("_")[1];
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiptinformation = customReception.getResponseText();
... ...
... ... @@ -51,16 +51,16 @@ public class TaskAnalysis {
File fileDirectory = new File(readDir);
List<File> files = FileTool.readDirectoryFiles(fileDirectory);
//文件数量大于50个,每次只解析前50个
if (files!=null && !files.isEmpty() && files.size()>50){
CountDownLatch latch = new CountDownLatch(50);
log.trace("解析任务开始{},文件数量:{}",startTime,50);
for (int i=0;i<50;i++){
if (files!=null && !files.isEmpty() && files.size()>10){
CountDownLatch latch = new CountDownLatch(10);
log.trace("解析任务开始{},文件数量:{}",startTime,10);
for (int i=0;i<10;i++){
threadJbob(files.get(i),latch,transToCfps,threadPool);
}
latch.await();
}
//文件数量小于50个,全部一次解析完
if (files!=null && !files.isEmpty() && files.size()<50){
if (files!=null && !files.isEmpty() && files.size()<10){
CountDownLatch latch = new CountDownLatch(files.size());
log.info("解析任务开始{},文件数量:{}",startTime,files.size());
for (int i=0;i<files.size();i++){
... ...
... ... @@ -7,7 +7,7 @@
<result column="WAYBILLNO" property="waybillno" jdbcType="VARCHAR" />
<result column="CARRIER" property="carrier" jdbcType="VARCHAR" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
<result column="FLIGHTDATE" property="flightdate" jdbcType="TIMESTAMP" />
<result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" />
<result column="CUSTOMOS" property="customos" jdbcType="VARCHAR" />
<result column="TALLYPIECES" property="tallypieces" jdbcType="VARCHAR" />
<result column="TALLYWEIGHT" property="tallyweight" jdbcType="VARCHAR" />
... ... @@ -140,7 +140,7 @@
AND
FLIGHTNO = #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=TIMESTAMP}
FLIGHTDATE= #{flightdate,jdbcType=DATE }
AND
WAYBILLNO = #{waybillno,jdbcType=VARCHAR}
</update>
... ... @@ -151,7 +151,7 @@
WHERE
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=TIMESTAMP}
FLIGHTDATE= #{flightdate,jdbcType=DATE}
AND
WAYBILLNO = #{waybillno,jdbcType=VARCHAR}
</select>
... ...