作者 朱兆平

抬杆指令逻辑继续优化.

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