作者 朱兆平

优化多线程mt3202已OK

正在显示 25 个修改的文件 包含 560 行增加195 行删除
... ... @@ -132,12 +132,12 @@ jwt:
#自定义配置
custom:
#进港放行回执读取目录
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
#回执解析成功后的备份目录
receptBakDir: ./success
receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
#解析错误报文的备份目录
errBakDir: ./error
transmitDir: ./transmit
errBakDir: /Users/mrz/Downloads/rdp_temp/logs/error
transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
devops:
dir:
singlewindow-tcs-recept: D:\TCSSingleWindow\recive
... ...
... ... @@ -24,9 +24,9 @@
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>DEBUG</level>
</filter>
<!--<filter class="ch.qos.logback.classic.filter.ThresholdFilter">-->
<!--<level>trace</level>-->
<!--</filter>-->
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 windows系统这里设置成GBK-->
... ... @@ -144,6 +144,33 @@
</filter>
</appender>
<!-- 时间滚动输出 level为 trace 日志 -->
<appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_trace.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录trace级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>TRACE</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender>。<logger>仅有一个name属性,
... ... @@ -169,17 +196,26 @@
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--<logger name="com.tianbo.analysis" level="trace">-->
<!--&lt;!&ndash;<appender-ref ref="CONSOLE" />&ndash;&gt;-->
<!--<appender-ref ref="TRACE_FILE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--</logger>-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="org.springframework.boot" level="trace"/>
<!--<logger name="org.springframework.boot" level="trace"/>-->
<logger name="org.apache.tomcat" level="info" />
<logger name="com.tianbo.analysis.dao" level="DEBUG" />
<root level="INFO">
<root level="trace">
<appender-ref ref="CONSOLE" />
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<appender-ref ref="TRACE_FILE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
</springProfile>
... ... @@ -194,6 +230,7 @@
<appender-ref ref="INFO_FILE" />
<appender-ref ref="ERROR_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="TRACE_FILE" />
</root>
</springProfile>
... ...
... ... @@ -4,6 +4,7 @@
*/
package com.tianbo.analysis;
import com.tianbo.analysis.task.TaskAnalysis;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
... ... @@ -12,6 +13,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
... ...
package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.ALLOCATEARRIVAL;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.*;
import com.tianbo.analysis.service.imp.*;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.XML.XMLXPath;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.xml.sax.SAXParseException;
... ... @@ -21,6 +26,7 @@ import javax.annotation.PostConstruct;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.CountDownLatch;
/**
* @author mrz
... ... @@ -32,6 +38,7 @@ import java.io.UnsupportedEncodingException;
@Slf4j
public class CustomXmlHandleThread implements Runnable{
private CountDownLatch latch;
//备份目录
@Value("${custom.receptBakDir}")
private String bakupDir;
... ... @@ -40,10 +47,6 @@ public class CustomXmlHandleThread implements Runnable{
@Value("${custom.errBakDir}")
private String errBakDir;
//回执转发目录
@Value("${custom.transmit}")
private String transmitDir;
private File xmlfile;
private static CustomXmlHandleThread customXmlHandle;
//海关新舱单回执报头
... ... @@ -55,66 +58,43 @@ public class CustomXmlHandleThread implements Runnable{
public final static String SendTime = "//Manifest/Head/SendTime";
public final static String Version = "//Manifest/Head/Version";
//海关新舱单回执报体
/**
* 海关普通业务新舱单回执报体
*/
public final static String JourneyID = "//Manifest/Response/BorderTransportMeans/JourneyID";
public final static String WaybillMaster = "//Manifest/Response/Consignment/TransportContractDocument/ID";
public final static String WaybillSecond = "//Manifest/Response/Consignment/AssociatedTransportDocument/ID";
public final static String ResponseCode = "//Manifest/Response/Consignment/ResponseType/Code";
public final static String ResponseText = "//Manifest/Response/Consignment/ResponseType/Text";
@Autowired
private CoustomAnalysisService coustomAnalysisService;
@Autowired
private ARRIVEDMASTERService arrivedmasterService;
@Autowired
private TALLYMASTERService tallymasterService;
@Autowired
private DEPARTURESLOADINGService departuresloadingService;
@Autowired
private PREPAREMASTERService preparemasterService;
@Autowired
private ALLOCATEARRIVALService allocatearrivalService;
@Autowired
private INPORTALLOCATEService inportallocateService;
/**
* 海关国际转运业务回执报体
*/
public final static String ImportJourneyID = "//Manifest/Response/ImportInformation/BorderTransportMeans/JourneyID";
public final static String ImportWaybillMaster = "//Manifest/Response/ImportInformation/Consignment/TransportContractDocument/ID";
public final static String ExportJourneyID = "//Manifest/Response/ExportInformation/BorderTransportMeans/JourneyID";
public final static String ExportWaybillMaster = "//Manifest/Response/ExportInformation/Consignment/TransportContractDocument/ID";
public final static String TransResponseCode = "//Manifest/Response/ResponseType/Code";
public final static String TransResponseText = "//Manifest/Response/ResponseType/Text";
//通过@PostConstruct实现初始化bean之前进行的操作,解决service调用空指针问题
@PostConstruct
public void init() {
customXmlHandle = this;
customXmlHandle.coustomAnalysisService = this.coustomAnalysisService;
customXmlHandle.arrivedmasterService = this.arrivedmasterService;
customXmlHandle.tallymasterService = this.tallymasterService;
customXmlHandle.departuresloadingService = this.departuresloadingService;
customXmlHandle.preparemasterService = this.preparemasterService;
customXmlHandle.allocatearrivalService = this.allocatearrivalService;
customXmlHandle.inportallocateService = this.inportallocateService;
customXmlHandle.bakupDir = this.bakupDir;
customXmlHandle.errBakDir = this.errBakDir;
customXmlHandle.transmitDir = this.transmitDir;
// 初使化时将已静态化的testService实例化
}
@Override
public void run() {
log.info("线程:{}开始",xmlfile.getName());
try{
FileUtils.copyFileToDirectory(xmlfile,new File(customXmlHandle.transmitDir));
int i =handelXmlDocument();
String today = DateUtil.getTodayBy_yyyyMMdd();
String backdireByDay = customXmlHandle.bakupDir + "/" + today;
... ... @@ -128,12 +108,17 @@ public class CustomXmlHandleThread implements Runnable{
errBak(xmlfile);
}
}catch (FileExistsException e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
e.printStackTrace();
log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
}catch (Exception e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
errBak(xmlfile);
e.printStackTrace();
}
log.info("线程:{}结束",xmlfile.getName());
latch.countDown();
log.info("剩余线程数量{}",latch.getCount());
}
/**
*
... ... @@ -156,12 +141,11 @@ public class CustomXmlHandleThread implements Runnable{
String flightDate = "";
//开始解析
// fzeFoh.setGrossweightmeasureuc(XMLXPath.getSingleValueByPath(document,GrossWeightMeasureUc));
String msgType = XMLXPath.getSingleValueByPath(document,MessageType);
String journeyid = XMLXPath.getSingleValueByPath(document,JourneyID);
// XMLXPath.getSingleValueByPath(document, )
if(journeyid != null&& !journeyid.isEmpty()){
if(!StringUtils.isEmpty(journeyid)){
String[] flightList = journeyid.split("/");
if(flightList.length > 0){
... ... @@ -223,15 +207,57 @@ public class CustomXmlHandleThread implements Runnable{
i = customXmlHandle.inportallocateService.insertRecept(customReception);
break;
case "MT3202":
i = customXmlHandle.allocatearrivalService.insertRecept(customReception);
ALLOCATEARRIVAL allocatearrival = new ALLOCATEARRIVAL(customReception);
i= allocatearrival.analysisReception();
break;
case "MT8205":
transXmlHandel(document,customReception);
break;
default:
break;
}
return i;
}
/**
* 国际转运回执处理
* @param document
* @param customReception
* @return
*/
private int transXmlHandel(Document document,CustomReception customReception){
String importJourneyID = XMLXPath.getSingleValueByPath(document,ImportJourneyID);
String importFlightNo = "UNKONW";
String importFlightDate = "00000000";
if(!StringUtils.isEmpty(importJourneyID)){
importFlightNo = AWBTools.splitFlightAndDate(importJourneyID)[0];
importFlightDate = AWBTools.splitFlightAndDate(importJourneyID)[1];
}
String importWaybillMaster= XMLXPath.getSingleValueByPath(document,ImportWaybillMaster);
String transResponseCode=XMLXPath.getSingleValueByPath(document,TransResponseCode);
String transResponseText=XMLXPath.getSingleValueByPath(document,TransResponseText);
CustomReception transCustomReception = new CustomReception( customReception.getMessageType(),
importFlightNo,
importFlightDate,
importWaybillMaster,
transResponseCode,
transResponseText,
customReception.getMessageID(),
customReception.getSendTime(),
customReception.getSenderID(),
customReception.getReceiverID(),
customReception.getVersion(),
customReception.getFunctionCode());
int i=customXmlHandle.internationaltransitService.insertRecept(transCustomReception);
return i;
}
public void errBak(File file){
... ... @@ -240,10 +266,9 @@ public class CustomXmlHandleThread implements Runnable{
String errDirByDay = customXmlHandle.errBakDir + "/" + today;
File berrDirectory = new File(errDirByDay);
FileUtils.moveFileToDirectory(file,berrDirectory,true);
log.error("解析或其他错误备份文件:"+File.pathSeparator);
log.info("数据库未找到与回执适配的信息备份文件:{}:"+file.getName());
}catch (FileExistsException e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
e.printStackTrace();
log.error("备份解析错误文件失败,目标文件夹存在同名文件{}",file.getName());
}catch (Exception e){
e.printStackTrace();
}
... ...
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.SpringBeanUtitl;
import com.tianbo.analysis.dao.ALLOCATEARRIVALMapper;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.service.SendLogService;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import java.util.Date;
import java.util.List;
@Slf4j
@Data
public class ALLOCATEARRIVAL {
private ALLOCATEARRIVALMapper allocatearrivalMapper;
private SendLogService sendLogService;
private String id;
private Date createdate;
... ... @@ -29,6 +47,33 @@ public class ALLOCATEARRIVAL {
private String receiptinformation;
private CustomReception customReception;
public ALLOCATEARRIVAL(){
}
public ALLOCATEARRIVAL(CustomReception customReception){
this.customReception = customReception;
this.waybillno = customReception.getWayBillMaster();
this.receiptinformation = customReception.getResponseText();
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
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()));
}
//处理多线程时 springboot 无法注入bean的问题
if (this.allocatearrivalMapper==null){
this.allocatearrivalMapper = SpringBeanUtitl.getBean(ALLOCATEARRIVALMapper.class);
}
if (this.sendLogService==null){
this.sendLogService = SpringBeanUtitl.getBean(SendLogService.class);
}
}
public String getId() {
return id;
}
... ... @@ -132,4 +177,24 @@ public class ALLOCATEARRIVAL {
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
}
public int analysisReception(){
int i= allocatearrivalMapper.updateRECEIPTION(this);
//获取主单autoid
List<ALLOCATEARRIVAL> arrivedmasterList = allocatearrivalMapper.selectAutoIdByAwb(this);
if(!arrivedmasterList.isEmpty()){
ALLOCATEARRIVAL departuresloading1 = arrivedmasterList.get(0);
String autoId = departuresloading1.getId();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+waybillno+"->id="+id);
int ii =sendLogService.insertSendlog("MT3202",receiptinformation,autoId);
if (i>0 && ii>0){
return 1;
}
}
return 0;
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,7 @@ import lombok.Data;
@Data
public class CustomReception {
//回执报头
private String messageID;
private String functionCode;
private String messageType;
... ... @@ -11,6 +12,8 @@ public class CustomReception {
private String receiverID;
private String sendTime;
private String version;
//一般业务回执
private String flightNo;
private String flightDate;
private String wayBillMaster;
... ... @@ -18,6 +21,14 @@ public class CustomReception {
private String responseCode;
private String responseText;
//国际转运回执
private String importFlightDate;
private String importFlightNo;
private String importWaybillMaster;
private String exportFlightDate;
private String exportFlightNo;
private String exportWaybillMaster;
public CustomReception(String messageType,
String flightNo,
String flightDate,
... ... @@ -45,4 +56,30 @@ public class CustomReception {
this.version = version;
this.functionCode = functionCode;
}
public CustomReception(String messageType,
String importFlightNo,
String importFlightDate,
String importWaybillMaster,
String transResponseCode,
String transResponseText,
String messageID,
String sendTime,
String senderID,
String receiverID,
String version,
String functionCode){
this.messageType = messageType;
this.importFlightNo = importFlightNo;
this.importFlightDate = importFlightDate;
this.importWaybillMaster = importWaybillMaster;
this.responseCode = transResponseCode;
this.responseText = transResponseText;
this.messageID = messageID;
this.sendTime = sendTime;
this.senderID =senderID;
this.receiverID = receiverID;
this.version = version;
this.functionCode = functionCode;
}
}
... ...
package com.tianbo.analysis.service;
package com.tianbo.analysis.model;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.imp.CoustomAnalysisServiceImp;
... ... @@ -7,11 +7,13 @@ import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.scheduling.annotation.Async;
import java.util.Date;
@Slf4j
public class NmmsBaseService {
@Async
public class NmmsBase {
public ShareServiceImp shareServiceImp;
public CoustomAnalysisServiceImp coustomAnalysisServiceImp;
... ... @@ -25,6 +27,7 @@ public class NmmsBaseService {
public Date flightDate;
public int insertRecept(CustomReception customReception){
log.warn("公共对象监控打印{}",this);
this.shareServiceImp = new ShareServiceImp();
// 发送日志 插入
this.coustomAnalysisServiceImp = new CoustomAnalysisServiceImp();
... ...
package com.tianbo.analysis.service;
public interface SendLogService {
int insertSendlog(String type,String reception,String autoId);
}
... ...
... ... @@ -2,17 +2,14 @@ package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.ALLOCATEARRIVALMapper;
import com.tianbo.analysis.model.ALLOCATEARRIVAL;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.ALLOCATEARRIVALService;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -21,7 +18,8 @@ import java.util.List;
*/
@Service
@Slf4j
public class ALLOCATEARRIVALServiceImp extends NmmsBaseService implements ALLOCATEARRIVALService {
@Async
public class ALLOCATEARRIVALServiceImp extends NmmsBase implements ALLOCATEARRIVALService {
@Autowired
ALLOCATEARRIVALMapper allocatearrivalMapper;
... ...
... ... @@ -4,15 +4,13 @@ import com.tianbo.analysis.dao.ARRIVEDMASTERMapper;
import com.tianbo.analysis.dao.ARRIVEDSECONDARYMapper;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.ARRIVEDMASTERService;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -21,7 +19,8 @@ import java.util.List;
*/
@Service
@Slf4j
public class ARRIVEDMASTERServiceImp extends NmmsBaseService implements ARRIVEDMASTERService{
@Async
public class ARRIVEDMASTERServiceImp extends NmmsBase implements ARRIVEDMASTERService{
@Autowired
... ...
... ... @@ -4,17 +4,15 @@ import com.tianbo.analysis.bean.SpringBeanUtitl;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.dao.OriginmanifestsecondaryMapper;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.Originmanifestsecondary;
import com.tianbo.analysis.model.SENDLOG;
import com.tianbo.analysis.service.CoustomAnalysisService;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.util.Helper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
... ... @@ -27,7 +25,8 @@ import java.util.List;
*/
@Service
@Slf4j
public class CoustomAnalysisServiceImp extends NmmsBaseService implements CoustomAnalysisService {
@Async
public class CoustomAnalysisServiceImp extends NmmsBase implements CoustomAnalysisService {
@Autowired
SENDLOGMapper sendlogMapper;
... ... @@ -41,6 +40,12 @@ public class CoustomAnalysisServiceImp extends NmmsBaseService implements Cousto
if (this.sendlogMapper==null){
this.sendlogMapper = SpringBeanUtitl.getBean(SENDLOGMapper.class);
}
if (this.originmanifestmasterMapper==null){
this.originmanifestmasterMapper = SpringBeanUtitl.getBean(ORIGINMANIFESTMASTERMapper.class);
}
if (this.originmanifestsecondaryMapper==null){
this.originmanifestsecondaryMapper = SpringBeanUtitl.getBean(OriginmanifestsecondaryMapper.class);
}
}
@Override
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.DEPARTURESLOADINGMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.DEPARTURESLOADING;
import com.tianbo.analysis.service.DEPARTURESLOADINGService;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.analysis.model.NmmsBase;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -20,7 +17,8 @@ import java.util.List;
*/
@Service
@Slf4j
public class DEPARTURESLOADINGServiceImp extends NmmsBaseService implements DEPARTURESLOADINGService{
@Async
public class DEPARTURESLOADINGServiceImp extends NmmsBase implements DEPARTURESLOADINGService{
@Autowired
DEPARTURESLOADINGMapper departuresloadingMapper;
... ...
package com.tianbo.analysis.service.imp;
import com.fasterxml.jackson.databind.annotation.JsonAppend;
import com.tianbo.analysis.dao.INPORTALLOCATEMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.INPORTALLOCATE;
import com.tianbo.analysis.service.INPORTALLOCATEService;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -23,7 +19,8 @@ import java.util.List;
@Service
@Slf4j
public class INPORTALLOCATEServiceImp extends NmmsBaseService implements INPORTALLOCATEService{
@Async
public class INPORTALLOCATEServiceImp extends NmmsBase implements INPORTALLOCATEService{
@Autowired
INPORTALLOCATEMapper inportallocateMapper;
... ...
... ... @@ -4,13 +4,14 @@ import com.tianbo.analysis.dao.INTERNATIONALTRANSITMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.INTERNATIONALTRANSIT;
import com.tianbo.analysis.service.INTERNATIONALTRANSITService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -19,72 +20,55 @@ import java.util.List;
*/
@Service
@Slf4j
public class INTERNATIONALTRANSITServiceImp implements INTERNATIONALTRANSITService{
@Async
public class INTERNATIONALTRANSITServiceImp extends NmmsBase implements INTERNATIONALTRANSITService{
@Autowired
INTERNATIONALTRANSITMapper internationaltransitMapper;
@Override
public int insertRecept(CustomReception customReception) {
ShareServiceImp shareServiceImp = new ShareServiceImp();
// 发送日志 插入
CoustomAnalysisServiceImp coustomAnalysisServiceImp = new CoustomAnalysisServiceImp();
// 主单号
String awbA = customReception.getWayBillMaster();
//回执内容
String reception = customReception.getResponseText();
String flightDateStr = customReception.getFlightDate();
if (!StringUtils.isEmpty(flightDateStr)) {
Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
//设置主单回执、航班号、航班日期
INTERNATIONALTRANSIT inportallocate = new INTERNATIONALTRANSIT();
inportallocate.setReceiption(reception);
inportallocate.setOriginalFlightno(customReception.getFlightNo().substring(2));
inportallocate.setOriginalFlightdate(flightDate);
if (awbA!=null && awbA.length()>0){
StringBuffer stringBuffer = new StringBuffer(awbA);
stringBuffer.insert(3,"-");
awbA = stringBuffer.toString();
public int insertRecept(CustomReception customReception){
super.insertRecept(customReception);
log.info("开始解析:运单号 {} 回执类型:{} ",customReception.getImportWaybillMaster(),customReception.getMessageType());
return master();
}
//设置主分单的 主单号
inportallocate.setOriginalBillno(awbA);
@Override
public int master() {
//设置主单回执、航班号、航班日期
INTERNATIONALTRANSIT inportallocate = new INTERNATIONALTRANSIT();
inportallocate.setReceiption(customReception.getResponseText());
String[] flightInfo = AWBTools.splitFlight(customReception.getImportFlightNo());
inportallocate.setOriginalFlightno(flightInfo[1]);
inportallocate.setOriginalCarrier(flightInfo[0]);
inportallocate.setOriginalFlightdate(DateUtil.formatByyyyyMMdd(customReception.getImportFlightDate()));
//设置主分单的 主单号
inportallocate.setOriginalBillno(AWBTools.awbFormat(customReception.getImportWaybillMaster()));
inportallocate.setStatus(AWBTools.transCusRspCode(customReception.getResponseCode()));
//更新主单回执
int i = internationaltransitMapper.updateRECEIPTION(inportallocate);
//获取分单autoid
List<INTERNATIONALTRANSIT> internationaltransits = internationaltransitMapper.selectAutoIdByAwb(inportallocate);
if(!internationaltransits.isEmpty()){
INTERNATIONALTRANSIT internationaltransit = internationaltransits.get(0);
String autoId = internationaltransit.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
int ii =coustomAnalysisServiceImp.insertSendlog("MT8205",reception,autoId);
int iii = shareServiceImp.updateMessages(customReception);
if (i>0 && ii>0){
log.info("运单号 {} 国际转运回执更新成功",customReception.getImportWaybillMaster());
return 1;
}
// 判断航班号 航班日期 是否为空
if (flightDate != null && customReception.getFlightNo() != null){
//处理主单格式,将海关回执的主单号58019316861,变为580-19316861
if (awbA!=null && awbA.length()>0){
//更新主单回执
int i = internationaltransitMapper.updateRECEIPTION(inportallocate);
//获取分单autoid
List<INTERNATIONALTRANSIT> arrivedmasterList = internationaltransitMapper.selectAutoIdByAwb(inportallocate);
if(!arrivedmasterList.isEmpty()){
INTERNATIONALTRANSIT departuresloading1 = arrivedmasterList.get(0);
String autoId = departuresloading1.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
int ii =coustomAnalysisServiceImp.insertSendlog("MT8205",reception,autoId);
int iii = shareServiceImp.updateMessages(customReception);
if (i>0 && ii>0 && iii > 0){
return 1;
}
}
return 0;
}
}else {
return shareServiceImp.share("MT8205", customReception);
if (iii > 0){
return 1;
}
}
//未进入主分单解析 返回0 失败
return 0;
}
}
... ...
... ... @@ -2,17 +2,16 @@ package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.PREPAREMASTERMapper;
import com.tianbo.analysis.dao.PREPARESECONDARYMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.model.PREPARESECONDARY;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.service.PREPAREMASTERService;
import com.tianbo.analysis.tools.AWBTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -21,7 +20,8 @@ import java.util.List;
*/
@Service
@Slf4j
public class PREPAREMASTERServiceImp extends NmmsBaseService implements PREPAREMASTERService {
@Async
public class PREPAREMASTERServiceImp extends NmmsBase implements PREPAREMASTERService {
@Autowired
PREPAREMASTERMapper preparemasterMapper;
... ... @@ -38,6 +38,10 @@ public class PREPAREMASTERServiceImp extends NmmsBaseService implements PREPAREM
// 设置 接收运抵分单 回执
PREPARESECONDARY preparesecondary = new PREPARESECONDARY();
preparesecondary.setReceiptinformation(reception);
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
preparesecondary.setFlightno(flightInfo[1]);
preparesecondary.setCarrier(flightInfo[0]);
preparesecondary.setFlightdate(flightDate);
//设置主分单的 主单号
preparesecondary.setWaybillnomaster(awbA);
//取分单号
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.model.SENDLOG;
import com.tianbo.analysis.service.SendLogService;
import com.tianbo.util.Helper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Date;
@Service
@Slf4j
public class SendLogServiceImp implements SendLogService{
@Autowired
private SENDLOGMapper sendlogMapper;
@Override
public int insertSendlog(String type,String reception,String autoId){
SENDLOG sendlog = new SENDLOG();
sendlog.setAutoid(Helper.getUUID());
sendlog.setCreatedate(new Date());
sendlog.setMessageautoid(autoId);
sendlog.setMessagetype(type);
sendlog.setReceiption(reception);
sendlog.setSendpeice(new Long(0));
sendlog.setSendweight(new BigDecimal(0));
int i = sendlogMapper.insertSelective(sendlog);
if (i>0){
log.info("插入回执日志成功,插入数据量为:"+i);
}
return i;
}
}
... ...
... ... @@ -2,18 +2,15 @@ package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.TALLYMASTERMapper;
import com.tianbo.analysis.dao.TALLYSECONDARYMapper;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.model.TALLYMASTER;
import com.tianbo.analysis.model.TALLYSECONDARY;
import com.tianbo.analysis.service.NmmsBaseService;
import com.tianbo.analysis.model.NmmsBase;
import com.tianbo.analysis.service.TALLYMASTERService;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
... ... @@ -24,7 +21,8 @@ import java.util.List;
@Service
@Slf4j
public class TALLYMASTERServiceImp extends NmmsBaseService implements TALLYMASTERService{
@Async
public class TALLYMASTERServiceImp extends NmmsBase implements TALLYMASTERService{
@Autowired
TALLYMASTERMapper tallymasterMapper;
... ... @@ -80,6 +78,7 @@ public class TALLYMASTERServiceImp extends NmmsBaseService implements TALLYMASTE
tallysecondary.setStatus(nmsStatusCode);
//设置主分单的 主单号
tallysecondary.setWaybillnomaster(awbA);
log.info("开始解析主单的{}分单{}",awbA,awbH);
//取分单号
String[] awbhArr = awbH.split("_");
String awbh = awbhArr[1];
... ...
... ... @@ -4,13 +4,17 @@ import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.IO.FileTool;
import com.tianbo.analysis.handle.CustomXmlHandleThread;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.File;
import java.util.Iterator;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
/**
* 回执解析定时任务
... ... @@ -23,31 +27,91 @@ public class TaskAnalysis {
@Value("${custom.receptDirectory}")
private String receptDir;
@Scheduled(fixedDelay = 500000)
//回执转发目录
@Value("${custom.transmitDir}")
private String transmitDir;
@Scheduled(fixedRate = 5000)
public void startTask(){
final SimpleDateFormat sdf = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
final String startTime = sdf.format(new Date());
//设置转发文件夹
String today = DateUtil.getTodayBy_yyyyMMdd();
String transToCfps = transmitDir + "/" + today;
//回执目录
String readDir = receptDir;
try{
//初始化线程池
ThreadPoolExecutor threadPool = XMLThreadPoolFactory.instance();
try {
File fileDirectory = new File(readDir);
List<File> files = FileTool.readDirectoryFiles(fileDirectory);
Iterator<File> it = files.iterator();
while(it.hasNext()){
File file = it.next();
try {
CustomXmlHandleThread customXmlHandleThread = new CustomXmlHandleThread();
customXmlHandleThread.setXmlfile(file);
Thread thread = new Thread(customXmlHandleThread);
thread.start();
}catch (Exception e){
e.printStackTrace();
log.error("解析回执出错",e);
}
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++){
threadJbob(files.get(i),latch,transToCfps,threadPool);
}
latch.await();
}
//文件数量小于50个,全部一次解析完
if (files!=null && !files.isEmpty() && files.size()<50){
CountDownLatch latch = new CountDownLatch(files.size());
log.info("解析任务开始{},文件数量:{}",startTime,files.size());
for (int i=0;i<files.size();i++){
threadJbob(files.get(i),latch,transToCfps,threadPool);
}
latch.await();
}
// Iterator<File> it = files.iterator();
// while (it.hasNext()) {
// if (threadPool.getActiveCount() < 100) {
// File file = it.next();
// try {
// FileUtils.copyFileToDirectory(file, new File(transToCfps));
// } catch (IOException e) {
// e.printStackTrace();
// log.error("复制报文{}到回执转发目录失败", file.getName());
// }
//
// try {
// CustomXmlHandleThread customXmlHandleThread = new CustomXmlHandleThread();
// customXmlHandleThread.setXmlfile(file);
// threadPool.execute(customXmlHandleThread);
// } catch (Exception e) {
// e.printStackTrace();
// log.error("解析回执出错", e);
// }
// }
// }
}catch (Exception e){
e.printStackTrace();
log.error("获取目录文件出错",e);
}
log.info("解析任务结束{}",sdf.format(new Date()));
}
private void threadJbob(File file,CountDownLatch latch,String transToCfps,ThreadPoolExecutor threadPool){
try{
FileUtils.copyFileToDirectory(file, new File(transToCfps));
CustomXmlHandleThread customXmlHandleThread = new CustomXmlHandleThread();
customXmlHandleThread.setXmlfile(file);
customXmlHandleThread.setLatch(latch);
threadPool.execute(customXmlHandleThread);
}catch (IOException e){
log.error("备份文件{}出错,错误代码:{}",file,e);
}catch (Exception e){
log.error("线程解析出错{}",e);
}
}
}
... ...
package com.tianbo.analysis.task;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadFactory;
public class XMLThreadFactory implements ThreadFactory {
private int counter;
private String name;
private List<String> stats;
public XMLThreadFactory(String name)
{
counter = 1;
this.name = name;
stats = new ArrayList<String>();
}
@Override
public Thread newThread(Runnable runnable)
{
Thread t = new Thread(runnable, name + "-Thread_" + counter);
counter++;
stats.add(String.format("Created thread %d with name %s on %s \n", t.getId(), t.getName(), new Date()));
return t;
}
public String getStats()
{
StringBuffer buffer = new StringBuffer();
Iterator<String> it = stats.iterator();
while (it.hasNext())
{
buffer.append(it.next());
}
return buffer.toString();
}
}
... ...
package com.tianbo.analysis.task;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class XMLThreadPoolFactory {
private static ThreadPoolExecutor threadPool;
public static ThreadPoolExecutor instance(){
if (threadPool==null){
XMLThreadFactory xmlThreadFactory = new XMLThreadFactory("xml");
threadPool = new ThreadPoolExecutor(5, 100,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024),
xmlThreadFactory,
new ThreadPoolExecutor.AbortPolicy());
}
return threadPool;
}
}
... ...
... ... @@ -14,6 +14,11 @@ public class AWBTools {
return "";
}
/**
* 将航班号拆分成承运人及航班
* @param flightNo
* @return 返回数组 [0]为承运人 [1]为航班号
*/
public static String[] splitFlight(String flightNo){
String[] flight = {"UNKONW","UNKONW"};
if (!StringUtils.isEmpty(flightNo) && flightNo.length()>2){
... ... @@ -24,6 +29,23 @@ public class AWBTools {
}
/**
* 拆分航班号与航班日期 CV7302/20190826
* @param flightNoAndDate
* @return [0] CV7302 [1]20190826
*/
public static String[] splitFlightAndDate(String flightNoAndDate){
String[] flight = {"UNKONW","UNKONW"};
if(!StringUtils.isEmpty(flightNoAndDate)){
String[] flightList = flightNoAndDate.split("/");
if(flightList.length > 0){
flight[0] = flightList[0];
flight[1] = flightList[1];
}
}
return flight;
}
/**
* 将海关回执中的response code 转换成新舱单1.0数据库中的相关状态,相关状态码参考readme.md
* @param rspCode
* @return
... ...
... ... @@ -124,7 +124,7 @@
AND
FLIGHTNO = #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=DATE}
FLIGHTDATE= #{flightdate,jdbcType=DATE}
AND
WAYBILLNO = #{waybillno,jdbcType=VARCHAR}
</update>
... ... @@ -135,7 +135,7 @@
WHERE
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=DATE}
FLIGHTDATE= #{flightdate,jdbcType=DATE}
AND
WAYBILLNO = #{waybillno,jdbcType=VARCHAR}
</select>
... ...
... ... @@ -172,21 +172,27 @@
<update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" >
UPDATE INTERNATIONALTRANSIT
SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR}
WHERE ORIGINAL_FLIGHTNO = #{originalFlightno,jdbcType=VARCHAR}
SET RECEIPTION= #{receiption,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR }
WHERE
ORIGINAL_FLIGHTNO = #{originalFlightno,jdbcType=VARCHAR}
AND
ORIGINAL_CARRIER = #{originalCarrier,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=TIMESTAMP}
ORIGINAL_FLIGHTDATE= #{originalFlightdate,jdbcType=DATE}
AND
WAYBILLNO = #{waybillno,jdbcType=VARCHAR}
ORIGINAL_BILLNO = #{originalBillno,jdbcType=VARCHAR}
</update>
<select id="selectAutoIdByAwb" parameterType="com.tianbo.analysis.model.INTERNATIONALTRANSIT" resultType="com.tianbo.analysis.model.INTERNATIONALTRANSIT">
SELECT ID
SELECT AUTOID
FROM INTERNATIONALTRANSIT
WHERE
ORIGINAL_FLIGHTNO= #{originalFlightno,jdbcType=VARCHAR}
AND
ORIGINAL_FLIGHTDATE= #{originalFlightdate,jdbcType=TIMESTAMP}
ORIGINAL_CARRIER = #{originalCarrier,jdbcType=VARCHAR}
AND
ORIGINAL_FLIGHTDATE= #{originalFlightdate,jdbcType=DATE}
AND
ORIGINAL_BILLNO = #{originalBillno,jdbcType=VARCHAR}
</select>
... ...
... ... @@ -4,7 +4,7 @@
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.PREPAREMASTER" >
<result column="AUTOID" property="autoid" 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="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
... ... @@ -310,9 +310,10 @@
UPDATE PREPAREMASTER
SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR }
WHERE FLIGHTNO = #{flightno,jdbcType=VARCHAR}
WHERE
FLIGHTNO = #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=TIMESTAMP}
FLIGHTDATE= #{flightdate,jdbcType=DATE }
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND
... ... @@ -325,7 +326,7 @@
WHERE
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightDate,jdbcType=TIMESTAMP}
FLIGHTDATE= #{flightdate,jdbcType=TIMESTAMP}
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
... ...
... ... @@ -20,7 +20,7 @@
<result column="CREATOR" jdbcType="DECIMAL" property="creator" />
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
<result column="FLIGHTNO" jdbcType="VARCHAR" property="flightno" />
<result column="FLIGHTDATE" jdbcType="TIMESTAMP" property="flightdate" />
<result column="FLIGHTDATE" jdbcType="DATE" property="flightdate" />
<result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingstation" />
<result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationstation" />
<result column="AGENTCOMPANYCODE" jdbcType="VARCHAR" property="agentcompanycode" />
... ... @@ -968,9 +968,18 @@
<update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.PREPARESECONDARY" >
UPDATE PREPARESECONDARY
SET RECEIPTION= #{receiption,jdbcType=VARCHAR}
WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=VARCHAR }
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND
WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
AND
FLIGHTNO = #{flightno,jdbcType=VARCHAR}
AND
FLIGHTDATE= #{flightdate,jdbcType=DATE }
AND
CARRIER = #{carrier,jdbcType=VARCHAR}
</update>
<select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.PREPARESECONDARY" resultType="com.tianbo.analysis.model.PREPARESECONDARY">
... ...