作者 xudada

提前运抵

1 -#\u8BBE\u7F6E\u8BBF\u95EE\u7AEF\u53E3 1 +
2 server.port=8848 2 server.port=8848
3 -#eureka\u6CE8\u518C\u4E2D\u5FC3\u670D\u52A1\u5668\u5730\u5740 3 +
4 #eureka.client.service-url.defaultZone=http://10.50.3.82:19527/eureka/ 4 #eureka.client.service-url.defaultZone=http://10.50.3.82:19527/eureka/
5 -#\u670D\u52A1\u540D  
6 -#spring.application.name=AnalysisForStation  
7 -#\u8BBE\u7F6E\u70ED\u90E8\u7F72  
8 -#\u5F00\u542F\u70ED\u90E8\u7F72 5 +eureka.client.service-url.defaultZone=http://192.168.1.53:12345/eureka/
  6 +
  7 +spring.application.name=kako_analysisforstation
  8 +
  9 +
9 spring.devtools.restart.enabled=true 10 spring.devtools.restart.enabled=true
10 -#\u91CD\u542F\u8303\u56F4 11 +
11 spring.devtools.restart.additional-paths=src/main/java 12 spring.devtools.restart.additional-paths=src/main/java
12 -#\u6620\u5C04\u524D\u7F00 13 +
13 spring.mvc.view.suffix=/WEB-INF/jsp/ 14 spring.mvc.view.suffix=/WEB-INF/jsp/
14 -#\u6620\u5C04\u540E\u7F00 15 +
15 spring.mvc.view.prefix=.jsp 16 spring.mvc.view.prefix=.jsp
16 -#\u8BBE\u7F6E\u672C\u5730\u6570\u636E\u6E90 17 +
17 spring.datasource.username=110 18 spring.datasource.username=110
18 spring.datasource.password=QAHqCJf2kFYCLirM 19 spring.datasource.password=QAHqCJf2kFYCLirM
19 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 20 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
20 spring.datasource.url=jdbc:mysql://118.31.66.166:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai 21 spring.datasource.url=jdbc:mysql://118.31.66.166:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
21 -#\u8BBE\u7F6E\u7EBF\u4E0A\u6570\u636E\u6E90 22 +
22 #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 23 #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
23 #spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai 24 #spring.datasource.url=jdbc:mysql://localhost:3306/station?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai
24 #spring.datasource.username=station 25 #spring.datasource.username=station
25 #spring.datasource.password=station@10.50.7.70 26 #spring.datasource.password=station@10.50.7.70
26 -#\u8FDE\u63A5\u6C60\u7C7B 27 +
27 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource 28 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
28 -#\u8FDE\u63A5\u6C60\u914D\u7F6E\uFF0C\u56E0\u4E3Aspringboot\u9ED8\u8BA4\u662F\u5F00\u542F\u4E86\u8FDE\u63A5\u6C60\u7684\uFF0C\u5B83\u6709\u9ED8\u8BA4\u914D\u7F6E\uFF0C\u8FD9\u4E00\u6BB5\u53EF\u4EE5\u5FFD\u7565  
29 -# \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927 29 +
30 spring.datasource.druid.initial-size=5 30 spring.datasource.druid.initial-size=5
31 spring.datasource.druid.min-idle=5 31 spring.datasource.druid.min-idle=5
32 spring.datasource.druid.max-active=20 32 spring.datasource.druid.max-active=20
33 -# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4 33 +
34 spring.datasource.druid.max-wait=60000 34 spring.datasource.druid.max-wait=60000
35 -# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2  
36 spring.datasource.druid.time-between-eviction-runs-millis=60000 35 spring.datasource.druid.time-between-eviction-runs-millis=60000
37 -# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2  
38 spring.datasource.druid.min-evictable-idle-time-millis=300000 36 spring.datasource.druid.min-evictable-idle-time-millis=300000
39 spring.datasource.druid.validation-query=SELECT 1 FROM DUAL 37 spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
40 spring.datasource.druid.test-while-idle=true 38 spring.datasource.druid.test-while-idle=true
41 spring.datasource.druid.test-on-borrow=false 39 spring.datasource.druid.test-on-borrow=false
42 spring.datasource.druid.test-on-return=false 40 spring.datasource.druid.test-on-return=false
43 -# \u6253\u5F00PSCache\uFF0C\u5E76\u4E14\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F  
44 spring.datasource.druid.pool-prepared-statements=true 41 spring.datasource.druid.pool-prepared-statements=true
45 spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20 42 spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
46 -# \u914D\u7F6E\u76D1\u63A7\u7EDF\u8BA1\u62E6\u622A\u7684filters\uFF0C\u53BB\u6389\u540E\u76D1\u63A7\u754C\u9762sql\u65E0\u6CD5\u7EDF\u8BA1\uFF0C'wall'\u7528\u4E8E\u9632\u706B\u5899  
47 spring.datasource.druid.filters=stat,wall,log4j 43 spring.datasource.druid.filters=stat,wall,log4j
48 -# \u901A\u8FC7connectProperties\u5C5E\u6027\u6765\u6253\u5F00mergeSql\u529F\u80FD\uFF1B\u6162SQL\u8BB0\u5F55  
49 spring.datasource.druid.connection-properties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500 44 spring.datasource.druid.connection-properties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
50 #\u914D\u7F6Emybatis 45 #\u914D\u7F6Emybatis
51 mybatis.mapper-locations=classpath:mapping/*.xml 46 mybatis.mapper-locations=classpath:mapping/*.xml
52 -#\u5168\u5C40\u7684\u6620\u5C04\uFF0C\u4E0D\u7528\u5728xml\u6587\u4EF6\u5199\u5B9E\u4F53\u7C7B\u7684\u5168\u8DEF\u5F84  
53 mybatis.type-aliases-package=com.sy.model 47 mybatis.type-aliases-package=com.sy.model
54 #\u5F00\u542F\u9A7C\u5CF0\u6620\u5C04 48 #\u5F00\u542F\u9A7C\u5CF0\u6620\u5C04
55 mybatis.configuration.map-underscore-to-camel-case=true 49 mybatis.configuration.map-underscore-to-camel-case=true
@@ -59,3 +53,11 @@ pagehelper.helper-dialect=mysql @@ -59,3 +53,11 @@ pagehelper.helper-dialect=mysql
59 pagehelper.reasonable=true 53 pagehelper.reasonable=true
60 pagehelper.support-methods-arguments=true 54 pagehelper.support-methods-arguments=true
61 pagehelper.params=count=countSql 55 pagehelper.params=count=countSql
  56 +# 是否启用httpclient
  57 +feign.httpclient.enabled=false
  58 +# 是否启用httpok(性能比httpclient高)
  59 +feign.okhttp.enabled=true
  60 +# 是否启用hystrix
  61 +feign.hystrix.enabled=true
  62 +# 请求连接超时时间(毫秒)
  63 +feign.httpclient.connection-timeout=3000
@@ -18,6 +18,7 @@ STYP=CARM @@ -18,6 +18,7 @@ STYP=CARM
18 #\u8F7D\u91CD\u4E0E\u79F0\u91CD\u7684\u53EF\u63A7\u8303\u56F4 ?% 18 #\u8F7D\u91CD\u4E0E\u79F0\u91CD\u7684\u53EF\u63A7\u8303\u56F4 ?%
19 grossWt=5% 19 grossWt=5%
20 station=4600329012 20 station=4600329012
  21 +stationsf=4600541001
21 22
22 #\u4E8C\u7EF4\u7801\u5B58\u653E\u8DEF\u5F84\uFF0C\u9879\u76EE\u542F\u52A8\u65F6\u8BBE\u7F6E\uFF0C\u540E\u671F\u4E0D\u80FD\u66F4\u6539\u3002 23 #\u4E8C\u7EF4\u7801\u5B58\u653E\u8DEF\u5F84\uFF0C\u9879\u76EE\u542F\u52A8\u65F6\u8BBE\u7F6E\uFF0C\u540E\u671F\u4E0D\u80FD\u66F4\u6539\u3002
23 #barCode = barcode/ 24 #barCode = barcode/
@@ -26,6 +26,7 @@ @@ -26,6 +26,7 @@
26 </properties> 26 </properties>
27 27
28 <dependencies> 28 <dependencies>
  29 +
29 <dependency> 30 <dependency>
30 <groupId>org.springframework.boot</groupId> 31 <groupId>org.springframework.boot</groupId>
31 <artifactId>spring-boot-starter-jdbc</artifactId> 32 <artifactId>spring-boot-starter-jdbc</artifactId>
@@ -34,15 +35,19 @@ @@ -34,15 +35,19 @@
34 <groupId>org.springframework.boot</groupId> 35 <groupId>org.springframework.boot</groupId>
35 <artifactId>spring-boot-starter-web</artifactId> 36 <artifactId>spring-boot-starter-web</artifactId>
36 </dependency> 37 </dependency>
37 -<!-- <dependency> 38 + <dependency>
38 <groupId>org.springframework.cloud</groupId> 39 <groupId>org.springframework.cloud</groupId>
39 <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> 40 <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
40 - </dependency>--> 41 + </dependency>
41 <dependency> 42 <dependency>
42 <groupId>org.mybatis.spring.boot</groupId> 43 <groupId>org.mybatis.spring.boot</groupId>
43 <artifactId>mybatis-spring-boot-starter</artifactId> 44 <artifactId>mybatis-spring-boot-starter</artifactId>
44 <version>1.3.2</version> 45 <version>1.3.2</version>
45 </dependency> 46 </dependency>
  47 + <dependency>
  48 + <groupId>org.springframework.cloud</groupId>
  49 + <artifactId>spring-cloud-starter-openfeign</artifactId>
  50 + </dependency>
46 51
47 <dependency> 52 <dependency>
48 <groupId>mysql</groupId> 53 <groupId>mysql</groupId>
@@ -413,6 +418,16 @@ @@ -413,6 +418,16 @@
413 <artifactId>httpclient</artifactId> 418 <artifactId>httpclient</artifactId>
414 <version>4.5.5</version> 419 <version>4.5.5</version>
415 </dependency> 420 </dependency>
  421 + <dependency>
  422 + <groupId>org.springframework.boot</groupId>
  423 + <artifactId>spring-boot-test</artifactId>
  424 + </dependency>
  425 + <dependency>
  426 + <groupId>org.junit.jupiter</groupId>
  427 + <artifactId>junit-jupiter</artifactId>
  428 + <version>RELEASE</version>
  429 + <scope>compile</scope>
  430 + </dependency>
416 431
417 432
418 </dependencies> 433 </dependencies>
@@ -457,6 +472,13 @@ @@ -457,6 +472,13 @@
457 <verbose>true</verbose> 472 <verbose>true</verbose>
458 </configuration> 473 </configuration>
459 </plugin> 474 </plugin>
  475 + <plugin>
  476 + <groupId>org.apache.maven.plugins</groupId>
  477 + <artifactId>maven-surefire-plugin</artifactId>
  478 + <configuration>
  479 + <testFailureIgnore>true</testFailureIgnore>
  480 + </configuration>
  481 + </plugin>
460 </plugins> 482 </plugins>
461 </build> 483 </build>
462 <repositories> 484 <repositories>
@@ -4,8 +4,9 @@ import com.sy.bwAnalysis.AnalysisRoute; @@ -4,8 +4,9 @@ import com.sy.bwAnalysis.AnalysisRoute;
4 import org.mybatis.spring.annotation.MapperScan; 4 import org.mybatis.spring.annotation.MapperScan;
5 import org.springframework.boot.SpringApplication; 5 import org.springframework.boot.SpringApplication;
6 import org.springframework.boot.autoconfigure.SpringBootApplication; 6 import org.springframework.boot.autoconfigure.SpringBootApplication;
  7 +import org.springframework.cloud.openfeign.EnableFeignClients;
7 import org.springframework.scheduling.annotation.EnableScheduling; 8 import org.springframework.scheduling.annotation.EnableScheduling;
8 - 9 +@EnableFeignClients
9 @SpringBootApplication 10 @SpringBootApplication
10 @EnableScheduling 11 @EnableScheduling
11 //不连接数据库开启服务 12 //不连接数据库开启服务
@@ -18,7 +19,7 @@ public class AnalysisImfApplication { @@ -18,7 +19,7 @@ public class AnalysisImfApplication {
18 SpringApplication.run(AnalysisImfApplication.class, args); 19 SpringApplication.run(AnalysisImfApplication.class, args);
19 20
20 /*String message="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 21 /*String message="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
21 - "<MSG><META><SNDR>KAO</SNDR><RCVR></RCVR><SEQN>20200924082928</SEQN><DDTM>20200924082928</DDTM><TYPE>KAKO</TYPE><STYP>CARM</STYP></META><GATHER_INFO AREA_ID=\"\t\t4600329012\" CHNL_NO=\"\t\t4600010005\" I_E_TYPE=\"E\" SEQ_NO=\"20200924082701000001\">\n" + 22 + "<MSG><META><SNDR>KAO</SNDR><RCVR></RCVR><SEQN>20200924082928</SEQN><DDTM>20200924082928</DDTM><TYPE>KAKO</TYPE><STYP>CARM</STYP></META><GATHER_INFO AREA_ID=\"\t\t4600329012\" CHNL_NO=\"\t\t4600010005\" I_E_TYPE=\"I\" SEQ_NO=\"20200924082701000001\">\n" +
22 " <IC>\n" + 23 " <IC>\n" +
23 " <DR_IC_NO/>\n" + 24 " <DR_IC_NO/>\n" +
24 " <IC_DR_CUSTOMS_NO/>\n" + 25 " <IC_DR_CUSTOMS_NO/>\n" +
@@ -40,13 +40,13 @@ public class IMF_Tesk { @@ -40,13 +40,13 @@ public class IMF_Tesk {
40 /** 40 /**
41 * 往IMF发送报文 41 * 往IMF发送报文
42 */ 42 */
43 - if(!KAKO_Sender.isrunning){ 43 + /*if(!KAKO_Sender.isrunning){
44 KAKO_Sender kako_sender = new KAKO_Sender(client); 44 KAKO_Sender kako_sender = new KAKO_Sender(client);
45 kako_sender.start(); 45 kako_sender.start();
46 logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>"); 46 logger.info("<<<<<<<<<KAKO发送线程已开启>>>>>>>>>>>>");
47 }else { 47 }else {
48 logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>"); 48 logger.info("<<<<<<<<<KAKO发送线程已开启-不再启动线程>>>>>>>>>>>>");
49 - } 49 + }*/
50 50
51 } 51 }
52 if (!LOGIN_OK){ 52 if (!LOGIN_OK){
@@ -14,13 +14,13 @@ public class KAKO_Reader extends Thread{ @@ -14,13 +14,13 @@ public class KAKO_Reader extends Thread{
14 } 14 }
15 15
16 public void run() { 16 public void run() {
17 -  
18 try{ 17 try{
19 isrunning =true; 18 isrunning =true;
  19 + logger.info("********读取线程状态true**********");
20 while(true) { 20 while(true) {
21 - if (IMF_Tesk.LOGIN_OK) synchronized (this) { 21 + if (IMF_Tesk.LOGIN_OK){
22 String message = this.client.getMSG(); 22 String message = this.client.getMSG();
23 - 23 + logger.info("读取线程已获取到消息");
24 if (message != null) { 24 if (message != null) {
25 // logger.info(message); 25 // logger.info(message);
26 AnalysisRoute.analysis(message); 26 AnalysisRoute.analysis(message);
@@ -44,6 +44,8 @@ public class KAKO_Reader extends Thread{ @@ -44,6 +44,8 @@ public class KAKO_Reader extends Thread{
44 }catch (Exception e){ 44 }catch (Exception e){
45 isrunning=false; 45 isrunning=false;
46 logger.info("****************读取线程不在了****************"); 46 logger.info("****************读取线程不在了****************");
  47 + logger.info("解析消息出错----------->"+e.toString());
47 } 48 }
  49 + isrunning=false;
48 } 50 }
49 } 51 }
@@ -86,15 +86,19 @@ public class AnalysisRoute { @@ -86,15 +86,19 @@ public class AnalysisRoute {
86 GatherInfo info = gatherInfoAnalysis.toJavaBean(message); 86 GatherInfo info = gatherInfoAnalysis.toJavaBean(message);
87 if(info.getBarcode().length()>0){ 87 if(info.getBarcode().length()>0){
88 //LogicOperation.operation(info) 88 //LogicOperation.operation(info)
89 - if(LiftBar.liftBar(info)){  
90 - String type = null;  
91 - if("I".equals(info.getIetype())){  
92 - type="进入";  
93 - }else{  
94 - type="离开"; 89 + try {
  90 + if(LiftBar.liftBar(info)){
  91 + String type = null;
  92 + if("I".equals(info.getIetype())){
  93 + type="进入";
  94 + }else{
  95 + type="离开";
  96 + }
  97 + logger.info("进出站业务申请成功");
  98 + logger.info("------->>>>>>>"+info.getVename()+"已"+type+info.getAreaid()+"场站<<<<<<<-----");
95 } 99 }
96 - logger.info("进出站业务申请成功");  
97 - logger.info("------->>>>>>>"+info.getVename()+"已"+type+info.getAreaid()+"场站<<<<<<<-----"); 100 + } catch (InterruptedException e) {
  101 + e.printStackTrace();
98 } 102 }
99 }else{ 103 }else{
100 if("4604000000".equals(info.getAreaid())){ 104 if("4604000000".equals(info.getAreaid())){
@@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONArray; @@ -5,10 +5,7 @@ import com.alibaba.fastjson.JSONArray;
5 import com.sy.crossDomain.buildBarCode; 5 import com.sy.crossDomain.buildBarCode;
6 import com.sy.model.*; 6 import com.sy.model.*;
7 import com.sy.relation.VeManifestRelation; 7 import com.sy.relation.VeManifestRelation;
8 -import com.sy.service.EnterCancelServer;  
9 -import com.sy.service.LandBusListService;  
10 -import com.sy.service.LandRoadVeService;  
11 -import com.sy.service.ResMessageService; 8 +import com.sy.service.*;
12 import com.sy.socket.CommandClient; 9 import com.sy.socket.CommandClient;
13 import com.sy.utils.FileTool; 10 import com.sy.utils.FileTool;
14 import org.apache.http.HttpEntity; 11 import org.apache.http.HttpEntity;
@@ -19,6 +16,7 @@ import org.apache.http.impl.client.DefaultHttpClient; @@ -19,6 +16,7 @@ import org.apache.http.impl.client.DefaultHttpClient;
19 import org.apache.http.util.EntityUtils; 16 import org.apache.http.util.EntityUtils;
20 import org.apache.log4j.PropertyConfigurator; 17 import org.apache.log4j.PropertyConfigurator;
21 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
  19 +import org.springframework.scheduling.annotation.Async;
22 import org.springframework.stereotype.Component; 20 import org.springframework.stereotype.Component;
23 import org.apache.log4j.Logger; 21 import org.apache.log4j.Logger;
24 22
@@ -33,6 +31,7 @@ import java.text.DecimalFormat; @@ -33,6 +31,7 @@ import java.text.DecimalFormat;
33 import java.text.NumberFormat; 31 import java.text.NumberFormat;
34 import java.text.ParseException; 32 import java.text.ParseException;
35 import java.util.Date; 33 import java.util.Date;
  34 +import java.util.HashMap;
36 import java.util.List; 35 import java.util.List;
37 import java.util.Map; 36 import java.util.Map;
38 37
@@ -48,6 +47,10 @@ public class LiftBar { @@ -48,6 +47,10 @@ public class LiftBar {
48 private ResMessageService resMessageService;//查询运单放行表 47 private ResMessageService resMessageService;//查询运单放行表
49 @Autowired 48 @Autowired
50 private EnterCancelServer enterCancelServer;//调拨业务单独记录表 49 private EnterCancelServer enterCancelServer;//调拨业务单独记录表
  50 + @Autowired
  51 + private BusnesslistinfoService busnesslistinfoService;
  52 + @Autowired
  53 + BusnessViewService busnessViewService;
51 private static LiftBar logic = new LiftBar(); 54 private static LiftBar logic = new LiftBar();
52 //从配置文件中读取货物重差可控范围 55 //从配置文件中读取货物重差可控范围
53 private static String checkWt = FileTool.readProperties("grossWt"); 56 private static String checkWt = FileTool.readProperties("grossWt");
@@ -62,6 +65,8 @@ public class LiftBar { @@ -62,6 +65,8 @@ public class LiftBar {
62 private static String IEPORSE = "无相对应进出场申请"; 65 private static String IEPORSE = "无相对应进出场申请";
63 private static String FANGXING="有运单未放行"; 66 private static String FANGXING="有运单未放行";
64 67
  68 + @Autowired
  69 + private FeignService feignService;
65 @PostConstruct 70 @PostConstruct
66 public void init() { 71 public void init() {
67 logic = this; 72 logic = this;
@@ -69,13 +74,16 @@ public class LiftBar { @@ -69,13 +74,16 @@ public class LiftBar {
69 logic.veService = this.veService; 74 logic.veService = this.veService;
70 logic.resMessageService = this.resMessageService; 75 logic.resMessageService = this.resMessageService;
71 logic.enterCancelServer = this.enterCancelServer; 76 logic.enterCancelServer = this.enterCancelServer;
  77 + logic.feignService=this.feignService;
  78 + logic.busnesslistinfoService=this.busnesslistinfoService;
  79 + logic.busnessViewService=this.busnessViewService;
72 } 80 }
73 81
74 /** 82 /**
75 * @Param info 卡口采集数据 83 * @Param info 卡口采集数据
76 * @Result 计算卡口采集数据并发送报文 84 * @Result 计算卡口采集数据并发送报文
77 */ 85 */
78 - public static boolean liftBar(GatherInfo info) { 86 + public static boolean liftBar(GatherInfo info) throws InterruptedException {
79 PropertyConfigurator.configure("config/log4j.properties"); 87 PropertyConfigurator.configure("config/log4j.properties");
80 //默认返回值 88 //默认返回值
81 boolean result = false; 89 boolean result = false;
@@ -118,7 +126,9 @@ public class LiftBar { @@ -118,7 +126,9 @@ public class LiftBar {
118 if("I".equals(info.getIetype())){ 126 if("I".equals(info.getIetype())){
119 //进场申请宽进 127 //进场申请宽进
120 checkResult=true; 128 checkResult=true;
121 - }else{ 129 +
  130 + }
  131 + else{
122 //获取对应场站进场申请的货物重量,进场过磅重量 132 //获取对应场站进场申请的货物重量,进场过磅重量
123 List<LandBusinessTypeList> listWt=logic.listService.selectwt(list.getTrailerFrameNo(),list.getBarcode(),list.getEndstation(),"I"); 133 List<LandBusinessTypeList> listWt=logic.listService.selectwt(list.getTrailerFrameNo(),list.getBarcode(),list.getEndstation(),"I");
124 for(LandBusinessTypeList typeList:listWt){ 134 for(LandBusinessTypeList typeList:listWt){
@@ -133,7 +143,7 @@ public class LiftBar { @@ -133,7 +143,7 @@ public class LiftBar {
133 diffVal = inWt- growssWt; 143 diffVal = inWt- growssWt;
134 } 144 }
135 //判断场站出场是否要重量校验 145 //判断场站出场是否要重量校验
136 - if(FileTool.readProperties("station").equals(list.getEndstation())){ 146 + if(FileTool.readProperties("station").equals(list.getEndstation())||FileTool.readProperties("stationsf").equals(list.getEndstation())){
137 checkResult=true; 147 checkResult=true;
138 }else if(!"普通货".equals(list.getCocode())){ 148 }else if(!"普通货".equals(list.getCocode())){
139 checkResult=true; 149 checkResult=true;
@@ -183,6 +193,38 @@ public class LiftBar { @@ -183,6 +193,38 @@ public class LiftBar {
183 if(count==0){ 193 if(count==0){
184 buildBarCode.cancleBarCode(vaName); 194 buildBarCode.cancleBarCode(vaName);
185 } 195 }
  196 + /**
  197 + * 提前运抵判断
  198 + * 如果有提前运抵标识,判断是否分批,不分批直接通知
  199 + * 分批是否最后一批,最后一批通知
  200 + * */
  201 + if("I".equals(info.getIetype())){
  202 + try{
  203 + List<LAND_BUSINEESTYPE_LIST_INFO> arrive_infos=logic.busnesslistinfoService.selectarrvie(info.getBarcode());//查询是否提前运抵
  204 + if(arrive_infos!=null && arrive_infos.size()>0){
  205 + for (LAND_BUSINEESTYPE_LIST_INFO businees:arrive_infos) {
  206 + //判断运单是否分批
  207 + if ("0".equals(businees.getPartialidentity())){
  208 + logger.info("运单号{}不分批,不从通知数组删除");
  209 + }else { //分批后的处理
  210 + List<businesstypelistinfo_view> info_view=logic.busnessViewService.selectawb(businees.getAwba());
  211 + // 装载运单的分批车辆还有未入场的,从通知数组中删除他
  212 + if (info_view.size()>0){
  213 + arrive_infos.remove(businees);
  214 + }
  215 + }
  216 + }
  217 + //最后发送通知数组
  218 + try{
  219 + new LiftBar().sendMessage(info.getVename(),arrive_infos);
  220 + }catch (Exception e){
  221 + logger.info("新舱单发送消息异常---"+e.toString());
  222 + }
  223 + }
  224 + }catch (Exception e){
  225 + logger.info("运单分批消息异常---"+e.toString());
  226 + }
  227 + }
186 //调拨货冻结 228 //调拨货冻结
187 if (list.getBusinesstype().indexOf("业务") > 0) { 229 if (list.getBusinesstype().indexOf("业务") > 0) {
188 logic.inOrUpEnterCancel(list); 230 logic.inOrUpEnterCancel(list);
@@ -227,7 +269,7 @@ public class LiftBar { @@ -227,7 +269,7 @@ public class LiftBar {
227 * @param IEtype 269 * @param IEtype
228 */ 270 */
229 public static void sendData(String stationCode, String carNo, boolean IEtype) { 271 public static void sendData(String stationCode, String carNo, boolean IEtype) {
230 - String url = "http://10.50.3.73:8080/air-api/car/channelCar?stationCode=" + stationCode + "&carNo=" + carNo + "&isPickup=" + IEtype; 272 + String url = "http://10.50.3.73:8881/air-api/car/channelCar?stationCode=" + stationCode + "&carNo=" + carNo + "&isPickup=" + IEtype;
231 try { 273 try {
232 HttpClient httpClient = new DefaultHttpClient(); 274 HttpClient httpClient = new DefaultHttpClient();
233 HttpGet httpGet = new HttpGet(url); 275 HttpGet httpGet = new HttpGet(url);
@@ -262,7 +304,11 @@ public class LiftBar { @@ -262,7 +304,11 @@ public class LiftBar {
262 } 304 }
263 //TODO:加场站判定 305 //TODO:加场站判定
264 } 306 }
265 - sendData(sationCode, list.getTrailerFrameNo(), flag); 307 + try{
  308 + sendData(sationCode, list.getTrailerFrameNo(), flag);
  309 + }catch (Exception e){
  310 + logger.info("码头发送消息异常---"+e.toString());
  311 + }
266 } 312 }
267 /** 313 /**
268 * 查询运单是否全部放行 314 * 查询运单是否全部放行
@@ -390,7 +436,7 @@ public class LiftBar { @@ -390,7 +436,7 @@ public class LiftBar {
390 logger.info("访问返回的数据重量:" + bg); 436 logger.info("访问返回的数据重量:" + bg);
391 in.close(); 437 in.close();
392 } catch (MalformedURLException e) { 438 } catch (MalformedURLException e) {
393 - e.printStackTrace(); 439 + logger.info("运单放行消息异常---"+e.toString());
394 logger.error(e); 440 logger.error(e);
395 } catch (IOException e) { 441 } catch (IOException e) {
396 e.printStackTrace(); 442 e.printStackTrace();
@@ -422,7 +468,7 @@ public class LiftBar { @@ -422,7 +468,7 @@ public class LiftBar {
422 try { 468 try {
423 m = nf.parse(checkWt);//将百分数转换成Number类型 469 m = nf.parse(checkWt);//将百分数转换成Number类型
424 } catch (ParseException e) { 470 } catch (ParseException e) {
425 - e.printStackTrace(); 471 + logger.info("重量校验消息异常---"+e.toString());
426 logger.info(e.getMessage()); 472 logger.info(e.getMessage());
427 } 473 }
428 return m.doubleValue(); 474 return m.doubleValue();
@@ -478,6 +524,22 @@ public class LiftBar { @@ -478,6 +524,22 @@ public class LiftBar {
478 } 524 }
479 } 525 }
480 } 526 }
481 - 527 + /**
  528 + * 为提前运抵服务发送数据
  529 + *
  530 + * @param
  531 + * @param
  532 + * @return
  533 + */
  534 + @Async("asyncPoolTaskExecutor")
  535 + public void sendMessage(String vname, List<LAND_BUSINEESTYPE_LIST_INFO> list_infos)throws InterruptedException{
  536 + logger.info("新舱单发送服务开始");
  537 + AdvanceArrive arrive=new AdvanceArrive();
  538 + arrive.setVname(vname);
  539 + arrive.setMasterList(list_infos);
  540 + logger.info("新舱单发送服务数据",arrive);
  541 + Map<String,Object> map=logic.feignService.sendMessage(arrive);
  542 + logger.info(""+map);
  543 + }
482 } 544 }
483 545
  1 +package com.sy.model;
  2 +
  3 +import java.util.List;
  4 +
  5 +public class AdvanceArrive extends Throwable {
  6 + private String vname;
  7 + private List<LAND_BUSINEESTYPE_LIST_INFO> masterList;
  8 +
  9 + public String getVname() {
  10 + return vname;
  11 + }
  12 +
  13 + public void setVname(String vname) {
  14 + this.vname = vname;
  15 + }
  16 +
  17 + public List<LAND_BUSINEESTYPE_LIST_INFO> getMasterList() {
  18 + return masterList;
  19 + }
  20 +
  21 + public void setMasterList(List<LAND_BUSINEESTYPE_LIST_INFO> masterList) {
  22 + this.masterList = masterList;
  23 + }
  24 +}
  1 +package com.sy.service;
  2 +
  3 +import com.sy.model.businesstypelistinfo_view;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface BusnessViewService {
  8 + List<businesstypelistinfo_view> selectawb(String awba);
  9 +}
  1 +package com.sy.service;
  2 +
  3 +import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface BusnesslistinfoService {
  8 + List<LAND_BUSINEESTYPE_LIST_INFO> selectarrvie(String applicationformid);
  9 + List<LAND_BUSINEESTYPE_LIST_INFO> selectpartialidentity(String applicationformid);
  10 +}
  1 +package com.sy.service;
  2 +
  3 +import com.sy.model.AdvanceArrive;
  4 +import com.sy.service.impl.MessageServiceHystrix;
  5 +import org.springframework.cloud.openfeign.FeignClient;
  6 +import org.springframework.stereotype.Component;
  7 +import org.springframework.web.bind.annotation.PostMapping;
  8 +
  9 +import java.util.Map;
  10 +
  11 +@Component
  12 +@FeignClient(value = "wlpt-nmms-manage",fallback = MessageServiceHystrix.class)
  13 +public interface FeignService {
  14 + @PostMapping("/arrive/forkako")
  15 + Map<String,Object> sendMessage(AdvanceArrive arrive);
  16 +}
  1 +package com.sy.service.impl;
  2 +
  3 +import com.sy.mapper.businesstypelistinfo_viewMapper;
  4 +import com.sy.model.businesstypelistinfo_view;
  5 +import com.sy.service.BusnessViewService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class BusnessViewImpl implements BusnessViewService {
  13 + @Autowired
  14 + businesstypelistinfo_viewMapper businesstypelistinfo_viewMapper;
  15 + @Override
  16 + public List<businesstypelistinfo_view> selectawb(String awba) {
  17 + return businesstypelistinfo_viewMapper.selectawb(awba);
  18 + }
  19 +}
  1 +package com.sy.service.impl;
  2 +
  3 +import com.sy.mapper.LAND_BUSINEESTYPE_LIST_INFOMapper;
  4 +import com.sy.model.LAND_BUSINEESTYPE_LIST_INFO;
  5 +import com.sy.service.BusnesslistinfoService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class BusnesslistinfoImpl implements BusnesslistinfoService {
  13 + @Autowired
  14 + LAND_BUSINEESTYPE_LIST_INFOMapper list_infoMapper;
  15 + @Override
  16 + public List<LAND_BUSINEESTYPE_LIST_INFO> selectarrvie(String applicationformid) {
  17 + return list_infoMapper.selectarrive(applicationformid);
  18 + }
  19 +
  20 + @Override
  21 + public List<LAND_BUSINEESTYPE_LIST_INFO> selectpartialidentity(String applicationformid) {
  22 + return list_infoMapper.selectpartialidentity(applicationformid);
  23 + }
  24 +}
  1 +package com.sy.service.impl;
  2 +
  3 +import com.sy.model.AdvanceArrive;
  4 +import com.sy.service.FeignService;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * @author
  13 + * @time 2020-03-05 11:45
  14 + * @desc
  15 + * @email vokes0069@163.com
  16 + */
  17 +@Service
  18 +public class MessageServiceHystrix implements FeignService {
  19 +
  20 + private static final Logger logger = LoggerFactory.getLogger(MessageServiceHystrix.class);
  21 +
  22 +
  23 + @Override
  24 + public Map<String, Object> sendMessage(AdvanceArrive arrive) {
  25 + logger.info("发送数据成功",arrive);
  26 + return null;
  27 + }
  28 +}
  1 +package com.sy.utils;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
  6 +
  7 +import java.util.concurrent.ThreadPoolExecutor;
  8 +
  9 +@Configuration
  10 +public class Config {
  11 + @Bean(name = "asyncPoolTaskExecutor")
  12 + public ThreadPoolTaskExecutor getAsyncThreadPoolTaskExecutor() {
  13 + ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
  14 + taskExecutor.setCorePoolSize(20);
  15 + taskExecutor.setMaxPoolSize(200);
  16 + taskExecutor.setQueueCapacity(25);
  17 + taskExecutor.setKeepAliveSeconds(200);
  18 + taskExecutor.setThreadNamePrefix("oKong-");
  19 + // 线程池对拒绝任务(无线程可用)的处理策略,目前只支持AbortPolicy、CallerRunsPolicy;默认为后者
  20 + taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
  21 + //调度器shutdown被调用时等待当前被调度的任务完成
  22 + taskExecutor.setWaitForTasksToCompleteOnShutdown(true);
  23 + //等待时长
  24 + taskExecutor.setAwaitTerminationSeconds(60);
  25 + taskExecutor.initialize();
  26 + return taskExecutor;
  27 + }
  28 +}
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> 4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5 <generatorConfiguration> 5 <generatorConfiguration>
6 <classPathEntry 6 <classPathEntry
7 - location="E:\java\mavenRepository\mysql\mysql-connector-java\5.1.37\mysql-connector-java-5.1.37.jar"/> 7 + location="/Users/xuyonghui/XYH/MAVEN/mysql-connector-java-5.1.38.jar"/>
8 <context id="DB2Tables" targetRuntime="MyBatis3"> 8 <context id="DB2Tables" targetRuntime="MyBatis3">
9 <commentGenerator> 9 <commentGenerator>
10 <property name="suppressDate" value="true"/> 10 <property name="suppressDate" value="true"/>
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 </commentGenerator> 13 </commentGenerator>
14 <!--数据库链接URL,用户名、密码 --> 14 <!--数据库链接URL,用户名、密码 -->
15 <jdbcConnection driverClass="com.mysql.jdbc.Driver" 15 <jdbcConnection driverClass="com.mysql.jdbc.Driver"
16 - connectionURL="jdbc:mysql://localhost:3306/station"  
17 - userId="root" password="root"> 16 + connectionURL="jdbc:mysql://118.31.66.166:3306/station"
  17 + userId="110" password="QAHqCJf2kFYCLirM">
18 </jdbcConnection> 18 </jdbcConnection>
19 <javaTypeResolver> 19 <javaTypeResolver>
20 <property name="forceBigDecimals" value="false"/> 20 <property name="forceBigDecimals" value="false"/>
@@ -78,9 +78,9 @@ @@ -78,9 +78,9 @@
78 enableUpdateByExample="false" 78 enableUpdateByExample="false"
79 enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> 79 enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">
80 </table>--> 80 </table>-->
81 - <table tableName="t_air_repertory" domainObjectName="T_AIR_REPERTORY" enableCountByExample="false" 81 + <table tableName="businesstypelistinfo_view" domainObjectName="businesstypelistinfo_view" enableCountByExample="false"
82 enableUpdateByExample="false" 82 enableUpdateByExample="false"
83 enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> 83 enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">
84 </table> 84 </table>
85 </context> 85 </context>
86 -</generatorConfiguration>  
  86 +</generatorConfiguration>