作者 朱兆平

舱单收发MQ节点,外网获取回执报文

正在显示 38 个修改的文件 包含 32 行增加4371 行删除

要显示太多修改。

为保证性能只显示 38 of 38+ 个文件。

... ... @@ -22,7 +22,7 @@ spring:
static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path}
application:
name: WLTP-NMMS-CUSTOM-RECIPTION-RESOLVER
name: WLTP-NMMS-CUSTOMMESSAGEPROCESS
jackson:
serialization:
... ... @@ -44,44 +44,6 @@ spring:
auto-registration:
enabled: false
datasource:
type: com.alibaba.druid.pool.DruidDataSource
#oracle
driver-class-name: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB
# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
username: CGONMS
password: 1q2w3e4r
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
# url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
# username: root
# password:
# driver-class-name: com.mysql.jdbc.Driver
max-idle: 20
max-wait: 10000
min-idle: 5
initial-size: 5
#配置初始化大小/最小/最大
druid:
initial-size: 1
min-idle: 1
#最大并发连接数
max-active: 40
#获取连接等待超时时间
max-wait: 60000
#一个连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
#间隔多久进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis: 60000
#mysql
# validation-query: SELECT 1 FROM DUAL
#oracle
validation-query: SELECT 'x' FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
default-auto-commit: true
eureka:
instance:
#eureka服务器页面中status的请求路径
... ... @@ -100,20 +62,6 @@ eureka:
defaultZone: http://10.50.3.82:19527/eureka/
registry-fetch-interval-seconds: 30
mybatis:
mapper-locations: classpath:mapping/*.xml
type-aliases-package: com.tianbo.warehouse.model
pagehelper:
#auto-dialect: true
#auto-runtime-dialect: true
helper-dialect: oracle
reasonable: true
support-methods-arguments: true
params: count=countSql
#debug配置,debug或者为true的时候,logback才会记录和写入日志文件
trace: false
debug: false
... ... @@ -169,7 +117,7 @@ mq:
#新舱单业务报文mq队列名称
nmms-mq: send
#读取回执报文mq队列名称
tcs-mq: responsebak
tcs-mq: response.agent
exchange:
#TCS回执发送到此交换,交换再把回执消息同步到其他配置的回执订阅队列
tcs-ex:
... ... @@ -181,8 +129,8 @@ mq:
routing-key:
connection:
ip: 10.50.7.90
port: 5672
ip: 218.28.199.134
port: 8004
vHost: NMMS
username: tianbo
password: vmvnv1v2VV
... ...
... ... @@ -22,10 +22,10 @@
</properties>
<dependencies>
<!--spring boot-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
... ... @@ -68,17 +68,17 @@
<version>${lombok_sersion}</version>
<scope>provided</scope>
</dependency>
<!--数据库-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<!-- &lt;!&ndash;数据库&ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>druid</artifactId>-->
<!-- <version>${druid.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.mybatis</groupId>-->
<!-- <artifactId>mybatis</artifactId>-->
<!-- <version>3.4.6</version>-->
<!-- </dependency>-->
<!--&lt;!&ndash; mysql&ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>mysql</groupId>-->
... ... @@ -86,11 +86,11 @@
<!--<version>8.0.15</version>-->
<!--</dependency>-->
<!-- oracle-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0-atlassian-hosted</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.oracle</groupId>-->
<!-- <artifactId>ojdbc6</artifactId>-->
<!-- <version>11.2.0.4.0-atlassian-hosted</version>-->
<!-- </dependency>-->
<!--util依赖-->
<dependency>
<groupId>com.tianbo</groupId>
... ...
Manifest-Version: 1.0
Main-Class: com.tianbo.analysis.BootApplication
Class-Path: spring-boot-starter-thymeleaf-2.2.0.BUILD-20191016.163455-71
2.jar commons-jxpath-1.3.jar netflix-commons-util-0.3.0.jar spring-jdbc
-5.2.0.RELEASE.jar woodstox-core-5.2.1.jar amqp-client-5.7.3.jar jersey
-core-1.19.1.jar thymeleaf-3.0.11.RELEASE.jar spring-boot-starter-loggi
ng-2.2.0.BUILD-20191016.163447-713.jar rxnetty-0.4.9.jar spring-cloud-n
etflix-hystrix-2.1.5.BUILD-20200131.212025-597.jar guice-4.1.0.jar myba
tis-spring-1.3.2.jar joda-time-2.10.4.jar logback-core-1.2.3.jar bcpkix
-jdk15on-1.64.jar snakeyaml-1.25.jar spring-cloud-netflix-archaius-2.1.
5.BUILD-20200131.211909-597.jar spring-tx-5.2.0.RELEASE.jar spring-webm
vc-5.2.0.RELEASE.jar hibernate-validator-6.0.17.Final.jar eureka-client
-1.9.13.jar javax.inject-1.jar unbescape-1.1.6.RELEASE.jar attoparser-2
.0.5.RELEASE.jar spring-boot-2.2.0.BUILD-20191016.163506-711.jar dom4j-
2.1.0.jar spring-messaging-5.2.0.RELEASE.jar mybatis-3.4.6.jar jackson-
annotations-2.10.0.jar tomcat-embed-core-9.0.27.jar spring-cloud-netfli
x-eureka-client-2.1.5.BUILD-20200131.212304-596.jar stax2-api-4.2.jar s
pring-core-5.2.0.RELEASE.jar mybatis-spring-boot-starter-1.3.2.jar spri
ng-cloud-starter-netflix-archaius-2.1.5.BUILD-20200131.212322-596.jar r
ibbon-2.3.0.jar netflix-eventbus-0.3.0.jar spring-boot-starter-web-2.2.
0.BUILD-20191016.163459-711.jar spring-web-5.2.0.RELEASE.jar spring-con
text-5.2.0.RELEASE.jar xstream-1.4.11.1.jar ojdbc6-11.2.0.4.0-atlassian
-hosted.jar spring-security-rsa-1.0.9.RELEASE.jar spring-boot-starter-w
ebsocket-2.2.0.BUILD-20191016.163500-711.jar commons-configuration-1.8.
jar slf4j-api-1.7.28.jar xercesImpl-2.11.0.jar ribbon-eureka-2.3.0.jar
ribbon-loadbalancer-2.3.0.jar spring-cloud-netflix-ribbon-2.1.5.BUILD-2
0200131.211941-597.jar spring-boot-starter-jdbc-2.2.0.BUILD-20191016.16
3441-713.jar spring-boot-starter-json-2.2.0.BUILD-20191016.163444-713.j
ar spring-cloud-commons-2.1.5.BUILD-20200131.003036-348.jar mybatis-spr
ing-boot-autoconfigure-1.3.2.jar spring-boot-autoconfigure-2.2.0.BUILD-
20191016.163400-713.jar jsr311-api-1.1.1.jar commons-lang-2.6.jar antlr
-runtime-3.4.jar rxnetty-contexts-0.4.9.jar spring-boot-starter-tomcat-
2.2.0.BUILD-20191016.163456-712.jar spring-boot-starter-validation-2.2.
0.BUILD-20191016.163457-711.jar spring-boot-starter-aop-2.2.0.BUILD-201
91016.163422-713.jar spring-cloud-starter-netflix-eureka-client-2.1.5.B
UILD-20200131.212334-596.jar thymeleaf-extras-java8time-3.0.4.RELEASE.j
ar jackson-module-parameter-names-2.10.0.jar aspectjweaver-1.9.4.jar je
rsey-client-1.19.1.jar stax-api-1.0.1.jar ribbon-httpclient-2.3.0.jar j
ettison-1.3.7.jar spring-aop-5.2.0.RELEASE.jar spring-cloud-context-2.1
.5.BUILD-20200131.002935-351.jar guava-16.0.jar commons-io-2.6.jar ribb
on-transport-2.3.0.jar annotations-19.0.0.jar httpcore-4.4.12.jar logba
ck-classic-1.2.3.jar log4j-to-slf4j-2.12.1.jar ribbon-core-2.3.0.jar co
mmons-math-2.2.jar HdrHistogram-2.1.9.jar xmlpull-1.1.3.1.jar jakarta.a
nnotation-api-1.3.5.jar httpclient-4.5.10.jar spring-websocket-5.2.0.RE
LEASE.jar HikariCP-3.4.1.jar spring-cloud-starter-2.1.5.BUILD-20200131.
003057-348.jar archaius-core-0.7.6.jar spring-expression-5.2.0.RELEASE.
jar xpp3_min-1.1.4c.jar jackson-datatype-jdk8-2.10.0.jar antlr-2.7.7.ja
r servo-core-0.12.21.jar hystrix-core-1.5.18.jar gson-2.8.6.jar rxnetty
-servo-0.4.9.jar jersey-apache-client4-1.19.1.jar eureka-core-1.9.13.ja
r bcprov-jdk15on-1.64.jar druid-1.1.9.jar jackson-core-2.10.0.jar jakar
ta.validation-api-2.0.1.jar netflix-infix-0.3.0.jar nekohtml-1.9.22.jar
tomcat-embed-el-9.0.27.jar jboss-logging-3.4.1.Final.jar jul-to-slf4j-
1.7.28.jar thymeleaf-spring5-3.0.11.RELEASE.jar netflix-statistics-0.1.
1.jar spring-beans-5.2.0.RELEASE.jar aopalliance-1.0.jar tomcat-embed-w
ebsocket-9.0.27.jar classmate-1.5.0.jar spring-jcl-5.2.0.RELEASE.jar st
ringtemplate-3.2.1.jar spring-security-crypto-5.2.0.RELEASE.jar rxjava-
1.3.8.jar xml-apis-1.4.01.jar spring-boot-starter-2.2.0.BUILD-20191016.
163501-711.jar log4j-api-2.12.1.jar commons-collections-3.2.2.jar jacks
on-datatype-jsr310-2.10.0.jar spring-cloud-starter-netflix-ribbon-2.1.5
.BUILD-20200131.212329-596.jar jackson-databind-2.10.0.jar commons-code
c-1.13.jar jaxen-1.2.0.jar
... ... @@ -7,6 +7,9 @@ package com.tianbo.analysis;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
... ... @@ -18,11 +21,14 @@ import org.springframework.web.client.RestTemplate;
import java.time.Duration;
@SpringBootApplication
@SpringBootApplication(exclude = {
DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
@EnableScheduling
@EnableDiscoveryClient
@EnableTransactionManagement
@MapperScan("com.tianbo.analysis.dao")
//@MapperScan("com.tianbo.analysis.dao")
public class BootApplication {
public static void main(String[] args) {
... ...
package com.tianbo.analysis.bean;
import com.netflix.discovery.converters.Auto;
import com.tianbo.analysis.dao.*;
import com.tianbo.analysis.service.CustomMessageService;
import com.tianbo.analysis.service.SendLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class WlptBaseModel {
@Autowired
public ALLOCATEARRIVALMapper allocatearrivalMapper;
@Autowired
public SendLogService sendLogService;
@Autowired
public ARRIVEDMASTERMapper arrivedmasterMapper;
@Autowired
public ARRIVEDSECONDARYMapper arrivedsecondaryMapper;
@Autowired
public DEPARTURESLOADINGMapper departuresloadingMapper;
@Autowired
public INPORTALLOCATEMapper inportallocateMapper;
@Autowired
public INTERNATIONALTRANSITMapper internationaltransitMapper;
@Autowired
public ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
public OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
@Autowired
public PREPAREMASTERMapper preparemasterMapper;
@Autowired
public PREPARESECONDARYMapper preparesecondaryMapper;
@Autowired
public TALLYMASTERMapper tallymasterMapper;
@Autowired
public TALLYSECONDARYMapper tallysecondaryMapper;
@Autowired
public CUSTOMSMESSAGEMapper customsmessageMapper;
@Autowired
public CustomMessageService customMessageService;
@Autowired
public MANIFESTLOADMapper manifestloadMapper;
@Autowired
public MANIFESTLOSTCHANGEMapper manifestlostchangeMapper;
public WlptBaseModel() {
//处理多线程时 springboot 无法注入bean的问题
if (allocatearrivalMapper==null){
allocatearrivalMapper = SpringBeanUtitl.getBean(ALLOCATEARRIVALMapper.class);
}
if (sendLogService==null){
sendLogService = SpringBeanUtitl.getBean(SendLogService.class);
}
if (arrivedmasterMapper==null){
arrivedmasterMapper = SpringBeanUtitl.getBean(ARRIVEDMASTERMapper.class);
}
if (arrivedsecondaryMapper==null){
arrivedsecondaryMapper= SpringBeanUtitl.getBean(ARRIVEDSECONDARYMapper.class);
}
if(departuresloadingMapper==null){
departuresloadingMapper = SpringBeanUtitl.getBean(DEPARTURESLOADINGMapper.class);
}
if(inportallocateMapper==null){
inportallocateMapper = SpringBeanUtitl.getBean(INPORTALLOCATEMapper.class);
}
if(internationaltransitMapper==null){
internationaltransitMapper = SpringBeanUtitl.getBean(INTERNATIONALTRANSITMapper.class);
}
if(originmanifestmasterMapper==null){
originmanifestmasterMapper = SpringBeanUtitl.getBean(ORIGINMANIFESTMASTERMapper.class);
}
if(originmanifestsecondaryMapper==null){
originmanifestsecondaryMapper = SpringBeanUtitl.getBean(OriginmanifestsecondaryMapper.class);
}
if(preparemasterMapper==null){
preparemasterMapper = SpringBeanUtitl.getBean(PREPAREMASTERMapper.class);
}
if(preparesecondaryMapper==null){
preparesecondaryMapper = SpringBeanUtitl.getBean(PREPARESECONDARYMapper.class);
}
if(tallymasterMapper==null){
tallymasterMapper = SpringBeanUtitl.getBean(TALLYMASTERMapper.class);
}
if(tallysecondaryMapper==null){
tallysecondaryMapper = SpringBeanUtitl.getBean(TALLYSECONDARYMapper.class);
}
if(customsmessageMapper==null){
customsmessageMapper = SpringBeanUtitl.getBean(CUSTOMSMESSAGEMapper.class);
}
if(customMessageService==null){
customMessageService = SpringBeanUtitl.getBean(CustomMessageService.class);
}
if(manifestloadMapper==null){
manifestloadMapper = SpringBeanUtitl.getBean(MANIFESTLOADMapper.class);
}
if(manifestlostchangeMapper==null){
manifestlostchangeMapper = SpringBeanUtitl.getBean(MANIFESTLOSTCHANGEMapper.class);
}
}
public static void init(){
}
public int masterAnalysisReception(){
return 0;
}
public int secondAnalysisReception(){
return 0;
}
}
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.ALLOCATEARRIVAL;
import java.util.List;
public interface ALLOCATEARRIVALMapper {
int insert(ALLOCATEARRIVAL record);
int insertSelective(ALLOCATEARRIVAL record);
int updateRECEIPTION(ALLOCATEARRIVAL record);
List<ALLOCATEARRIVAL> selectAutoIdByAwb(ALLOCATEARRIVAL record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.ARRIVEDMASTER;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import java.util.List;
public interface ARRIVEDMASTERMapper {
int deleteByPrimaryKey(String autoid);
int insert(ARRIVEDMASTER record);
int insertSelective(ARRIVEDMASTER record);
ARRIVEDMASTER selectByPrimaryKey(String autoid);
int updateByPrimaryKeySelective(ARRIVEDMASTER record);
int updateByPrimaryKey(ARRIVEDMASTER record);
int insertRecept(ARRIVEDMASTER arrivedmaster);
int updateRECEIPTION(ARRIVEDMASTER record);
List<ARRIVEDMASTER> selectAutoIdByAwb(ARRIVEDMASTER record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.ARRIVEDSECONDARY;
import java.util.List;
public interface ARRIVEDSECONDARYMapper {
int insert(ARRIVEDSECONDARY record);
int insertSelective(ARRIVEDSECONDARY record);
int updateRECEIPTION(ARRIVEDSECONDARY record);
List<ARRIVEDSECONDARY> selectAutoIdByawbAawbH(ARRIVEDSECONDARY record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.CUSTOMSMESSAGE;
import com.tianbo.analysis.model.CUSTOMSMESSAGEWithBLOBs;
import java.util.List;
public interface CUSTOMSMESSAGEMapper {
int insert(CUSTOMSMESSAGEWithBLOBs record);
int insertSelective(CUSTOMSMESSAGEWithBLOBs record);
List<CUSTOMSMESSAGEWithBLOBs> selectMessage(String messageId);
int updateMessageByMessageid(CUSTOMSMESSAGE record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.DEPARTURESLOADING;
import java.util.List;
public interface DEPARTURESLOADINGMapper {
int insert(DEPARTURESLOADING record);
int insertSelective(DEPARTURESLOADING record);
int updateRECEIPTION(DEPARTURESLOADING record);
List<DEPARTURESLOADING> selectAutoIdByAwb(DEPARTURESLOADING record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.INPORTALLOCATE;
import java.util.List;
public interface INPORTALLOCATEMapper {
int insert(INPORTALLOCATE record);
int insertSelective(INPORTALLOCATE record);
int updateRECEIPTION(INPORTALLOCATE record);
List<INPORTALLOCATE> selectAutoIdByAwb(INPORTALLOCATE record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.INTERNATIONALTRANSIT;
import java.util.List;
public interface INTERNATIONALTRANSITMapper {
int insert(INTERNATIONALTRANSIT record);
int insertSelective(INTERNATIONALTRANSIT record);
int updateRECEIPTION(INTERNATIONALTRANSIT record);
List<INTERNATIONALTRANSIT> selectAutoIdByAwb(INTERNATIONALTRANSIT record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.MANIFESTLOAD;
import java.util.List;
public interface MANIFESTLOADMapper {
int insert(MANIFESTLOAD record);
int insertSelective(MANIFESTLOAD record);
int updateRECEIPTION(MANIFESTLOAD record);
List<MANIFESTLOAD> selectAutoIdByawbAawbH(MANIFESTLOAD record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.MANIFESTLOSTCHANGE;
import java.util.List;
public interface MANIFESTLOSTCHANGEMapper {
int insert(MANIFESTLOSTCHANGE record);
int insertSelective(MANIFESTLOSTCHANGE record);
int updateRECEIPTION(MANIFESTLOSTCHANGE record);
List<MANIFESTLOSTCHANGE> selectAutoIdByawbAawbH(MANIFESTLOSTCHANGE record);
}
\ No newline at end of file
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.ARRIVEDMASTER;
import com.tianbo.analysis.model.PREPAREMASTER;
import java.util.List;
public interface PREPAREMASTERMapper {
int insert(PREPAREMASTER record);
int insertSelective(PREPAREMASTER record);
int updateRECEIPTION(PREPAREMASTER record);
List<PREPAREMASTER> selectAutoIdByAwb(PREPAREMASTER record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.ARRIVEDSECONDARY;
import com.tianbo.analysis.model.PREPARESECONDARY;
import java.util.List;
public interface PREPARESECONDARYMapper {
int deleteByPrimaryKey(Short id);
int insert(PREPARESECONDARY record);
int insertSelective(PREPARESECONDARY record);
PREPARESECONDARY selectByPrimaryKey(Short id);
int updateByPrimaryKeySelective(PREPARESECONDARY record);
int updateByPrimaryKey(PREPARESECONDARY record);
int updateRECEIPTION(PREPARESECONDARY record);
List<PREPARESECONDARY> selectAutoIdByawbAawbH(PREPARESECONDARY 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.dao;
import com.tianbo.analysis.model.TALLYMASTER;
import java.util.List;
public interface TALLYMASTERMapper {
int insert(TALLYMASTER record);
int insertSelective(TALLYMASTER record);
int updateRECEIPTION(TALLYMASTER record);
List<TALLYMASTER> selectAutoIdByAwb(TALLYMASTER record);
}
\ No newline at end of file
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.TALLYSECONDARY;
import java.util.List;
public interface TALLYSECONDARYMapper {
int insert(TALLYSECONDARY record);
int insertSelective(TALLYSECONDARY record);
int updateRECEIPTION(TALLYSECONDARY record);
List<TALLYSECONDARY> selectAutoIdByawbAawbH(TALLYSECONDARY record);
}
\ No newline at end of file
package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.Agent_Notice;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.tools.AWBTools;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
@Slf4j
@Component
public class AgentXmlHandle {
private static AgentXmlHandle agentXmlHandle;
public void Http_resolver(CustomReception customReception){
try{
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(5000);
requestFactory.setReadTimeout(5000);
RestTemplate restTemplate = new RestTemplate(requestFactory);
String secondSplit = "_";
String waybillnosecondary="";
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
//取分单号
String[] awbhArr = customReception.getWayBillSecond().split("_");
waybillnosecondary = awbhArr[1];
}
Agent_Notice notice = restTemplate.getForObject("http://10.50.3.73:1983/agent/receipt/a0608c4054662dd902e1314f7e450e3eaa81c114?message_type={1}&waybillNo={2}&waybillNoSub={3}&response_code={4}&response_text={5}"
, Agent_Notice.class,"MT2201", AWBTools.awbFormat(customReception.getWayBillMaster()),waybillnosecondary,customReception.getResponseCode(),customReception.getResponseText());
log.info(notice.toString());
}catch (Exception e){
log.error("链接代理人服务器超时或者接口异常,{}",e);
}
}
}
package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.CustomMessageService;
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.Value;
import org.springframework.stereotype.Component;
import org.xml.sax.SAXParseException;
import javax.annotation.PostConstruct;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.CountDownLatch;
/**
* @author mrz
* @e
* 海关新舱单回执解析xml文件
*/
@Data
@Component
@Slf4j
public class CustomXmlHandleThread implements Runnable{
private CountDownLatch latch;
//备份目录
@Value("${custom.receptBakDir}")
private String bakupDir;
//解析出错转移目录
@Value("${custom.errBakDir}")
private String errBakDir;
//回执转发目录
@Value("${custom.transmitDir}")
private String transmitDir;
//匹配技术回执正则
@Value("${custom.delTechnologyReceptMatch}")
private String delTechnologyReceptMatch;
private File xmlfile;
private static CustomXmlHandleThread 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 = "//ResponseType/Code";
public final static String ResponseText = "//ResponseType/Text";
/**
* 海关国际转运业务回执报体
*/
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";
public final static String TransResponseCode = "//ResponseType/Code";
public final static String TransResponseText = "//ResponseType/Text";
//通过@PostConstruct实现初始化bean之前进行的操作,解决service调用空指针问题
@PostConstruct
public void init() {
customXmlHandle = this;
customXmlHandle.bakupDir = this.bakupDir;
customXmlHandle.errBakDir = this.errBakDir;
customXmlHandle.delTechnologyReceptMatch = this.delTechnologyReceptMatch;
customXmlHandle.transmitDir = this.transmitDir;
// 初使化时将已静态化的testService实例化
}
@Override
public void run() {
String filename = xmlfile.getName();
log.info("线程:{}开始",filename);
if(filename.matches(customXmlHandle.delTechnologyReceptMatch)){
log.warn("{}报文为技术回执,剪切到错误备份目录,不解析",filename);
errBak(xmlfile);
log.info("{}报文为技术回执,剪切备份成功..开始解析下一文件,当前线程即将结束",filename);
}
else
{
try{
//解析前先转发
FileUtils.copyFileToDirectory(xmlfile, new File(customXmlHandle.transmitDir));
int i =handelXmlDocument();
String today = DateUtil.getTodayBy_yyyyMMdd();
String backdireByDay = customXmlHandle.bakupDir + "/" + today;
//操作成功,则转移剪切解析文件到备份目录,否则转移到error目录备份
if(i>0){
File bakupDirectory = new File(backdireByDay);
//解析成功备份一份到备份目录
FileUtils.moveFileToDirectory(xmlfile,bakupDirectory,true);
}else {
errBak(xmlfile);
}
}catch (FileExistsException e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
}catch (Exception e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
errBak(xmlfile);
e.printStackTrace();
}
}
log.info("线程:{}结束",xmlfile.getName());
latch.countDown();
log.info("剩余线程数量{}",latch.getCount());
}
/**
*
*
* @return
* @throws DocumentException
* @throws UnsupportedEncodingException
* @throws SAXParseException
* @throws FileNotFoundException
*/
private int handelXmlDocument() throws DocumentException,UnsupportedEncodingException,SAXParseException,FileNotFoundException {
int i = 0;
String secondSplit = "_";
SAXReader saxReader = new SAXReader();
Document document = saxReader.read(xmlfile);
Element contentRoot = document.getRootElement();
String flightNo = "UNKONW";
String flightDate = "20101010";
//开始解析
String msgType = XMLXPath.getSingleValueByPath(document,MessageType);
String journeyid = XMLXPath.getSingleValueByPath(document,JourneyID);
// XMLXPath.getSingleValueByPath(document, )
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);
String messageId = XMLXPath.getSingleValueByPath(document, MessageID);
String sendTime = XMLXPath.getSingleValueByPath(document,SendTime);
String sendId = XMLXPath.getSingleValueByPath(document,SenderID);
String reciveId = XMLXPath.getSingleValueByPath(document,ReceiverID);
String version = XMLXPath.getSingleValueByPath(document,Version);
String functionCode = XMLXPath.getSingleValueByPath(document,FunctionCode);
CustomReception customReception = new CustomReception( msgType,
flightNo,
flightDate,
awbA,
awbH,
resCode,
resText,
messageId,
sendTime,
sendId,
reciveId,
version,
functionCode);
/**
* 如果回执中没有携带航班信息节点,说明是出错报文
* 到发送日志表根据messageid 找到相应的发送日志报文的航班及运单信息,再进行解析
*/
if(!StringUtils.isEmpty(journeyid)){
String[] flightList = journeyid.split("/");
if(flightList.length > 0){
flightNo = flightList[0];
flightDate = flightList[1];
customReception.setFlightNo(flightNo);
customReception.setFlightDate(flightDate);
}
}else {
CUSTOMSMESSAGE customsmessage = new CUSTOMSMESSAGE();
customReception = customsmessage.getWaybillInfoByCutomResponse(customReception);
}
switch (msgType){
case "MT9999":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
PREPARESECONDARY preparesecondary = new PREPARESECONDARY(customReception);
int pre_i = preparesecondary.secondAnalysisReception();
if (pre_i>0){
i=1;
}else {
ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY(customReception);
int arr_i=arrivedsecondary.secondAnalysisReception();
if (arr_i>0){
i= 1;
}else {
Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary(customReception);
int org_i=originmanifestsecondary.secondAnalysisReception();
if (org_i>0){
i=1;
}
}
}
}else{
ORIGINMANIFESTMASTER originmanifestmaster = new ORIGINMANIFESTMASTER(customReception);
PREPAREMASTER preparemaster= new PREPAREMASTER(customReception);
ARRIVEDMASTER arrivedmaster9999 = new ARRIVEDMASTER(customReception);
if(originmanifestmaster.masterAnalysisReception()>0){
i=1;
}else if(preparemaster.masterAnalysisReception()>0){
i=1;
}else {
i=arrivedmaster9999.masterAnalysisReception();
}
}
AgentXmlHandle agentXmlHandle=new AgentXmlHandle();
agentXmlHandle.Http_resolver(customReception);
break;
case "MT3201":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY(customReception);
i=arrivedsecondary.secondAnalysisReception();
}else {
ARRIVEDMASTER arrivedmaster = new ARRIVEDMASTER(customReception);
i=arrivedmaster.masterAnalysisReception();
}
break;
case "MT5202":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
TALLYSECONDARY tallysecondary = new TALLYSECONDARY(customReception);
i=tallysecondary.secondAnalysisReception();
}else {
TALLYMASTER tallymaster= new TALLYMASTER(customReception);
i = tallymaster.masterAnalysisReception();
}
break;
case "MT5201":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
TALLYSECONDARY tallysecondary = new TALLYSECONDARY(customReception);
i=tallysecondary.secondAnalysisReception();
}else {
TALLYMASTER tallymaster= new TALLYMASTER(customReception);
i = tallymaster.masterAnalysisReception();
}
break;
case "MT4201":
DEPARTURESLOADING departuresloading = new DEPARTURESLOADING(customReception);
i=departuresloading.masterAnalysisReception();
break;
case "MT1201":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary(customReception);
i=originmanifestsecondary.secondAnalysisReception();
}else {
ORIGINMANIFESTMASTER originmanifestmaster1201 = new ORIGINMANIFESTMASTER(customReception);
i = originmanifestmaster1201.masterAnalysisReception();
}
break;
case "MT2201":
if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
PREPARESECONDARY preparesecondary = new PREPARESECONDARY(customReception);
i = preparesecondary.secondAnalysisReception();
}else {
PREPAREMASTER preparemaster1201= new PREPAREMASTER(customReception);
i = preparemaster1201.masterAnalysisReception();
}
break;
case "MT6202":
INPORTALLOCATE inportallocate = new INPORTALLOCATE(customReception);
i = inportallocate.masterAnalysisReception();
break;
case "MT3202":
ALLOCATEARRIVAL allocatearrival = new ALLOCATEARRIVAL(customReception);
i= allocatearrival.masterAnalysisReception();
break;
case "MT8205":
i = transXmlHandel(document,customReception);
break;
case "MT8202":
MANIFESTLOAD manifestload = new MANIFESTLOAD(customReception);
i= manifestload.secondAnalysisReception();
break;
case "MT8203":
MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
i= manifestlostchange.secondAnalysisReception();
break;
default:
break;
}
updateCustomMessage(customReception);
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 = "20101010";
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());
INTERNATIONALTRANSIT internationaltransit = new INTERNATIONALTRANSIT(transCustomReception);
int i=internationaltransit.masterAnalysisReception();
return i;
}
private int updateCustomMessage(CustomReception customReception){
CUSTOMSMESSAGE customsmessage = new CUSTOMSMESSAGE(customReception);
return customsmessage.updateMessageByMessageid();
}
private void errBak(File file){
try {
String today = DateUtil.getTodayBy_yyyyMMdd();
String errDirByDay = customXmlHandle.errBakDir + "/" + today;
File berrDirectory = new File(errDirByDay);
FileUtils.moveFileToDirectory(file,berrDirectory,true);
log.info("数据库未找到与回执适配的信息备份文件:{}:",file.getName());
}catch (FileExistsException e){
log.error("备份解析错误文件失败,目标文件夹存在同名文件{}",file.getName());
}catch (Exception e){
e.printStackTrace();
}
}
}
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class ALLOCATEARRIVAL extends WlptBaseModel{
private String id;
private Date createdate;
private String waybillno;
private String carrier;
private String flightno;
private Date flightdate;
private String customos;
private String arrivalpieces;
private String arrivalweight;
private String unloadingland;
private String productcode;
private String status;
private String receiptinformation;
public ALLOCATEARRIVAL(){
}
public ALLOCATEARRIVAL(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()));
}
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getWaybillno() {
return waybillno;
}
public void setWaybillno(String waybillno) {
this.waybillno = waybillno == null ? null : waybillno.trim();
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getCustomos() {
return customos;
}
public void setCustomos(String customos) {
this.customos = customos == null ? null : customos.trim();
}
public String getArrivalpieces() {
return arrivalpieces;
}
public void setArrivalpieces(String arrivalpieces) {
this.arrivalpieces = arrivalpieces == null ? null : arrivalpieces.trim();
}
public String getArrivalweight() {
return arrivalweight;
}
public void setArrivalweight(String arrivalweight) {
this.arrivalweight = arrivalweight == null ? null : arrivalweight.trim();
}
public String getUnloadingland() {
return unloadingland;
}
public void setUnloadingland(String unloadingland) {
this.unloadingland = unloadingland == null ? null : unloadingland.trim();
}
public String getProductcode() {
return productcode;
}
public void setProductcode(String productcode) {
this.productcode = productcode == null ? null : productcode.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getReceiptinformation() {
return receiptinformation;
}
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
}
@Override
public int masterAnalysisReception(){
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="+autoId);
int ii =sendLogService.insertSendlog("MT3202",receiptinformation,autoId);
if (i>0 && ii>0){
log.info("运单号 {} 分拨运抵回执更新成功",waybillno);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class ARRIVEDMASTER extends WlptBaseModel {
private String autoid;
private String waybillnomaster;
private String tcdName;
private String tcdTypecode;
private String flightno;
private Date flightDate;
private String carrier;
private String originatingstation;
private String oName;
private String destinationstation;
private String fdName;
private String arrivedtotalpiece;
private String totalpiecequantity;
private String arrivedtotalweight;
private String grossweightmeasureuc;
private String totalgrossweightmeasure;
private String totalgrossweightmeasureuc;
private String chargeableweightmeasure;
private String chargeableweightmeasureuc;
private Date arriveddate;
private String transportsplitdescription;
private String customscode;
private String productname;
private String status;
private String receiptinformation;
private Date createdate;
public ARRIVEDMASTER() {
}
public ARRIVEDMASTER(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
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()));
}
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiptinformation = customReception.getResponseText();
}
@Override
public int masterAnalysisReception() {
//更新主单回执
int i = arrivedmasterMapper.updateRECEIPTION(this);
//获取分单autoid
List<ARRIVEDMASTER> arrivedmasterList = arrivedmasterMapper.selectAutoIdByAwb(this);
if(!arrivedmasterList.isEmpty()){
ARRIVEDMASTER originMaster = arrivedmasterList.get(0);
String autoId = originMaster.getAutoid();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:"+waybillnomaster+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT3201",receiptinformation,autoId);
if (i>0 && ii>0){
log.info("运单号 {} 运抵回执更新成功",waybillnomaster);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class ARRIVEDSECONDARY extends WlptBaseModel {
private String autoid;
private String waybillnomaster;
private String tcdName;
private String tcdTypecode;
private String waybillnosecondary;
private String carrier;
private String oId;
private String oName;
private String fdId;
private String fdName;
private String flightno;
private Date flightdate;
private String arrivedtotalpiece;
private String totalpiecequantity;
private String arrivedtotalweight;
private String grossweightmeasureuc;
private String totalgrossweightmeasure;
private String totalgrossweightmeasureuc;
private String chargeableweightmeasure;
private String chargeableweightmeasureuc;
private Date arriveddate;
private String customscode;
private String productname;
private Date createdate;
private String arrivedmasterid;
private String transportsplitdescription;
private String receiption;
private String status;
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 getTcdName() {
return tcdName;
}
public void setTcdName(String tcdName) {
this.tcdName = tcdName == null ? null : tcdName.trim();
}
public String getTcdTypecode() {
return tcdTypecode;
}
public void setTcdTypecode(String tcdTypecode) {
this.tcdTypecode = tcdTypecode == null ? null : tcdTypecode.trim();
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getoId() {
return oId;
}
public void setoId(String oId) {
this.oId = oId == null ? null : oId.trim();
}
public String getoName() {
return oName;
}
public void setoName(String oName) {
this.oName = oName == null ? null : oName.trim();
}
public String getFdId() {
return fdId;
}
public void setFdId(String fdId) {
this.fdId = fdId == null ? null : fdId.trim();
}
public String getFdName() {
return fdName;
}
public void setFdName(String fdName) {
this.fdName = fdName == null ? null : fdName.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getArrivedtotalpiece() {
return arrivedtotalpiece;
}
public void setArrivedtotalpiece(String arrivedtotalpiece) {
this.arrivedtotalpiece = arrivedtotalpiece == null ? null : arrivedtotalpiece.trim();
}
public String getTotalpiecequantity() {
return totalpiecequantity;
}
public void setTotalpiecequantity(String totalpiecequantity) {
this.totalpiecequantity = totalpiecequantity == null ? null : totalpiecequantity.trim();
}
public String getArrivedtotalweight() {
return arrivedtotalweight;
}
public void setArrivedtotalweight(String arrivedtotalweight) {
this.arrivedtotalweight = arrivedtotalweight == null ? null : arrivedtotalweight.trim();
}
public String getGrossweightmeasureuc() {
return grossweightmeasureuc;
}
public void setGrossweightmeasureuc(String grossweightmeasureuc) {
this.grossweightmeasureuc = grossweightmeasureuc == null ? null : grossweightmeasureuc.trim();
}
public String getTotalgrossweightmeasure() {
return totalgrossweightmeasure;
}
public void setTotalgrossweightmeasure(String totalgrossweightmeasure) {
this.totalgrossweightmeasure = totalgrossweightmeasure == null ? null : totalgrossweightmeasure.trim();
}
public String getTotalgrossweightmeasureuc() {
return totalgrossweightmeasureuc;
}
public void setTotalgrossweightmeasureuc(String totalgrossweightmeasureuc) {
this.totalgrossweightmeasureuc = totalgrossweightmeasureuc == null ? null : totalgrossweightmeasureuc.trim();
}
public String getChargeableweightmeasure() {
return chargeableweightmeasure;
}
public void setChargeableweightmeasure(String chargeableweightmeasure) {
this.chargeableweightmeasure = chargeableweightmeasure == null ? null : chargeableweightmeasure.trim();
}
public String getChargeableweightmeasureuc() {
return chargeableweightmeasureuc;
}
public void setChargeableweightmeasureuc(String chargeableweightmeasureuc) {
this.chargeableweightmeasureuc = chargeableweightmeasureuc == null ? null : chargeableweightmeasureuc.trim();
}
public Date getArriveddate() {
return arriveddate;
}
public void setArriveddate(Date arriveddate) {
this.arriveddate = arriveddate;
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getArrivedmasterid() {
return arrivedmasterid;
}
public void setArrivedmasterid(String arrivedmasterid) {
this.arrivedmasterid = arrivedmasterid == null ? null : arrivedmasterid.trim();
}
public String getTransportsplitdescription() {
return transportsplitdescription;
}
public void setTransportsplitdescription(String transportsplitdescription) {
this.transportsplitdescription = transportsplitdescription == null ? null : transportsplitdescription.trim();
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption == null ? null : receiption.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public ARRIVEDSECONDARY() {
}
public ARRIVEDSECONDARY(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.waybillnosecondary = awbhArr[1];
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()));
}
this.receiption = customReception.getResponseText();
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
}
@Override
public int secondAnalysisReception() {
//更新分单回执
int i = arrivedsecondaryMapper.updateRECEIPTION(this);
//获取分单autoid
List<ARRIVEDSECONDARY> arrivedsecondaryList = arrivedsecondaryMapper.selectAutoIdByawbAawbH(this);
if(!arrivedsecondaryList.isEmpty()){
ARRIVEDSECONDARY arrivedSecond = arrivedsecondaryList.get(0);
String autoId = arrivedSecond.getAutoid();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
int ii = sendLogService.insertSendlog("MT3201",receiption,autoId);
//todo:同时更新发送日志表的回执信息
if (i>0 && ii>0 ){
log.info("运单号 {} 运抵分单回执更新成功",waybillnosecondary);
return 1;
}
}else {
//todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import lombok.Data;
@Data
public class Agent_Notice {
private int status;
private int code;
private String msg;
private Object data;
private int page;
private int count;
}
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
import com.tianbo.util.Date.DateUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Slf4j
public class CUSTOMSMESSAGE extends WlptBaseModel {
private String autoid;
private String messageid;
private String messagetype;
private String messagestatus;
private Date sendtime;
private Date receivetime;
private String objectid;
private String flightno;
private Date flightdate;
private String masterautoid;
private String waybillnomaster;
private String secondaryautoid;
private String waybillnosecondary;
private BigDecimal pcs;
private BigDecimal wt;
private String responsecode;
private String responsetext;
private Date createtime;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getMessageid() {
return messageid;
}
public void setMessageid(String messageid) {
this.messageid = messageid == null ? null : messageid.trim();
}
public String getMessagetype() {
return messagetype;
}
public void setMessagetype(String messagetype) {
this.messagetype = messagetype == null ? null : messagetype.trim();
}
public String getMessagestatus() {
return messagestatus;
}
public void setMessagestatus(String messagestatus) {
this.messagestatus = messagestatus == null ? null : messagestatus.trim();
}
public Date getSendtime() {
return sendtime;
}
public void setSendtime(Date sendtime) {
this.sendtime = sendtime;
}
public Date getReceivetime() {
return receivetime;
}
public void setReceivetime(Date receivetime) {
this.receivetime = receivetime;
}
public String getObjectid() {
return objectid;
}
public void setObjectid(String objectid) {
this.objectid = objectid == null ? null : objectid.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getMasterautoid() {
return masterautoid;
}
public void setMasterautoid(String masterautoid) {
this.masterautoid = masterautoid == null ? null : masterautoid.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public String getSecondaryautoid() {
return secondaryautoid;
}
public void setSecondaryautoid(String secondaryautoid) {
this.secondaryautoid = secondaryautoid == null ? null : secondaryautoid.trim();
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public BigDecimal getPcs() {
return pcs;
}
public void setPcs(BigDecimal pcs) {
this.pcs = pcs;
}
public BigDecimal getWt() {
return wt;
}
public void setWt(BigDecimal wt) {
this.wt = wt;
}
public String getResponsecode() {
return responsecode;
}
public void setResponsecode(String responsecode) {
this.responsecode = responsecode == null ? null : responsecode.trim();
}
public String getResponsetext() {
return responsetext;
}
public void setResponsetext(String responsetext) {
this.responsetext = responsetext == null ? null : responsetext.trim();
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public CUSTOMSMESSAGE(){
}
public CUSTOMSMESSAGE(CustomReception customReception) {
this.messageid = customReception.getMessageID();
this.messagetype = customReception.getMessageType();
this.receivetime = new Date();
this.flightno = customReception.getFlightNo();
this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
this.waybillnomaster = customReception.getWayBillMaster();
this.waybillnosecondary = customReception.getWayBillSecond();
this.responsecode = customReception.getResponseCode();
this.responsetext = customReception.getResponseText();
this.messagestatus = "3";
}
public CustomReception getWaybillInfoByCutomResponse(CustomReception customReception){
return customMessageService.getWaybillInfoByCutomResponse(customReception);
}
public int updateMessageByMessageid(){
return customsmessageMapper.updateMessageByMessageid(this);
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.util.Date.DateUtil;
import java.util.Date;
public class CUSTOMSMESSAGEWithBLOBs extends CUSTOMSMESSAGE {
private String messagecontent;
private String receivecontent;
public String getMessagecontent() {
return messagecontent;
}
public void setMessagecontent(String messagecontent) {
this.messagecontent = messagecontent == null ? null : messagecontent.trim();
}
public String getReceivecontent() {
return receivecontent;
}
public void setReceivecontent(String receivecontent) {
this.receivecontent = receivecontent == null ? null : receivecontent.trim();
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class DEPARTURESLOADING extends WlptBaseModel {
private String id;
private Date createdate;
private String waybillno;
private String flightno;
private Date flightdate;
private String originatingstation;
private String destinationstation;
private String stowagepieces;
private String stowageweight;
private String waybillpieces;
private String waybillweight;
private Date stowagedate;
private String productname;
private String specialcode;
private String customs;
private String receiption;
private String status;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getWaybillno() {
return waybillno;
}
public void setWaybillno(String waybillno) {
this.waybillno = waybillno == null ? null : waybillno.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
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 getStowagepieces() {
return stowagepieces;
}
public void setStowagepieces(String stowagepieces) {
this.stowagepieces = stowagepieces == null ? null : stowagepieces.trim();
}
public String getStowageweight() {
return stowageweight;
}
public void setStowageweight(String stowageweight) {
this.stowageweight = stowageweight == null ? null : stowageweight.trim();
}
public String getWaybillpieces() {
return waybillpieces;
}
public void setWaybillpieces(String waybillpieces) {
this.waybillpieces = waybillpieces == null ? null : waybillpieces.trim();
}
public String getWaybillweight() {
return waybillweight;
}
public void setWaybillweight(String waybillweight) {
this.waybillweight = waybillweight == null ? null : waybillweight.trim();
}
public Date getStowagedate() {
return stowagedate;
}
public void setStowagedate(Date stowagedate) {
this.stowagedate = stowagedate;
}
public String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.trim();
}
public String getSpecialcode() {
return specialcode;
}
public void setSpecialcode(String specialcode) {
this.specialcode = specialcode == null ? null : specialcode.trim();
}
public String getCustoms() {
return customs;
}
public void setCustoms(String customs) {
this.customs = customs == null ? null : customs.trim();
}
public String getReceiption() {
return receiption;
}
public void setReceiption(String receiption) {
this.receiption = receiption == null ? null : receiption.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public DEPARTURESLOADING() {
}
public DEPARTURESLOADING(CustomReception customReception) {
init();
this.waybillno = AWBTools.awbFormat(customReception.getWayBillMaster());
this.flightno = customReception.getFlightNo();
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
}
this.receiption = customReception.getResponseText();
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
}
@Override
public int masterAnalysisReception() {
int i = departuresloadingMapper.updateRECEIPTION(this);
List<DEPARTURESLOADING> list = departuresloadingMapper.selectAutoIdByAwb(this);
if(!list.isEmpty()){
DEPARTURESLOADING departuresloading1 = list.get(0);
String autoId = departuresloading1.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:"+waybillno+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT4201",receiption,autoId);
if (i>0 && ii>0){
log.info("运单号 {} 装载回执更新成功",waybillno);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class INPORTALLOCATE extends WlptBaseModel {
private String id;
private Date createdate;
private String waybillno;
private String carrier;
private String flightno;
private Date flightdate;
private String customos;
private String tallypieces;
private String tallyweight;
private String allocatepieces;
private String allocateweight;
private String allocatedestination;
private String trailernumber;
private String status;
private String receiptinformation;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getWaybillno() {
return waybillno;
}
public void setWaybillno(String waybillno) {
this.waybillno = waybillno == null ? null : waybillno.trim();
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getCustomos() {
return customos;
}
public void setCustomos(String customos) {
this.customos = customos == null ? null : customos.trim();
}
public String getTallypieces() {
return tallypieces;
}
public void setTallypieces(String tallypieces) {
this.tallypieces = tallypieces == null ? null : tallypieces.trim();
}
public String getTallyweight() {
return tallyweight;
}
public void setTallyweight(String tallyweight) {
this.tallyweight = tallyweight == null ? null : tallyweight.trim();
}
public String getAllocatepieces() {
return allocatepieces;
}
public void setAllocatepieces(String allocatepieces) {
this.allocatepieces = allocatepieces == null ? null : allocatepieces.trim();
}
public String getAllocateweight() {
return allocateweight;
}
public void setAllocateweight(String allocateweight) {
this.allocateweight = allocateweight == null ? null : allocateweight.trim();
}
public String getAllocatedestination() {
return allocatedestination;
}
public void setAllocatedestination(String allocatedestination) {
this.allocatedestination = allocatedestination == null ? null : allocatedestination.trim();
}
public String getTrailernumber() {
return trailernumber;
}
public void setTrailernumber(String trailernumber) {
this.trailernumber = trailernumber == null ? null : trailernumber.trim();
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getReceiptinformation() {
return receiptinformation;
}
public void setReceiptinformation(String receiptinformation) {
this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
}
public INPORTALLOCATE() {
}
public INPORTALLOCATE(CustomReception customReception) {
this.waybillno = customReception.getWayBillMaster();
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()));
}
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiptinformation = customReception.getResponseText();
}
@Override
public int masterAnalysisReception() {
int i = inportallocateMapper.updateRECEIPTION(this);
List<INPORTALLOCATE> arrivedmasterList = inportallocateMapper.selectAutoIdByAwb(this);
if(!arrivedmasterList.isEmpty()){
INPORTALLOCATE departuresloading1 = arrivedmasterList.get(0);
String autoId = departuresloading1.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:"+waybillno+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT6202",receiptinformation,autoId);
if (i>0 && ii>0 ){
log.info("运单号 {} 分拨申请回执更新成功",waybillno);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
@Data
@Slf4j
public class INTERNATIONALTRANSIT extends WlptBaseModel {
private String autoid;
private Date createdate;
private String originalCarrier;
private String originalFlightno;
private Date originalFlightdate;
private String originalBillno;
private String originalSubNumber;
private String preCarrier;
private String preFlightno;
private Date preFlightdate;
private String preBillno;
private String preSubNumber;
private String billpiece;
private String billweight;
private String product;
private String originatingstation;
private String packagingtype;
private String status;
private String receiption;
private String destinationstationBill;
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 getOriginalCarrier() {
return originalCarrier;
}
public void setOriginalCarrier(String originalCarrier) {
this.originalCarrier = originalCarrier == null ? null : originalCarrier.trim();
}
public String getOriginalFlightno() {
return originalFlightno;
}
public void setOriginalFlightno(String originalFlightno) {
this.originalFlightno = originalFlightno == null ? null : originalFlightno.trim();
}
public Date getOriginalFlightdate() {
return originalFlightdate;
}
public void setOriginalFlightdate(Date originalFlightdate) {
this.originalFlightdate = originalFlightdate;
}
public String getOriginalBillno() {
return originalBillno;
}
public void setOriginalBillno(String originalBillno) {
this.originalBillno = originalBillno == null ? null : originalBillno.trim();
}
public String getOriginalSubNumber() {
return originalSubNumber;
}
public void setOriginalSubNumber(String originalSubNumber) {
this.originalSubNumber = originalSubNumber == null ? null : originalSubNumber.trim();
}
public String getPreCarrier() {
return preCarrier;
}
public void setPreCarrier(String preCarrier) {
this.preCarrier = preCarrier == null ? null : preCarrier.trim();
}
public String getPreFlightno() {
return preFlightno;
}
public void setPreFlightno(String preFlightno) {
this.preFlightno = preFlightno == null ? null : preFlightno.trim();
}
public Date getPreFlightdate() {
return preFlightdate;
}
public void setPreFlightdate(Date preFlightdate) {
this.preFlightdate = preFlightdate;
}
public String getPreBillno() {
return preBillno;
}
public void setPreBillno(String preBillno) {
this.preBillno = preBillno == null ? null : preBillno.trim();
}
public String getPreSubNumber() {
return preSubNumber;
}
public void setPreSubNumber(String preSubNumber) {
this.preSubNumber = preSubNumber == null ? null : preSubNumber.trim();
}
public String getBillpiece() {
return billpiece;
}
public void setBillpiece(String billpiece) {
this.billpiece = billpiece == null ? null : billpiece.trim();
}
public String getBillweight() {
return billweight;
}
public void setBillweight(String billweight) {
this.billweight = billweight == null ? null : billweight.trim();
}
public String getProduct() {
return product;
}
public void setProduct(String product) {
this.product = product == null ? null : product.trim();
}
public String getOriginatingstation() {
return originatingstation;
}
public void setOriginatingstation(String originatingstation) {
this.originatingstation = originatingstation == null ? null : originatingstation.trim();
}
public String getPackagingtype() {
return packagingtype;
}
public void setPackagingtype(String packagingtype) {
this.packagingtype = packagingtype == null ? null : packagingtype.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 getDestinationstationBill() {
return destinationstationBill;
}
public void setDestinationstationBill(String destinationstationBill) {
this.destinationstationBill = destinationstationBill == null ? null : destinationstationBill.trim();
}
public INTERNATIONALTRANSIT(){
}
public INTERNATIONALTRANSIT(CustomReception customReception) {
String[] flightInfo = AWBTools.splitFlight(customReception.getImportFlightNo());
this.originalCarrier = flightInfo[0];
this.originalFlightno = flightInfo[1];
this.originalFlightdate = DateUtil.formatByyyyyMMdd(customReception.getImportFlightDate());
this.originalBillno = AWBTools.awbFormat(customReception.getImportWaybillMaster());
//TODO:碰见分单回执再解析
this.originalSubNumber = customReception.getWayBillSecond();
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
}
@Override
public int masterAnalysisReception() {
int i = internationaltransitMapper.updateRECEIPTION(this);
List<INTERNATIONALTRANSIT> internationaltransits = internationaltransitMapper.selectAutoIdByAwb(this);
if(!internationaltransits.isEmpty()){
INTERNATIONALTRANSIT internationaltransit = internationaltransits.get(0);
String autoId = internationaltransit.getAutoid();
//插入sendlog记录表
log.info("即将插入国际转运日志运单号为:"+originalBillno+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT8205",receiption,autoId);
if (i>0 && ii>0){
log.info("运单号 {} 国际转运回执更新成功",originalBillno);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
@Slf4j
public class MANIFESTLOAD extends WlptBaseModel {
private String id;
private Date createdate;
private String flightno;
private String waybillnomaster;
private Date flightdate;
private String waybillnosecondary;
private String remark;
private String status;
private String receiption;
private String customcode;
private String reason;
private String contactname;
private String contacttel;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public String getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
public String getWaybillnosecondary() {
return waybillnosecondary;
}
public void setWaybillnosecondary(String waybillnosecondary) {
this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.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 getCustomcode() {
return customcode;
}
public void setCustomcode(String customcode) {
this.customcode = customcode == null ? null : customcode.trim();
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason == null ? null : reason.trim();
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname == null ? null : contactname.trim();
}
public String getContacttel() {
return contacttel;
}
public void setContacttel(String contacttel) {
this.contacttel = contacttel == null ? null : contacttel.trim();
}
public MANIFESTLOAD() {
}
public MANIFESTLOAD(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
if(!customReception.getWayBillSecond().isEmpty()){
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.waybillnosecondary = awbhArr[1];
}
this.flightno = customReception.getFlightNo();
this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
}
@Override
public int secondAnalysisReception(){
//更新分单回执
int i = manifestloadMapper.updateRECEIPTION(this);
//获取分单autoid
List<MANIFESTLOAD> secondaryList = manifestloadMapper.selectAutoIdByawbAawbH(this);
if(!secondaryList.isEmpty()){
MANIFESTLOAD arrivedSecond = secondaryList.get(0);
String autoId = arrivedSecond.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
int ii = sendLogService.insertSendlog("MT8202",receiption,autoId);
//todo:同时更新发送日志表的回执信息
if (i>0 && ii>0 ){
log.info("运单号 {} 落装分单回执更新成功",waybillnosecondary);
return 1;
}
}else {
//todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Date;
import java.util.List;
@Slf4j
public class MANIFESTLOSTCHANGE extends WlptBaseModel{
private String id;
private String flightno;
private Date flightdate;
private String waybillnomaster;
private String waybillnosecondary;
private String cwaybillnomaster;
private String cwaybillnosecondary;
private Date createdate;
private String status;
private String receiption;
private String cflightno;
private Date cflightdate;
private String sequencenumeric;
private String quantity;
private String cargodescription;
private String goodsmeasure;
private String customcode;
private String reason;
private String contactname;
private String contacttel;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
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 getCwaybillnomaster() {
return cwaybillnomaster;
}
public void setCwaybillnomaster(String cwaybillnomaster) {
this.cwaybillnomaster = cwaybillnomaster == null ? null : cwaybillnomaster.trim();
}
public String getCwaybillnosecondary() {
return cwaybillnosecondary;
}
public void setCwaybillnosecondary(String cwaybillnosecondary) {
this.cwaybillnosecondary = cwaybillnosecondary == null ? null : cwaybillnosecondary.trim();
}
public Date getCreatedate() {
return createdate;
}
public void setCreatedate(Date createdate) {
this.createdate = createdate;
}
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 getCflightno() {
return cflightno;
}
public void setCflightno(String cflightno) {
this.cflightno = cflightno == null ? null : cflightno.trim();
}
public Date getCflightdate() {
return cflightdate;
}
public void setCflightdate(Date cflightdate) {
this.cflightdate = cflightdate;
}
public String getSequencenumeric() {
return sequencenumeric;
}
public void setSequencenumeric(String sequencenumeric) {
this.sequencenumeric = sequencenumeric == null ? null : sequencenumeric.trim();
}
public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity == null ? null : quantity.trim();
}
public String getCargodescription() {
return cargodescription;
}
public void setCargodescription(String cargodescription) {
this.cargodescription = cargodescription == null ? null : cargodescription.trim();
}
public String getGoodsmeasure() {
return goodsmeasure;
}
public void setGoodsmeasure(String goodsmeasure) {
this.goodsmeasure = goodsmeasure == null ? null : goodsmeasure.trim();
}
public String getCustomcode() {
return customcode;
}
public void setCustomcode(String customcode) {
this.customcode = customcode == null ? null : customcode.trim();
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason == null ? null : reason.trim();
}
public String getContactname() {
return contactname;
}
public void setContactname(String contactname) {
this.contactname = contactname == null ? null : contactname.trim();
}
public String getContacttel() {
return contacttel;
}
public void setContacttel(String contacttel) {
this.contacttel = contacttel == null ? null : contacttel.trim();
}
public MANIFESTLOSTCHANGE() {
}
public MANIFESTLOSTCHANGE(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
//取分单号
if(!customReception.getWayBillSecond().isEmpty()){
String[] awbhArr = customReception.getWayBillSecond().split("_");
this.waybillnosecondary = awbhArr[1];
}
this.flightno = customReception.getFlightNo();
this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
}
@Override
public int secondAnalysisReception(){
//更新分单回执
int i = manifestlostchangeMapper.updateRECEIPTION(this);
//获取分单autoid
List<MANIFESTLOSTCHANGE> secondaryList = manifestlostchangeMapper.selectAutoIdByawbAawbH(this);
if(!secondaryList.isEmpty()){
MANIFESTLOSTCHANGE arrivedSecond = secondaryList.get(0);
String autoId = arrivedSecond.getId();
//插入sendlog记录表
log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
int ii = sendLogService.insertSendlog("MT8203",receiption,autoId);
//todo:同时更新发送日志表的回执信息
if (i>0 && ii>0 ){
log.info("运单号 {} 落装改配分单回执更新成功",waybillnosecondary);
return 1;
}
}else {
//todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.model.CustomReception;
import com.tianbo.analysis.service.imp.CoustomAnalysisServiceImp;
import com.tianbo.analysis.service.imp.ShareServiceImp;
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
@Async
public class NmmsBase {
public ShareServiceImp shareServiceImp;
public CoustomAnalysisServiceImp coustomAnalysisServiceImp;
public String awbA ;
public String awbH ;
public String rspCode;
public String nmsStatusCode;
public String reception;
public String flightDateStr;
public CustomReception customReception;
public Date flightDate;
public int insertRecept(CustomReception customReception){
log.warn("公共对象监控打印{}",this);
this.shareServiceImp = new ShareServiceImp();
// 发送日志 插入
this.coustomAnalysisServiceImp = new CoustomAnalysisServiceImp();
this.customReception = customReception;
// 主单号;处理主单格式,将海关回执的主单号58019316861,变为580-19316861
this.awbA = AWBTools.awbFormat(customReception.getWayBillMaster());
this.awbH = customReception.getWayBillSecond();
this.rspCode = customReception.getResponseCode();
this.nmsStatusCode = AWBTools.transCusRspCode(rspCode);
this.reception = customReception.getResponseText();
this.flightDateStr = customReception.getFlightDate();
log.info("开始解析:运单号 {} 回执类型:{} ",awbA,customReception.getMessageType());
if (!StringUtils.isEmpty(flightDateStr)) {
this.flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
// 判断航班号 航班日期 是否为空
if (flightDate != null && customReception.getFlightNo() != null){
//有分单号 更新分单回执
if(!StringUtils.isEmpty(awbH)){
return second();
}
if (!StringUtils.isEmpty(awbA)){
return master();
}
}else {
//从发送日志表查找发送MESSAGEID进行二次入库
return shareServiceImp.share(customReception.getMessageType(), customReception);
}
}
return 0;
}
/**
* 入库分单回执信息
* @return 成功返回1,失败返回0。
*/
public int second() {
return 0;
}
/**
* 入库分单回执信息
* @return 成功返回1,失败返回0。
*/
public int master() {
return 0;
}
}
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class ORIGINMANIFESTMASTER extends WlptBaseModel {
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();
}
public ORIGINMANIFESTMASTER() {
}
public ORIGINMANIFESTMASTER(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.flightno = customReception.getFlightNo();
this.receiptinformation = customReception.getResponseText();
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.flightDate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
}
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
}
@Override
public int masterAnalysisReception() {
//更新主单回执
int i = originmanifestmasterMapper.updateRECEIPTION(this);
//获取分单autoid
List<ORIGINMANIFESTMASTER> originmanifestmasterList = originmanifestmasterMapper.selectAutoIdByAwb(this);
if(!originmanifestmasterList.isEmpty()){
ORIGINMANIFESTMASTER originMaster = originmanifestmasterList.get(0);
String autoId = originMaster.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+waybillnomaster+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT1201",receiptinformation,autoId);;
if (i>0 && ii>0){
log.info("运单号 {} 原始回执更新成功",waybillnomaster);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class Originmanifestsecondary extends WlptBaseModel {
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;
private ORIGINMANIFESTMASTER master;
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();
}
public Originmanifestsecondary(){
}
public Originmanifestsecondary(CustomReception customReception) {
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.waybillnosecondary = customReception.getWayBillSecond().split("_")[1];
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiption = customReception.getResponseText();
this.master = new ORIGINMANIFESTMASTER(customReception);
}
@Override
public int secondAnalysisReception() {
//更新分单回执
//todo:这里根据航班号航班日期还要反查下分单的主单id
List<ORIGINMANIFESTMASTER> masterlist = originmanifestmasterMapper.selectAutoIdByAwb(this.master);
if(!masterlist.isEmpty()){
ORIGINMANIFESTMASTER masterResult = masterlist.get(0);
this.originmanifestmasterautoid = masterResult.getAutoid();
}
int i = originmanifestsecondaryMapper.updateRECEIPTION(this);
//获取分单autoid
List<Originmanifestsecondary> originmanifestsecondaryList = originmanifestsecondaryMapper.selectAutoIdByawbAawbH(this);
if(!originmanifestsecondaryList.isEmpty()){
Originmanifestsecondary originSecond = originmanifestsecondaryList.get(0);
String autoId = originSecond.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+waybillnosecondary+"->autoid="+autoId);
int ii = sendLogService.insertSendlog("MT1201",receiption,autoId);
if (i>0 && ii>0){
log.info("运单号 {}_{} 原始回执更新成功",waybillnomaster,waybillnosecondary);
return 1;
}
}
return 0;
}
}
\ No newline at end of file
package com.tianbo.analysis.model;
import com.tianbo.analysis.bean.WlptBaseModel;
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;
@Data
@Slf4j
public class PREPAREMASTER extends WlptBaseModel {
private String autoid;
private String flightno;
private Date flightdate;
private String originatingstation;
private String destinationstation;
private String waybillnomaster;
private String totalweight;
private String totalpiece;
private String preparetotalpiece;
private String preparetotalweight;
private Date stowagedate;
private String status;
private String carrier;
private String customsstatus;
private String paymode;
private String customscode;
private String agentcode;
private String agentname;
private String shippername;
private String shippercity;
private String shipperaddress;
private String consigneename;
private String consigneecity;
private String consigneeaddress;
private String receiptinformation;
private Date createdate;
private String productname;
private String shipperCode;
private String shipperCountrycode;
private String shipperPhone;
private String shipperFax;
private String consigneeCode;
private String consigneeCountrycode;
private String consigneeFax;
private String consigneePhone;
private String shipperAeo;
private String consigneeAeo;
private String unloadingstation;
public String getAutoid() {
return autoid;
}
public void setAutoid(String autoid) {
this.autoid = autoid == null ? null : autoid.trim();
}
public String getFlightno() {
return flightno;
}
public void setFlightno(String flightno) {
this.flightno = flightno == null ? null : flightno.trim();
}
public Date getFlightdate() {
return flightdate;
}
public void setFlightdate(Date flightdate) {
this.flightdate = flightdate;
}
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 getWaybillnomaster() {
return waybillnomaster;
}
public void setWaybillnomaster(String waybillnomaster) {
this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.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 getPreparetotalpiece() {
return preparetotalpiece;
}
public void setPreparetotalpiece(String preparetotalpiece) {
this.preparetotalpiece = preparetotalpiece == null ? null : preparetotalpiece.trim();
}
public String getPreparetotalweight() {
return preparetotalweight;
}
public void setPreparetotalweight(String preparetotalweight) {
this.preparetotalweight = preparetotalweight == null ? null : preparetotalweight.trim();
}
public Date getStowagedate() {
return stowagedate;
}
public void setStowagedate(Date stowagedate) {
this.stowagedate = stowagedate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public String getCarrier() {
return carrier;
}
public void setCarrier(String carrier) {
this.carrier = carrier == null ? null : carrier.trim();
}
public String getCustomsstatus() {
return customsstatus;
}
public void setCustomsstatus(String customsstatus) {
this.customsstatus = customsstatus == null ? null : customsstatus.trim();
}
public String getPaymode() {
return paymode;
}
public void setPaymode(String paymode) {
this.paymode = paymode == null ? null : paymode.trim();
}
public String getCustomscode() {
return customscode;
}
public void setCustomscode(String customscode) {
this.customscode = customscode == null ? null : customscode.trim();
}
public String getAgentcode() {
return agentcode;
}
public void setAgentcode(String agentcode) {
this.agentcode = agentcode == null ? null : agentcode.trim();
}
public String getAgentname() {
return agentname;
}
public void setAgentname(String agentname) {
this.agentname = agentname == null ? null : agentname.trim();
}
public String getShippername() {
return shippername;
}
public void setShippername(String shippername) {
this.shippername = shippername == null ? null : shippername.trim();
}
public String getShippercity() {
return shippercity;
}
public void setShippercity(String shippercity) {
this.shippercity = shippercity == null ? null : shippercity.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 getConsigneecity() {
return consigneecity;
}
public void setConsigneecity(String consigneecity) {
this.consigneecity = consigneecity == null ? null : consigneecity.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 String getProductname() {
return productname;
}
public void setProductname(String productname) {
this.productname = productname == null ? null : productname.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 getConsigneePhone() {
return consigneePhone;
}
public void setConsigneePhone(String consigneePhone) {
this.consigneePhone = consigneePhone == null ? null : consigneePhone.trim();
}
public String getShipperAeo() {
return shipperAeo;
}
public void setShipperAeo(String shipperAeo) {
this.shipperAeo = shipperAeo == null ? null : shipperAeo.trim();
}
public String getConsigneeAeo() {
return consigneeAeo;
}
public void setConsigneeAeo(String consigneeAeo) {
this.consigneeAeo = consigneeAeo == null ? null : consigneeAeo.trim();
}
public String getUnloadingstation() {
return unloadingstation;
}
public void setUnloadingstation(String unloadingstation) {
this.unloadingstation = unloadingstation == null ? null : unloadingstation.trim();
}
public PREPAREMASTER() {
}
public PREPAREMASTER(CustomReception customReception) {
String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
this.setFlightno(flightInfo[1]);
this.setCarrier(flightInfo[0]);
if (!StringUtils.isEmpty(customReception.getFlightDate())) {
this.flightdate=DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
}
this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
this.receiptinformation = customReception.getResponseText();
}
@Override
public int masterAnalysisReception() {
//更新主单回执
int i = preparemasterMapper.updateRECEIPTION(this);
//获取分单autoid
List<PREPAREMASTER> preparemasterList = preparemasterMapper.selectAutoIdByAwb(this);
if(!preparemasterList.isEmpty()){
PREPAREMASTER originMaster = preparemasterList.get(0);
String autoId = originMaster.getAutoid();
//插入sendlog记录表
log.info("即将插入日志运单号为:"+waybillnomaster+"->autoid="+autoId);
int ii =sendLogService.insertSendlog("MT2201",receiptinformation,autoId);
if (i>0 && ii>0){
log.info("运单号 {} 预配回执更新成功",waybillnomaster);
return 1;
}
}
return 0;
}
}
\ No newline at end of file