作者 朱兆平

init

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

要显示太多修改。

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

  1 +/target/
  2 +!.mvn/wrapper/maven-wrapper.jar
  3 +/logs/
  4 +/out/
  5 +.mvn
  6 +/xmlFromImf/
  7 +kakoRevice/
  8 +/errorLogs/
  9 +### STS ###
  10 +.apt_generated
  11 +.classpath
  12 +.factorypath
  13 +.project
  14 +.settings
  15 +.springBeans
  16 +.sts4-cache
  17 +
  18 +### IntelliJ IDEA ###
  19 +.idea
  20 +*.iws
  21 +*.iml
  22 +*.ipr
  23 +
  24 +### NetBeans ###
  25 +/nbproject/private/
  26 +/build/
  27 +/nbbuild/
  28 +/dist/
  29 +/nbdist/
  30 +/.nb-gradle/
  31 +!/readMe.md
  1 +#上传文件的路径,要带斜杠
  2 +web:
  3 + upload-path: upload/
  4 +server:
  5 + port: 10002
  6 + servlet:
  7 + context-path: ${SERVER_CONTEXTPATH:}
  8 +spring:
  9 + profiles:
  10 + active: dev
  11 + mvc:
  12 + #静态资源,设置上传文件的访问,
  13 + static-path-pattern: /**
  14 +# view:
  15 +# suffix: .html
  16 +## prefix: /templates/
  17 + thymeleaf:
  18 + cache: false
  19 + mode: LEGACYHTML5
  20 +
  21 + resources:
  22 + static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,classpath:/public/,file:${web.upload-path}
  23 +
  24 + application:
  25 + name: WLTP-NMMS-CUSTOM-RECIPTION-RESOLVER
  26 +
  27 + jackson:
  28 + serialization:
  29 + FAIL_ON_EMPTY_BEANS: false
  30 + #springboot2.0之后会把Date类型字段自动给转成UTC字符串 如:1990-11-26T16:00:00.000+0000,如果想转成时间戳在application.properties配置文件增加以下配置
  31 + date-format: yyyy-MM-dd HH:mm:ss
  32 + #时区必须要设置
  33 + time-zone: GMT+8
  34 + #ALWAYS的意思是即时属性为null,仍然也会输出这个key
  35 + default-property-inclusion: always
  36 + cloud:
  37 + #eureka主机名,会在控制页面中显示
  38 + #DEV环境关闭注册。
  39 + features:
  40 + enabled: false
  41 + discovery:
  42 + enabled: false
  43 + service-registry:
  44 + auto-registration:
  45 + enabled: false
  46 +
  47 + datasource:
  48 + type: com.alibaba.druid.pool.DruidDataSource
  49 + #oracle
  50 + driver-class-name: oracle.jdbc.OracleDriver
  51 + url: jdbc:oracle:thin:@10.50.3.69:1521:CGODB
  52 +# url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
  53 + username: CGONMS
  54 + password: 1q2w3e4r
  55 + #spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
  56 +# url: jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
  57 +# username: root
  58 +# password:
  59 +# driver-class-name: com.mysql.jdbc.Driver
  60 + max-idle: 20
  61 + max-wait: 10000
  62 + min-idle: 5
  63 + initial-size: 5
  64 + #配置初始化大小/最小/最大
  65 + druid:
  66 + initial-size: 1
  67 + min-idle: 1
  68 + #最大并发连接数
  69 + max-active: 40
  70 + #获取连接等待超时时间
  71 + max-wait: 60000
  72 + #一个连接在池中最小生存的时间
  73 + min-evictable-idle-time-millis: 300000
  74 + #间隔多久进行一次检测,检测需要关闭的空闲连接
  75 + time-between-eviction-runs-millis: 60000
  76 + #mysql
  77 +# validation-query: SELECT 1 FROM DUAL
  78 + #oracle
  79 + validation-query: SELECT 'x' FROM DUAL
  80 + test-while-idle: true
  81 + test-on-borrow: false
  82 + test-on-return: false
  83 + default-auto-commit: true
  84 +
  85 +eureka:
  86 + instance:
  87 + #eureka服务器页面中status的请求路径
  88 + status-page-url: http://${eureka.instance.hostname}:${server.port}/
  89 + prefer-ip-address: true
  90 + instance-id: ${spring.cloud.client.ip-address}:${server.port}
  91 + hostname: ${spring.cloud.client.ip-address}
  92 + health-check-url-path: /actuator/health
  93 + lease-renewal-interval-in-seconds: 15
  94 + lease-expiration-duration-in-seconds: 45
  95 + metadata-map:
  96 + startup: ${random.int}
  97 + client:
  98 + #eureka注册中心服务器地址
  99 + service-url:
  100 + defaultZone: http://10.50.3.82:19527/eureka/
  101 + registry-fetch-interval-seconds: 30
  102 +
  103 +
  104 +
  105 +
  106 +mybatis:
  107 + mapper-locations: classpath:mapping/*.xml
  108 + type-aliases-package: com.tianbo.warehouse.model
  109 +pagehelper:
  110 + #auto-dialect: true
  111 + #auto-runtime-dialect: true
  112 + helper-dialect: oracle
  113 + reasonable: true
  114 + support-methods-arguments: true
  115 + params: count=countSql
  116 +
  117 +#debug配置,debug或者为true的时候,logback才会记录和写入日志文件
  118 +trace: false
  119 +debug: false
  120 +
  121 +logging:
  122 + file:
  123 + path: ./logs/
  124 + name: system.log
  125 + config: config/logback-dev.xml
  126 + #转移到logback配置文件中
  127 + #level:
  128 + #org.apache.tomcat: info
  129 + #com.tianbo.warehouse.dao: DEBUG
  130 + #org.springframework.security: trace
  131 + #日志配置,输出到文本,
  132 +#Java Web Token 时效时间,单位秒
  133 +jwt:
  134 + max-alive: 300
  135 +
  136 +#自定义配置
  137 +custom:
  138 + #进港放行回执读取目录
  139 + receptDirectory: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
  140 + #回执解析成功后的备份目录
  141 + receptBakDir: /Users/mrz/Downloads/rdp_temp/logs/success
  142 + #解析错误报文的备份目录
  143 + errBakDir: /Users/mrz/Downloads/rdp_temp/logs/error
  144 + #回执转发目录
  145 + transmitDir: /Users/mrz/Downloads/rdp_temp/logs/transmit
  146 + #匹配技术回执正则
  147 + delTechnologyReceptMatch: CN_MT(.*)_1P0_460470678920X_(.*).xml
  148 + #报文导入生成目录,这个地方目录结尾要带/
  149 + extRedioMsgDir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
  150 +devops:
  151 + dir:
  152 + singlewindow-tcs-recept: D:\TCSSingleWindow\recive
  153 + tianbo-tcs-recept: D:\Data\Receive
  154 + cfps-subscribe-dir: D:\系统部署\imf_Warehouse_reader\xmlFromImf
  155 +mq:
  156 + # 从新舱单服务器读取申报业务报文发送到业务报文发送队列 {nmmsXml-mq};从回执队列{tcs-mq}读取报文保存到本地服务器回执报文接收目录
  157 + # 从tcs服务器读取海关回执报文发送到回执报文发送队列 {tcs-mq};从新舱单报文申报队列{nmmsXml-mq}读取报文保存到本地服务器申报报文发送目录
  158 + nmms:
  159 + #发送新舱单业务报文目录 [目录结尾要带/]
  160 + sendXml-dir: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
  161 + #保存从mq取到的回执报文到本地回执目录 [目录结尾要带/]
  162 + saveXml-dir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
  163 + tcs:
  164 + #发送回执报文目录
  165 + sendXml-dir: /Users/mrz/Downloads/rdp_temp/logs/回执报文样例/
  166 + #保存从mq取到的新舱单业务报文到本地回执目录
  167 + saveNmmsXml-dir: /Users/mrz/Downloads/rdp_temp/logs/transmit/
  168 + queue:
  169 + #新舱单业务报文mq队列名称
  170 + nmms-mq: send
  171 + #读取回执报文mq队列名称
  172 + tcs-mq: responsebak
  173 + exchange:
  174 + #TCS回执发送到此交换,交换再把回执消息同步到其他配置的回执订阅队列
  175 + tcs-ex:
  176 + #交换名称
  177 + name: cus.rcv.broadcast
  178 + #交换类型
  179 + type: fanout
  180 + #routing key名称,此处为空,所有绑定交换的队列都被广播
  181 + routing-key:
  182 +
  183 + connection:
  184 + ip: 10.50.7.90
  185 + port: 5672
  186 + vHost: NMMS
  187 + username: tianbo
  188 + password: vmvnv1v2VV
  189 +# ip: 192.168.1.63
  190 +# port: 5672
  191 +# vHost: NMMS
  192 +# username: mrz
  193 +# password: vmvnv1v2
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132-->
  3 +<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
  4 +<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
  5 +<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
  6 +<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
  7 +<configuration scan="true" scanPeriod="10 seconds">
  8 +
  9 + <!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
  10 +
  11 + <contextName>logback</contextName>
  12 + <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
  13 + <property name="log.path" value="./logs" />
  14 +
  15 + <!-- 彩色日志 -->
  16 + <!-- 彩色日志依赖的渲染类 -->
  17 + <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
  18 + <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
  19 + <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
  20 + <!-- 彩色日志格式 -->
  21 + <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}}"/>
  22 +
  23 +
  24 + <!--输出到控制台-->
  25 + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  26 + <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
  27 + <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  28 + <level>trace</level>
  29 + </filter>
  30 + <encoder>
  31 + <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
  32 + <!-- 设置字符集 windows系统这里设置成GBK-->
  33 + <charset>UTF-8</charset>
  34 + </encoder>
  35 + </appender>
  36 +
  37 +
  38 + <!--输出到文件-->
  39 +
  40 + <!-- 时间滚动输出 level为 DEBUG 日志 -->
  41 + <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  42 + <!-- 正在记录的日志文件的路径及文件名 -->
  43 + <file>${log.path}/log_debug.log</file>
  44 + <!--日志文件输出格式-->
  45 + <encoder>
  46 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  47 + <charset>UTF-8</charset> <!-- 设置字符集 -->
  48 + </encoder>
  49 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  50 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  51 + <!-- 日志归档 -->
  52 + <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  53 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  54 + <maxFileSize>100MB</maxFileSize>
  55 + </timeBasedFileNamingAndTriggeringPolicy>
  56 + <!--日志文件保留天数-->
  57 + <maxHistory>15</maxHistory>
  58 + </rollingPolicy>
  59 + <!-- 此日志文件只记录debug级别的 -->
  60 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  61 + <level>debug</level>
  62 + <onMatch>ACCEPT</onMatch>
  63 + <onMismatch>DENY</onMismatch>
  64 + </filter>
  65 + </appender>
  66 +
  67 + <!-- 时间滚动输出 level为 INFO 日志 -->
  68 + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  69 + <!-- 正在记录的日志文件的路径及文件名 -->
  70 + <file>${log.path}/log_info.log</file>
  71 + <!--日志文件输出格式-->
  72 + <encoder>
  73 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  74 + <charset>UTF-8</charset>
  75 + </encoder>
  76 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  77 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  78 + <!-- 每天日志归档路径以及格式 -->
  79 + <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  80 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  81 + <maxFileSize>100MB</maxFileSize>
  82 + </timeBasedFileNamingAndTriggeringPolicy>
  83 + <!--日志文件保留天数-->
  84 + <maxHistory>15</maxHistory>
  85 + </rollingPolicy>
  86 + <!-- 此日志文件只记录info级别的 -->
  87 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  88 + <level>info</level>
  89 + <onMatch>ACCEPT</onMatch>
  90 + <onMismatch>DENY</onMismatch>
  91 + </filter>
  92 + </appender>
  93 +
  94 + <!-- 时间滚动输出 level为 WARN 日志 -->
  95 + <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  96 + <!-- 正在记录的日志文件的路径及文件名 -->
  97 + <file>${log.path}/log_warn.log</file>
  98 + <!--日志文件输出格式-->
  99 + <encoder>
  100 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  101 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  102 + </encoder>
  103 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  104 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  105 + <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  106 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  107 + <maxFileSize>100MB</maxFileSize>
  108 + </timeBasedFileNamingAndTriggeringPolicy>
  109 + <!--日志文件保留天数-->
  110 + <maxHistory>15</maxHistory>
  111 + </rollingPolicy>
  112 + <!-- 此日志文件只记录warn级别的 -->
  113 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  114 + <level>warn</level>
  115 + <onMatch>ACCEPT</onMatch>
  116 + <onMismatch>DENY</onMismatch>
  117 + </filter>
  118 + </appender>
  119 +
  120 +
  121 + <!-- 时间滚动输出 level为 ERROR 日志 -->
  122 + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  123 + <!-- 正在记录的日志文件的路径及文件名 -->
  124 + <file>${log.path}/log_error.log</file>
  125 + <!--日志文件输出格式-->
  126 + <encoder>
  127 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  128 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  129 + </encoder>
  130 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  131 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  132 + <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  133 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  134 + <maxFileSize>100MB</maxFileSize>
  135 + </timeBasedFileNamingAndTriggeringPolicy>
  136 + <!--日志文件保留天数-->
  137 + <maxHistory>15</maxHistory>
  138 + </rollingPolicy>
  139 + <!-- 此日志文件只记录ERROR级别的 -->
  140 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  141 + <level>ERROR</level>
  142 + <onMatch>ACCEPT</onMatch>
  143 + <onMismatch>DENY</onMismatch>
  144 + </filter>
  145 + </appender>
  146 +
  147 + <!-- 时间滚动输出 level为 trace 日志 -->
  148 + <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  149 + <!-- 正在记录的日志文件的路径及文件名 -->
  150 + <file>${log.path}/log_trace.log</file>
  151 + <!--日志文件输出格式-->
  152 + <encoder>
  153 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  154 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  155 + </encoder>
  156 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  157 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  158 + <fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  159 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  160 + <maxFileSize>100MB</maxFileSize>
  161 + </timeBasedFileNamingAndTriggeringPolicy>
  162 + <!--日志文件保留天数-->
  163 + <maxHistory>15</maxHistory>
  164 + </rollingPolicy>
  165 + <!-- 此日志文件只记录trace级别的 -->
  166 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  167 + <level>TRACE</level>
  168 + <onMatch>ACCEPT</onMatch>
  169 + <onMismatch>DENY</onMismatch>
  170 + </filter>
  171 + </appender>
  172 +
  173 +
  174 + <!--
  175 + <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
  176 + 以及指定<appender>。<logger>仅有一个name属性,
  177 + 一个可选的level和一个可选的addtivity属性。
  178 + name:用来指定受此logger约束的某一个包或者具体的某一个类。
  179 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  180 + 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
  181 + 如果未设置此属性,那么当前logger将会继承上级的级别。
  182 + addtivity:是否向上级logger传递打印信息。默认是true。
  183 + -->
  184 + <!--<logger name="org.springframework.web" level="info"/>-->
  185 + <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
  186 + <!--
  187 + 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
  188 + 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
  189 + 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
  190 + -->
  191 +
  192 +
  193 + <!--
  194 + root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
  195 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  196 + 不能设置为INHERITED或者同义词NULL。默认是DEBUG
  197 + 可以包含零个或多个元素,标识这个appender将会添加到这个logger。
  198 + -->
  199 + <!--<logger name="com.tianbo.analysis" level="trace">-->
  200 + <!--<appender-ref ref="CONSOLE" />-->
  201 + <!--<appender-ref ref="TRACE_FILE" />-->
  202 + <!--<appender-ref ref="DEBUG_FILE" />-->
  203 + <!--<appender-ref ref="INFO_FILE" />-->
  204 + <!--<appender-ref ref="WARN_FILE" />-->
  205 + <!--<appender-ref ref="ERROR_FILE" />-->
  206 + <!--</logger>-->
  207 +
  208 + <!--开发环境:打印控制台-->
  209 + <springProfile name="dev">
  210 + <logger name="org.springframework" level="info"/>
  211 + <logger name="org.apache.tomcat" level="info" />
  212 + <logger name="com.tianbo.analysis.dao" level="DEBUG" />
  213 + <logger name="com.tianbo.analysis" level="trace" />
  214 + <root level="info">
  215 + <appender-ref ref="CONSOLE" />
  216 + <appender-ref ref="TRACE_FILE" />
  217 + <appender-ref ref="DEBUG_FILE" />
  218 + <appender-ref ref="INFO_FILE" />
  219 + <appender-ref ref="WARN_FILE" />
  220 + <appender-ref ref="ERROR_FILE" />
  221 + </root>
  222 + </springProfile>
  223 +
  224 + <!--生产环境:输出到文件-->
  225 + <springProfile name="pro">
  226 + <logger name="com.tianbo.analysis" level="trace" />
  227 + <logger name="org.springframework.boot" level="INFO"/>
  228 + <logger name="com.tianbo.analysis.dao" level="DEBUG" />
  229 + <root level="info">
  230 + <appender-ref ref="CONSOLE" />
  231 + <appender-ref ref="DEBUG_FILE" />
  232 + <appender-ref ref="INFO_FILE" />
  233 + <appender-ref ref="ERROR_FILE" />
  234 + <appender-ref ref="WARN_FILE" />
  235 + <appender-ref ref="TRACE_FILE" />
  236 + </root>
  237 + </springProfile>
  238 +
  239 +</configuration>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <modelVersion>4.0.0</modelVersion>
  6 + <packaging>jar</packaging>
  7 + <parent>
  8 + <groupId>org.springframework.boot</groupId>
  9 + <artifactId>spring-boot-starter-parent</artifactId>
  10 + <version>2.2.0.BUILD-SNAPSHOT</version>
  11 + <relativePath/> <!-- lookup parent from repository -->
  12 + </parent>
  13 + <groupId>com.tianbo</groupId>
  14 + <artifactId>customs</artifactId>
  15 + <version>1.0-SNAPSHOT</version>
  16 + <name>customMessageProcess</name>
  17 + <description>process customs xml files with RabbitMQ</description>
  18 + <properties>
  19 + <druid.version>1.1.9</druid.version>
  20 + <spring-cloud.version>Greenwich.BUILD-SNAPSHOT</spring-cloud.version>
  21 + <lombok_sersion>1.18.6</lombok_sersion>
  22 + </properties>
  23 + <dependencies>
  24 + <!--spring boot-->
  25 + <dependency>
  26 + <groupId>org.springframework.boot</groupId>
  27 + <artifactId>spring-boot-starter-jdbc</artifactId>
  28 + </dependency>
  29 + <dependency>
  30 + <groupId>org.mybatis.spring.boot</groupId>
  31 + <artifactId>mybatis-spring-boot-starter</artifactId>
  32 + <version>1.3.2</version>
  33 + </dependency>
  34 + <dependency>
  35 + <groupId>org.springframework.boot</groupId>
  36 + <artifactId>spring-boot-starter-websocket</artifactId>
  37 + <exclusions>
  38 + <exclusion>
  39 + <groupId>org.springframework.boot</groupId>
  40 + <artifactId>spring-boot-starter</artifactId>
  41 + </exclusion>
  42 + </exclusions>
  43 + </dependency>
  44 + <dependency>
  45 + <groupId>org.springframework.boot</groupId>
  46 + <artifactId>spring-boot-starter-thymeleaf</artifactId>
  47 + </dependency>
  48 + <!--配合thymeleaf的LEGACYHTML5需要搭配一个额外的库NekoHTML才可用。-->
  49 + <dependency>
  50 + <groupId>net.sourceforge.nekohtml</groupId>
  51 + <artifactId>nekohtml</artifactId>
  52 + <version>1.9.22</version>
  53 + </dependency>
  54 + <dependency>
  55 + <groupId>org.springframework.boot</groupId>
  56 + <artifactId>spring-boot-starter-test</artifactId>
  57 + <scope>test</scope>
  58 + </dependency>
  59 + <!--clound-->
  60 + <dependency>
  61 + <groupId>org.springframework.cloud</groupId>
  62 + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  63 + </dependency>
  64 + <!--lombok-->
  65 + <dependency>
  66 + <groupId>org.projectlombok</groupId>
  67 + <artifactId>lombok</artifactId>
  68 + <version>${lombok_sersion}</version>
  69 + <scope>provided</scope>
  70 + </dependency>
  71 + <!--数据库-->
  72 + <dependency>
  73 + <groupId>com.alibaba</groupId>
  74 + <artifactId>druid</artifactId>
  75 + <version>${druid.version}</version>
  76 + </dependency>
  77 + <dependency>
  78 + <groupId>org.mybatis</groupId>
  79 + <artifactId>mybatis</artifactId>
  80 + <version>3.4.6</version>
  81 + </dependency>
  82 + <!--&lt;!&ndash; mysql&ndash;&gt;-->
  83 + <!--<dependency>-->
  84 + <!--<groupId>mysql</groupId>-->
  85 + <!--<artifactId>mysql-connector-java</artifactId>-->
  86 + <!--<version>8.0.15</version>-->
  87 + <!--</dependency>-->
  88 + <!-- oracle-->
  89 + <dependency>
  90 + <groupId>com.oracle</groupId>
  91 + <artifactId>ojdbc6</artifactId>
  92 + <version>11.2.0.4.0-atlassian-hosted</version>
  93 + </dependency>
  94 + <!--util依赖-->
  95 + <dependency>
  96 + <groupId>com.tianbo</groupId>
  97 + <artifactId>util</artifactId>
  98 + <version>1.0-SNAPSHOT</version>
  99 + </dependency>
  100 + <!--util依赖-->
  101 +
  102 + <!--&lt;!&ndash;IMF需要的包&ndash;&gt;-->
  103 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans &ndash;&gt;-->
  104 + <!--<dependency>-->
  105 + <!--<groupId>org.apache.xmlbeans</groupId>-->
  106 + <!--<artifactId>xmlbeans</artifactId>-->
  107 + <!--<version>2.4.0</version>-->
  108 + <!--</dependency>-->
  109 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.ws.commons.schema/XmlSchema &ndash;&gt;-->
  110 + <!--<dependency>-->
  111 + <!--<groupId>org.apache.ws.commons.schema</groupId>-->
  112 + <!--<artifactId>XmlSchema</artifactId>-->
  113 + <!--<version>1.4.7</version>-->
  114 + <!--</dependency>-->
  115 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/wsdl4j/wsdl4j &ndash;&gt;-->
  116 + <!--<dependency>-->
  117 + <!--<groupId>wsdl4j</groupId>-->
  118 + <!--<artifactId>wsdl4j</artifactId>-->
  119 + <!--<version>1.6.2</version>-->
  120 + <!--</dependency>-->
  121 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.neethi/neethi &ndash;&gt;-->
  122 + <!--<dependency>-->
  123 + <!--<groupId>org.apache.neethi</groupId>-->
  124 + <!--<artifactId>neethi</artifactId>-->
  125 + <!--<version>2.0.4</version>-->
  126 + <!--</dependency>-->
  127 +
  128 +
  129 +
  130 + <!--&lt;!&ndash; LOG &ndash;&gt;-->
  131 + <!--<dependency>-->
  132 + <!--<groupId>log4j</groupId>-->
  133 + <!--<artifactId>log4j</artifactId>-->
  134 + <!--<version>1.2.16</version>-->
  135 + <!--</dependency>-->
  136 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.slf4j/slf4j-api &ndash;&gt;-->
  137 + <!--<dependency>-->
  138 + <!--<groupId>org.slf4j</groupId>-->
  139 + <!--<artifactId>slf4j-api</artifactId>-->
  140 + <!--<version>1.6.1</version>-->
  141 + <!--</dependency>-->
  142 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 &ndash;&gt;-->
  143 + <!--<dependency>-->
  144 + <!--<groupId>org.slf4j</groupId>-->
  145 + <!--<artifactId>slf4j-jdk14</artifactId>-->
  146 + <!--<version>1.6.1</version>-->
  147 + <!--<scope>test</scope>-->
  148 + <!--</dependency>-->
  149 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.apache.cxf.xjcplugins/cxf-xjc-boolean &ndash;&gt;-->
  150 + <!--<dependency>-->
  151 + <!--<groupId>org.apache.cxf.xjcplugins</groupId>-->
  152 + <!--<artifactId>cxf-xjc-boolean</artifactId>-->
  153 + <!--<version>3.2.3</version>-->
  154 + <!--</dependency>-->
  155 + <!--&lt;!&ndash;添加本地IMF包&ndash;&gt;-->
  156 + <!--<dependency>-->
  157 + <!--<groupId>com.caac</groupId>-->
  158 + <!--<artifactId>imf</artifactId>-->
  159 + <!--<version>1.0.0</version>-->
  160 + <!--<scope>system</scope>-->
  161 + <!--<systemPath>${project.basedir}/lib/IMFClient.1.0.0.jar</systemPath>-->
  162 + <!--</dependency>-->
  163 + <!--<dependency>-->
  164 + <!--<groupId>com.caac.imf</groupId>-->
  165 + <!--<artifactId>imfmessage</artifactId>-->
  166 + <!--<version>1.0.0</version>-->
  167 + <!--<scope>system</scope>-->
  168 + <!--<systemPath>${project.basedir}/lib/imfmsg.jar</systemPath>-->
  169 + <!--</dependency>-->
  170 + <!--<dependency>-->
  171 + <!--<groupId>com.caac.imf</groupId>-->
  172 + <!--<artifactId>process</artifactId>-->
  173 + <!--<version>1.0.0</version>-->
  174 + <!--<scope>system</scope>-->
  175 + <!--<systemPath>${project.basedir}/lib/ProcessService.jar</systemPath>-->
  176 + <!--</dependency>-->
  177 + <!--<dependency>-->
  178 + <!--<groupId>com.caac.imf</groupId>-->
  179 + <!--<artifactId>apiconfig</artifactId>-->
  180 + <!--<version>1.0.0</version>-->
  181 + <!--<scope>system</scope>-->
  182 + <!--<systemPath>${project.basedir}/lib/apiConfig.jar</systemPath>-->
  183 + <!--</dependency>-->
  184 + <!--<dependency>-->
  185 + <!--<groupId>com.caac.imf</groupId>-->
  186 + <!--<artifactId>upload</artifactId>-->
  187 + <!--<version>1.0.0</version>-->
  188 + <!--<scope>system</scope>-->
  189 + <!--<systemPath>${project.basedir}/lib/UploadService.jar</systemPath>-->
  190 + <!--</dependency>-->
  191 + <!--<dependency>-->
  192 + <!--<groupId>com.caac.imf</groupId>-->
  193 + <!--<artifactId>heartbeat</artifactId>-->
  194 + <!--<version>1.0.0</version>-->
  195 + <!--<scope>system</scope>-->
  196 + <!--<systemPath>${project.basedir}/lib/HeartbeatService.jar</systemPath>-->
  197 + <!--</dependency>-->
  198 + <!--<dependency>-->
  199 + <!--<groupId>com.caac.imf</groupId>-->
  200 + <!--<artifactId>returnxml</artifactId>-->
  201 + <!--<version>1.0.0</version>-->
  202 + <!--<scope>system</scope>-->
  203 + <!--<systemPath>${project.basedir}/lib/returnXml.jar</systemPath>-->
  204 + <!--</dependency>-->
  205 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/org.hyperic/sigar &ndash;&gt;-->
  206 + <!--<dependency>-->
  207 + <!--<groupId>org.hyperic</groupId>-->
  208 + <!--<artifactId>sigar</artifactId>-->
  209 + <!--<version>1.6.4</version>-->
  210 + <!--<scope>system</scope>-->
  211 + <!--<systemPath>${project.basedir}/lib/sigar.jar</systemPath>-->
  212 + <!--</dependency>-->
  213 + <!--<dependency>-->
  214 + <!--<groupId>org.apache</groupId>-->
  215 + <!--<artifactId>cxf</artifactId>-->
  216 + <!--<version>2.3.2</version>-->
  217 + <!--<scope>system</scope>-->
  218 + <!--<systemPath>${project.basedir}/lib/cxf-2.3.2.jar</systemPath>-->
  219 + <!--</dependency>-->
  220 + <!--<dependency>-->
  221 + <!--<groupId>org.apache.cxf</groupId>-->
  222 + <!--<artifactId>xjc</artifactId>-->
  223 + <!--<version>2.3.2</version>-->
  224 + <!--<scope>system</scope>-->
  225 + <!--<systemPath>${project.basedir}/lib/cxf-xjc-bug671-2.3.2.jar</systemPath>-->
  226 + <!--</dependency>-->
  227 + <!--<dependency>-->
  228 + <!--<groupId>maven.org.apache</groupId>-->
  229 + <!--<artifactId>cxf</artifactId>-->
  230 + <!--<version>2.0</version>-->
  231 + <!--<scope>system</scope>-->
  232 + <!--<systemPath>${project.basedir}/lib/cxf-manifest.jar</systemPath>-->
  233 + <!--</dependency>-->
  234 + <!--<dependency>-->
  235 + <!--<groupId>org.apache.cxf.xjc</groupId>-->
  236 + <!--<artifactId>dv</artifactId>-->
  237 + <!--<version>2.3.2</version>-->
  238 + <!--<scope>system</scope>-->
  239 + <!--<systemPath>${project.basedir}/lib/cxf-xjc-dv-2.3.2.jar</systemPath>-->
  240 + <!--</dependency>-->
  241 + <!--<dependency>-->
  242 + <!--<groupId>org.apache.cxf.xjc</groupId>-->
  243 + <!--<artifactId>ts</artifactId>-->
  244 + <!--<version>2.3.2</version>-->
  245 + <!--<scope>system</scope>-->
  246 + <!--<systemPath>${project.basedir}/lib/cxf-xjc-ts-2.3.2.jar</systemPath>-->
  247 + <!--</dependency>-->
  248 + <!--<dependency>-->
  249 + <!--<groupId>org.apache.xml</groupId>-->
  250 + <!--<artifactId>xmlsec</artifactId>-->
  251 + <!--<version>1.4.4</version>-->
  252 + <!--<scope>system</scope>-->
  253 + <!--<systemPath>${project.basedir}/lib/xmlsec-1.4.4.jar</systemPath>-->
  254 + <!--</dependency>-->
  255 + <!--<dependency>-->
  256 + <!--<groupId>com.ibm.disthub2.impl</groupId>-->
  257 + <!--<artifactId>cl3e</artifactId>-->
  258 + <!--<version>1.0.0</version>-->
  259 + <!--<scope>system</scope>-->
  260 + <!--<systemPath>${project.basedir}/lib/CL3Export.jar</systemPath>-->
  261 + <!--</dependency>-->
  262 + <!--<dependency>-->
  263 + <!--<groupId>com.ibm.disthub2.impl</groupId>-->
  264 + <!--<artifactId>cl3ne</artifactId>-->
  265 + <!--<version>1.0.0</version>-->
  266 + <!--<scope>system</scope>-->
  267 + <!--<systemPath>${project.basedir}/lib/CL3Nonexport.jar</systemPath>-->
  268 + <!--</dependency>-->
  269 + <!--<dependency>-->
  270 + <!--<groupId>com.ibm.mq</groupId>-->
  271 + <!--<artifactId>axis2</artifactId>-->
  272 + <!--<version>1.0.0</version>-->
  273 + <!--<scope>system</scope>-->
  274 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.axis2.jar</systemPath>-->
  275 + <!--</dependency>-->
  276 + <!--<dependency>-->
  277 + <!--<groupId>com.ibm.mq</groupId>-->
  278 + <!--<artifactId>commonservices</artifactId>-->
  279 + <!--<version>1.0.0</version>-->
  280 + <!--<scope>system</scope>-->
  281 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.commonservices.jar</systemPath>-->
  282 + <!--</dependency>-->
  283 + <!--<dependency>-->
  284 + <!--<groupId>com.ibm.mq</groupId>-->
  285 + <!--<artifactId>defaultconfig</artifactId>-->
  286 + <!--<version>1.0.0</version>-->
  287 + <!--<scope>system</scope>-->
  288 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.defaultconfig.jar</systemPath>-->
  289 + <!--</dependency>-->
  290 + <!--<dependency>-->
  291 + <!--<groupId>com.ibm.mq</groupId>-->
  292 + <!--<artifactId>fta</artifactId>-->
  293 + <!--<version>1.0.0</version>-->
  294 + <!--<scope>system</scope>-->
  295 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.fta.jar</systemPath>-->
  296 + <!--</dependency>-->
  297 + <!--<dependency>-->
  298 + <!--<groupId>com.ibm.mq</groupId>-->
  299 + <!--<artifactId>headers</artifactId>-->
  300 + <!--<version>1.0.0</version>-->
  301 + <!--<scope>system</scope>-->
  302 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.headers.jar</systemPath>-->
  303 + <!--</dependency>-->
  304 + <!--<dependency>-->
  305 + <!--<groupId>com.ibm</groupId>-->
  306 + <!--<artifactId>mq</artifactId>-->
  307 + <!--<version>1.0.0</version>-->
  308 + <!--<scope>system</scope>-->
  309 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.jar</systemPath>-->
  310 + <!--</dependency>-->
  311 + <!--<dependency>-->
  312 + <!--<groupId>com.ibm</groupId>-->
  313 + <!--<artifactId>jmqi</artifactId>-->
  314 + <!--<version>1.0.0</version>-->
  315 + <!--<scope>system</scope>-->
  316 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.jmqi.jar</systemPath>-->
  317 + <!--</dependency>-->
  318 + <!--<dependency>-->
  319 + <!--<groupId>com.ibm.mq</groupId>-->
  320 + <!--<artifactId>jms.nojndi</artifactId>-->
  321 + <!--<version>1.0.0</version>-->
  322 + <!--<scope>system</scope>-->
  323 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.jms.Nojndi.jar</systemPath>-->
  324 + <!--</dependency>-->
  325 + <!--<dependency>-->
  326 + <!--<groupId>com.ibm.mq</groupId>-->
  327 + <!--<artifactId>pcf</artifactId>-->
  328 + <!--<version>1.0.0</version>-->
  329 + <!--<scope>system</scope>-->
  330 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.pcf.jar</systemPath>-->
  331 + <!--</dependency>-->
  332 + <!--<dependency>-->
  333 + <!--<groupId>com.ibm.mq</groupId>-->
  334 + <!--<artifactId>postcard</artifactId>-->
  335 + <!--<version>1.0.0</version>-->
  336 + <!--<scope>system</scope>-->
  337 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.postcard.jar</systemPath>-->
  338 + <!--</dependency>-->
  339 + <!--<dependency>-->
  340 + <!--<groupId>com.ibm.mq</groupId>-->
  341 + <!--<artifactId>soap</artifactId>-->
  342 + <!--<version>1.0.0</version>-->
  343 + <!--<scope>system</scope>-->
  344 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.soap.jar</systemPath>-->
  345 + <!--</dependency>-->
  346 + <!--<dependency>-->
  347 + <!--<groupId>com.ibm.mq</groupId>-->
  348 + <!--<artifactId>tools.ras</artifactId>-->
  349 + <!--<version>1.0.0</version>-->
  350 + <!--<scope>system</scope>-->
  351 + <!--<systemPath>${project.basedir}/lib/com.ibm.mq.tools.ras.jar</systemPath>-->
  352 + <!--</dependency>-->
  353 + <!--<dependency>-->
  354 + <!--<groupId>com.ibm.mq</groupId>-->
  355 + <!--<artifactId>etclient</artifactId>-->
  356 + <!--<version>1.0.0</version>-->
  357 + <!--<scope>system</scope>-->
  358 + <!--<systemPath>${project.basedir}/lib/com.ibm.mqetclient.jar</systemPath>-->
  359 + <!--</dependency>-->
  360 + <!--<dependency>-->
  361 + <!--<groupId>com.ibm</groupId>-->
  362 + <!--<artifactId>mqjms</artifactId>-->
  363 + <!--<version>1.0.0</version>-->
  364 + <!--<scope>system</scope>-->
  365 + <!--<systemPath>${project.basedir}/lib/com.ibm.mqjms.jar</systemPath>-->
  366 + <!--&lt;!&ndash; https://mvnrepository.com/artifact/javax.resource/connector &ndash;&gt;-->
  367 + <!--</dependency>-->
  368 + <!--<dependency>-->
  369 + <!--<groupId>javax.resource</groupId>-->
  370 + <!--<artifactId>connector</artifactId>-->
  371 + <!--<version>1.0</version>-->
  372 + <!--<scope>system</scope>-->
  373 + <!--<systemPath>${project.basedir}/lib/connector.jar</systemPath>-->
  374 + <!--</dependency>-->
  375 + </dependencies>
  376 +
  377 + <dependencyManagement>
  378 + <dependencies>
  379 + <dependency>
  380 + <groupId>org.springframework.cloud</groupId>
  381 + <artifactId>spring-cloud-dependencies</artifactId>
  382 + <version>${spring-cloud.version}</version>
  383 + <type>pom</type>
  384 + <scope>import</scope>
  385 + </dependency>
  386 + </dependencies>
  387 + </dependencyManagement>
  388 + <build>
  389 + <plugins>
  390 + <plugin>
  391 + <groupId>org.springframework.boot</groupId>
  392 + <artifactId>spring-boot-maven-plugin</artifactId>
  393 + <configuration>
  394 + <includeSystemScope>true</includeSystemScope>
  395 + </configuration>
  396 + </plugin>
  397 + <!-- mybatis generator 自动生成代码插件 -->
  398 + <plugin>
  399 + <groupId>org.mybatis.generator</groupId>
  400 + <artifactId>mybatis-generator-maven-plugin</artifactId>
  401 + <version>1.3.2</version>
  402 + <configuration>
  403 + <configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
  404 + <overwrite>true</overwrite>
  405 + <verbose>true</verbose>
  406 + </configuration>
  407 + </plugin>
  408 + </plugins>
  409 + </build>
  410 +
  411 + <repositories>
  412 + <repository>
  413 + <id>spring-snapshots</id>
  414 + <name>Spring Snapshots</name>
  415 + <url>https://repo.spring.io/snapshot</url>
  416 + <snapshots>
  417 + <enabled>true</enabled>
  418 + </snapshots>
  419 + </repository>
  420 + <repository>
  421 + <id>spring-milestones</id>
  422 + <name>Spring Milestones</name>
  423 + <url>https://repo.spring.io/milestone</url>
  424 + </repository>
  425 + </repositories>
  426 + <pluginRepositories>
  427 + <pluginRepository>
  428 + <id>spring-snapshots</id>
  429 + <name>Spring Snapshots</name>
  430 + <url>https://repo.spring.io/snapshot</url>
  431 + <snapshots>
  432 + <enabled>true</enabled>
  433 + </snapshots>
  434 + </pluginRepository>
  435 + <pluginRepository>
  436 + <id>spring-milestones</id>
  437 + <name>Spring Milestones</name>
  438 + <url>https://repo.spring.io/milestone</url>
  439 + </pluginRepository>
  440 + </pluginRepositories>
  441 +</project>
  1 +# 读取本地文件夹下的xml文件将新舱单xml申报报文发送到rabbitMQ队列,从MQ获取海关回执报文存储到本地文件夹下
  2 +# 读取本地TCS回执接收文件夹下的[xml海关回执文件]并发送到rabbitMQ队列,从MQ获取新舱单系统生成的申报XML报文并存储到到本地舱单申报发送文件夹下
  3 +
  4 +配置config/application.yml
  5 + eureka center注册中心地址
  6 + application name
  7 + coustom的读取回执目录(按当前日期读取目录下的日期子文件夹)
  8 + 解析成功的备份回执目录(按日期生成文件夹备份)
  9 + 解析失败的备份目录(按日期生成文件夹备份)
  10 + log配置文件为config/logback-dev.xml,日志文件夹为./logs
  11 +
  12 +* 配置文件为项目根目录下的config文件夹内,方便部署后的配置修改
  13 + * logback-dev.xml 为logback的配置文件
  14 + * winddows系统的控制台编码配置要设置成GBK,
  15 + 因为WINDOWS的DOS环境编码为GBK,否则出现乱码
  16 + * application.yml 为spring boot的配置文件
  17 +* 已集成mybatis、mybatisGenerator、pageHelper
  18 +* 集成IMFjar包
  19 +* 集成Spring boot 及 srping cloud
  20 +* 集成定时任务框架
  21 +* 后端采用spring boot 2 ,配合前端框架使用。
  22 +* 集成Spring Cloud
  23 +* 集成lombok,简化部分代码录入,比如实体类,方便实体及表结构修改,敏捷开发必用,使用方法见[lombok集成使用说明](https://jingyan.baidu.com/article/0a52e3f4e53ca1bf63ed725c.html)
  24 +)
  25 +* 集成websocket
  26 + * 可以在线查看imf客户端运行情况 web访问路径/log/imf,可查看项目logs目录下的log_info.log
  27 +* 打包jar散包 看这里 https://blog.csdn.net/m0_37202351/article/details/81738357
  28 +* 要集成util项目为model才能跑起来 [git地址](git@118.31.66.166:wlxxpt/utitls.git)
  29 +* 集成thymeleaf,webmvc 视图配置参考资料[地址](https://blog.csdn.net/zheng_chang_wei/article/details/76155440)
  30 +[打jar包后找不到路径](https://blog.csdn.net/qq_37372909/article/details/84824805)
  31 +* 支持在线CMD功能,运维级,访问路径/cmd
  32 + * 查询进程pid:
  33 + * wmic process get caption,commandline,processid /value |findstr java
  34 + * wmic process get name,executablepath,processid /value |findstr java
  35 + * wmic process where "((CommandLine LIKE '%convert.jar%') AND NOT (CommandLine LIKE '%wmic%'))" get caption,commandline,processid /value
  36 + * 停止启动服务: wmic Service where caption="新舱单数据订阅服务" call stopservice / wmic Service where caption="新舱单数据订阅服务" call startservice
  37 + * 系统服务截图在新舱单维护手册中,有道云笔记中也有。
  38 +
  39 +
  40 + 舱单回执目录: D:\Data\Receive
  41 + 单一窗口回执目录: D:\TCSSingleWindow\recive
  42 + 单一窗口报文转换工具目录:D:\TCSSingleWindow\报文转换工具,"java -Dfile.encoding=utf-8 -jar convert.jar"
  43 + 货运数据订阅目录:D:\系统部署\imf_Warehouse_reader\xmlFromImf
  44 +
  45 +* 配合微信前端定时监控3个回执目录的文件数量,超过警戒值 微信发出提醒
  46 + * path = /devops/watchdir?dir=tcs
  47 + 参数dir,可以是指定目录值,也可以是stcs、tcs、cfps 分别代表单一窗口回执目录、商务节点回执目录、CFPS数据订阅目录
  48 +
  1 +Manifest-Version: 1.0
  2 +Main-Class: com.tianbo.analysis.BootApplication
  3 +Class-Path: spring-boot-starter-thymeleaf-2.2.0.BUILD-20191016.163455-71
  4 + 2.jar commons-jxpath-1.3.jar netflix-commons-util-0.3.0.jar spring-jdbc
  5 + -5.2.0.RELEASE.jar woodstox-core-5.2.1.jar amqp-client-5.7.3.jar jersey
  6 + -core-1.19.1.jar thymeleaf-3.0.11.RELEASE.jar spring-boot-starter-loggi
  7 + ng-2.2.0.BUILD-20191016.163447-713.jar rxnetty-0.4.9.jar spring-cloud-n
  8 + etflix-hystrix-2.1.5.BUILD-20200131.212025-597.jar guice-4.1.0.jar myba
  9 + tis-spring-1.3.2.jar joda-time-2.10.4.jar logback-core-1.2.3.jar bcpkix
  10 + -jdk15on-1.64.jar snakeyaml-1.25.jar spring-cloud-netflix-archaius-2.1.
  11 + 5.BUILD-20200131.211909-597.jar spring-tx-5.2.0.RELEASE.jar spring-webm
  12 + vc-5.2.0.RELEASE.jar hibernate-validator-6.0.17.Final.jar eureka-client
  13 + -1.9.13.jar javax.inject-1.jar unbescape-1.1.6.RELEASE.jar attoparser-2
  14 + .0.5.RELEASE.jar spring-boot-2.2.0.BUILD-20191016.163506-711.jar dom4j-
  15 + 2.1.0.jar spring-messaging-5.2.0.RELEASE.jar mybatis-3.4.6.jar jackson-
  16 + annotations-2.10.0.jar tomcat-embed-core-9.0.27.jar spring-cloud-netfli
  17 + x-eureka-client-2.1.5.BUILD-20200131.212304-596.jar stax2-api-4.2.jar s
  18 + pring-core-5.2.0.RELEASE.jar mybatis-spring-boot-starter-1.3.2.jar spri
  19 + ng-cloud-starter-netflix-archaius-2.1.5.BUILD-20200131.212322-596.jar r
  20 + ibbon-2.3.0.jar netflix-eventbus-0.3.0.jar spring-boot-starter-web-2.2.
  21 + 0.BUILD-20191016.163459-711.jar spring-web-5.2.0.RELEASE.jar spring-con
  22 + text-5.2.0.RELEASE.jar xstream-1.4.11.1.jar ojdbc6-11.2.0.4.0-atlassian
  23 + -hosted.jar spring-security-rsa-1.0.9.RELEASE.jar spring-boot-starter-w
  24 + ebsocket-2.2.0.BUILD-20191016.163500-711.jar commons-configuration-1.8.
  25 + jar slf4j-api-1.7.28.jar xercesImpl-2.11.0.jar ribbon-eureka-2.3.0.jar
  26 + ribbon-loadbalancer-2.3.0.jar spring-cloud-netflix-ribbon-2.1.5.BUILD-2
  27 + 0200131.211941-597.jar spring-boot-starter-jdbc-2.2.0.BUILD-20191016.16
  28 + 3441-713.jar spring-boot-starter-json-2.2.0.BUILD-20191016.163444-713.j
  29 + ar spring-cloud-commons-2.1.5.BUILD-20200131.003036-348.jar mybatis-spr
  30 + ing-boot-autoconfigure-1.3.2.jar spring-boot-autoconfigure-2.2.0.BUILD-
  31 + 20191016.163400-713.jar jsr311-api-1.1.1.jar commons-lang-2.6.jar antlr
  32 + -runtime-3.4.jar rxnetty-contexts-0.4.9.jar spring-boot-starter-tomcat-
  33 + 2.2.0.BUILD-20191016.163456-712.jar spring-boot-starter-validation-2.2.
  34 + 0.BUILD-20191016.163457-711.jar spring-boot-starter-aop-2.2.0.BUILD-201
  35 + 91016.163422-713.jar spring-cloud-starter-netflix-eureka-client-2.1.5.B
  36 + UILD-20200131.212334-596.jar thymeleaf-extras-java8time-3.0.4.RELEASE.j
  37 + ar jackson-module-parameter-names-2.10.0.jar aspectjweaver-1.9.4.jar je
  38 + rsey-client-1.19.1.jar stax-api-1.0.1.jar ribbon-httpclient-2.3.0.jar j
  39 + ettison-1.3.7.jar spring-aop-5.2.0.RELEASE.jar spring-cloud-context-2.1
  40 + .5.BUILD-20200131.002935-351.jar guava-16.0.jar commons-io-2.6.jar ribb
  41 + on-transport-2.3.0.jar annotations-19.0.0.jar httpcore-4.4.12.jar logba
  42 + ck-classic-1.2.3.jar log4j-to-slf4j-2.12.1.jar ribbon-core-2.3.0.jar co
  43 + mmons-math-2.2.jar HdrHistogram-2.1.9.jar xmlpull-1.1.3.1.jar jakarta.a
  44 + nnotation-api-1.3.5.jar httpclient-4.5.10.jar spring-websocket-5.2.0.RE
  45 + LEASE.jar HikariCP-3.4.1.jar spring-cloud-starter-2.1.5.BUILD-20200131.
  46 + 003057-348.jar archaius-core-0.7.6.jar spring-expression-5.2.0.RELEASE.
  47 + jar xpp3_min-1.1.4c.jar jackson-datatype-jdk8-2.10.0.jar antlr-2.7.7.ja
  48 + r servo-core-0.12.21.jar hystrix-core-1.5.18.jar gson-2.8.6.jar rxnetty
  49 + -servo-0.4.9.jar jersey-apache-client4-1.19.1.jar eureka-core-1.9.13.ja
  50 + r bcprov-jdk15on-1.64.jar druid-1.1.9.jar jackson-core-2.10.0.jar jakar
  51 + ta.validation-api-2.0.1.jar netflix-infix-0.3.0.jar nekohtml-1.9.22.jar
  52 + tomcat-embed-el-9.0.27.jar jboss-logging-3.4.1.Final.jar jul-to-slf4j-
  53 + 1.7.28.jar thymeleaf-spring5-3.0.11.RELEASE.jar netflix-statistics-0.1.
  54 + 1.jar spring-beans-5.2.0.RELEASE.jar aopalliance-1.0.jar tomcat-embed-w
  55 + ebsocket-9.0.27.jar classmate-1.5.0.jar spring-jcl-5.2.0.RELEASE.jar st
  56 + ringtemplate-3.2.1.jar spring-security-crypto-5.2.0.RELEASE.jar rxjava-
  57 + 1.3.8.jar xml-apis-1.4.01.jar spring-boot-starter-2.2.0.BUILD-20191016.
  58 + 163501-711.jar log4j-api-2.12.1.jar commons-collections-3.2.2.jar jacks
  59 + on-datatype-jsr310-2.10.0.jar spring-cloud-starter-netflix-ribbon-2.1.5
  60 + .BUILD-20200131.212329-596.jar jackson-databind-2.10.0.jar commons-code
  61 + c-1.13.jar jaxen-1.2.0.jar
  62 +
  1 +/**
  2 + * @author mrz
  3 + * @email 17966059@qq.com
  4 + */
  5 +package com.tianbo.analysis;
  6 +
  7 +import org.mybatis.spring.annotation.MapperScan;
  8 +import org.springframework.boot.SpringApplication;
  9 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  10 +import org.springframework.boot.web.client.RestTemplateBuilder;
  11 +import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  12 +import org.springframework.cloud.client.loadbalancer.LoadBalanced;
  13 +import org.springframework.context.annotation.Bean;
  14 +import org.springframework.context.annotation.ComponentScan;
  15 +import org.springframework.scheduling.annotation.EnableScheduling;
  16 +import org.springframework.transaction.annotation.EnableTransactionManagement;
  17 +import org.springframework.web.client.RestTemplate;
  18 +
  19 +import java.time.Duration;
  20 +
  21 +@SpringBootApplication
  22 +@EnableScheduling
  23 +@EnableDiscoveryClient
  24 +@EnableTransactionManagement
  25 +@MapperScan("com.tianbo.analysis.dao")
  26 +public class BootApplication {
  27 +
  28 + public static void main(String[] args) {
  29 + SpringApplication.run(BootApplication.class, args);
  30 + }
  31 +
  32 + @Bean
  33 + @LoadBalanced
  34 + RestTemplate restTemplate(RestTemplateBuilder builder){
  35 +
  36 + return builder.setConnectTimeout(Duration.ofSeconds(15)).setReadTimeout(Duration.ofSeconds(15))
  37 + .build();
  38 + }
  39 +}
  40 +
  1 +package com.tianbo.analysis.bean;
  2 +import org.springframework.beans.BeansException;
  3 +import org.springframework.context.ApplicationContext;
  4 +import org.springframework.context.ApplicationContextAware;
  5 +import org.springframework.stereotype.Component;
  6 +
  7 +/**
  8 + * @ProjectName:
  9 + * @Package: com.backstage.config
  10 + * @ClassName: ApplicationContextProvider
  11 + * @Description: 获取bean对象的工具类
  12 + * @Author: wangzhilong
  13 + * @CreateDate: 2018/8/31 13:26
  14 + * @Version: 1.0
  15 + */
  16 +
  17 +/**
  18 + * Author:ZhuShangJin
  19 + * Date:2018/7/3
  20 + */
  21 +@Component
  22 +public class SpringBeanUtitl implements ApplicationContextAware{
  23 +
  24 + private static ApplicationContext applicationContext = null;
  25 + @Override
  26 + public void setApplicationContext(ApplicationContext applicationContext) throws
  27 + BeansException {
  28 + // TODO Auto-generated method stub
  29 + SpringBeanUtitl.applicationContext = applicationContext;
  30 + }
  31 +
  32 + /**
  33 + * 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
  34 + */
  35 + @SuppressWarnings("unchecked")
  36 + public static <T> T getBean(String name) {
  37 + if(name == null || applicationContext == null){
  38 + return null;
  39 + }
  40 +
  41 + return (T) applicationContext.getBean(name);
  42 + }
  43 +
  44 + /**
  45 + * 从静态变量applicationContext中得到Bean, 自动转型为所赋值对象的类型.
  46 + */
  47 + public static <T> T getBean(Class<T> clazz) {
  48 + return applicationContext.getBean(clazz);
  49 + }
  50 +
  51 +}
  52 +
  1 +package com.tianbo.analysis.bean;
  2 +
  3 +import com.netflix.discovery.converters.Auto;
  4 +import com.tianbo.analysis.dao.*;
  5 +import com.tianbo.analysis.service.CustomMessageService;
  6 +import com.tianbo.analysis.service.SendLogService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +@Component
  11 +public class WlptBaseModel {
  12 +
  13 +
  14 + @Autowired
  15 + public ALLOCATEARRIVALMapper allocatearrivalMapper;
  16 +
  17 + @Autowired
  18 + public SendLogService sendLogService;
  19 +
  20 + @Autowired
  21 + public ARRIVEDMASTERMapper arrivedmasterMapper;
  22 +
  23 + @Autowired
  24 + public ARRIVEDSECONDARYMapper arrivedsecondaryMapper;
  25 +
  26 + @Autowired
  27 + public DEPARTURESLOADINGMapper departuresloadingMapper;
  28 +
  29 + @Autowired
  30 + public INPORTALLOCATEMapper inportallocateMapper;
  31 +
  32 + @Autowired
  33 + public INTERNATIONALTRANSITMapper internationaltransitMapper;
  34 +
  35 + @Autowired
  36 + public ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
  37 +
  38 + @Autowired
  39 + public OriginmanifestsecondaryMapper originmanifestsecondaryMapper;
  40 +
  41 + @Autowired
  42 + public PREPAREMASTERMapper preparemasterMapper;
  43 +
  44 + @Autowired
  45 + public PREPARESECONDARYMapper preparesecondaryMapper;
  46 +
  47 + @Autowired
  48 + public TALLYMASTERMapper tallymasterMapper;
  49 +
  50 + @Autowired
  51 + public TALLYSECONDARYMapper tallysecondaryMapper;
  52 +
  53 + @Autowired
  54 + public CUSTOMSMESSAGEMapper customsmessageMapper;
  55 +
  56 + @Autowired
  57 + public CustomMessageService customMessageService;
  58 +
  59 + @Autowired
  60 + public MANIFESTLOADMapper manifestloadMapper;
  61 +
  62 + @Autowired
  63 + public MANIFESTLOSTCHANGEMapper manifestlostchangeMapper;
  64 +
  65 +
  66 + public WlptBaseModel() {
  67 + //处理多线程时 springboot 无法注入bean的问题
  68 + if (allocatearrivalMapper==null){
  69 + allocatearrivalMapper = SpringBeanUtitl.getBean(ALLOCATEARRIVALMapper.class);
  70 + }
  71 + if (sendLogService==null){
  72 + sendLogService = SpringBeanUtitl.getBean(SendLogService.class);
  73 + }
  74 + if (arrivedmasterMapper==null){
  75 + arrivedmasterMapper = SpringBeanUtitl.getBean(ARRIVEDMASTERMapper.class);
  76 + }
  77 + if (arrivedsecondaryMapper==null){
  78 + arrivedsecondaryMapper= SpringBeanUtitl.getBean(ARRIVEDSECONDARYMapper.class);
  79 + }
  80 + if(departuresloadingMapper==null){
  81 + departuresloadingMapper = SpringBeanUtitl.getBean(DEPARTURESLOADINGMapper.class);
  82 + }
  83 + if(inportallocateMapper==null){
  84 + inportallocateMapper = SpringBeanUtitl.getBean(INPORTALLOCATEMapper.class);
  85 + }
  86 + if(internationaltransitMapper==null){
  87 + internationaltransitMapper = SpringBeanUtitl.getBean(INTERNATIONALTRANSITMapper.class);
  88 + }
  89 + if(originmanifestmasterMapper==null){
  90 + originmanifestmasterMapper = SpringBeanUtitl.getBean(ORIGINMANIFESTMASTERMapper.class);
  91 + }
  92 + if(originmanifestsecondaryMapper==null){
  93 + originmanifestsecondaryMapper = SpringBeanUtitl.getBean(OriginmanifestsecondaryMapper.class);
  94 + }
  95 + if(preparemasterMapper==null){
  96 + preparemasterMapper = SpringBeanUtitl.getBean(PREPAREMASTERMapper.class);
  97 + }
  98 + if(preparesecondaryMapper==null){
  99 + preparesecondaryMapper = SpringBeanUtitl.getBean(PREPARESECONDARYMapper.class);
  100 + }
  101 + if(tallymasterMapper==null){
  102 + tallymasterMapper = SpringBeanUtitl.getBean(TALLYMASTERMapper.class);
  103 + }
  104 + if(tallysecondaryMapper==null){
  105 + tallysecondaryMapper = SpringBeanUtitl.getBean(TALLYSECONDARYMapper.class);
  106 + }
  107 + if(customsmessageMapper==null){
  108 + customsmessageMapper = SpringBeanUtitl.getBean(CUSTOMSMESSAGEMapper.class);
  109 + }
  110 + if(customMessageService==null){
  111 + customMessageService = SpringBeanUtitl.getBean(CustomMessageService.class);
  112 + }
  113 + if(manifestloadMapper==null){
  114 + manifestloadMapper = SpringBeanUtitl.getBean(MANIFESTLOADMapper.class);
  115 + }
  116 + if(manifestlostchangeMapper==null){
  117 + manifestlostchangeMapper = SpringBeanUtitl.getBean(MANIFESTLOSTCHANGEMapper.class);
  118 + }
  119 +
  120 + }
  121 +
  122 + public static void init(){
  123 +
  124 + }
  125 +
  126 + public int masterAnalysisReception(){
  127 + return 0;
  128 + }
  129 +
  130 + public int secondAnalysisReception(){
  131 + return 0;
  132 + }
  133 +}
  1 +package com.tianbo.analysis.config;
  2 +
  3 +import org.springframework.boot.web.server.ErrorPage;
  4 +import org.springframework.boot.web.server.ErrorPageRegistrar;
  5 +import org.springframework.boot.web.server.ErrorPageRegistry;
  6 +import org.springframework.http.HttpStatus;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +
  10 +/**
  11 + * @descrption 需要解决srpingboot error页面模板
  12 + * @author mrz
  13 + * @date 20190414
  14 + */
  15 +@Component
  16 +public class ErrorPageConfig implements ErrorPageRegistrar {
  17 +
  18 + @Override
  19 + public void registerErrorPages(ErrorPageRegistry registry){
  20 + ErrorPage[] errorPages=new ErrorPage[2];
  21 + errorPages[0]=new ErrorPage(HttpStatus.NOT_FOUND,"/error404");
  22 + errorPages[1]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error500");
  23 +
  24 + registry.addErrorPages(errorPages);
  25 + }
  26 +
  27 +}
  1 +package com.tianbo.analysis.config;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import org.springframework.web.socket.server.standard.ServerEndpointExporter;
  6 +
  7 +@Configuration
  8 +public class WebSocketConfig {
  9 + @Bean
  10 + public ServerEndpointExporter serverEndpointExporter() {
  11 + return new ServerEndpointExporter();
  12 + }
  13 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import lombok.extern.slf4j.Slf4j;
  4 +import org.springframework.stereotype.Controller;
  5 +import org.springframework.ui.Model;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +
  9 +import java.io.BufferedReader;
  10 +import java.io.InputStreamReader;
  11 +import java.io.LineNumberReader;
  12 +import java.util.ArrayList;
  13 +import java.util.List;
  14 +
  15 +@Controller
  16 +@Slf4j
  17 +public class CmdController {
  18 +
  19 + @RequestMapping("/linuxCmd")
  20 + public String linuxCmd(@RequestParam(value = "command",required = false) String command,Model model){
  21 + List<String> strList = new ArrayList();
  22 + try {
  23 + if (command !=null && !command.isEmpty()){
  24 + Process process;
  25 + process = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command}, null, null);
  26 + InputStreamReader ir = new InputStreamReader(process
  27 + .getInputStream());
  28 + LineNumberReader input = new LineNumberReader(ir);
  29 + String line;
  30 + process.waitFor();
  31 + while ((line = input.readLine()) != null) {
  32 + strList.add(line);
  33 + log.info(line);
  34 + }
  35 + model.addAttribute("cmdResult",strList);
  36 + }
  37 + }catch (Exception e){
  38 + e.printStackTrace();
  39 + log.error("执行命令出错",e);
  40 + }
  41 +
  42 +
  43 +
  44 + return "cmd/cmd";
  45 + }
  46 +
  47 + @RequestMapping("/windowsCmd")
  48 + public String windowsCmd(@RequestParam(value = "command",required = false) String command,Model model){
  49 + List<String> strList = new ArrayList();
  50 + try {
  51 + if (command !=null && !command.isEmpty()){
  52 + Runtime rt = Runtime.getRuntime();
  53 + String[] args = new String[]{"cmd","/c",command};
  54 + Process pr = rt.exec(args,null,null);
  55 + //Process pr = rt.exec("cmd /c dir"); // cmd /c calc
  56 + // Process pr = rt.exec("D:\\xunlei\\project.aspx");
  57 +
  58 + BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream(), "GBK"));
  59 +
  60 + String line;
  61 +
  62 + while ((line = input.readLine()) != null) {
  63 + strList.add(line);
  64 + log.info(line);
  65 + }
  66 +
  67 + int exitVal = pr.waitFor();
  68 + log.info("exitVal",exitVal);
  69 + model.addAttribute("cmdResult",strList);
  70 + }
  71 + }catch (Exception e){
  72 + e.printStackTrace();
  73 + log.error("执行命令出错",e);
  74 + }
  75 + return "cmd/wincmd";
  76 + }
  77 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import com.tianbo.util.IO.FileTool;
  4 +import lombok.extern.slf4j.Slf4j;
  5 +import org.springframework.beans.factory.annotation.Value;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import java.io.File;
  11 +import java.util.List;
  12 +
  13 +@RestController
  14 +@Slf4j
  15 +@RequestMapping("/devops")
  16 +public class DevOpsController {
  17 +
  18 + //单一窗口回执读取目录
  19 + @Value("${devops.dir.singlewindow-tcs-recept}")
  20 + private String singlewindow_tcs_recept_dir;
  21 +
  22 + //天博TCS回执读取目录
  23 + @Value("${devops.dir.tianbo-tcs-recept}")
  24 + private String tianbo_tcs_recept_dir;
  25 +
  26 + //CFPS订阅货运报文目录
  27 + @Value("${devops.dir.cfps-subscribe-dir}")
  28 + private String cfps_recept_dir;
  29 +
  30 + @RequestMapping("/watchdir")
  31 + public Integer singlewindow(@RequestParam(value = "dir",required = true,defaultValue = "D:\\系统部署\\imf_Warehouse_reader\\xmlFromImf") String dir){
  32 + switch (dir){
  33 + case "stcs" :
  34 + dir = singlewindow_tcs_recept_dir;
  35 + break;
  36 + case "tcs" :
  37 + dir = tianbo_tcs_recept_dir;
  38 + break;
  39 + case "cfps" :
  40 + dir = cfps_recept_dir;
  41 + break;
  42 + default:
  43 + dir = cfps_recept_dir;
  44 + break;
  45 + }
  46 + try{
  47 +// dir = "/Users/mrz/Downloads/rdp_temp";
  48 + File fileDirectory = new File(dir);
  49 + if (!fileDirectory.exists()){
  50 + log.error("目录{}不存在",dir);
  51 + }else{
  52 + log.info("{}{}{}","开始获取目录",dir,"文件数量");
  53 + List<File> files = FileTool.readAllDirectoryFiles(fileDirectory);
  54 + if(files!=null && !files.isEmpty()){
  55 + log.info("{}{}{}{}","目录",dir,"文件数量为:",files.size());
  56 + return files.size();
  57 + }else {
  58 + return 0;
  59 + }
  60 + }
  61 + }catch (Exception e){
  62 + e.printStackTrace();
  63 + log.error("获取目录文件出错",e);
  64 + }
  65 + return 500;
  66 + }
  67 +
  68 +
  69 +
  70 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import org.springframework.stereotype.Controller;
  4 +import org.springframework.web.bind.annotation.RequestMapping;
  5 +
  6 +@Controller
  7 +public class ErrorController {
  8 +
  9 + @RequestMapping("/error404")
  10 + public String error404(){
  11 + return "error/404";
  12 + }
  13 +
  14 + @RequestMapping("/error500")
  15 + public String error500(){
  16 + return "error/500";
  17 + }
  18 +
  19 +
  20 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import org.springframework.stereotype.Controller;
  4 +import org.springframework.web.bind.annotation.RequestMapping;
  5 +
  6 +@Controller
  7 +public class ImfLogController {
  8 +
  9 +
  10 + @RequestMapping("/log/imf")
  11 + public String IMFlog(){
  12 + return "log/imf";
  13 + }
  14 +
  15 +
  16 +}
  17 +
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import org.springframework.stereotype.Controller;
  4 +import org.springframework.web.bind.annotation.RequestMapping;
  5 +
  6 +@Controller
  7 +public class IndexController {
  8 +
  9 + @RequestMapping("/")
  10 + public String index(){
  11 + return "index";
  12 + }
  13 +
  14 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import com.tianbo.analysis.handle.IO_Log_Handle;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +import javax.websocket.OnClose;
  7 +import javax.websocket.OnError;
  8 +import javax.websocket.OnOpen;
  9 +import javax.websocket.Session;
  10 +import javax.websocket.server.ServerEndpoint;
  11 +import java.io.IOException;
  12 +import java.io.InputStream;
  13 +import java.util.concurrent.CopyOnWriteArraySet;
  14 +
  15 +
  16 +@ServerEndpoint(value = "/log")
  17 +@Component
  18 +public class LogWebsockController {
  19 + private Process process;
  20 + private InputStream inputStream;
  21 + //与某个客户端的连接会话,需要通过它来给客户端发送数据
  22 + private Session session;
  23 +
  24 + //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
  25 + private static int onlineCount = 0;
  26 + //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
  27 + private static CopyOnWriteArraySet<LogWebsockController> webSocketSet = new CopyOnWriteArraySet<LogWebsockController>();
  28 +
  29 +
  30 + @OnOpen
  31 + public void onOpen(Session session){
  32 + this.session = session;
  33 + webSocketSet.add(this);
  34 + addOnlineCount();
  35 + try {
  36 + process = Runtime.getRuntime().exec("tail -f logs/log_info.log");
  37 + inputStream = process.getInputStream();
  38 + IO_Log_Handle thread = new IO_Log_Handle(inputStream, session);
  39 + thread.start();
  40 +
  41 + }catch (IOException e){
  42 + e.printStackTrace();
  43 + }
  44 +
  45 + }
  46 + /**
  47 + * WebSocket请求关闭
  48 + */
  49 + @OnClose
  50 + public void onClose() {
  51 + try {
  52 + if(inputStream != null) {
  53 + inputStream.close();
  54 + }
  55 + } catch (Exception e) {
  56 + e.printStackTrace();
  57 + }
  58 + if(process != null){
  59 + process.destroy();
  60 + }
  61 +
  62 + }
  63 +
  64 + @OnError
  65 + public void onError(Throwable thr) {
  66 + thr.printStackTrace();
  67 + }
  68 +
  69 + public static synchronized void addOnlineCount() {
  70 + LogWebsockController.onlineCount++;
  71 + }
  72 + public static synchronized int getOnlineCount() {
  73 + return onlineCount;
  74 + }
  75 +
  76 +
  77 +}
  1 +package com.tianbo.analysis.controller;
  2 +
  3 +import lombok.extern.slf4j.Slf4j;
  4 +import org.apache.commons.io.FileUtils;
  5 +import org.springframework.beans.factory.annotation.Value;
  6 +import org.springframework.web.bind.annotation.PostMapping;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import java.io.File;
  11 +import java.io.IOException;
  12 +import java.util.UUID;
  13 +
  14 +/**
  15 + * 在线报文导入管理
  16 + */
  17 +@RestController
  18 +@RequestMapping("/Rmsg")
  19 +@Slf4j
  20 +public class RadioMsgController {
  21 +
  22 + //备份目录
  23 + @Value("${custom.extRedioMsgDir}")
  24 + private String extRedioMsgDir;
  25 +
  26 + private final static String FFM_HEADER = "<MSG>\n" +
  27 + "<META>\n" +
  28 + "<SNDR>TXD</SNDR>\n" +
  29 + "<DDTM>20200113050339</DDTM>\n" +
  30 + "<TYPE>IATA</TYPE>\n" +
  31 + "<STYP>FFM</STYP>\n" +
  32 + "<SEQN>95205940</SEQN>\n" +
  33 + "</META>\n" +
  34 + "<FFM>\n";
  35 +
  36 + private final static String FFM_FOOTER = "\n</FFM>\n" +
  37 + "</MSG>";
  38 +
  39 + private final static String FWB_HEADER="<MSG>\n" +
  40 + "<META>\n" +
  41 + "<SNDR>TXD</SNDR>\n" +
  42 + "<DDTM>20200113004608</DDTM>\n" +
  43 + "<TYPE>IATA</TYPE>\n" +
  44 + "<STYP>IFWB</STYP>\n" +
  45 + "<SEQN>95203026</SEQN>\n" +
  46 + "</META>\n" +
  47 + "<FWB>\n";
  48 + private final static String FWB_FOOTER="\n</FWB>\n" +
  49 + "</MSG>";
  50 +
  51 + private final static String FHL_HEADER="<MSG>\n" +
  52 + "<META>\n" +
  53 + "<SNDR>TXD</SNDR>\n" +
  54 + "<DDTM>20200113003006</DDTM>\n" +
  55 + "<TYPE>IATA</TYPE>\n" +
  56 + "<STYP>IFHL</STYP>\n" +
  57 + "<SEQN>95202782</SEQN>\n" +
  58 + "</META>\n" +
  59 + "<FHL>\n";
  60 + private final static String FHL_FOOTER="\n</FHL>\n" +
  61 + "</MSG>";
  62 +
  63 + @PostMapping("ffm")
  64 + public int extFFM(String ffmmsg){
  65 + if (ffmmsg!=null){
  66 + ffmmsg = FFM_HEADER + ffmmsg;
  67 + ffmmsg = ffmmsg + FFM_FOOTER;
  68 + File file = new File(extRedioMsgDir+UUID.randomUUID()+".txt");
  69 + try {
  70 + FileUtils.writeStringToFile(file,ffmmsg,"UTF-8");
  71 + log.info("FFM报文导入成功");
  72 + return 1;
  73 + }catch (IOException e){
  74 + e.printStackTrace();
  75 + }
  76 + }
  77 + return 0;
  78 + }
  79 +
  80 +
  81 + @PostMapping("fwb")
  82 + public int extFWB(String ffmmsg){
  83 + if (ffmmsg!=null) {
  84 + ffmmsg = FWB_HEADER + ffmmsg;
  85 + ffmmsg = ffmmsg + FWB_FOOTER;
  86 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  87 + try {
  88 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  89 + log.info("FWB报文导入成功");
  90 + return 1;
  91 + } catch (IOException e) {
  92 + e.printStackTrace();
  93 + }
  94 + }
  95 + return 0;
  96 + }
  97 +
  98 + @PostMapping("fhl")
  99 + public int extFHL(String ffmmsg){
  100 + if (ffmmsg!=null) {
  101 + ffmmsg = FHL_HEADER + ffmmsg;
  102 + ffmmsg = ffmmsg + FHL_FOOTER;
  103 + File file = new File(extRedioMsgDir + UUID.randomUUID() + ".txt");
  104 + try {
  105 + FileUtils.writeStringToFile(file, ffmmsg, "UTF-8");
  106 + log.info("FHL报文导入成功");
  107 + return 1;
  108 + } catch (IOException e) {
  109 + e.printStackTrace();
  110 + }
  111 + }
  112 + return 0;
  113 + }
  114 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ALLOCATEARRIVAL;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface ALLOCATEARRIVALMapper {
  8 + int insert(ALLOCATEARRIVAL record);
  9 +
  10 + int insertSelective(ALLOCATEARRIVAL record);
  11 +
  12 + int updateRECEIPTION(ALLOCATEARRIVAL record);
  13 +
  14 + List<ALLOCATEARRIVAL> selectAutoIdByAwb(ALLOCATEARRIVAL record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ARRIVEDMASTER;
  4 +import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface ARRIVEDMASTERMapper {
  9 + int deleteByPrimaryKey(String autoid);
  10 +
  11 + int insert(ARRIVEDMASTER record);
  12 +
  13 + int insertSelective(ARRIVEDMASTER record);
  14 +
  15 + ARRIVEDMASTER selectByPrimaryKey(String autoid);
  16 +
  17 + int updateByPrimaryKeySelective(ARRIVEDMASTER record);
  18 +
  19 + int updateByPrimaryKey(ARRIVEDMASTER record);
  20 +
  21 + int insertRecept(ARRIVEDMASTER arrivedmaster);
  22 +
  23 + int updateRECEIPTION(ARRIVEDMASTER record);
  24 +
  25 + List<ARRIVEDMASTER> selectAutoIdByAwb(ARRIVEDMASTER record);
  26 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ARRIVEDSECONDARY;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface ARRIVEDSECONDARYMapper {
  8 + int insert(ARRIVEDSECONDARY record);
  9 +
  10 + int insertSelective(ARRIVEDSECONDARY record);
  11 +
  12 + int updateRECEIPTION(ARRIVEDSECONDARY record);
  13 +
  14 + List<ARRIVEDSECONDARY> selectAutoIdByawbAawbH(ARRIVEDSECONDARY record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.CUSTOMSMESSAGE;
  4 +import com.tianbo.analysis.model.CUSTOMSMESSAGEWithBLOBs;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface CUSTOMSMESSAGEMapper {
  9 + int insert(CUSTOMSMESSAGEWithBLOBs record);
  10 +
  11 + int insertSelective(CUSTOMSMESSAGEWithBLOBs record);
  12 +
  13 + List<CUSTOMSMESSAGEWithBLOBs> selectMessage(String messageId);
  14 +
  15 + int updateMessageByMessageid(CUSTOMSMESSAGE record);
  16 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.DEPARTURESLOADING;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface DEPARTURESLOADINGMapper {
  8 + int insert(DEPARTURESLOADING record);
  9 +
  10 + int insertSelective(DEPARTURESLOADING record);
  11 +
  12 + int updateRECEIPTION(DEPARTURESLOADING record);
  13 +
  14 + List<DEPARTURESLOADING> selectAutoIdByAwb(DEPARTURESLOADING record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.INPORTALLOCATE;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface INPORTALLOCATEMapper {
  8 + int insert(INPORTALLOCATE record);
  9 +
  10 + int insertSelective(INPORTALLOCATE record);
  11 +
  12 + int updateRECEIPTION(INPORTALLOCATE record);
  13 +
  14 + List<INPORTALLOCATE> selectAutoIdByAwb(INPORTALLOCATE record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.INTERNATIONALTRANSIT;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface INTERNATIONALTRANSITMapper {
  8 + int insert(INTERNATIONALTRANSIT record);
  9 +
  10 + int insertSelective(INTERNATIONALTRANSIT record);
  11 +
  12 + int updateRECEIPTION(INTERNATIONALTRANSIT record);
  13 +
  14 + List<INTERNATIONALTRANSIT> selectAutoIdByAwb(INTERNATIONALTRANSIT record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.MANIFESTLOAD;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MANIFESTLOADMapper {
  8 + int insert(MANIFESTLOAD record);
  9 +
  10 + int insertSelective(MANIFESTLOAD record);
  11 +
  12 + int updateRECEIPTION(MANIFESTLOAD record);
  13 +
  14 + List<MANIFESTLOAD> selectAutoIdByawbAawbH(MANIFESTLOAD record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.MANIFESTLOSTCHANGE;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MANIFESTLOSTCHANGEMapper {
  8 +
  9 + int insert(MANIFESTLOSTCHANGE record);
  10 +
  11 + int insertSelective(MANIFESTLOSTCHANGE record);
  12 +
  13 + int updateRECEIPTION(MANIFESTLOSTCHANGE record);
  14 +
  15 + List<MANIFESTLOSTCHANGE> selectAutoIdByawbAawbH(MANIFESTLOSTCHANGE record);
  16 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface ORIGINMANIFESTMASTERMapper {
  8 + int insert(ORIGINMANIFESTMASTER record);
  9 +
  10 + int insertSelective(ORIGINMANIFESTMASTER record);
  11 +
  12 + int updateRECEIPTION(ORIGINMANIFESTMASTER record);
  13 +
  14 + List<ORIGINMANIFESTMASTER> selectAutoIdByAwb(ORIGINMANIFESTMASTER record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.Originmanifestsecondary;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface OriginmanifestsecondaryMapper {
  8 + int insert(Originmanifestsecondary record);
  9 +
  10 + int insertSelective(Originmanifestsecondary record);
  11 +
  12 + int updateRECEIPTION(Originmanifestsecondary record);
  13 +
  14 + List<Originmanifestsecondary> selectAutoIdByawbAawbH(Originmanifestsecondary record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ARRIVEDMASTER;
  4 +import com.tianbo.analysis.model.PREPAREMASTER;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface PREPAREMASTERMapper {
  9 + int insert(PREPAREMASTER record);
  10 +
  11 + int insertSelective(PREPAREMASTER record);
  12 +
  13 + int updateRECEIPTION(PREPAREMASTER record);
  14 +
  15 + List<PREPAREMASTER> selectAutoIdByAwb(PREPAREMASTER record);
  16 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.ARRIVEDSECONDARY;
  4 +import com.tianbo.analysis.model.PREPARESECONDARY;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface PREPARESECONDARYMapper {
  9 + int deleteByPrimaryKey(Short id);
  10 +
  11 + int insert(PREPARESECONDARY record);
  12 +
  13 + int insertSelective(PREPARESECONDARY record);
  14 +
  15 + PREPARESECONDARY selectByPrimaryKey(Short id);
  16 +
  17 + int updateByPrimaryKeySelective(PREPARESECONDARY record);
  18 +
  19 + int updateByPrimaryKey(PREPARESECONDARY record);
  20 +
  21 + int updateRECEIPTION(PREPARESECONDARY record);
  22 +
  23 + List<PREPARESECONDARY> selectAutoIdByawbAawbH(PREPARESECONDARY record);
  24 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.SENDLOG;
  4 +
  5 +public interface SENDLOGMapper {
  6 + int insert(SENDLOG record);
  7 +
  8 + int insertSelective(SENDLOG record);
  9 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.TALLYMASTER;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface TALLYMASTERMapper {
  8 + int insert(TALLYMASTER record);
  9 +
  10 + int insertSelective(TALLYMASTER record);
  11 +
  12 + int updateRECEIPTION(TALLYMASTER record);
  13 +
  14 + List<TALLYMASTER> selectAutoIdByAwb(TALLYMASTER record);
  15 +}
  1 +package com.tianbo.analysis.dao;
  2 +
  3 +import com.tianbo.analysis.model.TALLYSECONDARY;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface TALLYSECONDARYMapper {
  8 + int insert(TALLYSECONDARY record);
  9 +
  10 + int insertSelective(TALLYSECONDARY record);
  11 +
  12 + int updateRECEIPTION(TALLYSECONDARY record);
  13 +
  14 + List<TALLYSECONDARY> selectAutoIdByawbAawbH(TALLYSECONDARY record);
  15 +}
  1 +package com.tianbo.analysis.handle;
  2 +
  3 +
  4 +import com.tianbo.analysis.model.Agent_Notice;
  5 +import com.tianbo.analysis.model.CustomReception;
  6 +import com.tianbo.analysis.tools.AWBTools;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.http.client.SimpleClientHttpRequestFactory;
  11 +import org.springframework.stereotype.Component;
  12 +import org.springframework.web.client.RestTemplate;
  13 +
  14 +import javax.annotation.PostConstruct;
  15 +
  16 +
  17 +@Slf4j
  18 +@Component
  19 +public class AgentXmlHandle {
  20 +
  21 + private static AgentXmlHandle agentXmlHandle;
  22 +
  23 +
  24 + public void Http_resolver(CustomReception customReception){
  25 + try{
  26 + SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
  27 + requestFactory.setConnectTimeout(5000);
  28 + requestFactory.setReadTimeout(5000);
  29 + RestTemplate restTemplate = new RestTemplate(requestFactory);
  30 +
  31 + String secondSplit = "_";
  32 + String waybillnosecondary="";
  33 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  34 + //取分单号
  35 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  36 + waybillnosecondary = awbhArr[1];
  37 + }
  38 +
  39 + 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}"
  40 + , Agent_Notice.class,"MT2201", AWBTools.awbFormat(customReception.getWayBillMaster()),waybillnosecondary,customReception.getResponseCode(),customReception.getResponseText());
  41 + log.info(notice.toString());
  42 + }catch (Exception e){
  43 + log.error("链接代理人服务器超时或者接口异常,{}",e);
  44 + }
  45 +
  46 +
  47 + }
  48 +
  49 +}
  1 +package com.tianbo.analysis.handle;
  2 +
  3 +import com.tianbo.analysis.model.*;
  4 +import com.tianbo.analysis.service.CustomMessageService;
  5 +import com.tianbo.analysis.tools.AWBTools;
  6 +import com.tianbo.util.Date.DateUtil;
  7 +import com.tianbo.util.XML.XMLXPath;
  8 +import lombok.Data;
  9 +import lombok.extern.slf4j.Slf4j;
  10 +import org.apache.commons.io.FileExistsException;
  11 +import org.apache.commons.io.FileUtils;
  12 +import org.apache.commons.lang.StringUtils;
  13 +import org.dom4j.Document;
  14 +import org.dom4j.DocumentException;
  15 +import org.dom4j.Element;
  16 +import org.dom4j.io.SAXReader;
  17 +import org.springframework.beans.factory.annotation.Value;
  18 +import org.springframework.stereotype.Component;
  19 +import org.xml.sax.SAXParseException;
  20 +
  21 +import javax.annotation.PostConstruct;
  22 +import java.io.File;
  23 +import java.io.FileNotFoundException;
  24 +import java.io.IOException;
  25 +import java.io.UnsupportedEncodingException;
  26 +import java.util.concurrent.CountDownLatch;
  27 +
  28 +/**
  29 + * @author mrz
  30 + * @e
  31 + * 海关新舱单回执解析xml文件
  32 + */
  33 +@Data
  34 +@Component
  35 +@Slf4j
  36 +public class CustomXmlHandleThread implements Runnable{
  37 +
  38 + private CountDownLatch latch;
  39 + //备份目录
  40 + @Value("${custom.receptBakDir}")
  41 + private String bakupDir;
  42 +
  43 + //解析出错转移目录
  44 + @Value("${custom.errBakDir}")
  45 + private String errBakDir;
  46 +
  47 + //回执转发目录
  48 + @Value("${custom.transmitDir}")
  49 + private String transmitDir;
  50 +
  51 + //匹配技术回执正则
  52 + @Value("${custom.delTechnologyReceptMatch}")
  53 + private String delTechnologyReceptMatch;
  54 +
  55 + private File xmlfile;
  56 +
  57 + private static CustomXmlHandleThread customXmlHandle;
  58 + //海关新舱单回执报头
  59 + public final static String MessageID = "//Manifest/Head/MessageID";
  60 + public final static String FunctionCode = "//Manifest/Head/FunctionCode";
  61 + public final static String MessageType = "//Manifest/Head/MessageType";
  62 + public final static String SenderID = "//Manifest/Head/SenderID";
  63 + public final static String ReceiverID = "//Manifest/Head/ReceiverID";
  64 + public final static String SendTime = "//Manifest/Head/SendTime";
  65 + public final static String Version = "//Manifest/Head/Version";
  66 +
  67 +
  68 + /**
  69 + * 海关普通业务新舱单回执报体
  70 + */
  71 + public final static String JourneyID = "//Manifest/Response/BorderTransportMeans/JourneyID";
  72 + public final static String WaybillMaster = "//Manifest/Response/Consignment/TransportContractDocument/ID";
  73 + public final static String WaybillSecond = "//Manifest/Response/Consignment/AssociatedTransportDocument/ID";
  74 + public final static String ResponseCode = "//ResponseType/Code";
  75 + public final static String ResponseText = "//ResponseType/Text";
  76 +
  77 + /**
  78 + * 海关国际转运业务回执报体
  79 + */
  80 + public final static String ImportJourneyID = "//Manifest/Response/ImportInformation/BorderTransportMeans/JourneyID";
  81 + public final static String ImportWaybillMaster = "//Manifest/Response/ImportInformation/Consignment/TransportContractDocument/ID";
  82 + public final static String ExportJourneyID = "//Manifest/Response/ExportInformation/BorderTransportMeans/JourneyID";
  83 + public final static String ExportWaybillMaster = "//Manifest/Response/ExportInformation/Consignment/TransportContractDocument/ID";
  84 +// public final static String TransResponseCode = "//Manifest/Response/ResponseType/Code";
  85 +// public final static String TransResponseText = "//Manifest/Response/ResponseType/Text";
  86 + public final static String TransResponseCode = "//ResponseType/Code";
  87 + public final static String TransResponseText = "//ResponseType/Text";
  88 +
  89 +
  90 + //通过@PostConstruct实现初始化bean之前进行的操作,解决service调用空指针问题
  91 + @PostConstruct
  92 + public void init() {
  93 + customXmlHandle = this;
  94 +
  95 + customXmlHandle.bakupDir = this.bakupDir;
  96 +
  97 + customXmlHandle.errBakDir = this.errBakDir;
  98 +
  99 + customXmlHandle.delTechnologyReceptMatch = this.delTechnologyReceptMatch;
  100 +
  101 + customXmlHandle.transmitDir = this.transmitDir;
  102 +
  103 + // 初使化时将已静态化的testService实例化
  104 + }
  105 +
  106 + @Override
  107 + public void run() {
  108 + String filename = xmlfile.getName();
  109 + log.info("线程:{}开始",filename);
  110 + if(filename.matches(customXmlHandle.delTechnologyReceptMatch)){
  111 + log.warn("{}报文为技术回执,剪切到错误备份目录,不解析",filename);
  112 + errBak(xmlfile);
  113 + log.info("{}报文为技术回执,剪切备份成功..开始解析下一文件,当前线程即将结束",filename);
  114 + }
  115 + else
  116 + {
  117 + try{
  118 + //解析前先转发
  119 + FileUtils.copyFileToDirectory(xmlfile, new File(customXmlHandle.transmitDir));
  120 + int i =handelXmlDocument();
  121 + String today = DateUtil.getTodayBy_yyyyMMdd();
  122 + String backdireByDay = customXmlHandle.bakupDir + "/" + today;
  123 + //操作成功,则转移剪切解析文件到备份目录,否则转移到error目录备份
  124 + if(i>0){
  125 + File bakupDirectory = new File(backdireByDay);
  126 + //解析成功备份一份到备份目录
  127 + FileUtils.moveFileToDirectory(xmlfile,bakupDirectory,true);
  128 + }else {
  129 + errBak(xmlfile);
  130 + }
  131 + }catch (FileExistsException e){
  132 + log.error("错误的解析文件剪切失败,目标目录已存在同名文件");
  133 + }catch (Exception e){
  134 + log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
  135 + errBak(xmlfile);
  136 + e.printStackTrace();
  137 + }
  138 +
  139 + }
  140 +
  141 + log.info("线程:{}结束",xmlfile.getName());
  142 + latch.countDown();
  143 + log.info("剩余线程数量{}",latch.getCount());
  144 + }
  145 + /**
  146 + *
  147 + *
  148 + * @return
  149 + * @throws DocumentException
  150 + * @throws UnsupportedEncodingException
  151 + * @throws SAXParseException
  152 + * @throws FileNotFoundException
  153 + */
  154 + private int handelXmlDocument() throws DocumentException,UnsupportedEncodingException,SAXParseException,FileNotFoundException {
  155 +
  156 + int i = 0;
  157 + String secondSplit = "_";
  158 + SAXReader saxReader = new SAXReader();
  159 + Document document = saxReader.read(xmlfile);
  160 + Element contentRoot = document.getRootElement();
  161 +
  162 + String flightNo = "UNKONW";
  163 + String flightDate = "20101010";
  164 +
  165 + //开始解析
  166 + String msgType = XMLXPath.getSingleValueByPath(document,MessageType);
  167 + String journeyid = XMLXPath.getSingleValueByPath(document,JourneyID);
  168 +// XMLXPath.getSingleValueByPath(document, )
  169 +
  170 +
  171 + String awbA = XMLXPath.getSingleValueByPath(document,WaybillMaster);
  172 + //全格式的分单 如 17212345678_ADBD
  173 + String awbH = XMLXPath.getSingleValueByPath(document,WaybillSecond);
  174 + String resCode = XMLXPath.getSingleValueByPath(document,ResponseCode);
  175 + String resText = XMLXPath.getSingleValueByPath(document,ResponseText);
  176 + String messageId = XMLXPath.getSingleValueByPath(document, MessageID);
  177 + String sendTime = XMLXPath.getSingleValueByPath(document,SendTime);
  178 + String sendId = XMLXPath.getSingleValueByPath(document,SenderID);
  179 + String reciveId = XMLXPath.getSingleValueByPath(document,ReceiverID);
  180 + String version = XMLXPath.getSingleValueByPath(document,Version);
  181 + String functionCode = XMLXPath.getSingleValueByPath(document,FunctionCode);
  182 +
  183 +
  184 +
  185 + CustomReception customReception = new CustomReception( msgType,
  186 + flightNo,
  187 + flightDate,
  188 + awbA,
  189 + awbH,
  190 + resCode,
  191 + resText,
  192 + messageId,
  193 + sendTime,
  194 + sendId,
  195 + reciveId,
  196 + version,
  197 + functionCode);
  198 +
  199 + /**
  200 + * 如果回执中没有携带航班信息节点,说明是出错报文
  201 + * 到发送日志表根据messageid 找到相应的发送日志报文的航班及运单信息,再进行解析
  202 + */
  203 + if(!StringUtils.isEmpty(journeyid)){
  204 +
  205 + String[] flightList = journeyid.split("/");
  206 + if(flightList.length > 0){
  207 + flightNo = flightList[0];
  208 + flightDate = flightList[1];
  209 + customReception.setFlightNo(flightNo);
  210 + customReception.setFlightDate(flightDate);
  211 + }
  212 + }else {
  213 + CUSTOMSMESSAGE customsmessage = new CUSTOMSMESSAGE();
  214 + customReception = customsmessage.getWaybillInfoByCutomResponse(customReception);
  215 + }
  216 +
  217 + switch (msgType){
  218 + case "MT9999":
  219 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  220 + PREPARESECONDARY preparesecondary = new PREPARESECONDARY(customReception);
  221 + int pre_i = preparesecondary.secondAnalysisReception();
  222 +
  223 + if (pre_i>0){
  224 + i=1;
  225 + }else {
  226 + ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY(customReception);
  227 + int arr_i=arrivedsecondary.secondAnalysisReception();
  228 +
  229 + if (arr_i>0){
  230 + i= 1;
  231 + }else {
  232 + Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary(customReception);
  233 + int org_i=originmanifestsecondary.secondAnalysisReception();
  234 + if (org_i>0){
  235 + i=1;
  236 + }
  237 + }
  238 + }
  239 + }else{
  240 + ORIGINMANIFESTMASTER originmanifestmaster = new ORIGINMANIFESTMASTER(customReception);
  241 + PREPAREMASTER preparemaster= new PREPAREMASTER(customReception);
  242 + ARRIVEDMASTER arrivedmaster9999 = new ARRIVEDMASTER(customReception);
  243 + if(originmanifestmaster.masterAnalysisReception()>0){
  244 + i=1;
  245 + }else if(preparemaster.masterAnalysisReception()>0){
  246 + i=1;
  247 + }else {
  248 + i=arrivedmaster9999.masterAnalysisReception();
  249 + }
  250 + }
  251 + AgentXmlHandle agentXmlHandle=new AgentXmlHandle();
  252 + agentXmlHandle.Http_resolver(customReception);
  253 + break;
  254 + case "MT3201":
  255 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  256 + ARRIVEDSECONDARY arrivedsecondary = new ARRIVEDSECONDARY(customReception);
  257 + i=arrivedsecondary.secondAnalysisReception();
  258 + }else {
  259 + ARRIVEDMASTER arrivedmaster = new ARRIVEDMASTER(customReception);
  260 + i=arrivedmaster.masterAnalysisReception();
  261 + }
  262 + break;
  263 + case "MT5202":
  264 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  265 + TALLYSECONDARY tallysecondary = new TALLYSECONDARY(customReception);
  266 + i=tallysecondary.secondAnalysisReception();
  267 + }else {
  268 + TALLYMASTER tallymaster= new TALLYMASTER(customReception);
  269 + i = tallymaster.masterAnalysisReception();
  270 + }
  271 + break;
  272 + case "MT5201":
  273 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  274 + TALLYSECONDARY tallysecondary = new TALLYSECONDARY(customReception);
  275 + i=tallysecondary.secondAnalysisReception();
  276 + }else {
  277 + TALLYMASTER tallymaster= new TALLYMASTER(customReception);
  278 + i = tallymaster.masterAnalysisReception();
  279 + }
  280 + break;
  281 + case "MT4201":
  282 + DEPARTURESLOADING departuresloading = new DEPARTURESLOADING(customReception);
  283 + i=departuresloading.masterAnalysisReception();
  284 + break;
  285 + case "MT1201":
  286 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  287 + Originmanifestsecondary originmanifestsecondary = new Originmanifestsecondary(customReception);
  288 + i=originmanifestsecondary.secondAnalysisReception();
  289 + }else {
  290 + ORIGINMANIFESTMASTER originmanifestmaster1201 = new ORIGINMANIFESTMASTER(customReception);
  291 + i = originmanifestmaster1201.masterAnalysisReception();
  292 + }
  293 + break;
  294 + case "MT2201":
  295 + if (customReception.getWayBillSecond()!=null && customReception.getWayBillSecond().contains(secondSplit)){
  296 + PREPARESECONDARY preparesecondary = new PREPARESECONDARY(customReception);
  297 + i = preparesecondary.secondAnalysisReception();
  298 + }else {
  299 + PREPAREMASTER preparemaster1201= new PREPAREMASTER(customReception);
  300 + i = preparemaster1201.masterAnalysisReception();
  301 + }
  302 + break;
  303 + case "MT6202":
  304 + INPORTALLOCATE inportallocate = new INPORTALLOCATE(customReception);
  305 + i = inportallocate.masterAnalysisReception();
  306 + break;
  307 + case "MT3202":
  308 + ALLOCATEARRIVAL allocatearrival = new ALLOCATEARRIVAL(customReception);
  309 + i= allocatearrival.masterAnalysisReception();
  310 + break;
  311 + case "MT8205":
  312 + i = transXmlHandel(document,customReception);
  313 + break;
  314 + case "MT8202":
  315 + MANIFESTLOAD manifestload = new MANIFESTLOAD(customReception);
  316 + i= manifestload.secondAnalysisReception();
  317 + break;
  318 + case "MT8203":
  319 + MANIFESTLOSTCHANGE manifestlostchange = new MANIFESTLOSTCHANGE(customReception);
  320 + i= manifestlostchange.secondAnalysisReception();
  321 + break;
  322 + default:
  323 + break;
  324 +
  325 + }
  326 +
  327 + updateCustomMessage(customReception);
  328 + return i;
  329 +
  330 + }
  331 +
  332 + /**
  333 + * 国际转运回执处理,特殊业务
  334 + * @param document
  335 + * @param customReception
  336 + * @return
  337 + */
  338 + private int transXmlHandel(Document document,CustomReception customReception){
  339 +
  340 + String importJourneyID = XMLXPath.getSingleValueByPath(document,ImportJourneyID);
  341 + String importFlightNo = "UNKONW";
  342 + String importFlightDate = "20101010";
  343 + if(!StringUtils.isEmpty(importJourneyID)){
  344 + importFlightNo = AWBTools.splitFlightAndDate(importJourneyID)[0];
  345 + importFlightDate = AWBTools.splitFlightAndDate(importJourneyID)[1];
  346 + }
  347 +
  348 +
  349 + String importWaybillMaster= XMLXPath.getSingleValueByPath(document,ImportWaybillMaster);
  350 + String transResponseCode=XMLXPath.getSingleValueByPath(document,TransResponseCode);
  351 + String transResponseText=XMLXPath.getSingleValueByPath(document,TransResponseText);
  352 + CustomReception transCustomReception = new CustomReception( customReception.getMessageType(),
  353 + importFlightNo,
  354 + importFlightDate,
  355 + importWaybillMaster,
  356 + transResponseCode,
  357 + transResponseText,
  358 + customReception.getMessageID(),
  359 + customReception.getSendTime(),
  360 + customReception.getSenderID(),
  361 + customReception.getReceiverID(),
  362 + customReception.getVersion(),
  363 + customReception.getFunctionCode());
  364 + INTERNATIONALTRANSIT internationaltransit = new INTERNATIONALTRANSIT(transCustomReception);
  365 +
  366 + int i=internationaltransit.masterAnalysisReception();
  367 +
  368 + return i;
  369 +
  370 + }
  371 +
  372 + private int updateCustomMessage(CustomReception customReception){
  373 + CUSTOMSMESSAGE customsmessage = new CUSTOMSMESSAGE(customReception);
  374 + return customsmessage.updateMessageByMessageid();
  375 + }
  376 +
  377 + private void errBak(File file){
  378 + try {
  379 + String today = DateUtil.getTodayBy_yyyyMMdd();
  380 + String errDirByDay = customXmlHandle.errBakDir + "/" + today;
  381 + File berrDirectory = new File(errDirByDay);
  382 + FileUtils.moveFileToDirectory(file,berrDirectory,true);
  383 + log.info("数据库未找到与回执适配的信息备份文件:{}:",file.getName());
  384 + }catch (FileExistsException e){
  385 + log.error("备份解析错误文件失败,目标文件夹存在同名文件{}",file.getName());
  386 + }catch (Exception e){
  387 + e.printStackTrace();
  388 + }
  389 + }
  390 +
  391 +}
  1 +package com.tianbo.analysis.handle;
  2 +
  3 +import javax.websocket.Session;
  4 +import java.io.BufferedReader;
  5 +import java.io.IOException;
  6 +import java.io.InputStream;
  7 +import java.io.InputStreamReader;
  8 +
  9 +public class IO_Log_Handle extends Thread{
  10 +
  11 + private BufferedReader reader;
  12 + private Session session;
  13 +
  14 + public IO_Log_Handle(InputStream in, Session session) {
  15 + this.reader = new BufferedReader(new InputStreamReader(in));
  16 + this.session = session;
  17 +
  18 + }
  19 +
  20 + @Override
  21 + public void run() {
  22 + String line;
  23 + try {
  24 + while((line = reader.readLine()) != null) {
  25 + // 将实时日志通过WebSocket发送给客户端,给每一行添加一个HTML换行
  26 + session.getBasicRemote().sendText(line + "<br>");
  27 + }
  28 + } catch (IOException e) {
  29 + e.printStackTrace();
  30 + }
  31 + }
  32 +}
  1 +package com.tianbo.analysis.handle;
  2 +
  3 +import com.tianbo.analysis.model.*;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import com.tianbo.util.RabitMq.MQSendMsg;
  7 +import com.tianbo.util.RabitMq.exchange.ExSendMsg;
  8 +import com.tianbo.util.XML.XMLXPath;
  9 +import lombok.Data;
  10 +import lombok.extern.slf4j.Slf4j;
  11 +import org.apache.commons.io.FileExistsException;
  12 +import org.apache.commons.io.FileUtils;
  13 +import org.apache.commons.lang.StringUtils;
  14 +import org.dom4j.Document;
  15 +import org.dom4j.DocumentException;
  16 +import org.dom4j.Element;
  17 +import org.dom4j.io.SAXReader;
  18 +import org.springframework.beans.factory.annotation.Value;
  19 +import org.springframework.stereotype.Component;
  20 +import org.xml.sax.SAXParseException;
  21 +
  22 +import javax.annotation.PostConstruct;
  23 +import java.io.File;
  24 +import java.io.FileNotFoundException;
  25 +import java.io.IOException;
  26 +import java.io.UnsupportedEncodingException;
  27 +import java.util.concurrent.CountDownLatch;
  28 +
  29 +/**
  30 + * @author mrz
  31 + * @e
  32 + * 海关新舱单回执解析xml文件
  33 + */
  34 +@Data
  35 +@Component
  36 +@Slf4j
  37 +public class SendXml2MqThread implements Runnable{
  38 +
  39 + private CountDownLatch latch;
  40 +
  41 + private File xmlfile;
  42 +
  43 + private String mqIp;
  44 +
  45 + private int mqPort;
  46 +
  47 + private String mqVhost;
  48 +
  49 + private String mqUsername;
  50 +
  51 + private String mqPassword;
  52 +
  53 + private String queueName;
  54 +
  55 + private String exchangeName;
  56 +
  57 + private String exchangeType;
  58 +
  59 + private String routingName;
  60 +
  61 +
  62 + @Override
  63 + public void run() {
  64 + String filename = xmlfile.getName();
  65 + log.info("线程:{}开始",filename);
  66 +
  67 + try{
  68 + //解析前先转发
  69 + int i = handelXmlDocument();
  70 + //发送成功删除,发送失败不管保留报文
  71 + if(i==1){
  72 + FileUtils.forceDelete(xmlfile);
  73 + }
  74 +
  75 + }catch (IOException ioe){
  76 + log.error("文件不存在",ioe);
  77 + ioe.printStackTrace();
  78 + } catch (Exception e){
  79 + log.error("错误的解析文件剪切失败,目标目录已存在同名文件",e);
  80 + e.printStackTrace();
  81 + }
  82 +
  83 +
  84 +
  85 + log.info("线程:{}结束",xmlfile.getName());
  86 + latch.countDown();
  87 + log.info("剩余线程数量{}",latch.getCount());
  88 + }
  89 + /**
  90 + *
  91 + *
  92 + * @return
  93 + * @throws DocumentException
  94 + * @throws UnsupportedEncodingException
  95 + * @throws SAXParseException
  96 + * @throws FileNotFoundException
  97 + */
  98 + private int handelXmlDocument() throws DocumentException,UnsupportedEncodingException,SAXParseException,FileNotFoundException, IOException {
  99 +
  100 + int i = 0;
  101 + String content = FileUtils.readFileToString(xmlfile,"UTF-8");
  102 + /**
  103 + * 发送消息到交换上
  104 + */
  105 + boolean success = ExSendMsg.sendMsg(
  106 + exchangeName,
  107 + exchangeType,
  108 + routingName,
  109 + queueName,
  110 + content,
  111 + mqIp,
  112 + mqPort,
  113 + mqVhost,
  114 + mqUsername,
  115 + mqPassword
  116 + );
  117 +
  118 + return success ? 1 : 0;
  119 +
  120 + }
  121 +
  122 +
  123 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.apache.commons.lang.StringUtils;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +@Slf4j
  15 +public class ALLOCATEARRIVAL extends WlptBaseModel{
  16 +
  17 + private String id;
  18 +
  19 + private Date createdate;
  20 +
  21 + private String waybillno;
  22 +
  23 + private String carrier;
  24 +
  25 + private String flightno;
  26 +
  27 + private Date flightdate;
  28 +
  29 + private String customos;
  30 +
  31 + private String arrivalpieces;
  32 +
  33 + private String arrivalweight;
  34 +
  35 + private String unloadingland;
  36 +
  37 + private String productcode;
  38 +
  39 + private String status;
  40 +
  41 + private String receiptinformation;
  42 +
  43 +
  44 +
  45 + public ALLOCATEARRIVAL(){
  46 +
  47 + }
  48 +
  49 + public ALLOCATEARRIVAL(CustomReception customReception){
  50 + this.waybillno = customReception.getWayBillMaster();
  51 + this.receiptinformation = customReception.getResponseText();
  52 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  53 + String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
  54 + this.setFlightno(flightInfo[1]);
  55 + this.setCarrier(flightInfo[0]);
  56 + if (!StringUtils.isEmpty(customReception.getFlightDate())) {
  57 + this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
  58 + }
  59 +
  60 + }
  61 +
  62 + public String getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(String id) {
  67 + this.id = id == null ? null : id.trim();
  68 + }
  69 +
  70 + public Date getCreatedate() {
  71 + return createdate;
  72 + }
  73 +
  74 + public void setCreatedate(Date createdate) {
  75 + this.createdate = createdate;
  76 + }
  77 +
  78 + public String getWaybillno() {
  79 + return waybillno;
  80 + }
  81 +
  82 + public void setWaybillno(String waybillno) {
  83 + this.waybillno = waybillno == null ? null : waybillno.trim();
  84 + }
  85 +
  86 + public String getCarrier() {
  87 + return carrier;
  88 + }
  89 +
  90 + public void setCarrier(String carrier) {
  91 + this.carrier = carrier == null ? null : carrier.trim();
  92 + }
  93 +
  94 + public String getFlightno() {
  95 + return flightno;
  96 + }
  97 +
  98 + public void setFlightno(String flightno) {
  99 + this.flightno = flightno == null ? null : flightno.trim();
  100 + }
  101 +
  102 + public Date getFlightdate() {
  103 + return flightdate;
  104 + }
  105 +
  106 + public void setFlightdate(Date flightdate) {
  107 + this.flightdate = flightdate;
  108 + }
  109 +
  110 + public String getCustomos() {
  111 + return customos;
  112 + }
  113 +
  114 + public void setCustomos(String customos) {
  115 + this.customos = customos == null ? null : customos.trim();
  116 + }
  117 +
  118 + public String getArrivalpieces() {
  119 + return arrivalpieces;
  120 + }
  121 +
  122 + public void setArrivalpieces(String arrivalpieces) {
  123 + this.arrivalpieces = arrivalpieces == null ? null : arrivalpieces.trim();
  124 + }
  125 +
  126 + public String getArrivalweight() {
  127 + return arrivalweight;
  128 + }
  129 +
  130 + public void setArrivalweight(String arrivalweight) {
  131 + this.arrivalweight = arrivalweight == null ? null : arrivalweight.trim();
  132 + }
  133 +
  134 + public String getUnloadingland() {
  135 + return unloadingland;
  136 + }
  137 +
  138 + public void setUnloadingland(String unloadingland) {
  139 + this.unloadingland = unloadingland == null ? null : unloadingland.trim();
  140 + }
  141 +
  142 + public String getProductcode() {
  143 + return productcode;
  144 + }
  145 +
  146 + public void setProductcode(String productcode) {
  147 + this.productcode = productcode == null ? null : productcode.trim();
  148 + }
  149 +
  150 + public String getStatus() {
  151 + return status;
  152 + }
  153 +
  154 + public void setStatus(String status) {
  155 + this.status = status == null ? null : status.trim();
  156 + }
  157 +
  158 + public String getReceiptinformation() {
  159 + return receiptinformation;
  160 + }
  161 +
  162 + public void setReceiptinformation(String receiptinformation) {
  163 + this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
  164 + }
  165 +
  166 + @Override
  167 + public int masterAnalysisReception(){
  168 +
  169 + int i= allocatearrivalMapper.updateRECEIPTION(this);
  170 + //获取主单autoid
  171 + List<ALLOCATEARRIVAL> arrivedmasterList = allocatearrivalMapper.selectAutoIdByAwb(this);
  172 + if(!arrivedmasterList.isEmpty()){
  173 + ALLOCATEARRIVAL departuresloading1 = arrivedmasterList.get(0);
  174 + String autoId = departuresloading1.getId();
  175 +
  176 + //插入sendlog记录表
  177 + log.info("即将插入回执日志运单号为:"+waybillno+"->id="+autoId);
  178 + int ii =sendLogService.insertSendlog("MT3202",receiptinformation,autoId);
  179 +
  180 + if (i>0 && ii>0){
  181 + log.info("运单号 {} 分拨运抵回执更新成功",waybillno);
  182 + return 1;
  183 + }
  184 + }
  185 + return 0;
  186 + }
  187 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.apache.commons.lang.StringUtils;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +@Slf4j
  15 +public class ARRIVEDMASTER extends WlptBaseModel {
  16 +
  17 + private String autoid;
  18 +
  19 + private String waybillnomaster;
  20 +
  21 + private String tcdName;
  22 +
  23 + private String tcdTypecode;
  24 +
  25 + private String flightno;
  26 +
  27 + private Date flightDate;
  28 +
  29 + private String carrier;
  30 +
  31 + private String originatingstation;
  32 +
  33 + private String oName;
  34 +
  35 + private String destinationstation;
  36 +
  37 + private String fdName;
  38 +
  39 + private String arrivedtotalpiece;
  40 +
  41 + private String totalpiecequantity;
  42 +
  43 + private String arrivedtotalweight;
  44 +
  45 + private String grossweightmeasureuc;
  46 +
  47 + private String totalgrossweightmeasure;
  48 +
  49 + private String totalgrossweightmeasureuc;
  50 +
  51 + private String chargeableweightmeasure;
  52 +
  53 + private String chargeableweightmeasureuc;
  54 +
  55 + private Date arriveddate;
  56 +
  57 + private String transportsplitdescription;
  58 +
  59 + private String customscode;
  60 +
  61 + private String productname;
  62 +
  63 + private String status;
  64 +
  65 + private String receiptinformation;
  66 +
  67 + private Date createdate;
  68 +
  69 + public ARRIVEDMASTER() {
  70 +
  71 + }
  72 +
  73 + public ARRIVEDMASTER(CustomReception customReception) {
  74 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  75 +
  76 + String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
  77 + this.setFlightno(flightInfo[1]);
  78 + this.setCarrier(flightInfo[0]);
  79 + if (!StringUtils.isEmpty(customReception.getFlightDate())) {
  80 + this.setFlightDate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
  81 + }
  82 +
  83 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  84 + this.receiptinformation = customReception.getResponseText();
  85 + }
  86 +
  87 + @Override
  88 + public int masterAnalysisReception() {
  89 + //更新主单回执
  90 + int i = arrivedmasterMapper.updateRECEIPTION(this);
  91 + //获取分单autoid
  92 + List<ARRIVEDMASTER> arrivedmasterList = arrivedmasterMapper.selectAutoIdByAwb(this);
  93 + if(!arrivedmasterList.isEmpty()){
  94 + ARRIVEDMASTER originMaster = arrivedmasterList.get(0);
  95 + String autoId = originMaster.getAutoid();
  96 +
  97 + //插入sendlog记录表
  98 + log.info("即将插入回执日志运单号为:"+waybillnomaster+"->autoid="+autoId);
  99 + int ii =sendLogService.insertSendlog("MT3201",receiptinformation,autoId);
  100 +
  101 +
  102 + if (i>0 && ii>0){
  103 + log.info("运单号 {} 运抵回执更新成功",waybillnomaster);
  104 + return 1;
  105 + }
  106 + }
  107 + return 0;
  108 + }
  109 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.apache.commons.lang.StringUtils;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +@Slf4j
  15 +public class ARRIVEDSECONDARY extends WlptBaseModel {
  16 + private String autoid;
  17 +
  18 + private String waybillnomaster;
  19 +
  20 + private String tcdName;
  21 +
  22 + private String tcdTypecode;
  23 +
  24 + private String waybillnosecondary;
  25 +
  26 + private String carrier;
  27 +
  28 + private String oId;
  29 +
  30 + private String oName;
  31 +
  32 + private String fdId;
  33 +
  34 + private String fdName;
  35 +
  36 + private String flightno;
  37 +
  38 + private Date flightdate;
  39 +
  40 + private String arrivedtotalpiece;
  41 +
  42 + private String totalpiecequantity;
  43 +
  44 + private String arrivedtotalweight;
  45 +
  46 + private String grossweightmeasureuc;
  47 +
  48 + private String totalgrossweightmeasure;
  49 +
  50 + private String totalgrossweightmeasureuc;
  51 +
  52 + private String chargeableweightmeasure;
  53 +
  54 + private String chargeableweightmeasureuc;
  55 +
  56 + private Date arriveddate;
  57 +
  58 + private String customscode;
  59 +
  60 + private String productname;
  61 +
  62 + private Date createdate;
  63 +
  64 + private String arrivedmasterid;
  65 +
  66 + private String transportsplitdescription;
  67 +
  68 + private String receiption;
  69 +
  70 + private String status;
  71 +
  72 + public String getAutoid() {
  73 + return autoid;
  74 + }
  75 +
  76 + public void setAutoid(String autoid) {
  77 + this.autoid = autoid == null ? null : autoid.trim();
  78 + }
  79 +
  80 + public String getWaybillnomaster() {
  81 + return waybillnomaster;
  82 + }
  83 +
  84 + public void setWaybillnomaster(String waybillnomaster) {
  85 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  86 + }
  87 +
  88 + public String getTcdName() {
  89 + return tcdName;
  90 + }
  91 +
  92 + public void setTcdName(String tcdName) {
  93 + this.tcdName = tcdName == null ? null : tcdName.trim();
  94 + }
  95 +
  96 + public String getTcdTypecode() {
  97 + return tcdTypecode;
  98 + }
  99 +
  100 + public void setTcdTypecode(String tcdTypecode) {
  101 + this.tcdTypecode = tcdTypecode == null ? null : tcdTypecode.trim();
  102 + }
  103 +
  104 + public String getWaybillnosecondary() {
  105 + return waybillnosecondary;
  106 + }
  107 +
  108 + public void setWaybillnosecondary(String waybillnosecondary) {
  109 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  110 + }
  111 +
  112 + public String getCarrier() {
  113 + return carrier;
  114 + }
  115 +
  116 + public void setCarrier(String carrier) {
  117 + this.carrier = carrier == null ? null : carrier.trim();
  118 + }
  119 +
  120 + public String getoId() {
  121 + return oId;
  122 + }
  123 +
  124 + public void setoId(String oId) {
  125 + this.oId = oId == null ? null : oId.trim();
  126 + }
  127 +
  128 + public String getoName() {
  129 + return oName;
  130 + }
  131 +
  132 + public void setoName(String oName) {
  133 + this.oName = oName == null ? null : oName.trim();
  134 + }
  135 +
  136 + public String getFdId() {
  137 + return fdId;
  138 + }
  139 +
  140 + public void setFdId(String fdId) {
  141 + this.fdId = fdId == null ? null : fdId.trim();
  142 + }
  143 +
  144 + public String getFdName() {
  145 + return fdName;
  146 + }
  147 +
  148 + public void setFdName(String fdName) {
  149 + this.fdName = fdName == null ? null : fdName.trim();
  150 + }
  151 +
  152 + public String getFlightno() {
  153 + return flightno;
  154 + }
  155 +
  156 + public void setFlightno(String flightno) {
  157 + this.flightno = flightno == null ? null : flightno.trim();
  158 + }
  159 +
  160 + public Date getFlightdate() {
  161 + return flightdate;
  162 + }
  163 +
  164 + public void setFlightdate(Date flightdate) {
  165 + this.flightdate = flightdate;
  166 + }
  167 +
  168 + public String getArrivedtotalpiece() {
  169 + return arrivedtotalpiece;
  170 + }
  171 +
  172 + public void setArrivedtotalpiece(String arrivedtotalpiece) {
  173 + this.arrivedtotalpiece = arrivedtotalpiece == null ? null : arrivedtotalpiece.trim();
  174 + }
  175 +
  176 + public String getTotalpiecequantity() {
  177 + return totalpiecequantity;
  178 + }
  179 +
  180 + public void setTotalpiecequantity(String totalpiecequantity) {
  181 + this.totalpiecequantity = totalpiecequantity == null ? null : totalpiecequantity.trim();
  182 + }
  183 +
  184 + public String getArrivedtotalweight() {
  185 + return arrivedtotalweight;
  186 + }
  187 +
  188 + public void setArrivedtotalweight(String arrivedtotalweight) {
  189 + this.arrivedtotalweight = arrivedtotalweight == null ? null : arrivedtotalweight.trim();
  190 + }
  191 +
  192 + public String getGrossweightmeasureuc() {
  193 + return grossweightmeasureuc;
  194 + }
  195 +
  196 + public void setGrossweightmeasureuc(String grossweightmeasureuc) {
  197 + this.grossweightmeasureuc = grossweightmeasureuc == null ? null : grossweightmeasureuc.trim();
  198 + }
  199 +
  200 + public String getTotalgrossweightmeasure() {
  201 + return totalgrossweightmeasure;
  202 + }
  203 +
  204 + public void setTotalgrossweightmeasure(String totalgrossweightmeasure) {
  205 + this.totalgrossweightmeasure = totalgrossweightmeasure == null ? null : totalgrossweightmeasure.trim();
  206 + }
  207 +
  208 + public String getTotalgrossweightmeasureuc() {
  209 + return totalgrossweightmeasureuc;
  210 + }
  211 +
  212 + public void setTotalgrossweightmeasureuc(String totalgrossweightmeasureuc) {
  213 + this.totalgrossweightmeasureuc = totalgrossweightmeasureuc == null ? null : totalgrossweightmeasureuc.trim();
  214 + }
  215 +
  216 + public String getChargeableweightmeasure() {
  217 + return chargeableweightmeasure;
  218 + }
  219 +
  220 + public void setChargeableweightmeasure(String chargeableweightmeasure) {
  221 + this.chargeableweightmeasure = chargeableweightmeasure == null ? null : chargeableweightmeasure.trim();
  222 + }
  223 +
  224 + public String getChargeableweightmeasureuc() {
  225 + return chargeableweightmeasureuc;
  226 + }
  227 +
  228 + public void setChargeableweightmeasureuc(String chargeableweightmeasureuc) {
  229 + this.chargeableweightmeasureuc = chargeableweightmeasureuc == null ? null : chargeableweightmeasureuc.trim();
  230 + }
  231 +
  232 + public Date getArriveddate() {
  233 + return arriveddate;
  234 + }
  235 +
  236 + public void setArriveddate(Date arriveddate) {
  237 + this.arriveddate = arriveddate;
  238 + }
  239 +
  240 + public String getCustomscode() {
  241 + return customscode;
  242 + }
  243 +
  244 + public void setCustomscode(String customscode) {
  245 + this.customscode = customscode == null ? null : customscode.trim();
  246 + }
  247 +
  248 + public String getProductname() {
  249 + return productname;
  250 + }
  251 +
  252 + public void setProductname(String productname) {
  253 + this.productname = productname == null ? null : productname.trim();
  254 + }
  255 +
  256 + public Date getCreatedate() {
  257 + return createdate;
  258 + }
  259 +
  260 + public void setCreatedate(Date createdate) {
  261 + this.createdate = createdate;
  262 + }
  263 +
  264 + public String getArrivedmasterid() {
  265 + return arrivedmasterid;
  266 + }
  267 +
  268 + public void setArrivedmasterid(String arrivedmasterid) {
  269 + this.arrivedmasterid = arrivedmasterid == null ? null : arrivedmasterid.trim();
  270 + }
  271 +
  272 + public String getTransportsplitdescription() {
  273 + return transportsplitdescription;
  274 + }
  275 +
  276 + public void setTransportsplitdescription(String transportsplitdescription) {
  277 + this.transportsplitdescription = transportsplitdescription == null ? null : transportsplitdescription.trim();
  278 + }
  279 +
  280 + public String getReceiption() {
  281 + return receiption;
  282 + }
  283 +
  284 + public void setReceiption(String receiption) {
  285 + this.receiption = receiption == null ? null : receiption.trim();
  286 + }
  287 +
  288 + public String getStatus() {
  289 + return status;
  290 + }
  291 +
  292 + public void setStatus(String status) {
  293 + this.status = status == null ? null : status.trim();
  294 + }
  295 +
  296 + public ARRIVEDSECONDARY() {
  297 + }
  298 +
  299 + public ARRIVEDSECONDARY(CustomReception customReception) {
  300 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  301 + //取分单号
  302 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  303 + this.waybillnosecondary = awbhArr[1];
  304 + String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
  305 + this.setFlightno(flightInfo[1]);
  306 + this.setCarrier(flightInfo[0]);
  307 + if (!StringUtils.isEmpty(customReception.getFlightDate())) {
  308 + this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
  309 + }
  310 + this.receiption = customReception.getResponseText();
  311 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  312 + }
  313 +
  314 + @Override
  315 + public int secondAnalysisReception() {
  316 + //更新分单回执
  317 + int i = arrivedsecondaryMapper.updateRECEIPTION(this);
  318 + //获取分单autoid
  319 + List<ARRIVEDSECONDARY> arrivedsecondaryList = arrivedsecondaryMapper.selectAutoIdByawbAawbH(this);
  320 + if(!arrivedsecondaryList.isEmpty()){
  321 + ARRIVEDSECONDARY arrivedSecond = arrivedsecondaryList.get(0);
  322 + String autoId = arrivedSecond.getAutoid();
  323 + //插入sendlog记录表
  324 + log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
  325 + int ii = sendLogService.insertSendlog("MT3201",receiption,autoId);
  326 +
  327 + //todo:同时更新发送日志表的回执信息
  328 +
  329 +
  330 + if (i>0 && ii>0 ){
  331 + log.info("运单号 {} 运抵分单回执更新成功",waybillnosecondary);
  332 + return 1;
  333 + }
  334 + }else {
  335 + //todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
  336 + }
  337 + return 0;
  338 +
  339 +
  340 + }
  341 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class Agent_Notice {
  7 + private int status;
  8 + private int code;
  9 + private String msg;
  10 + private Object data;
  11 + private int page;
  12 + private int count;
  13 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.util.Date.DateUtil;
  5 +import lombok.Data;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +
  8 +import java.math.BigDecimal;
  9 +import java.util.Date;
  10 +
  11 +@Data
  12 +@Slf4j
  13 +public class CUSTOMSMESSAGE extends WlptBaseModel {
  14 + private String autoid;
  15 +
  16 + private String messageid;
  17 +
  18 + private String messagetype;
  19 +
  20 + private String messagestatus;
  21 +
  22 + private Date sendtime;
  23 +
  24 + private Date receivetime;
  25 +
  26 + private String objectid;
  27 +
  28 + private String flightno;
  29 +
  30 + private Date flightdate;
  31 +
  32 + private String masterautoid;
  33 +
  34 + private String waybillnomaster;
  35 +
  36 + private String secondaryautoid;
  37 +
  38 + private String waybillnosecondary;
  39 +
  40 + private BigDecimal pcs;
  41 +
  42 + private BigDecimal wt;
  43 +
  44 + private String responsecode;
  45 +
  46 + private String responsetext;
  47 +
  48 + private Date createtime;
  49 +
  50 + public String getAutoid() {
  51 + return autoid;
  52 + }
  53 +
  54 + public void setAutoid(String autoid) {
  55 + this.autoid = autoid == null ? null : autoid.trim();
  56 + }
  57 +
  58 + public String getMessageid() {
  59 + return messageid;
  60 + }
  61 +
  62 + public void setMessageid(String messageid) {
  63 + this.messageid = messageid == null ? null : messageid.trim();
  64 + }
  65 +
  66 + public String getMessagetype() {
  67 + return messagetype;
  68 + }
  69 +
  70 + public void setMessagetype(String messagetype) {
  71 + this.messagetype = messagetype == null ? null : messagetype.trim();
  72 + }
  73 +
  74 + public String getMessagestatus() {
  75 + return messagestatus;
  76 + }
  77 +
  78 + public void setMessagestatus(String messagestatus) {
  79 + this.messagestatus = messagestatus == null ? null : messagestatus.trim();
  80 + }
  81 +
  82 + public Date getSendtime() {
  83 + return sendtime;
  84 + }
  85 +
  86 + public void setSendtime(Date sendtime) {
  87 + this.sendtime = sendtime;
  88 + }
  89 +
  90 + public Date getReceivetime() {
  91 + return receivetime;
  92 + }
  93 +
  94 + public void setReceivetime(Date receivetime) {
  95 + this.receivetime = receivetime;
  96 + }
  97 +
  98 + public String getObjectid() {
  99 + return objectid;
  100 + }
  101 +
  102 + public void setObjectid(String objectid) {
  103 + this.objectid = objectid == null ? null : objectid.trim();
  104 + }
  105 +
  106 + public String getFlightno() {
  107 + return flightno;
  108 + }
  109 +
  110 + public void setFlightno(String flightno) {
  111 + this.flightno = flightno == null ? null : flightno.trim();
  112 + }
  113 +
  114 + public Date getFlightdate() {
  115 + return flightdate;
  116 + }
  117 +
  118 + public void setFlightdate(Date flightdate) {
  119 + this.flightdate = flightdate;
  120 + }
  121 +
  122 + public String getMasterautoid() {
  123 + return masterautoid;
  124 + }
  125 +
  126 + public void setMasterautoid(String masterautoid) {
  127 + this.masterautoid = masterautoid == null ? null : masterautoid.trim();
  128 + }
  129 +
  130 + public String getWaybillnomaster() {
  131 + return waybillnomaster;
  132 + }
  133 +
  134 + public void setWaybillnomaster(String waybillnomaster) {
  135 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  136 + }
  137 +
  138 + public String getSecondaryautoid() {
  139 + return secondaryautoid;
  140 + }
  141 +
  142 + public void setSecondaryautoid(String secondaryautoid) {
  143 + this.secondaryautoid = secondaryautoid == null ? null : secondaryautoid.trim();
  144 + }
  145 +
  146 + public String getWaybillnosecondary() {
  147 + return waybillnosecondary;
  148 + }
  149 +
  150 + public void setWaybillnosecondary(String waybillnosecondary) {
  151 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  152 + }
  153 +
  154 + public BigDecimal getPcs() {
  155 + return pcs;
  156 + }
  157 +
  158 + public void setPcs(BigDecimal pcs) {
  159 + this.pcs = pcs;
  160 + }
  161 +
  162 + public BigDecimal getWt() {
  163 + return wt;
  164 + }
  165 +
  166 + public void setWt(BigDecimal wt) {
  167 + this.wt = wt;
  168 + }
  169 +
  170 + public String getResponsecode() {
  171 + return responsecode;
  172 + }
  173 +
  174 + public void setResponsecode(String responsecode) {
  175 + this.responsecode = responsecode == null ? null : responsecode.trim();
  176 + }
  177 +
  178 + public String getResponsetext() {
  179 + return responsetext;
  180 + }
  181 +
  182 + public void setResponsetext(String responsetext) {
  183 + this.responsetext = responsetext == null ? null : responsetext.trim();
  184 + }
  185 +
  186 + public Date getCreatetime() {
  187 + return createtime;
  188 + }
  189 +
  190 + public void setCreatetime(Date createtime) {
  191 + this.createtime = createtime;
  192 + }
  193 +
  194 + public CUSTOMSMESSAGE(){
  195 +
  196 + }
  197 + public CUSTOMSMESSAGE(CustomReception customReception) {
  198 + this.messageid = customReception.getMessageID();
  199 + this.messagetype = customReception.getMessageType();
  200 + this.receivetime = new Date();
  201 + this.flightno = customReception.getFlightNo();
  202 + this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
  203 + this.waybillnomaster = customReception.getWayBillMaster();
  204 + this.waybillnosecondary = customReception.getWayBillSecond();
  205 + this.responsecode = customReception.getResponseCode();
  206 + this.responsetext = customReception.getResponseText();
  207 + this.messagestatus = "3";
  208 + }
  209 +
  210 + public CustomReception getWaybillInfoByCutomResponse(CustomReception customReception){
  211 + return customMessageService.getWaybillInfoByCutomResponse(customReception);
  212 + }
  213 +
  214 + public int updateMessageByMessageid(){
  215 + return customsmessageMapper.updateMessageByMessageid(this);
  216 + }
  217 +
  218 +
  219 +
  220 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.util.Date.DateUtil;
  4 +
  5 +import java.util.Date;
  6 +
  7 +public class CUSTOMSMESSAGEWithBLOBs extends CUSTOMSMESSAGE {
  8 + private String messagecontent;
  9 +
  10 + private String receivecontent;
  11 +
  12 + public String getMessagecontent() {
  13 + return messagecontent;
  14 + }
  15 +
  16 + public void setMessagecontent(String messagecontent) {
  17 + this.messagecontent = messagecontent == null ? null : messagecontent.trim();
  18 + }
  19 +
  20 + public String getReceivecontent() {
  21 + return receivecontent;
  22 + }
  23 +
  24 + public void setReceivecontent(String receivecontent) {
  25 + this.receivecontent = receivecontent == null ? null : receivecontent.trim();
  26 + }
  27 +
  28 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class CustomReception {
  7 + //回执报头
  8 + private String messageID;
  9 + private String functionCode;
  10 + private String messageType;
  11 + private String senderID;
  12 + private String receiverID;
  13 + private String sendTime;
  14 + private String version;
  15 +
  16 + //一般业务回执
  17 + private String flightNo;
  18 + private String flightDate;
  19 + private String wayBillMaster;
  20 + private String wayBillSecond;
  21 + private String responseCode;
  22 + private String responseText;
  23 +
  24 + //国际转运回执
  25 + private String importFlightDate;
  26 + private String importFlightNo;
  27 + private String importWaybillMaster;
  28 + private String exportFlightDate;
  29 + private String exportFlightNo;
  30 + private String exportWaybillMaster;
  31 +
  32 + public CustomReception(String messageType,
  33 + String flightNo,
  34 + String flightDate,
  35 + String wayBillMaster,
  36 + String wayBillSecond,
  37 + String responseCode,
  38 + String responseText,
  39 + String messageID,
  40 + String sendTime,
  41 + String senderID,
  42 + String receiverID,
  43 + String version,
  44 + String functionCode){
  45 + this.messageType = messageType;
  46 + this.flightNo = flightNo;
  47 + this.flightDate = flightDate;
  48 + this.wayBillMaster = wayBillMaster;
  49 + this.wayBillSecond = wayBillSecond;
  50 + this.responseCode = responseCode;
  51 + this.responseText = responseText;
  52 + this.messageID = messageID;
  53 + this.sendTime = sendTime;
  54 + this.senderID =senderID;
  55 + this.receiverID = receiverID;
  56 + this.version = version;
  57 + this.functionCode = functionCode;
  58 + }
  59 +
  60 + public CustomReception(String messageType,
  61 + String importFlightNo,
  62 + String importFlightDate,
  63 + String importWaybillMaster,
  64 + String transResponseCode,
  65 + String transResponseText,
  66 + String messageID,
  67 + String sendTime,
  68 + String senderID,
  69 + String receiverID,
  70 + String version,
  71 + String functionCode){
  72 + this.messageType = messageType;
  73 + this.importFlightNo = importFlightNo;
  74 + this.importFlightDate = importFlightDate;
  75 + this.importWaybillMaster = importWaybillMaster;
  76 + this.responseCode = transResponseCode;
  77 + this.responseText = transResponseText;
  78 + this.messageID = messageID;
  79 + this.sendTime = sendTime;
  80 + this.senderID =senderID;
  81 + this.receiverID = receiverID;
  82 + this.version = version;
  83 + this.functionCode = functionCode;
  84 + }
  85 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.apache.commons.lang.StringUtils;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +@Data
  13 +@Slf4j
  14 +public class DEPARTURESLOADING extends WlptBaseModel {
  15 + private String id;
  16 +
  17 + private Date createdate;
  18 +
  19 + private String waybillno;
  20 +
  21 + private String flightno;
  22 +
  23 + private Date flightdate;
  24 +
  25 + private String originatingstation;
  26 +
  27 + private String destinationstation;
  28 +
  29 + private String stowagepieces;
  30 +
  31 + private String stowageweight;
  32 +
  33 + private String waybillpieces;
  34 +
  35 + private String waybillweight;
  36 +
  37 + private Date stowagedate;
  38 +
  39 + private String productname;
  40 +
  41 + private String specialcode;
  42 +
  43 + private String customs;
  44 +
  45 + private String receiption;
  46 +
  47 + private String status;
  48 +
  49 + public String getId() {
  50 + return id;
  51 + }
  52 +
  53 + public void setId(String id) {
  54 + this.id = id == null ? null : id.trim();
  55 + }
  56 +
  57 + public Date getCreatedate() {
  58 + return createdate;
  59 + }
  60 +
  61 + public void setCreatedate(Date createdate) {
  62 + this.createdate = createdate;
  63 + }
  64 +
  65 + public String getWaybillno() {
  66 + return waybillno;
  67 + }
  68 +
  69 + public void setWaybillno(String waybillno) {
  70 + this.waybillno = waybillno == null ? null : waybillno.trim();
  71 + }
  72 +
  73 + public String getFlightno() {
  74 + return flightno;
  75 + }
  76 +
  77 + public void setFlightno(String flightno) {
  78 + this.flightno = flightno == null ? null : flightno.trim();
  79 + }
  80 +
  81 + public Date getFlightdate() {
  82 + return flightdate;
  83 + }
  84 +
  85 + public void setFlightdate(Date flightdate) {
  86 + this.flightdate = flightdate;
  87 + }
  88 +
  89 + public String getOriginatingstation() {
  90 + return originatingstation;
  91 + }
  92 +
  93 + public void setOriginatingstation(String originatingstation) {
  94 + this.originatingstation = originatingstation == null ? null : originatingstation.trim();
  95 + }
  96 +
  97 + public String getDestinationstation() {
  98 + return destinationstation;
  99 + }
  100 +
  101 + public void setDestinationstation(String destinationstation) {
  102 + this.destinationstation = destinationstation == null ? null : destinationstation.trim();
  103 + }
  104 +
  105 + public String getStowagepieces() {
  106 + return stowagepieces;
  107 + }
  108 +
  109 + public void setStowagepieces(String stowagepieces) {
  110 + this.stowagepieces = stowagepieces == null ? null : stowagepieces.trim();
  111 + }
  112 +
  113 + public String getStowageweight() {
  114 + return stowageweight;
  115 + }
  116 +
  117 + public void setStowageweight(String stowageweight) {
  118 + this.stowageweight = stowageweight == null ? null : stowageweight.trim();
  119 + }
  120 +
  121 + public String getWaybillpieces() {
  122 + return waybillpieces;
  123 + }
  124 +
  125 + public void setWaybillpieces(String waybillpieces) {
  126 + this.waybillpieces = waybillpieces == null ? null : waybillpieces.trim();
  127 + }
  128 +
  129 + public String getWaybillweight() {
  130 + return waybillweight;
  131 + }
  132 +
  133 + public void setWaybillweight(String waybillweight) {
  134 + this.waybillweight = waybillweight == null ? null : waybillweight.trim();
  135 + }
  136 +
  137 + public Date getStowagedate() {
  138 + return stowagedate;
  139 + }
  140 +
  141 + public void setStowagedate(Date stowagedate) {
  142 + this.stowagedate = stowagedate;
  143 + }
  144 +
  145 + public String getProductname() {
  146 + return productname;
  147 + }
  148 +
  149 + public void setProductname(String productname) {
  150 + this.productname = productname == null ? null : productname.trim();
  151 + }
  152 +
  153 + public String getSpecialcode() {
  154 + return specialcode;
  155 + }
  156 +
  157 + public void setSpecialcode(String specialcode) {
  158 + this.specialcode = specialcode == null ? null : specialcode.trim();
  159 + }
  160 +
  161 + public String getCustoms() {
  162 + return customs;
  163 + }
  164 +
  165 + public void setCustoms(String customs) {
  166 + this.customs = customs == null ? null : customs.trim();
  167 + }
  168 +
  169 + public String getReceiption() {
  170 + return receiption;
  171 + }
  172 +
  173 + public void setReceiption(String receiption) {
  174 + this.receiption = receiption == null ? null : receiption.trim();
  175 + }
  176 +
  177 + public String getStatus() {
  178 + return status;
  179 + }
  180 +
  181 + public void setStatus(String status) {
  182 + this.status = status == null ? null : status.trim();
  183 + }
  184 +
  185 + public DEPARTURESLOADING() {
  186 +
  187 + }
  188 + public DEPARTURESLOADING(CustomReception customReception) {
  189 + init();
  190 + this.waybillno = AWBTools.awbFormat(customReception.getWayBillMaster());
  191 + this.flightno = customReception.getFlightNo();
  192 + if (!StringUtils.isEmpty(customReception.getFlightDate())) {
  193 + this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
  194 + }
  195 + this.receiption = customReception.getResponseText();
  196 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  197 + }
  198 +
  199 + @Override
  200 + public int masterAnalysisReception() {
  201 + int i = departuresloadingMapper.updateRECEIPTION(this);
  202 + List<DEPARTURESLOADING> list = departuresloadingMapper.selectAutoIdByAwb(this);
  203 + if(!list.isEmpty()){
  204 + DEPARTURESLOADING departuresloading1 = list.get(0);
  205 + String autoId = departuresloading1.getId();
  206 + //插入sendlog记录表
  207 + log.info("即将插入回执日志运单号为:"+waybillno+"->autoid="+autoId);
  208 + int ii =sendLogService.insertSendlog("MT4201",receiption,autoId);
  209 +
  210 + if (i>0 && ii>0){
  211 + log.info("运单号 {} 装载回执更新成功",waybillno);
  212 + return 1;
  213 + }
  214 + }
  215 + return 0;
  216 + }
  217 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +import org.apache.commons.lang.StringUtils;
  9 +
  10 +import java.util.Date;
  11 +import java.util.List;
  12 +
  13 +@Data
  14 +@Slf4j
  15 +public class INPORTALLOCATE extends WlptBaseModel {
  16 + private String id;
  17 +
  18 + private Date createdate;
  19 +
  20 + private String waybillno;
  21 +
  22 + private String carrier;
  23 +
  24 + private String flightno;
  25 +
  26 + private Date flightdate;
  27 +
  28 + private String customos;
  29 +
  30 + private String tallypieces;
  31 +
  32 + private String tallyweight;
  33 +
  34 + private String allocatepieces;
  35 +
  36 + private String allocateweight;
  37 +
  38 + private String allocatedestination;
  39 +
  40 + private String trailernumber;
  41 +
  42 + private String status;
  43 +
  44 + private String receiptinformation;
  45 +
  46 + public String getId() {
  47 + return id;
  48 + }
  49 +
  50 + public void setId(String id) {
  51 + this.id = id == null ? null : id.trim();
  52 + }
  53 +
  54 + public Date getCreatedate() {
  55 + return createdate;
  56 + }
  57 +
  58 + public void setCreatedate(Date createdate) {
  59 + this.createdate = createdate;
  60 + }
  61 +
  62 + public String getWaybillno() {
  63 + return waybillno;
  64 + }
  65 +
  66 + public void setWaybillno(String waybillno) {
  67 + this.waybillno = waybillno == null ? null : waybillno.trim();
  68 + }
  69 +
  70 + public String getCarrier() {
  71 + return carrier;
  72 + }
  73 +
  74 + public void setCarrier(String carrier) {
  75 + this.carrier = carrier == null ? null : carrier.trim();
  76 + }
  77 +
  78 + public String getFlightno() {
  79 + return flightno;
  80 + }
  81 +
  82 + public void setFlightno(String flightno) {
  83 + this.flightno = flightno == null ? null : flightno.trim();
  84 + }
  85 +
  86 + public Date getFlightdate() {
  87 + return flightdate;
  88 + }
  89 +
  90 + public void setFlightdate(Date flightdate) {
  91 + this.flightdate = flightdate;
  92 + }
  93 +
  94 + public String getCustomos() {
  95 + return customos;
  96 + }
  97 +
  98 + public void setCustomos(String customos) {
  99 + this.customos = customos == null ? null : customos.trim();
  100 + }
  101 +
  102 + public String getTallypieces() {
  103 + return tallypieces;
  104 + }
  105 +
  106 + public void setTallypieces(String tallypieces) {
  107 + this.tallypieces = tallypieces == null ? null : tallypieces.trim();
  108 + }
  109 +
  110 + public String getTallyweight() {
  111 + return tallyweight;
  112 + }
  113 +
  114 + public void setTallyweight(String tallyweight) {
  115 + this.tallyweight = tallyweight == null ? null : tallyweight.trim();
  116 + }
  117 +
  118 + public String getAllocatepieces() {
  119 + return allocatepieces;
  120 + }
  121 +
  122 + public void setAllocatepieces(String allocatepieces) {
  123 + this.allocatepieces = allocatepieces == null ? null : allocatepieces.trim();
  124 + }
  125 +
  126 + public String getAllocateweight() {
  127 + return allocateweight;
  128 + }
  129 +
  130 + public void setAllocateweight(String allocateweight) {
  131 + this.allocateweight = allocateweight == null ? null : allocateweight.trim();
  132 + }
  133 +
  134 + public String getAllocatedestination() {
  135 + return allocatedestination;
  136 + }
  137 +
  138 + public void setAllocatedestination(String allocatedestination) {
  139 + this.allocatedestination = allocatedestination == null ? null : allocatedestination.trim();
  140 + }
  141 +
  142 + public String getTrailernumber() {
  143 + return trailernumber;
  144 + }
  145 +
  146 + public void setTrailernumber(String trailernumber) {
  147 + this.trailernumber = trailernumber == null ? null : trailernumber.trim();
  148 + }
  149 +
  150 + public String getStatus() {
  151 + return status;
  152 + }
  153 +
  154 + public void setStatus(String status) {
  155 + this.status = status == null ? null : status.trim();
  156 + }
  157 +
  158 + public String getReceiptinformation() {
  159 + return receiptinformation;
  160 + }
  161 +
  162 + public void setReceiptinformation(String receiptinformation) {
  163 + this.receiptinformation = receiptinformation == null ? null : receiptinformation.trim();
  164 + }
  165 +
  166 + public INPORTALLOCATE() {
  167 + }
  168 + public INPORTALLOCATE(CustomReception customReception) {
  169 + this.waybillno = customReception.getWayBillMaster();
  170 + String[] flightInfo = AWBTools.splitFlight(customReception.getFlightNo());
  171 + this.setFlightno(flightInfo[1]);
  172 + this.setCarrier(flightInfo[0]);
  173 + if (!StringUtils.isEmpty(customReception.getFlightDate())) {
  174 + this.setFlightdate(DateUtil.formatByyyyyMMdd(customReception.getFlightDate()));
  175 + }
  176 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  177 + this.receiptinformation = customReception.getResponseText();
  178 + }
  179 +
  180 + @Override
  181 + public int masterAnalysisReception() {
  182 + int i = inportallocateMapper.updateRECEIPTION(this);
  183 +
  184 + List<INPORTALLOCATE> arrivedmasterList = inportallocateMapper.selectAutoIdByAwb(this);
  185 + if(!arrivedmasterList.isEmpty()){
  186 + INPORTALLOCATE departuresloading1 = arrivedmasterList.get(0);
  187 + String autoId = departuresloading1.getId();
  188 +
  189 + //插入sendlog记录表
  190 + log.info("即将插入回执日志运单号为:"+waybillno+"->autoid="+autoId);
  191 + int ii =sendLogService.insertSendlog("MT6202",receiptinformation,autoId);
  192 +
  193 + if (i>0 && ii>0 ){
  194 + log.info("运单号 {} 分拨申请回执更新成功",waybillno);
  195 + return 1;
  196 + }
  197 + }
  198 + return 0;
  199 + }
  200 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.Data;
  7 +import lombok.extern.slf4j.Slf4j;
  8 +
  9 +import java.util.Date;
  10 +import java.util.List;
  11 +
  12 +@Data
  13 +@Slf4j
  14 +public class INTERNATIONALTRANSIT extends WlptBaseModel {
  15 + private String autoid;
  16 +
  17 + private Date createdate;
  18 +
  19 + private String originalCarrier;
  20 +
  21 + private String originalFlightno;
  22 +
  23 + private Date originalFlightdate;
  24 +
  25 + private String originalBillno;
  26 +
  27 + private String originalSubNumber;
  28 +
  29 + private String preCarrier;
  30 +
  31 + private String preFlightno;
  32 +
  33 + private Date preFlightdate;
  34 +
  35 + private String preBillno;
  36 +
  37 + private String preSubNumber;
  38 +
  39 + private String billpiece;
  40 +
  41 + private String billweight;
  42 +
  43 + private String product;
  44 +
  45 + private String originatingstation;
  46 +
  47 + private String packagingtype;
  48 +
  49 + private String status;
  50 +
  51 + private String receiption;
  52 +
  53 + private String destinationstationBill;
  54 +
  55 + public String getAutoid() {
  56 + return autoid;
  57 + }
  58 +
  59 + public void setAutoid(String autoid) {
  60 + this.autoid = autoid == null ? null : autoid.trim();
  61 + }
  62 +
  63 + public Date getCreatedate() {
  64 + return createdate;
  65 + }
  66 +
  67 + public void setCreatedate(Date createdate) {
  68 + this.createdate = createdate;
  69 + }
  70 +
  71 + public String getOriginalCarrier() {
  72 + return originalCarrier;
  73 + }
  74 +
  75 + public void setOriginalCarrier(String originalCarrier) {
  76 + this.originalCarrier = originalCarrier == null ? null : originalCarrier.trim();
  77 + }
  78 +
  79 + public String getOriginalFlightno() {
  80 + return originalFlightno;
  81 + }
  82 +
  83 + public void setOriginalFlightno(String originalFlightno) {
  84 + this.originalFlightno = originalFlightno == null ? null : originalFlightno.trim();
  85 + }
  86 +
  87 + public Date getOriginalFlightdate() {
  88 + return originalFlightdate;
  89 + }
  90 +
  91 + public void setOriginalFlightdate(Date originalFlightdate) {
  92 + this.originalFlightdate = originalFlightdate;
  93 + }
  94 +
  95 + public String getOriginalBillno() {
  96 + return originalBillno;
  97 + }
  98 +
  99 + public void setOriginalBillno(String originalBillno) {
  100 + this.originalBillno = originalBillno == null ? null : originalBillno.trim();
  101 + }
  102 +
  103 + public String getOriginalSubNumber() {
  104 + return originalSubNumber;
  105 + }
  106 +
  107 + public void setOriginalSubNumber(String originalSubNumber) {
  108 + this.originalSubNumber = originalSubNumber == null ? null : originalSubNumber.trim();
  109 + }
  110 +
  111 + public String getPreCarrier() {
  112 + return preCarrier;
  113 + }
  114 +
  115 + public void setPreCarrier(String preCarrier) {
  116 + this.preCarrier = preCarrier == null ? null : preCarrier.trim();
  117 + }
  118 +
  119 + public String getPreFlightno() {
  120 + return preFlightno;
  121 + }
  122 +
  123 + public void setPreFlightno(String preFlightno) {
  124 + this.preFlightno = preFlightno == null ? null : preFlightno.trim();
  125 + }
  126 +
  127 + public Date getPreFlightdate() {
  128 + return preFlightdate;
  129 + }
  130 +
  131 + public void setPreFlightdate(Date preFlightdate) {
  132 + this.preFlightdate = preFlightdate;
  133 + }
  134 +
  135 + public String getPreBillno() {
  136 + return preBillno;
  137 + }
  138 +
  139 + public void setPreBillno(String preBillno) {
  140 + this.preBillno = preBillno == null ? null : preBillno.trim();
  141 + }
  142 +
  143 + public String getPreSubNumber() {
  144 + return preSubNumber;
  145 + }
  146 +
  147 + public void setPreSubNumber(String preSubNumber) {
  148 + this.preSubNumber = preSubNumber == null ? null : preSubNumber.trim();
  149 + }
  150 +
  151 + public String getBillpiece() {
  152 + return billpiece;
  153 + }
  154 +
  155 + public void setBillpiece(String billpiece) {
  156 + this.billpiece = billpiece == null ? null : billpiece.trim();
  157 + }
  158 +
  159 + public String getBillweight() {
  160 + return billweight;
  161 + }
  162 +
  163 + public void setBillweight(String billweight) {
  164 + this.billweight = billweight == null ? null : billweight.trim();
  165 + }
  166 +
  167 + public String getProduct() {
  168 + return product;
  169 + }
  170 +
  171 + public void setProduct(String product) {
  172 + this.product = product == null ? null : product.trim();
  173 + }
  174 +
  175 + public String getOriginatingstation() {
  176 + return originatingstation;
  177 + }
  178 +
  179 + public void setOriginatingstation(String originatingstation) {
  180 + this.originatingstation = originatingstation == null ? null : originatingstation.trim();
  181 + }
  182 +
  183 + public String getPackagingtype() {
  184 + return packagingtype;
  185 + }
  186 +
  187 + public void setPackagingtype(String packagingtype) {
  188 + this.packagingtype = packagingtype == null ? null : packagingtype.trim();
  189 + }
  190 +
  191 + public String getStatus() {
  192 + return status;
  193 + }
  194 +
  195 + public void setStatus(String status) {
  196 + this.status = status == null ? null : status.trim();
  197 + }
  198 +
  199 + public String getReceiption() {
  200 + return receiption;
  201 + }
  202 +
  203 + public void setReceiption(String receiption) {
  204 + this.receiption = receiption == null ? null : receiption.trim();
  205 + }
  206 +
  207 + public String getDestinationstationBill() {
  208 + return destinationstationBill;
  209 + }
  210 +
  211 + public void setDestinationstationBill(String destinationstationBill) {
  212 + this.destinationstationBill = destinationstationBill == null ? null : destinationstationBill.trim();
  213 + }
  214 +
  215 + public INTERNATIONALTRANSIT(){
  216 +
  217 + }
  218 + public INTERNATIONALTRANSIT(CustomReception customReception) {
  219 + String[] flightInfo = AWBTools.splitFlight(customReception.getImportFlightNo());
  220 + this.originalCarrier = flightInfo[0];
  221 + this.originalFlightno = flightInfo[1];
  222 + this.originalFlightdate = DateUtil.formatByyyyyMMdd(customReception.getImportFlightDate());
  223 + this.originalBillno = AWBTools.awbFormat(customReception.getImportWaybillMaster());
  224 + //TODO:碰见分单回执再解析
  225 + this.originalSubNumber = customReception.getWayBillSecond();
  226 +
  227 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  228 + this.receiption = customReception.getResponseText();
  229 + }
  230 +
  231 + @Override
  232 + public int masterAnalysisReception() {
  233 + int i = internationaltransitMapper.updateRECEIPTION(this);
  234 + List<INTERNATIONALTRANSIT> internationaltransits = internationaltransitMapper.selectAutoIdByAwb(this);
  235 + if(!internationaltransits.isEmpty()){
  236 + INTERNATIONALTRANSIT internationaltransit = internationaltransits.get(0);
  237 + String autoId = internationaltransit.getAutoid();
  238 +
  239 + //插入sendlog记录表
  240 + log.info("即将插入国际转运日志运单号为:"+originalBillno+"->autoid="+autoId);
  241 + int ii =sendLogService.insertSendlog("MT8205",receiption,autoId);
  242 + if (i>0 && ii>0){
  243 + log.info("运单号 {} 国际转运回执更新成功",originalBillno);
  244 + return 1;
  245 + }
  246 + }
  247 + return 0;
  248 + }
  249 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +@Slf4j
  12 +public class MANIFESTLOAD extends WlptBaseModel {
  13 + private String id;
  14 +
  15 + private Date createdate;
  16 +
  17 + private String flightno;
  18 +
  19 + private String waybillnomaster;
  20 +
  21 + private Date flightdate;
  22 +
  23 + private String waybillnosecondary;
  24 +
  25 + private String remark;
  26 +
  27 + private String status;
  28 +
  29 + private String receiption;
  30 +
  31 + private String customcode;
  32 +
  33 + private String reason;
  34 +
  35 + private String contactname;
  36 +
  37 + private String contacttel;
  38 +
  39 + public String getId() {
  40 + return id;
  41 + }
  42 +
  43 + public void setId(String id) {
  44 + this.id = id == null ? null : id.trim();
  45 + }
  46 +
  47 + public Date getCreatedate() {
  48 + return createdate;
  49 + }
  50 +
  51 + public void setCreatedate(Date createdate) {
  52 + this.createdate = createdate;
  53 + }
  54 +
  55 + public String getFlightno() {
  56 + return flightno;
  57 + }
  58 +
  59 + public void setFlightno(String flightno) {
  60 + this.flightno = flightno == null ? null : flightno.trim();
  61 + }
  62 +
  63 + public String getWaybillnomaster() {
  64 + return waybillnomaster;
  65 + }
  66 +
  67 + public void setWaybillnomaster(String waybillnomaster) {
  68 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  69 + }
  70 +
  71 + public Date getFlightdate() {
  72 + return flightdate;
  73 + }
  74 +
  75 + public void setFlightdate(Date flightdate) {
  76 + this.flightdate = flightdate;
  77 + }
  78 +
  79 + public String getWaybillnosecondary() {
  80 + return waybillnosecondary;
  81 + }
  82 +
  83 + public void setWaybillnosecondary(String waybillnosecondary) {
  84 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  85 + }
  86 +
  87 + public String getRemark() {
  88 + return remark;
  89 + }
  90 +
  91 + public void setRemark(String remark) {
  92 + this.remark = remark == null ? null : remark.trim();
  93 + }
  94 +
  95 + public String getStatus() {
  96 + return status;
  97 + }
  98 +
  99 + public void setStatus(String status) {
  100 + this.status = status == null ? null : status.trim();
  101 + }
  102 +
  103 + public String getReceiption() {
  104 + return receiption;
  105 + }
  106 +
  107 + public void setReceiption(String receiption) {
  108 + this.receiption = receiption == null ? null : receiption.trim();
  109 + }
  110 +
  111 + public String getCustomcode() {
  112 + return customcode;
  113 + }
  114 +
  115 + public void setCustomcode(String customcode) {
  116 + this.customcode = customcode == null ? null : customcode.trim();
  117 + }
  118 +
  119 + public String getReason() {
  120 + return reason;
  121 + }
  122 +
  123 + public void setReason(String reason) {
  124 + this.reason = reason == null ? null : reason.trim();
  125 + }
  126 +
  127 + public String getContactname() {
  128 + return contactname;
  129 + }
  130 +
  131 + public void setContactname(String contactname) {
  132 + this.contactname = contactname == null ? null : contactname.trim();
  133 + }
  134 +
  135 + public String getContacttel() {
  136 + return contacttel;
  137 + }
  138 +
  139 + public void setContacttel(String contacttel) {
  140 + this.contacttel = contacttel == null ? null : contacttel.trim();
  141 + }
  142 +
  143 + public MANIFESTLOAD() {
  144 +
  145 + }
  146 +
  147 + public MANIFESTLOAD(CustomReception customReception) {
  148 +
  149 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  150 +
  151 +
  152 + //取分单号
  153 + if(!customReception.getWayBillSecond().isEmpty()){
  154 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  155 + this.waybillnosecondary = awbhArr[1];
  156 + }
  157 +
  158 + this.flightno = customReception.getFlightNo();
  159 + this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
  160 +
  161 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  162 + this.receiption = customReception.getResponseText();
  163 + }
  164 +
  165 + @Override
  166 + public int secondAnalysisReception(){
  167 +
  168 + //更新分单回执
  169 + int i = manifestloadMapper.updateRECEIPTION(this);
  170 + //获取分单autoid
  171 + List<MANIFESTLOAD> secondaryList = manifestloadMapper.selectAutoIdByawbAawbH(this);
  172 + if(!secondaryList.isEmpty()){
  173 + MANIFESTLOAD arrivedSecond = secondaryList.get(0);
  174 + String autoId = arrivedSecond.getId();
  175 + //插入sendlog记录表
  176 + log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
  177 + int ii = sendLogService.insertSendlog("MT8202",receiption,autoId);
  178 +
  179 + //todo:同时更新发送日志表的回执信息
  180 +
  181 +
  182 + if (i>0 && ii>0 ){
  183 + log.info("运单号 {} 落装分单回执更新成功",waybillnosecondary);
  184 + return 1;
  185 + }
  186 + }else {
  187 + //todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
  188 + }
  189 + return 0;
  190 + }
  191 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.bean.WlptBaseModel;
  4 +import com.tianbo.analysis.tools.AWBTools;
  5 +import com.tianbo.util.Date.DateUtil;
  6 +import lombok.extern.slf4j.Slf4j;
  7 +
  8 +import java.util.Date;
  9 +import java.util.List;
  10 +
  11 +@Slf4j
  12 +public class MANIFESTLOSTCHANGE extends WlptBaseModel{
  13 + private String id;
  14 +
  15 + private String flightno;
  16 +
  17 + private Date flightdate;
  18 +
  19 + private String waybillnomaster;
  20 +
  21 + private String waybillnosecondary;
  22 +
  23 + private String cwaybillnomaster;
  24 +
  25 + private String cwaybillnosecondary;
  26 +
  27 + private Date createdate;
  28 +
  29 + private String status;
  30 +
  31 + private String receiption;
  32 +
  33 + private String cflightno;
  34 +
  35 + private Date cflightdate;
  36 +
  37 + private String sequencenumeric;
  38 +
  39 + private String quantity;
  40 +
  41 + private String cargodescription;
  42 +
  43 + private String goodsmeasure;
  44 +
  45 + private String customcode;
  46 +
  47 + private String reason;
  48 +
  49 + private String contactname;
  50 +
  51 + private String contacttel;
  52 +
  53 + public String getId() {
  54 + return id;
  55 + }
  56 +
  57 + public void setId(String id) {
  58 + this.id = id == null ? null : id.trim();
  59 + }
  60 +
  61 + public String getFlightno() {
  62 + return flightno;
  63 + }
  64 +
  65 + public void setFlightno(String flightno) {
  66 + this.flightno = flightno == null ? null : flightno.trim();
  67 + }
  68 +
  69 + public Date getFlightdate() {
  70 + return flightdate;
  71 + }
  72 +
  73 + public void setFlightdate(Date flightdate) {
  74 + this.flightdate = flightdate;
  75 + }
  76 +
  77 + public String getWaybillnomaster() {
  78 + return waybillnomaster;
  79 + }
  80 +
  81 + public void setWaybillnomaster(String waybillnomaster) {
  82 + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim();
  83 + }
  84 +
  85 + public String getWaybillnosecondary() {
  86 + return waybillnosecondary;
  87 + }
  88 +
  89 + public void setWaybillnosecondary(String waybillnosecondary) {
  90 + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim();
  91 + }
  92 +
  93 + public String getCwaybillnomaster() {
  94 + return cwaybillnomaster;
  95 + }
  96 +
  97 + public void setCwaybillnomaster(String cwaybillnomaster) {
  98 + this.cwaybillnomaster = cwaybillnomaster == null ? null : cwaybillnomaster.trim();
  99 + }
  100 +
  101 + public String getCwaybillnosecondary() {
  102 + return cwaybillnosecondary;
  103 + }
  104 +
  105 + public void setCwaybillnosecondary(String cwaybillnosecondary) {
  106 + this.cwaybillnosecondary = cwaybillnosecondary == null ? null : cwaybillnosecondary.trim();
  107 + }
  108 +
  109 + public Date getCreatedate() {
  110 + return createdate;
  111 + }
  112 +
  113 + public void setCreatedate(Date createdate) {
  114 + this.createdate = createdate;
  115 + }
  116 +
  117 + public String getStatus() {
  118 + return status;
  119 + }
  120 +
  121 + public void setStatus(String status) {
  122 + this.status = status == null ? null : status.trim();
  123 + }
  124 +
  125 + public String getReceiption() {
  126 + return receiption;
  127 + }
  128 +
  129 + public void setReceiption(String receiption) {
  130 + this.receiption = receiption == null ? null : receiption.trim();
  131 + }
  132 +
  133 + public String getCflightno() {
  134 + return cflightno;
  135 + }
  136 +
  137 + public void setCflightno(String cflightno) {
  138 + this.cflightno = cflightno == null ? null : cflightno.trim();
  139 + }
  140 +
  141 + public Date getCflightdate() {
  142 + return cflightdate;
  143 + }
  144 +
  145 + public void setCflightdate(Date cflightdate) {
  146 + this.cflightdate = cflightdate;
  147 + }
  148 +
  149 + public String getSequencenumeric() {
  150 + return sequencenumeric;
  151 + }
  152 +
  153 + public void setSequencenumeric(String sequencenumeric) {
  154 + this.sequencenumeric = sequencenumeric == null ? null : sequencenumeric.trim();
  155 + }
  156 +
  157 + public String getQuantity() {
  158 + return quantity;
  159 + }
  160 +
  161 + public void setQuantity(String quantity) {
  162 + this.quantity = quantity == null ? null : quantity.trim();
  163 + }
  164 +
  165 + public String getCargodescription() {
  166 + return cargodescription;
  167 + }
  168 +
  169 + public void setCargodescription(String cargodescription) {
  170 + this.cargodescription = cargodescription == null ? null : cargodescription.trim();
  171 + }
  172 +
  173 + public String getGoodsmeasure() {
  174 + return goodsmeasure;
  175 + }
  176 +
  177 + public void setGoodsmeasure(String goodsmeasure) {
  178 + this.goodsmeasure = goodsmeasure == null ? null : goodsmeasure.trim();
  179 + }
  180 +
  181 + public String getCustomcode() {
  182 + return customcode;
  183 + }
  184 +
  185 + public void setCustomcode(String customcode) {
  186 + this.customcode = customcode == null ? null : customcode.trim();
  187 + }
  188 +
  189 + public String getReason() {
  190 + return reason;
  191 + }
  192 +
  193 + public void setReason(String reason) {
  194 + this.reason = reason == null ? null : reason.trim();
  195 + }
  196 +
  197 + public String getContactname() {
  198 + return contactname;
  199 + }
  200 +
  201 + public void setContactname(String contactname) {
  202 + this.contactname = contactname == null ? null : contactname.trim();
  203 + }
  204 +
  205 + public String getContacttel() {
  206 + return contacttel;
  207 + }
  208 +
  209 + public void setContacttel(String contacttel) {
  210 + this.contacttel = contacttel == null ? null : contacttel.trim();
  211 + }
  212 +
  213 +
  214 + public MANIFESTLOSTCHANGE() {
  215 +
  216 + }
  217 +
  218 + public MANIFESTLOSTCHANGE(CustomReception customReception) {
  219 +
  220 + this.waybillnomaster = AWBTools.awbFormat(customReception.getWayBillMaster());
  221 +
  222 +
  223 + //取分单号
  224 + if(!customReception.getWayBillSecond().isEmpty()){
  225 + String[] awbhArr = customReception.getWayBillSecond().split("_");
  226 + this.waybillnosecondary = awbhArr[1];
  227 + }
  228 +
  229 + this.flightno = customReception.getFlightNo();
  230 + this.flightdate = DateUtil.formatByyyyyMMdd(customReception.getFlightDate());
  231 +
  232 + this.status = AWBTools.transCusRspCode(customReception.getResponseCode());
  233 + this.receiption = customReception.getResponseText();
  234 + }
  235 +
  236 + @Override
  237 + public int secondAnalysisReception(){
  238 +
  239 + //更新分单回执
  240 + int i = manifestlostchangeMapper.updateRECEIPTION(this);
  241 + //获取分单autoid
  242 + List<MANIFESTLOSTCHANGE> secondaryList = manifestlostchangeMapper.selectAutoIdByawbAawbH(this);
  243 + if(!secondaryList.isEmpty()){
  244 + MANIFESTLOSTCHANGE arrivedSecond = secondaryList.get(0);
  245 + String autoId = arrivedSecond.getId();
  246 + //插入sendlog记录表
  247 + log.info("即将插入回执日志运单号为:{}{},->autoid={}",waybillnomaster,waybillnosecondary,autoId);
  248 + int ii = sendLogService.insertSendlog("MT8203",receiption,autoId);
  249 +
  250 + //todo:同时更新发送日志表的回执信息
  251 +
  252 +
  253 + if (i>0 && ii>0 ){
  254 + log.info("运单号 {} 落装改配分单回执更新成功",waybillnosecondary);
  255 + return 1;
  256 + }
  257 + }else {
  258 + //todo:如果都没适配到的话,要从发送日志表里面通过回执中的messageid 找到发送信息,适配回执
  259 + }
  260 + return 0;
  261 + }
  262 +}
  1 +package com.tianbo.analysis.model;
  2 +
  3 +import com.tianbo.analysis.model.CustomReception;
  4 +import com.tianbo.analysis.service.imp.CoustomAnalysisServiceImp;
  5 +import com.tianbo.analysis.service.imp.ShareServiceImp;
  6 +import com.tianbo.analysis.tools.AWBTools;
  7 +import com.tianbo.util.Date.DateUtil;
  8 +import lombok.extern.slf4j.Slf4j;
  9 +import org.apache.commons.lang.StringUtils;
  10 +import org.springframework.scheduling.annotation.Async;
  11 +
  12 +import java.util.Date;
  13 +
  14 +@Slf4j
  15 +@Async
  16 +public class NmmsBase {
  17 +
  18 + public ShareServiceImp shareServiceImp;
  19 + public CoustomAnalysisServiceImp coustomAnalysisServiceImp;
  20 + public String awbA ;
  21 + public String awbH ;
  22 + public String rspCode;
  23 + public String nmsStatusCode;
  24 + public String reception;
  25 + public String flightDateStr;
  26 + public CustomReception customReception;
  27 + public Date flightDate;
  28 +
  29 + public int insertRecept(CustomReception customReception){
  30 + log.warn("公共对象监控打印{}",this);
  31 + this.shareServiceImp = new ShareServiceImp();
  32 + // 发送日志 插入
  33 + this.coustomAnalysisServiceImp = new CoustomAnalysisServiceImp();
  34 + this.customReception = customReception;
  35 +
  36 + // 主单号;处理主单格式,将海关回执的主单号58019316861,变为580-19316861
  37 + this.awbA = AWBTools.awbFormat(customReception.getWayBillMaster());
  38 + this.awbH = customReception.getWayBillSecond();
  39 + this.rspCode = customReception.getResponseCode();
  40 + this.nmsStatusCode = AWBTools.transCusRspCode(rspCode);
  41 +
  42 + this.reception = customReception.getResponseText();
  43 + this.flightDateStr = customReception.getFlightDate();
  44 + log.info("开始解析:运单号 {} 回执类型:{} ",awbA,customReception.getMessageType());
  45 + if (!StringUtils.isEmpty(flightDateStr)) {
  46 + this.flightDate = DateUtil.formatByyyyyMMdd(flightDateStr);
  47 +
  48 + // 判断航班号 航班日期 是否为空
  49 + if (flightDate != null && customReception.getFlightNo() != null){
  50 + //有分单号 更新分单回执
  51 + if(!StringUtils.isEmpty(awbH)){
  52 + return second();
  53 + }
  54 +
  55 + if (!StringUtils.isEmpty(awbA)){
  56 + return master();
  57 + }
  58 + }else {
  59 + //从发送日志表查找发送MESSAGEID进行二次入库
  60 + return shareServiceImp.share(customReception.getMessageType(), customReception);
  61 + }
  62 + }
  63 +
  64 + return 0;
  65 +
  66 + }
  67 +
  68 + /**
  69 + * 入库分单回执信息
  70 + * @return 成功返回1,失败返回0。
  71 + */
  72 + public int second() {
  73 + return 0;
  74 + }
  75 +
  76 + /**
  77 + * 入库分单回执信息
  78 + * @return 成功返回1,失败返回0。
  79 + */
  80 + public int master() {
  81 + return 0;
  82 + }
  83 +}