作者 朱兆平

抬杆指令逻辑继续优化.

@@ -5,7 +5,7 @@ server.port=8848 @@ -5,7 +5,7 @@ server.port=8848
5 eureka.client.service-url.defaultZone=http://192.168.1.53:12345/eureka/ 5 eureka.client.service-url.defaultZone=http://192.168.1.53:12345/eureka/
6 6
7 spring.application.name=kako_analysisforstation 7 spring.application.name=kako_analysisforstation
8 - 8 +spring.cloud.service-registry.auto-registration.enabled=false
9 9
10 spring.devtools.restart.enabled=true 10 spring.devtools.restart.enabled=true
11 11
@@ -66,5 +66,5 @@ wharf.interface.host=http://10.50.3.66:1983/ @@ -66,5 +66,5 @@ wharf.interface.host=http://10.50.3.66:1983/
66 #新舱单运单查询数据接口,注意尾部带/符号 66 #新舱单运单查询数据接口,注意尾部带/符号
67 nmms.interface.host=http://10.50.3.82:8081/ 67 nmms.interface.host=http://10.50.3.82:8081/
68 #新舱单网站内网接口,注意尾部带/符号 68 #新舱单网站内网接口,注意尾部带/符号
69 -nmms.site.host=https://nmms.zzcargo.com:8443/ 69 +nmms.site.host=http://nmms1.15miaoo.com:17999
70 custom.receptDirectory= bw/read/ 70 custom.receptDirectory= bw/read/
@@ -8,7 +8,7 @@ sendDirectory=D:/bw/sendDirectory @@ -8,7 +8,7 @@ sendDirectory=D:/bw/sendDirectory
8 #\u63A5\u6536\u5B58\u50A8\u62A5\u6587\u76EE\u5F55 8 #\u63A5\u6536\u5B58\u50A8\u62A5\u6587\u76EE\u5F55
9 receiveDirectory=D:/bw/receiveDirectory 9 receiveDirectory=D:/bw/receiveDirectory
10 #\u8F66\u5355\u5173\u7CFB\u62A5\u6587\u76EE\u5F55 10 #\u8F66\u5355\u5173\u7CFB\u62A5\u6587\u76EE\u5F55
11 -veManifestDirectory=D:/bw/veManifestDirectory/ 11 +veManifestDirectory=bw/veManifestDirectory/
12 12
13 #IMF MEAT\u62A5\u5934\u914D\u7F6E 13 #IMF MEAT\u62A5\u5934\u914D\u7F6E
14 RCVR= 14 RCVR=
1 -log4j.rootLogger=ERROR, stdout, fileout 1 +log4j.rootLogger=INFO, stdout, fileout, E
2 2
3 log4j.logger.com.fiscal = INFO 3 log4j.logger.com.fiscal = INFO
4 #******************************* 4 #*******************************
@@ -17,7 +17,7 @@ log4j.appender.fileout.layout=org.apache.log4j.PatternLayout @@ -17,7 +17,7 @@ log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
17 log4j.appender.fileout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n 17 log4j.appender.fileout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n
18 18
19 ### 输出ERROR 级别以上的日志到=E://logs/error.log ### 19 ### 输出ERROR 级别以上的日志到=E://logs/error.log ###
20 -log4j.appender.E = org.apache.log4j.DailyRollingFileAppender 20 +log4j.appender.E = org.apache.log4j.RollingFileAppender
21 log4j.appender.E.File = logs/error.log 21 log4j.appender.E.File = logs/error.log
22 log4j.appender.E.MaxFileSize = 50MB 22 log4j.appender.E.MaxFileSize = 50MB
23 log4j.appender.E.MaxBackupIndex = 10 23 log4j.appender.E.MaxBackupIndex = 10
@@ -27,14 +27,14 @@ public class KAKO_Reader extends Thread{ @@ -27,14 +27,14 @@ public class KAKO_Reader extends Thread{
27 logger.info("********Client-INFO= "+client+"********"); 27 logger.info("********Client-INFO= "+client+"********");
28 Thread t =Thread.currentThread(); 28 Thread t =Thread.currentThread();
29 ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou"); 29 ThreadPoolExecutor threadPoolEs = XMLThreadPoolFactory.instance("kakou");
  30 + AnalysisRoute analysisRoute= null;
30 while(true) { 31 while(true) {
31 if (IMF_Tesk.LOGIN_OK){ 32 if (IMF_Tesk.LOGIN_OK){
32 String message = this.client.getMSG(); 33 String message = this.client.getMSG();
33 logger.info(t.toString()+"读取线程已获取到消息"); 34 logger.info(t.toString()+"读取线程已获取到消息");
34 - if (message != null && StringUtils.isNotEmpty(message)) { 35 + if (StringUtils.isNotEmpty(message)) {
35 // logger.info(message); 36 // logger.info(message);
36 -  
37 - AnalysisRoute analysisRoute=new AnalysisRoute(); 37 + analysisRoute = new AnalysisRoute();
38 analysisRoute.setMessage(message); 38 analysisRoute.setMessage(message);
39 threadPoolEs.execute(analysisRoute); 39 threadPoolEs.execute(analysisRoute);
40 logger.info("[THREADPOOL-INFO]-当前运行线程总数量: " + threadPoolEs.getActiveCount()); 40 logger.info("[THREADPOOL-INFO]-当前运行线程总数量: " + threadPoolEs.getActiveCount());
@@ -182,6 +182,10 @@ public class LiftBar { @@ -182,6 +182,10 @@ public class LiftBar {
182 } 182 }
183 diffVal = inWt- growssWt; 183 diffVal = inWt- growssWt;
184 } 184 }
  185 + if (Double.doubleToLongBits(goodsWt)==Double.doubleToLongBits(0.0)){
  186 + goodsWt = Double.parseDouble(list.getRemark());
  187 + }
  188 + //TODO:进场校验 增加 车辆备案重量要 <= 进场过磅重量 ,要有误差判定
185 189
186 log4.info("[CHECK-INFO]-出场过磅重量:{}-申报装载货物重量:{}-入场过磅重量:{}-进出差值:{}-车重:{}",growssWt,goodsWt,inWt,diffVal,ve.getSelfWt()); 190 log4.info("[CHECK-INFO]-出场过磅重量:{}-申报装载货物重量:{}-入场过磅重量:{}-进出差值:{}-车重:{}",growssWt,goodsWt,inWt,diffVal,ve.getSelfWt());
187 191
@@ -292,10 +296,10 @@ public class LiftBar { @@ -292,10 +296,10 @@ public class LiftBar {
292 296
293 } 297 }
294 298
295 - //发送抬杆指令  
296 -// boolean commandResult = logic.sendBw(info, checkResult); 299 + //发送抬杆指令,todo:生产环境去掉下面注释
  300 + boolean commandResult = logic.sendBw(info, checkResult);
297 //fortest 正式环境删除 301 //fortest 正式环境删除
298 - boolean commandResult = true; 302 +// boolean commandResult = true;
299 if(commandResult){//发送抬杆儿报文 303 if(commandResult){//发送抬杆儿报文
300 if ("I".equals(info.getIetype())) { 304 if ("I".equals(info.getIetype())) {
301 //过卡重量 305 //过卡重量
@@ -533,8 +537,9 @@ public class LiftBar { @@ -533,8 +537,9 @@ public class LiftBar {
533 if (!(waybill.indexOf("-") != -1)) { 537 if (!(waybill.indexOf("-") != -1)) {
534 waybill = waybill.substring(0, 3) + "-" + waybill.substring(3); 538 waybill = waybill.substring(0, 3) + "-" + waybill.substring(3);
535 } 539 }
536 -// String url = logic.nmmsHost+"orig/orig?waybill=" + waybill + "&imp=" + imp;  
537 - String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp; 540 + //todo:生产环境用下面这个
  541 + String url = logic.nmmsHost+"orig/orig?waybill=" + waybill + "&imp=" + imp;
  542 +// String url = "http://tjfx.15miaoo.com:8003/tj/orig/orig?waybill=" + waybill + "&imp=" + imp;
538 StringBuilder json = new StringBuilder(); 543 StringBuilder json = new StringBuilder();
539 Map map = null; 544 Map map = null;
540 double bg = 0; 545 double bg = 0;
@@ -13,9 +13,10 @@ import java.util.Map; @@ -13,9 +13,10 @@ import java.util.Map;
13 13
14 /** 14 /**
15 * @author mrz 15 * @author mrz
  16 + * todo:生产要把这里改成内网舱单地址,已更新为在配置文件改
16 */ 17 */
17 @Component 18 @Component
18 -@FeignClient(name = "nmmsFeign",url = "http://nmms1.15miaoo.com:17999",fallback = NmmsServiceHystrix.class) 19 +@FeignClient(name = "nmmsFeign",url = "${nmms.site.host}",fallback = NmmsServiceHystrix.class)
19 public interface NmmsService { 20 public interface NmmsService {
20 21
21 @ResponseBody 22 @ResponseBody
@@ -5,6 +5,7 @@ import org.slf4j.Logger; @@ -5,6 +5,7 @@ import org.slf4j.Logger;
5 import org.slf4j.LoggerFactory; 5 import org.slf4j.LoggerFactory;
6 import org.springframework.stereotype.Service; 6 import org.springframework.stereotype.Service;
7 7
  8 +import java.util.HashMap;
8 import java.util.Map; 9 import java.util.Map;
9 10
10 @Service 11 @Service
@@ -14,6 +15,6 @@ public class NmmsServiceHystrix implements NmmsService { @@ -14,6 +15,6 @@ public class NmmsServiceHystrix implements NmmsService {
14 @Override 15 @Override
15 public Map<String, Object> getAllocate(String waybill, int pageIndex, int pageSize) { 16 public Map<String, Object> getAllocate(String waybill, int pageIndex, int pageSize) {
16 logger.error("查询分拨申请数据失败,{}",waybill); 17 logger.error("查询分拨申请数据失败,{}",waybill);
17 - return null; 18 + return new HashMap<>();
18 } 19 }
19 } 20 }
@@ -71,7 +71,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -71,7 +71,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
71 double result= 0.0; 71 double result= 0.0;
72 //以防万一 空车离场判定 72 //以防万一 空车离场判定
73 double result2= 0.0; 73 double result2= 0.0;
74 - if(grossWt>0){ 74 + if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
75 result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); 75 result = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt));
76 System.out.println("进出场比对差值:"+result); 76 System.out.println("进出场比对差值:"+result);
77 result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); 77 result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt));
@@ -99,9 +99,9 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -99,9 +99,9 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
99 public boolean checkImportDlv(double grossWt, double wt, double goodsWt,double inWt){ 99 public boolean checkImportDlv(double grossWt, double wt, double goodsWt,double inWt){
100 DecimalFormat df = new DecimalFormat("0.00"); 100 DecimalFormat df = new DecimalFormat("0.00");
101 boolean flag = false; 101 boolean flag = false;
102 - double result= 0.0;  
103 - double result1= 0.0;  
104 - if(grossWt>0){ 102 + double result= 0.00;
  103 + double result1= 0.00;
  104 + if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
105 //进场过磅重量+带货重量 = 出场过磅重量 105 //进场过磅重量+带货重量 = 出场过磅重量
106 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); 106 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
107 107
@@ -119,11 +119,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -119,11 +119,12 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
119 flag = true; 119 flag = true;
120 } 120 }
121 121
122 - //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭  
123 - if (result1 <= range) { 122 +// //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭
  123 +// if (result1 <= range) {
  124 +//
  125 +// return true;
  126 +// }
124 127
125 - return true;  
126 - }  
127 return flag; 128 return flag;
128 } 129 }
129 130
@@ -141,17 +142,18 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { @@ -141,17 +142,18 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService {
141 */ 142 */
142 @Override 143 @Override
143 public boolean checkAllocateOrDispatch(double grossWt, double wt, double goodsWt,double inWt){ 144 public boolean checkAllocateOrDispatch(double grossWt, double wt, double goodsWt,double inWt){
  145 + //todo:调拨分拨中的第二.三...场站的如卡口判断 都应该以带货入场进行判定.离场都应该已空车进行判定.
144 DecimalFormat df = new DecimalFormat("0.00"); 146 DecimalFormat df = new DecimalFormat("0.00");
145 boolean flag = false; 147 boolean flag = false;
146 //载货离场判定 148 //载货离场判定
147 - double result= 0.0; 149 + double result= 0.00;
148 //空车离场判定 150 //空车离场判定
149 - double result2= 0.0; 151 + double result2= 0.00;
150 152
151 //卸货离场判定 153 //卸货离场判定
152 - double result3= 0.0; 154 + double result3= 0.00;
153 155
154 - if(grossWt>0){ 156 + if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){
155 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); 157 result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt));
156 result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt)); 158 result2 = Double.parseDouble(df.format(Math.abs((grossWt-wt)) / grossWt));
157 result3 = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt)); 159 result3 = Double.parseDouble(df.format(Math.abs((inWt - goodsWt - grossWt)) / grossWt));
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </select> 25 </select>
26 <select id="selectByManifestList" resultMap="BaseResultMap"> 26 <select id="selectByManifestList" resultMap="BaseResultMap">
27 select 27 select
28 - <include refid="Base_Column_List" /> 28 + distinct Manifest
29 from resmessage 29 from resmessage
30 where Manifest in 30 where Manifest in
31 <foreach collection="array" item="manifest" index="index" open="(" close=")" separator=","> 31 <foreach collection="array" item="manifest" index="index" open="(" close=")" separator=",">