作者 朱兆平

init

正在显示 51 个修改的文件 包含 4705 行增加0 行删除

要显示太多修改。

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

/target/
!.mvn/wrapper/maven-wrapper.jar
/logs/
/out/
.mvn
/xmlFromImf/
kakoRevice/
/errorLogs/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
!/readMe.md
... ...
#上传文件的路径,要带斜杠
web:
upload-path: upload/
server:
port: 10002
servlet:
context-path: ${SERVER_CONTEXTPATH:}
spring:
profiles:
active: dev
mvc:
#静态资源,设置上传文件的访问,
static-path-pattern: /**
# view:
# suffix: .html
## prefix: /templates/
thymeleaf:
cache: false
mode: LEGACYHTML5
resources:
static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path}
application:
name: WLTP-NMMS-CUSTOM-RECIPTION-RESOLVER
jackson:
serialization:
FAIL_ON_EMPTY_BEANS: false
#springboot2.0之后会把Date类型字段自动给转成UTC字符串 如:1990-11-26T16:00:00.000+0000,如果想转成时间戳在application.properties配置文件增加以下配置
date-format: yyyy-MM-dd HH:mm:ss
#时区必须要设置
time-zone: GMT+8
#ALWAYS的意思是即时属性为null,仍然也会输出这个key
default-property-inclusion: always
cloud:
#eureka主机名,会在控制页面中显示
#DEV环境关闭注册。
features:
enabled: false
discovery:
enabled: false
service-registry:
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的请求路径
status-page-url: http://${eureka.instance.hostname}:${server.port}/
prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
hostname: ${spring.cloud.client.ip-address}
health-check-url-path: /actuator/health
lease-renewal-interval-in-seconds: 15
lease-expiration-duration-in-seconds: 45
metadata-map:
startup: ${random.int}
client:
#eureka注册中心服务器地址
service-url:
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
logging:
file:
path: ./logs/
name: system.log
config: config/logback-dev.xml
#转移到logback配置文件中
#level:
#org.apache.tomcat: info
#com.tianbo.warehouse.dao: DEBUG
#org.springframework.security: trace
#日志配置,输出到文本,
#Java Web Token 时效时间,单位秒
jwt:
max-alive: 300
#自定义配置
custom:
#进港放行回执读取目录
receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
#回执解析成功后的备份目录
receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
#解析错误报文的备份目录
errBakDir: /Users/mrz/Downloads/rdp_temp/logs/error
#回执转发目录
transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
#匹配技术回执正则
delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml
#报文导入生成目录,这个地方目录结尾要带/
extRedioMsgDir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
devops:
dir:
singlewindow-tcs-recept: D:\TCSSingleWindow\recive
tianbo-tcs-recept: D:\Data\Receive
cfps-subscribe-dir: D:\系统部署\imf_Warehouse_reader\xmlFromImf
mq:
# 从新舱单服务器读取申报业务报文发送到业务报文发送队列 {nmmsXml-mq};从回执队列{tcs-mq}读取报文保存到本地服务器回执报文接收目录
# 从tcs服务器读取海关回执报文发送到回执报文发送队列 {tcs-mq};从新舱单报文申报队列{nmmsXml-mq}读取报文保存到本地服务器申报报文发送目录
nmms:
#发送新舱单业务报文目录 [目录结尾要带/]
sendXml-dir: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
#保存从mq取到的回执报文到本地回执目录 [目录结尾要带/]
saveXml-dir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
tcs:
#发送回执报文目录
sendXml-dir: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
#保存从mq取到的新舱单业务报文到本地回执目录
saveNmmsXml-dir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
queue:
#新舱单业务报文mq队列名称
nmms-mq: send
#读取回执报文mq队列名称
tcs-mq: responsebak
exchange:
#TCS回执发送到此交换,交换再把回执消息同步到其他配置的回执订阅队列
tcs-ex:
#交换名称
name: cus.rcv.broadcast
#交换类型
type: fanout
#routing key名称,此处为空,所有绑定交换的队列都被广播
routing-key:
connection:
ip: 10.50.7.90
port: 5672
vHost: NMMS
username: tianbo
password: vmvnv1v2VV
# ip: 192.168.1.63
# port: 5672
# vHost: NMMS
# username: mrz
# password: vmvnv1v2
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132-->
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="./logs" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>trace</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 windows系统这里设置成GBK-->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 trace 日志 -->
<appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_trace.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录trace级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>TRACE</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender>。<logger>仅有一个name属性,
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!--<logger name="org.springframework.web" level="info"/>-->
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--<logger name="com.tianbo.analysis" level="trace">-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="TRACE_FILE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--</logger>-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="org.springframework" level="info"/>
<logger name="org.apache.tomcat" level="info" />
<logger name="com.tianbo.analysis.dao" level="DEBUG" />
<logger name="com.tianbo.analysis" level="trace" />
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="TRACE_FILE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
</springProfile>
<!--生产环境:输出到文件-->
<springProfile name="pro">
<logger name="com.tianbo.analysis" level="trace" />
<logger name="org.springframework.boot" level="INFO"/>
<logger name="com.tianbo.analysis.dao" level="DEBUG" />
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="ERROR_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="TRACE_FILE" />
</root>
</springProfile>
</configuration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tianbo</groupId>
<artifactId>customs</artifactId>
<version>1.0-SNAPSHOT</version>
<name>customMessageProcess</name>
<description>process customs xml files with RabbitMQ</description>
<properties>
<druid.version>1.1.9</druid.version>
<spring-cloud.version>Greenwich.BUILD-SNAPSHOT</spring-cloud.version>
<lombok_sersion>1.18.6</lombok_sersion>
</properties>
<dependencies>
<!--spring boot-->
<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>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!--配合thymeleaf的LEGACYHTML5需要搭配一个额外的库NekoHTML才可用。-->
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
<version>1.9.22</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--clound-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!--lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<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; mysql&ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>mysql</groupId>-->
<!--<artifactId>mysql-connector-java</artifactId>-->
<!--<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>
<!--util依赖-->
<dependency>
<groupId>com.tianbo</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util依赖-->
<!--&lt;!&ndash;IMF需要的包&ndash;&gt;-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.apache.xmlbeans</groupId>-->
<!--<artifactId>xmlbeans</artifactId>-->
<!--<version>2.4.0</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.ws.commons.schema/XmlSchema &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.apache.ws.commons.schema</groupId>-->
<!--<artifactId>XmlSchema</artifactId>-->
<!--<version>1.4.7</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/wsdl4j/wsdl4j &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>wsdl4j</groupId>-->
<!--<artifactId>wsdl4j</artifactId>-->
<!--<version>1.6.2</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.neethi/neethi &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.apache.neethi</groupId>-->
<!--<artifactId>neethi</artifactId>-->
<!--<version>2.0.4</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; LOG &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>log4j</groupId>-->
<!--<artifactId>log4j</artifactId>-->
<!--<version>1.2.16</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.slf4j/slf4j-api &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>slf4j-api</artifactId>-->
<!--<version>1.6.1</version>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.slf4j</groupId>-->
<!--<artifactId>slf4j-jdk14</artifactId>-->
<!--<version>1.6.1</version>-->
<!--<scope>test</scope>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.cxf.xjcplugins/cxf-xjc-boolean &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf.xjcplugins</groupId>-->
<!--<artifactId>cxf-xjc-boolean</artifactId>-->
<!--<version>3.2.3</version>-->
<!--</dependency>-->
<!--&lt;!&ndash;添加本地IMF包&ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>com.caac</groupId>-->
<!--<artifactId>imf</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/IMFClient.1.0.0.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>imfmessage</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/imfmsg.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>process</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/ProcessService.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>apiconfig</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/apiConfig.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>upload</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/UploadService.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>heartbeat</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/HeartbeatService.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.caac.imf</groupId>-->
<!--<artifactId>returnxml</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/returnXml.jar</systemPath>-->
<!--</dependency>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/org.hyperic/sigar &ndash;&gt;-->
<!--<dependency>-->
<!--<groupId>org.hyperic</groupId>-->
<!--<artifactId>sigar</artifactId>-->
<!--<version>1.6.4</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/sigar.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache</groupId>-->
<!--<artifactId>cxf</artifactId>-->
<!--<version>2.3.2</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/cxf-2.3.2.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf</groupId>-->
<!--<artifactId>xjc</artifactId>-->
<!--<version>2.3.2</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/cxf-xjc-bug671-2.3.2.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>maven.org.apache</groupId>-->
<!--<artifactId>cxf</artifactId>-->
<!--<version>2.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/cxf-manifest.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf.xjc</groupId>-->
<!--<artifactId>dv</artifactId>-->
<!--<version>2.3.2</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/cxf-xjc-dv-2.3.2.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.cxf.xjc</groupId>-->
<!--<artifactId>ts</artifactId>-->
<!--<version>2.3.2</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/cxf-xjc-ts-2.3.2.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>org.apache.xml</groupId>-->
<!--<artifactId>xmlsec</artifactId>-->
<!--<version>1.4.4</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/xmlsec-1.4.4.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.disthub2.impl</groupId>-->
<!--<artifactId>cl3e</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/CL3Export.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.disthub2.impl</groupId>-->
<!--<artifactId>cl3ne</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/CL3Nonexport.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>axis2</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.axis2.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>commonservices</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.commonservices.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>defaultconfig</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.defaultconfig.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>fta</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.fta.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>headers</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.headers.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm</groupId>-->
<!--<artifactId>mq</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm</groupId>-->
<!--<artifactId>jmqi</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.jmqi.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>jms.nojndi</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.jms.Nojndi.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>pcf</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.pcf.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>postcard</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.postcard.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>soap</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.soap.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>tools.ras</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mq.tools.ras.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm.mq</groupId>-->
<!--<artifactId>etclient</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mqetclient.jar</systemPath>-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>com.ibm</groupId>-->
<!--<artifactId>mqjms</artifactId>-->
<!--<version>1.0.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/com.ibm.mqjms.jar</systemPath>-->
<!--&lt;!&ndash; https://mvnrepository.com/artifact/javax.resource/connector &ndash;&gt;-->
<!--</dependency>-->
<!--<dependency>-->
<!--<groupId>javax.resource</groupId>-->
<!--<artifactId>connector</artifactId>-->
<!--<version>1.0</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>${project.basedir}/lib/connector.jar</systemPath>-->
<!--</dependency>-->
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
... ...
# 读取本地文件夹下的xml文件将新舱单xml申报报文发送到rabbitMQ队列,从MQ获取海关回执报文存储到本地文件夹下
# 读取本地TCS回执接收文件夹下的[xml海关回执文件]并发送到rabbitMQ队列,从MQ获取新舱单系统生成的申报XML报文并存储到到本地舱单申报发送文件夹下
配置config/application.yml
eureka center注册中心地址
application name
coustom的读取回执目录(按当前日期读取目录下的日期子文件夹)
解析成功的备份回执目录(按日期生成文件夹备份)
解析失败的备份目录(按日期生成文件夹备份)
log配置文件为config/logback-dev.xml,日志文件夹为./logs
* 配置文件为项目根目录下的config文件夹内,方便部署后的配置修改
* logback-dev.xml 为logback的配置文件
* winddows系统的控制台编码配置要设置成GBK,
因为WINDOWS的DOS环境编码为GBK,否则出现乱码
* application.yml 为spring boot的配置文件
* 已集成mybatis、mybatisGenerator、pageHelper
* 集成IMFjar包
* 集成Spring boot 及 srping cloud
* 集成定时任务框架
* 后端采用spring boot 2 ,配合前端框架使用。
* 集成Spring Cloud
* 集成lombok,简化部分代码录入,比如实体类,方便实体及表结构修改,敏捷开发必用,使用方法见[lombok集成使用说明](https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html)
)
* 集成websocket
* 可以在线查看imf客户端运行情况 web访问路径/log/imf,可查看项目logs目录下的log_info.log
* 打包jar散包 看这里 https://blog.csdn.net/m0_37202351/article/details/81738357
* 要集成util项目为model才能跑起来 [git地址](git@118.31.66.166:wlxxpt/utitls.git)
* 集成thymeleaf,webmvc 视图配置参考资料[地址](https://blog.csdn.net/zheng_chang_wei/article/details/76155440)
[打jar包后找不到路径](https://blog.csdn.net/qq_37372909/article/details/84824805)
* 支持在线CMD功能,运维级,访问路径/cmd
* 查询进程pid:
* wmic process get caption,commandline,processid /value |findstr java
* wmic process get name,executablepath,processid /value |findstr java
* wmic process where "((CommandLine LIKE '%convert.jar%') AND NOT (CommandLine LIKE '%wmic%'))" get caption,commandline,processid /value
* 停止启动服务: wmic Service where caption="新舱单数据订阅服务" call stopservice / wmic Service where caption="新舱单数据订阅服务" call startservice
* 系统服务截图在新舱单维护手册中,有道云笔记中也有。
舱单回执目录: D:\Data\Receive
单一窗口回执目录: D:\TCSSingleWindow\recive
单一窗口报文转换工具目录:D:\TCSSingleWindow\报文转换工具,"java -Dfile.encoding=utf-8 -jar convert.jar"
货运数据订阅目录:D:\系统部署\imf_Warehouse_reader\xmlFromImf
* 配合微信前端定时监控3个回执目录的文件数量,超过警戒值 微信发出提醒
* path = /devops/watchdir?dir=tcs
参数dir,可以是指定目录值,也可以是stcs、tcs、cfps 分别代表单一窗口回执目录、商务节点回执目录、CFPS数据订阅目录
\ No newline at end of file
... ...
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
... ...
/**
* @author mrz
* @email 17966059@qq.com
*/
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.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import java.time.Duration;
@SpringBootApplication
@EnableScheduling
@EnableDiscoveryClient
@EnableTransactionManagement
@MapperScan("com.tianbo.analysis.dao")
public class BootApplication {
public static void main(String[] args) {
SpringApplication.run(BootApplication.class, args);
}
@Bean
@LoadBalanced
RestTemplate restTemplate(RestTemplateBuilder builder){
return builder.setConnectTimeout(Duration.ofSeconds(15)).setReadTimeout(Duration.ofSeconds(15))
.build();
}
}
... ...
package com.tianbo.analysis.bean;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @ProjectName:
* @Package: com.backstage.config
* @ClassName: ApplicationContextProvider
* @Description: 获取bean对象的工具类
* @Author: wangzhilong
* @CreateDate: 2018/8/31 13:26
* @Version: 1.0
*/
/**
* Author:ZhuShangJin
* Date:2018/7/3
*/
@Component
public class SpringBeanUtitl implements ApplicationContextAware{
private static ApplicationContext applicationContext = null;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws
BeansException {
// TODO Auto-generated method stub
SpringBeanUtitl.applicationContext = applicationContext;
}
/**
* 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) {
if(name == null || applicationContext == null){
return null;
}
return (T) applicationContext.getBean(name);
}
/**
* 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
*/
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
}
... ...
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.config;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
/**
* @descrption 需要解决srpingboot error页面模板
* @author mrz
* @date 20190414
*/
@Component
public class ErrorPageConfig implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry registry){
ErrorPage[] errorPages=new ErrorPage[2];
errorPages[0]=new ErrorPage(HttpStatus.NOT_FOUND,"/error404");
errorPages[1]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error500");
registry.addErrorPages(errorPages);
}
}
... ...
package com.tianbo.analysis.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig {
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
... ...
package com.tianbo.analysis.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.LineNumberReader;
import java.util.ArrayList;
import java.util.List;
@Controller
@Slf4j
public class CmdController {
@RequestMapping("/linuxCmd")
public String linuxCmd(@RequestParam(value = "command",required = false) String command,Model model){
List<String> strList = new ArrayList();
try {
if (command !=null && !command.isEmpty()){
Process process;
process = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command}, null, null);
InputStreamReader ir = new InputStreamReader(process
.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
process.waitFor();
while ((line = input.readLine()) != null) {
strList.add(line);
log.info(line);
}
model.addAttribute("cmdResult",strList);
}
}catch (Exception e){
e.printStackTrace();
log.error("执行命令出错",e);
}
return "cmd/cmd";
}
@RequestMapping("/windowsCmd")
public String windowsCmd(@RequestParam(value = "command",required = false) String command,Model model){
List<String> strList = new ArrayList();
try {
if (command !=null && !command.isEmpty()){
Runtime rt = Runtime.getRuntime();
String[] args = new String[]{"cmd","/c",command};
Process pr = rt.exec(args,null,null);
//Process pr = rt.exec("cmd /c dir"); // cmd /c calc
// Process pr = rt.exec("D:\\xunlei\\project.aspx");
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream(), "GBK"));
String line;
while ((line = input.readLine()) != null) {
strList.add(line);
log.info(line);
}
int exitVal = pr.waitFor();
log.info("exitVal",exitVal);
model.addAttribute("cmdResult",strList);
}
}catch (Exception e){
e.printStackTrace();
log.error("执行命令出错",e);
}
return "cmd/wincmd";
}
}
... ...
package com.tianbo.analysis.controller;
import com.tianbo.util.IO.FileTool;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.util.List;
@RestController
@Slf4j
@RequestMapping("/devops")
public class DevOpsController {
//单一窗口回执读取目录
@Value("${devops.dir.singlewindow-tcs-recept}")
private String singlewindow_tcs_recept_dir;
//天博TCS回执读取目录
@Value("${devops.dir.tianbo-tcs-recept}")
private String tianbo_tcs_recept_dir;
//CFPS订阅货运报文目录
@Value("${devops.dir.cfps-subscribe-dir}")
private String cfps_recept_dir;
@RequestMapping("/watchdir")
public Integer singlewindow(@RequestParam(value = "dir",required = true,defaultValue = "D:\\系统部署\\imf_Warehouse_reader\\xmlFromImf") String dir){
switch (dir){
case "stcs" :
dir = singlewindow_tcs_recept_dir;
break;
case "tcs" :
dir = tianbo_tcs_recept_dir;
break;
case "cfps" :
dir = cfps_recept_dir;
break;
default:
dir = cfps_recept_dir;
break;
}
try{
// dir = "/Users/mrz/Downloads/rdp_temp";
File fileDirectory = new File(dir);
if (!fileDirectory.exists()){
log.error("目录{}不存在",dir);
}else{
log.info("{}{}{}","开始获取目录",dir,"文件数量");
List<File> files = FileTool.readAllDirectoryFiles(fileDirectory);
if(files!=null && !files.isEmpty()){
log.info("{}{}{}{}","目录",dir,"文件数量为:",files.size());
return files.size();
}else {
return 0;
}
}
}catch (Exception e){
e.printStackTrace();
log.error("获取目录文件出错",e);
}
return 500;
}
}
... ...
package com.tianbo.analysis.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ErrorController {
@RequestMapping("/error404")
public String error404(){
return "error/404";
}
@RequestMapping("/error500")
public String error500(){
return "error/500";
}
}
... ...
package com.tianbo.analysis.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ImfLogController {
@RequestMapping("/log/imf")
public String IMFlog(){
return "log/imf";
}
}
... ...
package com.tianbo.analysis.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class IndexController {
@RequestMapping("/")
public String index(){
return "index";
}
}
... ...
package com.tianbo.analysis.controller;
import com.tianbo.analysis.handle.IO_Log_Handle;
import org.springframework.stereotype.Component;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.CopyOnWriteArraySet;
@ServerEndpoint(value = "/log")
@Component
public class LogWebsockController {
private Process process;
private InputStream inputStream;
//与某个客户端的连接会话,需要通过它来给客户端发送数据
private Session session;
//静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
private static int onlineCount = 0;
//concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
private static CopyOnWriteArraySet<LogWebsockController> webSocketSet = new CopyOnWriteArraySet<LogWebsockController>();
@OnOpen
public void onOpen(Session session){
this.session = session;
webSocketSet.add(this);
addOnlineCount();
try {
process = Runtime.getRuntime().exec("tail -f logs/log_info.log");
inputStream = process.getInputStream();
IO_Log_Handle thread = new IO_Log_Handle(inputStream, session);
thread.start();
}catch (IOException e){
e.printStackTrace();
}
}
/**
* WebSocket请求关闭
*/
@OnClose
public void onClose() {
try {
if(inputStream != null) {
inputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
if(process != null){
process.destroy();
}
}
@OnError
public void onError(Throwable thr) {
thr.printStackTrace();
}
public static synchronized void addOnlineCount() {
LogWebsockController.onlineCount++;
}
public static synchronized int getOnlineCount() {
return onlineCount;
}
}
... ...
package com.tianbo.analysis.controller;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
/**
* 在线报文导入管理
*/
@RestController
@RequestMapping("/Rmsg")
@Slf4j
public class RadioMsgController {
//备份目录
@Value("${custom.extRedioMsgDir}")
private String extRedioMsgDir;
private final static String FFM_HEADER = "<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113050339</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>FFM</STYP>\n" +
"<SEQN>95205940</SEQN>\n" +
"</META>\n" +
"<FFM>\n";
private final static String FFM_FOOTER = "\n</FFM>\n" +
"</MSG>";
private final static String FWB_HEADER="<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113004608</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>IFWB</STYP>\n" +
"<SEQN>95203026</SEQN>\n" +
"</META>\n" +
"<FWB>\n";
private final static String FWB_FOOTER="\n</FWB>\n" +
"</MSG>";
private final static String FHL_HEADER="<MSG>\n" +
"<META>\n" +
"<SNDR>TXD</SNDR>\n" +
"<DDTM>20200113003006</DDTM>\n" +
"<TYPE>IATA</TYPE>\n" +
"<STYP>IFHL</STYP>\n" +
"<SEQN>95202782</SEQN>\n" +
"</META>\n" +
"<FHL>\n";
private final static String FHL_FOOTER="\n</FHL>\n" +
"</MSG>";
@PostMapping("ffm")
public int extFFM(String ffmmsg){
if (ffmmsg!=null){
ffmmsg = FFM_HEADER + ffmmsg;
ffmmsg = ffmmsg + FFM_FOOTER;
File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
try {
FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
log.info("FFM报文导入成功");
return 1;
}catch (IOException e){
e.printStackTrace();
}
}
return 0;
}
@PostMapping("fwb")
public int extFWB(String ffmmsg){
if (ffmmsg!=null) {
ffmmsg = FWB_HEADER + ffmmsg;
ffmmsg = ffmmsg + FWB_FOOTER;
File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
try {
FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
log.info("FWB报文导入成功");
return 1;
} catch (IOException e) {
e.printStackTrace();
}
}
return 0;
}
@PostMapping("fhl")
public int extFHL(String ffmmsg){
if (ffmmsg!=null) {
ffmmsg = FHL_HEADER + ffmmsg;
ffmmsg = ffmmsg + FHL_FOOTER;
File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
try {
FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
log.info("FHL报文导入成功");
return 1;
} catch (IOException e) {
e.printStackTrace();
}
}
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.handle;
import javax.websocket.Session;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class IO_Log_Handle extends Thread{
private BufferedReader reader;
private Session session;
public IO_Log_Handle(InputStream in, Session session) {
this.reader = new BufferedReader(new InputStreamReader(in));
this.session = session;
}
@Override
public void run() {
String line;
try {
while((line = reader.readLine()) != null) {
// 将实时日志通过WebSocket发送给客户端,给每一行添加一个HTML换行
session.getBasicRemote().sendText(line + "<br>");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
... ...
package com.tianbo.analysis.handle;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.tools.AWBTools;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.RabitMq.MQSendMsg;
import com.tianbo.util.RabitMq.exchange.ExSendMsg;
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 SendXml2MqThread implements Runnable{
private CountDownLatch latch;
private File xmlfile;
private String mqIp;
private int mqPort;
private String mqVhost;
private String mqUsername;
private String mqPassword;
private String queueName;
private String exchangeName;
private String exchangeType;
private String routingName;
@Override
public void run() {
String filename = xmlfile.getName();
log.info("线程:{}开始",filename);
try{
//解析前先转发
int i = handelXmlDocument();
//发送成功删除,发送失败不管保留报文
if(i==1){
FileUtils.forceDelete(xmlfile);
}
}catch (IOException ioe){
log.error("文件不存在",ioe);
ioe.printStackTrace();
} catch (Exception e){
log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
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, IOException {
int i = 0;
String content = FileUtils.readFileToString(xmlfile,"UTF-8");
/**
* 发送消息到交换上
*/
boolean success = ExSendMsg.sendMsg(
exchangeName,
exchangeType,
routingName,
queueName,
content,
mqIp,
mqPort,
mqVhost,
mqUsername,
mqPassword
);
return success ? 1 : 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 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 lombok.Data;
@Data
public class CustomReception {
//回执报头
private String messageID;
private String functionCode;
private String messageType;
private String senderID;
private String receiverID;
private String sendTime;
private String version;
//一般业务回执
private String flightNo;
private String flightDate;
private String wayBillMaster;
private String wayBillSecond;
private String responseCode;
private String responseText;
//国际转运回执
private String importFlightDate;
private String importFlightNo;
private String importWaybillMaster;
private String exportFlightDate;
private String exportFlightNo;
private String exportWaybillMaster;
public CustomReception(String messageType,
String flightNo,
String flightDate,
String wayBillMaster,
String wayBillSecond,
String responseCode,
String responseText,
String messageID,
String sendTime,
String senderID,
String receiverID,
String version,
String functionCode){
this.messageType = messageType;
this.flightNo = flightNo;
this.flightDate = flightDate;
this.wayBillMaster = wayBillMaster;
this.wayBillSecond = wayBillSecond;
this.responseCode = responseCode;
this.responseText = responseText;
this.messageID = messageID;
this.sendTime = sendTime;
this.senderID =senderID;
this.receiverID = receiverID;
this.version = version;
this.functionCode = functionCode;
}
public CustomReception(String messageType,
String importFlightNo,
String importFlightDate,
String importWaybillMaster,
String transResponseCode,
String transResponseText,
String messageID,
String sendTime,
String senderID,
String receiverID,
String version,
String functionCode){
this.messageType = messageType;
this.importFlightNo = importFlightNo;
this.importFlightDate = importFlightDate;
this.importWaybillMaster = importWaybillMaster;
this.responseCode = transResponseCode;
this.responseText = transResponseText;
this.messageID = messageID;
this.sendTime = sendTime;
this.senderID =senderID;
this.receiverID = receiverID;
this.version = version;
this.functionCode = functionCode;
}
}
... ...
package com.tianbo.analysis.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;
}
}
... ...