作者 朱兆平

解析回执并备份

... ... @@ -122,3 +122,11 @@ logging:
#Java Web Token 时效时间,单位秒
jwt:
max-alive: 300
#自定义配置
custom:
#进港放行回执读取目录
receptDirectory: /Users/mrz/Downloads/rdp_temp
#回执解析成功后的备份目录
receptBakDir: ./success
errBakDir: ./error
\ No newline at end of file
... ...
... ... @@ -25,7 +25,7 @@
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>trace</level>
<level>info</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
... ... @@ -186,7 +186,7 @@
<!--生产环境:输出到文件-->
<springProfile name="pro">
<logger name="org.springframework.boot" level="trace"/>
<logger name="org.springframework.boot" level="INFO"/>
<logger name="com.tianbo.analysis.dao" level="DEBUG" />
<root level="info">
<appender-ref ref="CONSOLE" />
... ...
... ... @@ -88,6 +88,7 @@
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util依赖-->
<!--&lt;!&ndash;IMF需要的包&ndash;&gt;-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans &ndash;&gt;-->
<!--<dependency>-->
... ...
# 通用IMF接收客户端框架
# 新舱单回执解析
* 配置文件为项目根目录下的config文件夹内,方便部署后的配置修改
* logback-dev.xml 为logback的配置文件
* application.yml 为spring boot的配置文件
* 已集成mybatis、mybatisGenerator、pageHelper
* 集成IMFjar包
* 集成Spring boot 及 srping cloud
* 集成定时任务框架
* 后端采用spring boot 2 ,配合前端框架使用。
* 集成Spring Cloud
* 集成lombok,简化部分代码录入,比如实体类,方便实体及表结构修改,敏捷开发必用,使用方法见[lombok集成使用说明](https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html)
)
* 集成websocket
* 可以在线查看imf客户端运行情况 web访问路径/log/imf,可查看项目logs目录下的imf.log
\ No newline at end of file
* 可以在线查看imf客户端运行情况 web访问路径/log/imf,可查看项目logs目录下的imf.log
* 打包jar散包 看这里 https://blog.csdn.net/m0_37202351/article/details/81738357
\ No newline at end of file
... ...
... ... @@ -12,19 +12,20 @@ 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.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
//@EnableScheduling
@EnableScheduling
@EnableDiscoveryClient
@EnableTransactionManagement
@MapperScan("com.tianbo.analysis.dao")
@ComponentScan({"com.tianbo.analysis"})
public class ImfClientApplication {
public class BootApplication {
public static void main(String[] args) {
SpringApplication.run(ImfClientApplication.class, args);
SpringApplication.run(BootApplication.class, args);
}
@Bean
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import java.util.List;
public interface ORIGINMANIFESTMASTERMapper {
int insert(ORIGINMANIFESTMASTER record);
int insertSelective(ORIGINMANIFESTMASTER record);
int updateRECEIPTION(ORIGINMANIFESTMASTER record);
List<ORIGINMANIFESTMASTER> selectAutoIdByAwb(ORIGINMANIFESTMASTER record);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.Originmanifestsecondary;
import java.util.List;
public interface OriginmanifestsecondaryMapper {
int insert(Originmanifestsecondary record);
int insertSelective(Originmanifestsecondary record);
int updateRECEIPTION(Originmanifestsecondary record);
List<Originmanifestsecondary> selectAutoIdByawbAawbH (Originmanifestsecondary record);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.SENDLOG;
public interface SENDLOGMapper {
int insert(SENDLOG record);
int insertSelective(SENDLOG record);
}
\ No newline at end of file
... ...
package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.CoustomAnalysisService;
import com.tianbo.util.XML.XMLXPath;
import org.apache.commons.io.FileUtils;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xml.sax.SAXParseException;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* @author mrz
* @e
* 海关新舱单回执解析xml文件
*/
@Component
public class CustomXmlHandle {
private static CustomXmlHandle customXmlHandle;
//海关新舱单回执报头
public final static String MessageID = "//Manifest/Head/MessageID";
public final static String FunctionCode = "//Manifest/Head/FunctionCode";
public final static String MessageType = "//Manifest/Head/MessageType";
public final static String SenderID = "//Manifest/Head/SenderID";
public final static String ReceiverID = "//Manifest/Head/ReceiverID";
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;
//通过@PostConstruct实现初始化bean之前进行的操作,解决service调用空指针问题
@PostConstruct
public void init() {
customXmlHandle = this;
customXmlHandle.coustomAnalysisService = this.coustomAnalysisService;
// 初使化时将已静态化的testService实例化
}
/**
*
* @param file 回执目录的文件
* @return
* @throws DocumentException
* @throws UnsupportedEncodingException
* @throws SAXParseException
*/
public int handelXmlDocument(File file) throws DocumentException,UnsupportedEncodingException,SAXParseException {
SAXReader saxReader = new SAXReader();
Document document = saxReader.read(file);
Element contentRoot = document.getRootElement();
//要解析的回执类型
String type= "MT9999";
//开始解析
// fzeFoh.setGrossweightmeasureuc(XMLXPath.getSingleValueByPath(document,GrossWeightMeasureUc));
String msgType = XMLXPath.getSingleValueByPath(document,MessageType);
if (type.equals(msgType)){
String journeyid = XMLXPath.getSingleValueByPath(document,JourneyID);
String[] flightList = journeyid.split("/");
String flightNo = flightList[0];
String flightDate = flightList[1];
String awbA = XMLXPath.getSingleValueByPath(document,waybillMaster);
//全格式的分单 如 17212345678_ADBD
String awbH = XMLXPath.getSingleValueByPath(document,waybillSecond);
String resCode = XMLXPath.getSingleValueByPath(document,responseCode);
String resText = XMLXPath.getSingleValueByPath(document,responseText);
CustomReception customReception = new CustomReception(msgType,flightNo,flightDate,awbA,awbH,resText);
int i = customXmlHandle.coustomAnalysisService.insertRecept(customReception);
return i;
}
return 0;
}
}
... ...
package com.tianbo.analysis.model;
import lombok.Data;
@Data
public class CustomReception {
private String messageID;
private String functionCode;
private String messageType;
private String senderID;
private String receiverID;
private String sendTime;
private String version;
private String flightNo;
private String flightDate;
private String wayBillMaster;
private String wayBillSecond;
private String responseCode;
private String responseText;
public CustomReception(String messageType,
String flightNo,
String flightDate,
String wayBillMaster,
String wayBillSecond,
String responseText
){
this.messageType = messageType;
this.flightNo = flightNo;
this.flightDate = flightDate;
this.wayBillMaster = wayBillMaster;
this.wayBillSecond = wayBillSecond;
this.responseText = responseText;
}
}
... ...
package com.tianbo.analysis.model;
import java.util.Date;
public class ORIGINMANIFESTMASTER {
private String autoid;
private String waybillnomaster;
private String segment;
private String originatingstation;
private String destinationstation;
private String totalweight;
private String totalpiece;
private String manifesttotalpiece;
private String manifesttotalweight;
private String flightno;
private String productname;
private String customsstatus;
private String carrier1;
private String arrivalstation1;
private String carrier2;
private String arrivalstation2;
private String carrier3;
private String arrivalstation3;
private String paymode;
private String specialgoodscode;
private String customscode;
private String shippername;
private String shipperaddress;
private String consigneename;
private String consigneeaddress;
private String receiptinformation;
private Date createdate;
private Date flightDate;
private String status;
private String isbatch;
private String originatingstationBill;
private String destinationstationBill;
private String reportorder;
private String islast;
private String shipperCode;
private String shipperCountrycode;
private String shipperPhone;
private String shipperFax;
private String consigneeCode;
private String consigneeCountrycode;
private String consigneeFax;
private String specificConsigneename;
private String specificConsigneePhone;
private String consigneePhone;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getSegment() {
return segment;
}
public void setSegment(String segment) {
this.segment = segment == null ? null : segment.trim();
}
public String getOriginatingstation() {
return originatingstation;
}
public void setOriginatingstation(String originatingstation) {
this.originatingstation = originatingstation == null ? null : originatingstation.trim();
}
public String getDestinationstation() {
return destinationstation;
}
public void setDestinationstation(String destinationstation) {
this.destinationstation = destinationstation == null ? null : destinationstation.trim();
}
public String getTotalweight() {
return totalweight;
}
public void setTotalweight(String totalweight) {
this.totalweight = totalweight == null ? null : totalweight.trim();
}
public String getTotalpiece() {
return totalpiece;
}
public void setTotalpiece(String totalpiece) {
this.totalpiece = totalpiece == null ? null : totalpiece.trim();
}
public String getManifesttotalpiece() {
return manifesttotalpiece;
}
public void setManifesttotalpiece(String manifesttotalpiece) {
this.manifesttotalpiece = manifesttotalpiece == null ? null : manifesttotalpiece.trim();
}
public String getManifesttotalweight() {
return manifesttotalweight;
}
public void setManifesttotalweight(String manifesttotalweight) {
this.manifesttotalweight = manifesttotalweight == null ? null : manifesttotalweight.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getCustomsstatus() {
return customsstatus;
}
public void setCustomsstatus(String customsstatus) {
this.customsstatus = customsstatus == null ? null : customsstatus.trim();
}
public String getCarrier1() {
return carrier1;
}
public void setCarrier1(String carrier1) {
this.carrier1 = carrier1 == null ? null : carrier1.trim();
}
public String getArrivalstation1() {
return arrivalstation1;
}
public void setArrivalstation1(String arrivalstation1) {
this.arrivalstation1 = arrivalstation1 == null ? null : arrivalstation1.trim();
}
public String getCarrier2() {
return carrier2;
}
public void setCarrier2(String carrier2) {
this.carrier2 = carrier2 == null ? null : carrier2.trim();
}
public String getArrivalstation2() {
return arrivalstation2;
}
public void setArrivalstation2(String arrivalstation2) {
this.arrivalstation2 = arrivalstation2 == null ? null : arrivalstation2.trim();
}
public String getCarrier3() {
return carrier3;
}
public void setCarrier3(String carrier3) {
this.carrier3 = carrier3 == null ? null : carrier3.trim();
}
public String getArrivalstation3() {
return arrivalstation3;
}
public void setArrivalstation3(String arrivalstation3) {
this.arrivalstation3 = arrivalstation3 == null ? null : arrivalstation3.trim();
}
public String getPaymode() {
return paymode;
}
public void setPaymode(String paymode) {
this.paymode = paymode == null ? null : paymode.trim();
}
public String getSpecialgoodscode() {
return specialgoodscode;
}
public void setSpecialgoodscode(String specialgoodscode) {
this.specialgoodscode = specialgoodscode == null ? null : specialgoodscode.trim();
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getShippername() {
return shippername;
}
public void setShippername(String shippername) {
this.shippername = shippername == null ? null : shippername.trim();
}
public String getShipperaddress() {
return shipperaddress;
}
public void setShipperaddress(String shipperaddress) {
this.shipperaddress = shipperaddress == null ? null : shipperaddress.trim();
}
public String getConsigneename() {
return consigneename;
}
public void setConsigneename(String consigneename) {
this.consigneename = consigneename == null ? null : consigneename.trim();
}
public String getConsigneeaddress() {
return consigneeaddress;
}
public void setConsigneeaddress(String consigneeaddress) {
this.consigneeaddress = consigneeaddress == null ? null : consigneeaddress.trim();
}
public String getReceiptinformation() {
return receiptinformation;
}
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public Date getFlightDate() {
return flightDate;
}
public void setFlightDate(Date flightDate) {
this.flightDate = flightDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getIsbatch() {
return isbatch;
}
public void setIsbatch(String isbatch) {
this.isbatch = isbatch == null ? null : isbatch.trim();
}
public String getOriginatingstationBill() {
return originatingstationBill;
}
public void setOriginatingstationBill(String originatingstationBill) {
this.originatingstationBill = originatingstationBill == null ? null : originatingstationBill.trim();
}
public String getDestinationstationBill() {
return destinationstationBill;
}
public void setDestinationstationBill(String destinationstationBill) {
this.destinationstationBill = destinationstationBill == null ? null : destinationstationBill.trim();
}
public String getReportorder() {
return reportorder;
}
public void setReportorder(String reportorder) {
this.reportorder = reportorder == null ? null : reportorder.trim();
}
public String getIslast() {
return islast;
}
public void setIslast(String islast) {
this.islast = islast == null ? null : islast.trim();
}
public String getShipperCode() {
return shipperCode;
}
public void setShipperCode(String shipperCode) {
this.shipperCode = shipperCode == null ? null : shipperCode.trim();
}
public String getShipperCountrycode() {
return shipperCountrycode;
}
public void setShipperCountrycode(String shipperCountrycode) {
this.shipperCountrycode = shipperCountrycode == null ? null : shipperCountrycode.trim();
}
public String getShipperPhone() {
return shipperPhone;
}
public void setShipperPhone(String shipperPhone) {
this.shipperPhone = shipperPhone == null ? null : shipperPhone.trim();
}
public String getShipperFax() {
return shipperFax;
}
public void setShipperFax(String shipperFax) {
this.shipperFax = shipperFax == null ? null : shipperFax.trim();
}
public String getConsigneeCode() {
return consigneeCode;
}
public void setConsigneeCode(String consigneeCode) {
this.consigneeCode = consigneeCode == null ? null : consigneeCode.trim();
}
public String getConsigneeCountrycode() {
return consigneeCountrycode;
}
public void setConsigneeCountrycode(String consigneeCountrycode) {
this.consigneeCountrycode = consigneeCountrycode == null ? null : consigneeCountrycode.trim();
}
public String getConsigneeFax() {
return consigneeFax;
}
public void setConsigneeFax(String consigneeFax) {
this.consigneeFax = consigneeFax == null ? null : consigneeFax.trim();
}
public String getSpecificConsigneename() {
return specificConsigneename;
}
public void setSpecificConsigneename(String specificConsigneename) {
this.specificConsigneename = specificConsigneename == null ? null : specificConsigneename.trim();
}
public String getSpecificConsigneePhone() {
return specificConsigneePhone;
}
public void setSpecificConsigneePhone(String specificConsigneePhone) {
this.specificConsigneePhone = specificConsigneePhone == null ? null : specificConsigneePhone.trim();
}
public String getConsigneePhone() {
return consigneePhone;
}
public void setConsigneePhone(String consigneePhone) {
this.consigneePhone = consigneePhone == null ? null : consigneePhone.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.model;
import java.util.Date;
public class Originmanifestsecondary {
private String autoid;
private String waybillnomaster;
private String waybillnosecondary;
private String weight;
private String piece;
private String manifestpiece;
private String manifestweight;
private String productname;
private String paymode;
private String specialgoodscode;
private String customscode;
private String shippername;
private String shipperaddress;
private String consigneename;
private String consigneeaddress;
private Date createdate;
private String originmanifestmasterautoid;
private String customsstatus;
private String status;
private String receiption;
private String originatingstationBill;
private String destinationstationBill;
private String shipperCode;
private String shipperCountrycode;
private String shipperPhone;
private String shipperFax;
private String consigneeCode;
private String consigneeCountrycode;
private String consigneeFax;
private String specificConsigneename;
private String specificConsigneePhone;
private String consigneePhone;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public String getWeight() {
return weight;
}
public void setWeight(String weight) {
this.weight = weight == null ? null : weight.trim();
}
public String getPiece() {
return piece;
}
public void setPiece(String piece) {
this.piece = piece == null ? null : piece.trim();
}
public String getManifestpiece() {
return manifestpiece;
}
public void setManifestpiece(String manifestpiece) {
this.manifestpiece = manifestpiece == null ? null : manifestpiece.trim();
}
public String getManifestweight() {
return manifestweight;
}
public void setManifestweight(String manifestweight) {
this.manifestweight = manifestweight == null ? null : manifestweight.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getPaymode() {
return paymode;
}
public void setPaymode(String paymode) {
this.paymode = paymode == null ? null : paymode.trim();
}
public String getSpecialgoodscode() {
return specialgoodscode;
}
public void setSpecialgoodscode(String specialgoodscode) {
this.specialgoodscode = specialgoodscode == null ? null : specialgoodscode.trim();
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getShippername() {
return shippername;
}
public void setShippername(String shippername) {
this.shippername = shippername == null ? null : shippername.trim();
}
public String getShipperaddress() {
return shipperaddress;
}
public void setShipperaddress(String shipperaddress) {
this.shipperaddress = shipperaddress == null ? null : shipperaddress.trim();
}
public String getConsigneename() {
return consigneename;
}
public void setConsigneename(String consigneename) {
this.consigneename = consigneename == null ? null : consigneename.trim();
}
public String getConsigneeaddress() {
return consigneeaddress;
}
public void setConsigneeaddress(String consigneeaddress) {
this.consigneeaddress = consigneeaddress == null ? null : consigneeaddress.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getOriginmanifestmasterautoid() {
return originmanifestmasterautoid;
}
public void setOriginmanifestmasterautoid(String originmanifestmasterautoid) {
this.originmanifestmasterautoid = originmanifestmasterautoid == null ? null : originmanifestmasterautoid.trim();
}
public String getCustomsstatus() {
return customsstatus;
}
public void setCustomsstatus(String customsstatus) {
this.customsstatus = customsstatus == null ? null : customsstatus.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 getOriginatingstationBill() {
return originatingstationBill;
}
public void setOriginatingstationBill(String originatingstationBill) {
this.originatingstationBill = originatingstationBill == null ? null : originatingstationBill.trim();
}
public String getDestinationstationBill() {
return destinationstationBill;
}
public void setDestinationstationBill(String destinationstationBill) {
this.destinationstationBill = destinationstationBill == null ? null : destinationstationBill.trim();
}
public String getShipperCode() {
return shipperCode;
}
public void setShipperCode(String shipperCode) {
this.shipperCode = shipperCode == null ? null : shipperCode.trim();
}
public String getShipperCountrycode() {
return shipperCountrycode;
}
public void setShipperCountrycode(String shipperCountrycode) {
this.shipperCountrycode = shipperCountrycode == null ? null : shipperCountrycode.trim();
}
public String getShipperPhone() {
return shipperPhone;
}
public void setShipperPhone(String shipperPhone) {
this.shipperPhone = shipperPhone == null ? null : shipperPhone.trim();
}
public String getShipperFax() {
return shipperFax;
}
public void setShipperFax(String shipperFax) {
this.shipperFax = shipperFax == null ? null : shipperFax.trim();
}
public String getConsigneeCode() {
return consigneeCode;
}
public void setConsigneeCode(String consigneeCode) {
this.consigneeCode = consigneeCode == null ? null : consigneeCode.trim();
}
public String getConsigneeCountrycode() {
return consigneeCountrycode;
}
public void setConsigneeCountrycode(String consigneeCountrycode) {
this.consigneeCountrycode = consigneeCountrycode == null ? null : consigneeCountrycode.trim();
}
public String getConsigneeFax() {
return consigneeFax;
}
public void setConsigneeFax(String consigneeFax) {
this.consigneeFax = consigneeFax == null ? null : consigneeFax.trim();
}
public String getSpecificConsigneename() {
return specificConsigneename;
}
public void setSpecificConsigneename(String specificConsigneename) {
this.specificConsigneename = specificConsigneename == null ? null : specificConsigneename.trim();
}
public String getSpecificConsigneePhone() {
return specificConsigneePhone;
}
public void setSpecificConsigneePhone(String specificConsigneePhone) {
this.specificConsigneePhone = specificConsigneePhone == null ? null : specificConsigneePhone.trim();
}
public String getConsigneePhone() {
return consigneePhone;
}
public void setConsigneePhone(String consigneePhone) {
this.consigneePhone = consigneePhone == null ? null : consigneePhone.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.model;
import java.math.BigDecimal;
import java.util.Date;
public class SENDLOG {
private String autoid;
private Date createdate;
private String opauthor;
private Long sendpeice;
private BigDecimal sendweight;
private String receiption;
private String messagetype;
private String messageautoid;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getOpauthor() {
return opauthor;
}
public void setOpauthor(String opauthor) {
this.opauthor = opauthor == null ? null : opauthor.trim();
}
public Long getSendpeice() {
return sendpeice;
}
public void setSendpeice(Long sendpeice) {
this.sendpeice = sendpeice;
}
public BigDecimal getSendweight() {
return sendweight;
}
public void setSendweight(BigDecimal sendweight) {
this.sendweight = sendweight;
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption == null ? null : receiption.trim();
}
public String getMessagetype() {
return messagetype;
}
public void setMessagetype(String messagetype) {
this.messagetype = messagetype == null ? null : messagetype.trim();
}
public String getMessageautoid() {
return messageautoid;
}
public void setMessageautoid(String messageautoid) {
this.messageautoid = messageautoid == null ? null : messageautoid.trim();
}
}
\ No newline at end of file
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.CustomReception;
public interface CoustomAnalysisService {
int insertRecept(CustomReception customReception);
}
... ...
package com.tianbo.analysis.service.imp;
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.util.Date.DateUtil;
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;
import java.util.List;
@Service
@Slf4j
public class CoustomAnalysisServiceImp implements CoustomAnalysisService {
@Autowired
SENDLOGMapper sendlogMapper;
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
@Override
public int insertRecept(CustomReception customReception){
String awbA = customReception.getWayBillMaster();
String awbH = customReception.getWayBillSecond();
//回执内容
String reception = customReception.getResponseText();
String flightDateStr = customReception.getFlightDate();
Date flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
//设置分单回执
Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary();
originmanifestsecondary.setReceiption(reception);
//设置主单回执、航班号、航班日期
ORIGINMANIFESTMASTER originmanifestmaster = new ORIGINMANIFESTMASTER();
originmanifestmaster.setReceiptinformation(reception);
originmanifestmaster.setFlightno(customReception.getFlightNo());
originmanifestmaster.setFlightDate(flightDate);
if (awbA!=null && awbA.length()>0){
StringBuffer stringBuffer = new StringBuffer(awbA);
stringBuffer.insert(3,"-");
awbA = stringBuffer.toString();
//设置主分单的 主单号
originmanifestsecondary.setWaybillnomaster(awbA);
originmanifestmaster.setWaybillnomaster(awbA);
}
//有分单号 更新分单
if(awbA!=null && awbA.length()>0 && awbH!=null && awbH.length()> 0){
//取分单号
String[] awbhArr = awbH.split("_");
String awbh = awbhArr[1];
originmanifestsecondary.setWaybillnosecondary(awbh);
//更新分单回执
int i = originmanifestsecondaryMapper.updateRECEIPTION(originmanifestsecondary);
//获取分单autoid
List<Originmanifestsecondary> originmanifestsecondaryList = originmanifestsecondaryMapper.selectAutoIdByawbAawbH(originmanifestsecondary);
if(!originmanifestsecondaryList.isEmpty()){
Originmanifestsecondary originSecond = originmanifestsecondaryList.get(0);
String autoId = originSecond.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+awbH+"->autoid="+autoId);
int ii = insertSendlog("MT1201",reception,autoId);
if (i>0 && ii>0){
return 1;
}
}
return 0;
}
//处理主单格式,将海关回执的主单号58019316861,变为580-19316861
if (awbA!=null && awbA.length()>0){
//更新主单回执
int i = originmanifestmasterMapper.updateRECEIPTION(originmanifestmaster);
//获取分单autoid
List<ORIGINMANIFESTMASTER> originmanifestmasterList = originmanifestmasterMapper.selectAutoIdByAwb(originmanifestmaster);
if(!originmanifestmasterList.isEmpty()){
ORIGINMANIFESTMASTER originMaster = originmanifestmasterList.get(0);
String autoId = originMaster.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+awbA+"->autoid="+autoId);
int ii =insertSendlog("MT1201",reception,autoId);
if (i>0 && ii>0){
return 1;
}
}
return 0;
}
//未进入主分单解析 返回0 失败
return 0;
}
private 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;
}
}
... ...
package com.tianbo.analysis.task;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.IO.FileTool;
import com.tianbo.analysis.handle.CustomXmlHandle;
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.util.List;
/**
* 回执解析定时任务
*/
@Component
public class TaskAnalysis {
private String today = DateUtil.getTodayBy_yyyyMMdd();
//回执读取目录
@Value("${custom.receptDirectory}")
private String receptDir;
//备份目录
@Value("${custom.receptBakDir}")
private String bakupDir;
//解析出错转移目录
@Value("${custom.errBakDir}")
private String errBakDir;
@Scheduled(fixedDelay = 5000)
public void startTask(){
String readDir = receptDir + "/" + today;
String backdireByDay = bakupDir + "/" + today;
List<File> files = FileTool.readDirectoryFiles(new File(readDir));
Iterator<File> it = files.iterator();
while(it.hasNext()){
File file = it.next();
try {
//解析
int i = new CustomXmlHandle().handelXmlDocument(file);
//操作成功,则转移剪切解析文件到备份目录,否则转移到error目录备份
if(i>0){
File bakupDirectory = new File(backdireByDay);
FileUtils.moveFileToDirectory(file,bakupDirectory,true);
}else {
errBak(file);
}
}catch (Exception e){
e.printStackTrace();
errBak(file);
}
}
}
public void errBak(File file){
try {
String errDirByDay = errBakDir + "/" + today;
File berrDirectory = new File(errDirByDay);
FileUtils.moveFileToDirectory(file,berrDirectory,true);
}catch (Exception e){
e.printStackTrace();
}
}
}
... ...
... ... @@ -45,6 +45,6 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="CUSTOMSMESSAGE" domainObjectName="CUSTOMSMESSAGE" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="originmanifestsecondary" domainObjectName="originmanifestsecondary" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="SEGMENT" property="segment" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION" property="originatingstation" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION" property="destinationstation" jdbcType="VARCHAR" />
<result column="TOTALWEIGHT" property="totalweight" jdbcType="VARCHAR" />
<result column="TOTALPIECE" property="totalpiece" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALPIECE" property="manifesttotalpiece" jdbcType="VARCHAR" />
<result column="MANIFESTTOTALWEIGHT" property="manifesttotalweight" jdbcType="VARCHAR" />
<result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" />
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR" />
<result column="CARRIER1" property="carrier1" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION1" property="arrivalstation1" jdbcType="VARCHAR" />
<result column="CARRIER2" property="carrier2" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION2" property="arrivalstation2" jdbcType="VARCHAR" />
<result column="CARRIER3" property="carrier3" jdbcType="VARCHAR" />
<result column="ARRIVALSTATION3" property="arrivalstation3" jdbcType="VARCHAR" />
<result column="PAYMODE" property="paymode" jdbcType="VARCHAR" />
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" />
<result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR" />
<result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR" />
<result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR" />
<result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR" />
<result column="RECEIPTINFORMATION" property="receiptinformation" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="FLIGHT_DATE" property="flightDate" jdbcType="TIMESTAMP" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="ISBATCH" property="isbatch" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />
<result column="REPORTORDER" property="reportorder" jdbcType="VARCHAR" />
<result column="ISLAST" property="islast" jdbcType="VARCHAR" />
<result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR" />
<result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR" />
<result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR" />
<result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR" />
<result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR" />
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
insert into ORIGINMANIFESTMASTER (AUTOID, WAYBILLNOMASTER, SEGMENT,
ORIGINATINGSTATION, DESTINATIONSTATION,
TOTALWEIGHT, TOTALPIECE, MANIFESTTOTALPIECE,
MANIFESTTOTALWEIGHT, FLIGHTNO, PRODUCTNAME,
CUSTOMSSTATUS, CARRIER1, ARRIVALSTATION1,
CARRIER2, ARRIVALSTATION2, CARRIER3,
ARRIVALSTATION3, PAYMODE, SPECIALGOODSCODE,
CUSTOMSCODE, SHIPPERNAME, SHIPPERADDRESS,
CONSIGNEENAME, CONSIGNEEADDRESS, RECEIPTINFORMATION,
CREATEDATE, FLIGHT_DATE, STATUS,
ISBATCH, ORIGINATINGSTATION_BILL, DESTINATIONSTATION_BILL,
REPORTORDER, ISLAST, SHIPPER_CODE,
SHIPPER_COUNTRYCODE, SHIPPER_PHONE, SHIPPER_FAX,
CONSIGNEE_CODE, CONSIGNEE_COUNTRYCODE, CONSIGNEE_FAX,
SPECIFIC_CONSIGNEENAME, SPECIFIC_CONSIGNEE_PHONE,
CONSIGNEE_PHONE)
values (#{autoid,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{segment,jdbcType=VARCHAR},
#{originatingstation,jdbcType=VARCHAR}, #{destinationstation,jdbcType=VARCHAR},
#{totalweight,jdbcType=VARCHAR}, #{totalpiece,jdbcType=VARCHAR}, #{manifesttotalpiece,jdbcType=VARCHAR},
#{manifesttotalweight,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR},
#{customsstatus,jdbcType=VARCHAR}, #{carrier1,jdbcType=VARCHAR}, #{arrivalstation1,jdbcType=VARCHAR},
#{carrier2,jdbcType=VARCHAR}, #{arrivalstation2,jdbcType=VARCHAR}, #{carrier3,jdbcType=VARCHAR},
#{arrivalstation3,jdbcType=VARCHAR}, #{paymode,jdbcType=VARCHAR}, #{specialgoodscode,jdbcType=VARCHAR},
#{customscode,jdbcType=VARCHAR}, #{shippername,jdbcType=VARCHAR}, #{shipperaddress,jdbcType=VARCHAR},
#{consigneename,jdbcType=VARCHAR}, #{consigneeaddress,jdbcType=VARCHAR}, #{receiptinformation,jdbcType=VARCHAR},
#{createdate,jdbcType=TIMESTAMP}, #{flightDate,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR},
#{isbatch,jdbcType=VARCHAR}, #{originatingstationBill,jdbcType=VARCHAR}, #{destinationstationBill,jdbcType=VARCHAR},
#{reportorder,jdbcType=VARCHAR}, #{islast,jdbcType=VARCHAR}, #{shipperCode,jdbcType=VARCHAR},
#{shipperCountrycode,jdbcType=VARCHAR}, #{shipperPhone,jdbcType=VARCHAR}, #{shipperFax,jdbcType=VARCHAR},
#{consigneeCode,jdbcType=VARCHAR}, #{consigneeCountrycode,jdbcType=VARCHAR}, #{consigneeFax,jdbcType=VARCHAR},
#{specificConsigneename,jdbcType=VARCHAR}, #{specificConsigneePhone,jdbcType=VARCHAR},
#{consigneePhone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
insert into ORIGINMANIFESTMASTER
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="segment != null" >
SEGMENT,
</if>
<if test="originatingstation != null" >
ORIGINATINGSTATION,
</if>
<if test="destinationstation != null" >
DESTINATIONSTATION,
</if>
<if test="totalweight != null" >
TOTALWEIGHT,
</if>
<if test="totalpiece != null" >
TOTALPIECE,
</if>
<if test="manifesttotalpiece != null" >
MANIFESTTOTALPIECE,
</if>
<if test="manifesttotalweight != null" >
MANIFESTTOTALWEIGHT,
</if>
<if test="flightno != null" >
FLIGHTNO,
</if>
<if test="productname != null" >
PRODUCTNAME,
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS,
</if>
<if test="carrier1 != null" >
CARRIER1,
</if>
<if test="arrivalstation1 != null" >
ARRIVALSTATION1,
</if>
<if test="carrier2 != null" >
CARRIER2,
</if>
<if test="arrivalstation2 != null" >
ARRIVALSTATION2,
</if>
<if test="carrier3 != null" >
CARRIER3,
</if>
<if test="arrivalstation3 != null" >
ARRIVALSTATION3,
</if>
<if test="paymode != null" >
PAYMODE,
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE,
</if>
<if test="customscode != null" >
CUSTOMSCODE,
</if>
<if test="shippername != null" >
SHIPPERNAME,
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS,
</if>
<if test="consigneename != null" >
CONSIGNEENAME,
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS,
</if>
<if test="receiptinformation != null" >
RECEIPTINFORMATION,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="flightDate != null" >
FLIGHT_DATE,
</if>
<if test="status != null" >
STATUS,
</if>
<if test="isbatch != null" >
ISBATCH,
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL,
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL,
</if>
<if test="reportorder != null" >
REPORTORDER,
</if>
<if test="islast != null" >
ISLAST,
</if>
<if test="shipperCode != null" >
SHIPPER_CODE,
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE,
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE,
</if>
<if test="shipperFax != null" >
SHIPPER_FAX,
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE,
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE,
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX,
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME,
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE,
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="segment != null" >
#{segment,jdbcType=VARCHAR},
</if>
<if test="originatingstation != null" >
#{originatingstation,jdbcType=VARCHAR},
</if>
<if test="destinationstation != null" >
#{destinationstation,jdbcType=VARCHAR},
</if>
<if test="totalweight != null" >
#{totalweight,jdbcType=VARCHAR},
</if>
<if test="totalpiece != null" >
#{totalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalpiece != null" >
#{manifesttotalpiece,jdbcType=VARCHAR},
</if>
<if test="manifesttotalweight != null" >
#{manifesttotalweight,jdbcType=VARCHAR},
</if>
<if test="flightno != null" >
#{flightno,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
#{productname,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
#{customsstatus,jdbcType=VARCHAR},
</if>
<if test="carrier1 != null" >
#{carrier1,jdbcType=VARCHAR},
</if>
<if test="arrivalstation1 != null" >
#{arrivalstation1,jdbcType=VARCHAR},
</if>
<if test="carrier2 != null" >
#{carrier2,jdbcType=VARCHAR},
</if>
<if test="arrivalstation2 != null" >
#{arrivalstation2,jdbcType=VARCHAR},
</if>
<if test="carrier3 != null" >
#{carrier3,jdbcType=VARCHAR},
</if>
<if test="arrivalstation3 != null" >
#{arrivalstation3,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
#{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
#{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
#{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
#{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
#{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
#{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="receiptinformation != null" >
#{receiptinformation,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="flightDate != null" >
#{flightDate,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="isbatch != null" >
#{isbatch,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
#{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
#{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="reportorder != null" >
#{reportorder,jdbcType=VARCHAR},
</if>
<if test="islast != null" >
#{islast,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
#{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
#{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
#{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
#{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
#{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
#{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
#{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
#{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
#{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
#{consigneePhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" >
UPDATE ORIGINMANIFESTMASTER
SET RECEIPTINFORMATION= #{receiptinformation,jdbcType=VARCHAR}
WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND
FLIGHT_DATE= #{flightDate,jdbcType=TIMESTAMP}
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</update>
<select id="selectAutoIdByAwb" parameterType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER" resultType="com.tianbo.analysis.model.ORIGINMANIFESTMASTER">
SELECT AUTOID
FROM ORIGINMANIFESTMASTER
WHERE
FLIGHTNO= #{flightno,jdbcType=VARCHAR}
AND
FLIGHT_DATE= #{flightDate,jdbcType=TIMESTAMP}
AND
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.analysis.dao.SENDLOGMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.SENDLOG" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="OPAUTHOR" property="opauthor" jdbcType="VARCHAR" />
<result column="SENDPEICE" property="sendpeice" jdbcType="DECIMAL" />
<result column="SENDWEIGHT" property="sendweight" jdbcType="DECIMAL" />
<result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
<result column="MESSAGETYPE" property="messagetype" jdbcType="VARCHAR" />
<result column="MESSAGEAUTOID" property="messageautoid" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.SENDLOG" >
insert into SENDLOG (AUTOID, CREATEDATE, OPAUTHOR,
SENDPEICE, SENDWEIGHT, RECEIPTION,
MESSAGETYPE, MESSAGEAUTOID)
values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{opauthor,jdbcType=VARCHAR},
#{sendpeice,jdbcType=DECIMAL}, #{sendweight,jdbcType=DECIMAL}, #{receiption,jdbcType=VARCHAR},
#{messagetype,jdbcType=VARCHAR}, #{messageautoid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.SENDLOG" >
insert into SENDLOG
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="opauthor != null" >
OPAUTHOR,
</if>
<if test="sendpeice != null" >
SENDPEICE,
</if>
<if test="sendweight != null" >
SENDWEIGHT,
</if>
<if test="receiption != null" >
RECEIPTION,
</if>
<if test="messagetype != null" >
MESSAGETYPE,
</if>
<if test="messageautoid != null" >
MESSAGEAUTOID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="opauthor != null" >
#{opauthor,jdbcType=VARCHAR},
</if>
<if test="sendpeice != null" >
#{sendpeice,jdbcType=DECIMAL},
</if>
<if test="sendweight != null" >
#{sendweight,jdbcType=DECIMAL},
</if>
<if test="receiption != null" >
#{receiption,jdbcType=VARCHAR},
</if>
<if test="messagetype != null" >
#{messagetype,jdbcType=VARCHAR},
</if>
<if test="messageautoid != null" >
#{messageautoid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.tianbo.analysis.dao.OriginmanifestsecondaryMapper" >
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.Originmanifestsecondary" >
<result column="AUTOID" property="autoid" jdbcType="VARCHAR" />
<result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" />
<result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" />
<result column="WEIGHT" property="weight" jdbcType="VARCHAR" />
<result column="PIECE" property="piece" jdbcType="VARCHAR" />
<result column="MANIFESTPIECE" property="manifestpiece" jdbcType="VARCHAR" />
<result column="MANIFESTWEIGHT" property="manifestweight" jdbcType="VARCHAR" />
<result column="PRODUCTNAME" property="productname" jdbcType="VARCHAR" />
<result column="PAYMODE" property="paymode" jdbcType="VARCHAR" />
<result column="SPECIALGOODSCODE" property="specialgoodscode" jdbcType="VARCHAR" />
<result column="CUSTOMSCODE" property="customscode" jdbcType="VARCHAR" />
<result column="SHIPPERNAME" property="shippername" jdbcType="VARCHAR" />
<result column="SHIPPERADDRESS" property="shipperaddress" jdbcType="VARCHAR" />
<result column="CONSIGNEENAME" property="consigneename" jdbcType="VARCHAR" />
<result column="CONSIGNEEADDRESS" property="consigneeaddress" jdbcType="VARCHAR" />
<result column="CREATEDATE" property="createdate" jdbcType="TIMESTAMP" />
<result column="ORIGINMANIFESTMASTERAUTOID" property="originmanifestmasterautoid" jdbcType="VARCHAR" />
<result column="CUSTOMSSTATUS" property="customsstatus" jdbcType="VARCHAR" />
<result column="STATUS" property="status" jdbcType="VARCHAR" />
<result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" />
<result column="ORIGINATINGSTATION_BILL" property="originatingstationBill" jdbcType="VARCHAR" />
<result column="DESTINATIONSTATION_BILL" property="destinationstationBill" jdbcType="VARCHAR" />
<result column="SHIPPER_CODE" property="shipperCode" jdbcType="VARCHAR" />
<result column="SHIPPER_COUNTRYCODE" property="shipperCountrycode" jdbcType="VARCHAR" />
<result column="SHIPPER_PHONE" property="shipperPhone" jdbcType="VARCHAR" />
<result column="SHIPPER_FAX" property="shipperFax" jdbcType="VARCHAR" />
<result column="CONSIGNEE_CODE" property="consigneeCode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_COUNTRYCODE" property="consigneeCountrycode" jdbcType="VARCHAR" />
<result column="CONSIGNEE_FAX" property="consigneeFax" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEENAME" property="specificConsigneename" jdbcType="VARCHAR" />
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR" />
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR" />
</resultMap>
<insert id="insert" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" >
insert into ORIGINMANIFESTSECONDARY (AUTOID, WAYBILLNOMASTER, WAYBILLNOSECONDARY,
WEIGHT, PIECE, MANIFESTPIECE,
MANIFESTWEIGHT, PRODUCTNAME, PAYMODE,
SPECIALGOODSCODE, CUSTOMSCODE, SHIPPERNAME,
SHIPPERADDRESS, CONSIGNEENAME, CONSIGNEEADDRESS,
CREATEDATE, ORIGINMANIFESTMASTERAUTOID,
CUSTOMSSTATUS, STATUS, RECEIPTION,
ORIGINATINGSTATION_BILL, DESTINATIONSTATION_BILL,
SHIPPER_CODE, SHIPPER_COUNTRYCODE, SHIPPER_PHONE,
SHIPPER_FAX, CONSIGNEE_CODE, CONSIGNEE_COUNTRYCODE,
CONSIGNEE_FAX, SPECIFIC_CONSIGNEENAME, SPECIFIC_CONSIGNEE_PHONE,
CONSIGNEE_PHONE)
values (#{autoid,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{waybillnosecondary,jdbcType=VARCHAR},
#{weight,jdbcType=VARCHAR}, #{piece,jdbcType=VARCHAR}, #{manifestpiece,jdbcType=VARCHAR},
#{manifestweight,jdbcType=VARCHAR}, #{productname,jdbcType=VARCHAR}, #{paymode,jdbcType=VARCHAR},
#{specialgoodscode,jdbcType=VARCHAR}, #{customscode,jdbcType=VARCHAR}, #{shippername,jdbcType=VARCHAR},
#{shipperaddress,jdbcType=VARCHAR}, #{consigneename,jdbcType=VARCHAR}, #{consigneeaddress,jdbcType=VARCHAR},
#{createdate,jdbcType=TIMESTAMP}, #{originmanifestmasterautoid,jdbcType=VARCHAR},
#{customsstatus,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{receiption,jdbcType=VARCHAR},
#{originatingstationBill,jdbcType=VARCHAR}, #{destinationstationBill,jdbcType=VARCHAR},
#{shipperCode,jdbcType=VARCHAR}, #{shipperCountrycode,jdbcType=VARCHAR}, #{shipperPhone,jdbcType=VARCHAR},
#{shipperFax,jdbcType=VARCHAR}, #{consigneeCode,jdbcType=VARCHAR}, #{consigneeCountrycode,jdbcType=VARCHAR},
#{consigneeFax,jdbcType=VARCHAR}, #{specificConsigneename,jdbcType=VARCHAR}, #{specificConsigneePhone,jdbcType=VARCHAR},
#{consigneePhone,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" >
insert into ORIGINMANIFESTSECONDARY
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
AUTOID,
</if>
<if test="waybillnomaster != null" >
WAYBILLNOMASTER,
</if>
<if test="waybillnosecondary != null" >
WAYBILLNOSECONDARY,
</if>
<if test="weight != null" >
WEIGHT,
</if>
<if test="piece != null" >
PIECE,
</if>
<if test="manifestpiece != null" >
MANIFESTPIECE,
</if>
<if test="manifestweight != null" >
MANIFESTWEIGHT,
</if>
<if test="productname != null" >
PRODUCTNAME,
</if>
<if test="paymode != null" >
PAYMODE,
</if>
<if test="specialgoodscode != null" >
SPECIALGOODSCODE,
</if>
<if test="customscode != null" >
CUSTOMSCODE,
</if>
<if test="shippername != null" >
SHIPPERNAME,
</if>
<if test="shipperaddress != null" >
SHIPPERADDRESS,
</if>
<if test="consigneename != null" >
CONSIGNEENAME,
</if>
<if test="consigneeaddress != null" >
CONSIGNEEADDRESS,
</if>
<if test="createdate != null" >
CREATEDATE,
</if>
<if test="originmanifestmasterautoid != null" >
ORIGINMANIFESTMASTERAUTOID,
</if>
<if test="customsstatus != null" >
CUSTOMSSTATUS,
</if>
<if test="status != null" >
STATUS,
</if>
<if test="receiption != null" >
RECEIPTION,
</if>
<if test="originatingstationBill != null" >
ORIGINATINGSTATION_BILL,
</if>
<if test="destinationstationBill != null" >
DESTINATIONSTATION_BILL,
</if>
<if test="shipperCode != null" >
SHIPPER_CODE,
</if>
<if test="shipperCountrycode != null" >
SHIPPER_COUNTRYCODE,
</if>
<if test="shipperPhone != null" >
SHIPPER_PHONE,
</if>
<if test="shipperFax != null" >
SHIPPER_FAX,
</if>
<if test="consigneeCode != null" >
CONSIGNEE_CODE,
</if>
<if test="consigneeCountrycode != null" >
CONSIGNEE_COUNTRYCODE,
</if>
<if test="consigneeFax != null" >
CONSIGNEE_FAX,
</if>
<if test="specificConsigneename != null" >
SPECIFIC_CONSIGNEENAME,
</if>
<if test="specificConsigneePhone != null" >
SPECIFIC_CONSIGNEE_PHONE,
</if>
<if test="consigneePhone != null" >
CONSIGNEE_PHONE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="autoid != null" >
#{autoid,jdbcType=VARCHAR},
</if>
<if test="waybillnomaster != null" >
#{waybillnomaster,jdbcType=VARCHAR},
</if>
<if test="waybillnosecondary != null" >
#{waybillnosecondary,jdbcType=VARCHAR},
</if>
<if test="weight != null" >
#{weight,jdbcType=VARCHAR},
</if>
<if test="piece != null" >
#{piece,jdbcType=VARCHAR},
</if>
<if test="manifestpiece != null" >
#{manifestpiece,jdbcType=VARCHAR},
</if>
<if test="manifestweight != null" >
#{manifestweight,jdbcType=VARCHAR},
</if>
<if test="productname != null" >
#{productname,jdbcType=VARCHAR},
</if>
<if test="paymode != null" >
#{paymode,jdbcType=VARCHAR},
</if>
<if test="specialgoodscode != null" >
#{specialgoodscode,jdbcType=VARCHAR},
</if>
<if test="customscode != null" >
#{customscode,jdbcType=VARCHAR},
</if>
<if test="shippername != null" >
#{shippername,jdbcType=VARCHAR},
</if>
<if test="shipperaddress != null" >
#{shipperaddress,jdbcType=VARCHAR},
</if>
<if test="consigneename != null" >
#{consigneename,jdbcType=VARCHAR},
</if>
<if test="consigneeaddress != null" >
#{consigneeaddress,jdbcType=VARCHAR},
</if>
<if test="createdate != null" >
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="originmanifestmasterautoid != null" >
#{originmanifestmasterautoid,jdbcType=VARCHAR},
</if>
<if test="customsstatus != null" >
#{customsstatus,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="receiption != null" >
#{receiption,jdbcType=VARCHAR},
</if>
<if test="originatingstationBill != null" >
#{originatingstationBill,jdbcType=VARCHAR},
</if>
<if test="destinationstationBill != null" >
#{destinationstationBill,jdbcType=VARCHAR},
</if>
<if test="shipperCode != null" >
#{shipperCode,jdbcType=VARCHAR},
</if>
<if test="shipperCountrycode != null" >
#{shipperCountrycode,jdbcType=VARCHAR},
</if>
<if test="shipperPhone != null" >
#{shipperPhone,jdbcType=VARCHAR},
</if>
<if test="shipperFax != null" >
#{shipperFax,jdbcType=VARCHAR},
</if>
<if test="consigneeCode != null" >
#{consigneeCode,jdbcType=VARCHAR},
</if>
<if test="consigneeCountrycode != null" >
#{consigneeCountrycode,jdbcType=VARCHAR},
</if>
<if test="consigneeFax != null" >
#{consigneeFax,jdbcType=VARCHAR},
</if>
<if test="specificConsigneename != null" >
#{specificConsigneename,jdbcType=VARCHAR},
</if>
<if test="specificConsigneePhone != null" >
#{specificConsigneePhone,jdbcType=VARCHAR},
</if>
<if test="consigneePhone != null" >
#{consigneePhone,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateRECEIPTION" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" >
UPDATE ORIGINMANIFESTSECONDARY
SET RECEIPTION= #{receiption,jdbcType=VARCHAR}
WHERE WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
</update>
<select id="selectAutoIdByawbAawbH" parameterType="com.tianbo.analysis.model.Originmanifestsecondary" resultType="com.tianbo.analysis.model.Originmanifestsecondary">
SELECT AUTOID
FROM ORIGINMANIFESTSECONDARY
WHERE
WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} AND WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
... ...