正在显示
5 个修改的文件
包含
91 行增加
和
22 行删除
@@ -7,7 +7,6 @@ | @@ -7,7 +7,6 @@ | ||
7 | <artifactId>analysis_imf</artifactId> | 7 | <artifactId>analysis_imf</artifactId> |
8 | <version>3.0-G2-SNAPSHOT</version> | 8 | <version>3.0-G2-SNAPSHOT</version> |
9 | <packaging>jar</packaging> | 9 | <packaging>jar</packaging> |
10 | - | ||
11 | <name>analysis_imf</name> | 10 | <name>analysis_imf</name> |
12 | <description>北货集成金二抬杆指令判定</description> | 11 | <description>北货集成金二抬杆指令判定</description> |
13 | 12 |
@@ -22,6 +22,18 @@ public interface WeightCheckHandleService { | @@ -22,6 +22,18 @@ public interface WeightCheckHandleService { | ||
22 | boolean checkExportDownLoading(double grossWt, double wt, double goodsWt,double inWt); | 22 | boolean checkExportDownLoading(double grossWt, double wt, double goodsWt,double inWt); |
23 | 23 | ||
24 | /** | 24 | /** |
25 | + * 进口普货提货业务,入场时的数据校验 | ||
26 | + * 校验入场重量是否等于车辆备案重量 | ||
27 | + * @param grossWt 地磅称重,也称出场过磅重量 | ||
28 | + * @param wt 车辆自重 | ||
29 | + * @param goodsWt 货物总重 | ||
30 | + * @param inWt 进场过磅重量 | ||
31 | + * 误差计算方式 (应该出场重量 - 出场重量) / 出场重量 与 误差比对,超过误差则不放行 | ||
32 | + * @return 返回校验结果 true 通过,false 不通过 | ||
33 | + */ | ||
34 | + boolean checkImportAtCheckIN(double grossWt, double wt, double goodsWt,double inWt); | ||
35 | + | ||
36 | + /** | ||
25 | * 进口普货提货业务重量校验,可支持 带货提货,不支持卸货提货 | 37 | * 进口普货提货业务重量校验,可支持 带货提货,不支持卸货提货 |
26 | * 进口转关业务重量校验 | 38 | * 进口转关业务重量校验 |
27 | * 进场重量+载货重量 = 出场重量 | 39 | * 进场重量+载货重量 = 出场重量 |
@@ -45,6 +45,8 @@ public class GatherInfoHandle implements GatherInfoService { | @@ -45,6 +45,8 @@ public class GatherInfoHandle implements GatherInfoService { | ||
45 | private static String NOGrossWt = "过磅重量异常"; | 45 | private static String NOGrossWt = "过磅重量异常"; |
46 | private static String BLACKLIST= "车辆已被拉进黑名单,不允许出区"; | 46 | private static String BLACKLIST= "车辆已被拉进黑名单,不允许出区"; |
47 | private static String CHANEL_ERR= "无对应通道流转申请,走错通道"; | 47 | private static String CHANEL_ERR= "无对应通道流转申请,走错通道"; |
48 | + private static String TUIKU= "车辆装载有退库货物,人工放行"; | ||
49 | + private static String CHECKINNOEMPTY= "提货业务禁止非空车驶入"; | ||
48 | 50 | ||
49 | 51 | ||
50 | @Autowired | 52 | @Autowired |
@@ -177,8 +179,22 @@ public class GatherInfoHandle implements GatherInfoService { | @@ -177,8 +179,22 @@ public class GatherInfoHandle implements GatherInfoService { | ||
177 | } | 179 | } |
178 | //入区核放 | 180 | //入区核放 |
179 | if(chanelInCheck()){ | 181 | if(chanelInCheck()){ |
180 | - pass(); | ||
181 | - log.info("[X21-SUCCESS]:[IN]-车辆入区直接放行"); | 182 | + |
183 | + switch (landBusinessTypeList.getBusinesstype()){ | ||
184 | + case "进口转关": | ||
185 | + case "进口提货": | ||
186 | + if (gatherInfoHandle.weightCheckHandleService.checkImportAtCheckIN(growssWt, selfWt, goodsWt,inWt)){ | ||
187 | + pass(); | ||
188 | + log.info("[X21-SUCCESS]:[IN]-进口提货放行"); | ||
189 | + }else{ | ||
190 | + sendBw(info,false,CHECKINNOEMPTY,landBusinessTypeList,listinfos); | ||
191 | + log.info("[X21-ERR]:[IN]-进口提货-费空车驶入"); | ||
192 | + } | ||
193 | + break; | ||
194 | + default: | ||
195 | + pass(); | ||
196 | + log.info("[X21-SUCCESS]:[IN]-车辆入区直接放行"); | ||
197 | + } | ||
182 | 198 | ||
183 | /** | 199 | /** |
184 | * 华东区内流转-进口分拨核销部分. | 200 | * 华东区内流转-进口分拨核销部分. |
@@ -388,7 +404,9 @@ public class GatherInfoHandle implements GatherInfoService { | @@ -388,7 +404,9 @@ public class GatherInfoHandle implements GatherInfoService { | ||
388 | private boolean goodsWhiteListCheck(){ | 404 | private boolean goodsWhiteListCheck(){ |
389 | if(!"普通货物".equals(landBusinessTypeList.getCocode()) | 405 | if(!"普通货物".equals(landBusinessTypeList.getCocode()) |
390 | && !"转关货物".equals(landBusinessTypeList.getCocode()) | 406 | && !"转关货物".equals(landBusinessTypeList.getCocode()) |
391 | - && !"退库货物".equals(landBusinessTypeList.getCocode()) ) { | 407 | + && !"退库货物".equals(landBusinessTypeList.getCocode()) |
408 | + && !"换单货物".equals(landBusinessTypeList.getCocode()) | ||
409 | + ) { | ||
392 | //todo:比如货物类型为快件货物,只走重量校验,不走放行信息等校验. | 410 | //todo:比如货物类型为快件货物,只走重量校验,不走放行信息等校验. |
393 | //todo:退库货物可以关联货运系统,得到退库信息进行比对 | 411 | //todo:退库货物可以关联货运系统,得到退库信息进行比对 |
394 | //todo:查验货物走查验信息比对 | 412 | //todo:查验货物走查验信息比对 |
@@ -481,12 +499,14 @@ public class GatherInfoHandle implements GatherInfoService { | @@ -481,12 +499,14 @@ public class GatherInfoHandle implements GatherInfoService { | ||
481 | case "进口转关": | 499 | case "进口转关": |
482 | case "进口提货": | 500 | case "进口提货": |
483 | if (gatherInfoHandle.weightCheckHandleService.checkImportDlv(growssWt, selfWt, goodsWt,inWt)){ | 501 | if (gatherInfoHandle.weightCheckHandleService.checkImportDlv(growssWt, selfWt, goodsWt,inWt)){ |
484 | - if ("退库货物".equals(landBusinessTypeList.getCocode())){ | 502 | + if ("退库货物".equals(landBusinessTypeList.getCocode()) || "换单货物".equals(landBusinessTypeList.getCocode())){ |
485 | /** | 503 | /** |
486 | * 退库货物不校验运单放行. | 504 | * 退库货物不校验运单放行. |
505 | + * @chenageNew 退库货物不自动抬杆放行,改为人工验放模式 | ||
487 | */ | 506 | */ |
488 | - log.info("[退库业务]-重量核验通过."); | ||
489 | - return true; | 507 | + log.info("[退库业务]-人工验放模式."); |
508 | + sendBw(info,false,TUIKU,landBusinessTypeList,listinfos); | ||
509 | + return false; | ||
490 | }else{ | 510 | }else{ |
491 | //检查运单放行 | 511 | //检查运单放行 |
492 | if (gatherInfoHandle.resMessageService.checkManifestRelease(info,listinfos)){ | 512 | if (gatherInfoHandle.resMessageService.checkManifestRelease(info,listinfos)){ |
@@ -63,6 +63,17 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -63,6 +63,17 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
63 | */ | 63 | */ |
64 | @Override | 64 | @Override |
65 | public boolean checkExportDownLoading(double grossWt, double wt, double goodsWt, double inWt){ | 65 | public boolean checkExportDownLoading(double grossWt, double wt, double goodsWt, double inWt){ |
66 | + | ||
67 | + /** | ||
68 | + * 异常情况判定 | ||
69 | + * 送货业务的入场重量必须大于离场重量 | ||
70 | + * 比如申请单申请的时候本来是进口提货 申请成出口送货 | ||
71 | + */ | ||
72 | + if (inWt<grossWt){ | ||
73 | + log.info("出区重量比入区重量大,信息异常"); | ||
74 | + return false; | ||
75 | + } | ||
76 | + | ||
66 | DecimalFormat df = new DecimalFormat("0.00"); | 77 | DecimalFormat df = new DecimalFormat("0.00"); |
67 | boolean flag = false; | 78 | boolean flag = false; |
68 | //卸货判定 | 79 | //卸货判定 |
@@ -77,12 +88,37 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -77,12 +88,37 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
77 | log.info("[WEIGHT-CHECK]-进出场比对差值:{},空车出场差值:{},进出场比对重量差:{},空车比对重量差:{}",result,result2,Math.abs(inWt - goodsWt - grossWt),Math.abs(grossWt-wt)); | 88 | log.info("[WEIGHT-CHECK]-进出场比对差值:{},空车出场差值:{},进出场比对重量差:{},空车比对重量差:{}",result,result2,Math.abs(inWt - goodsWt - grossWt),Math.abs(grossWt-wt)); |
78 | } | 89 | } |
79 | double range = valueDob(); | 90 | double range = valueDob(); |
80 | - if (result <= range || result2 <= range) { | 91 | + |
92 | + //车辆离场重量与车辆备案重量验放,只允许空车离场 | ||
93 | + if (result2 <= range) { | ||
81 | flag = true; | 94 | flag = true; |
82 | } | 95 | } |
96 | +// | ||
97 | +// if (result <= range || result2 <= range) { | ||
98 | +// flag = true; | ||
99 | +// } | ||
83 | return flag; | 100 | return flag; |
84 | } | 101 | } |
85 | 102 | ||
103 | + | ||
104 | + @Override | ||
105 | + public boolean checkImportAtCheckIN(double grossWt, double wt, double goodsWt, double inWt){ | ||
106 | + double emptyIN= 0.00; | ||
107 | + DecimalFormat df = new DecimalFormat("0.00"); | ||
108 | + if(Double.doubleToLongBits(grossWt)>Double.doubleToLongBits(0)){ | ||
109 | + //空车入场判定,入场重量-车辆备案重量 | ||
110 | + emptyIN = Double.parseDouble(df.format(Math.abs((wt - grossWt)) / grossWt)); | ||
111 | + | ||
112 | + double range = valueDob(); | ||
113 | + | ||
114 | + if (emptyIN <= range) { | ||
115 | + log.info("[WEIGHT-CHECK]-进口提货入口重量验放:入场重量{},车辆备案重量:{},差值:{}",grossWt,wt,emptyIN); | ||
116 | + return true; | ||
117 | + } | ||
118 | + } | ||
119 | + | ||
120 | + return false; | ||
121 | + } | ||
86 | /** | 122 | /** |
87 | * 进口普货提货业务重量校验,可支持 带货提货,不支持卸货提货 | 123 | * 进口普货提货业务重量校验,可支持 带货提货,不支持卸货提货 |
88 | * 进口转关业务重量校验 | 124 | * 进口转关业务重量校验 |
@@ -107,7 +143,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -107,7 +143,7 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
107 | //进场过磅重量+带货重量 = 出场过磅重量 | 143 | //进场过磅重量+带货重量 = 出场过磅重量 |
108 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); | 144 | result = Double.parseDouble(df.format(Math.abs((inWt + goodsWt - grossWt)) / grossWt)); |
109 | 145 | ||
110 | - //todo:这里没有加空车离场判定,暂时不加,进口提货业务空车离场走空车验放判定系统. | 146 | + //带货提货,不提货判定,非空车离场 |
111 | result2 = Double.parseDouble(df.format(Math.abs((inWt - grossWt)) / grossWt)); | 147 | result2 = Double.parseDouble(df.format(Math.abs((inWt - grossWt)) / grossWt)); |
112 | 148 | ||
113 | //个别原因不提货了,空车离场 | 149 | //个别原因不提货了,空车离场 |
@@ -116,25 +152,28 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | @@ -116,25 +152,28 @@ public class WeightCheckHandleServiceImpl implements WeightCheckHandleService { | ||
116 | //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 | 152 | //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 |
117 | result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt)); | 153 | result1 = Double.parseDouble(df.format(Math.abs((wt + goodsWt - grossWt)) / grossWt)); |
118 | 154 | ||
119 | - //货重误差 | 155 | + //带货提货,货重误差 |
120 | goodCheckResult = Double.parseDouble(df.format(Math.abs((grossWt-inWt-goodsWt)) / goodsWt)); | 156 | goodCheckResult = Double.parseDouble(df.format(Math.abs((grossWt-inWt-goodsWt)) / goodsWt)); |
121 | - } | ||
122 | - double range = valueDob(); | ||
123 | - log.info("[WEIGHT-CHECK]-实际离场拉货重量:{},申请离场拉货重量:{},货重差值:{},货重误差:{}",grossWt-inWt,goodsWt,grossWt-inWt-goodsWt,goodCheckResult); | ||
124 | - log.info("[WEIGHT-CHECK]-进出场比对差值:{},提货离场差值:{},进出场比对重量差:{}",result,result1,Math.abs(inWt - grossWt)); | ||
125 | 157 | ||
158 | + double range = valueDob(); | ||
159 | + log.info("[WEIGHT-CHECK]-实际离场拉货重量:{},申请离场拉货重量:{},货重差值:{},货重误差:{}",grossWt-inWt,goodsWt,grossWt-inWt-goodsWt,goodCheckResult); | ||
160 | + log.info("[WEIGHT-CHECK]-进出场比对差值:{},提货离场差值:{},进出场比对重量差:{}",result,result1,Math.abs(inWt - grossWt)); | ||
126 | 161 | ||
127 | - if (result <= range || goodCheckResult<=range) { | 162 | + if (result <= range |
163 | +// || goodCheckResult<=range | ||
164 | + ) { | ||
128 | 165 | ||
129 | - flag = true; | ||
130 | - } | 166 | + flag = true; |
167 | + } | ||
131 | 168 | ||
132 | - //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 | ||
133 | - if (result1 <= range || result2 <= range || emptyOut <= range) { | 169 | +// //车辆备案重量+货物重量 = 出场过磅重量,测试用,生产关闭 |
170 | +// if (result1 <= range || result2 <= range || emptyOut <= range) { | ||
171 | +// | ||
172 | +// return true; | ||
173 | +// } | ||
134 | 174 | ||
135 | - return true; | ||
136 | - } | ||
137 | 175 | ||
176 | + } | ||
138 | return flag; | 177 | return flag; |
139 | } | 178 | } |
140 | 179 |
@@ -3,7 +3,6 @@ package com.sy.socket; | @@ -3,7 +3,6 @@ package com.sy.socket; | ||
3 | import com.sy.model.CommandInfoX22; | 3 | import com.sy.model.CommandInfoX22; |
4 | import com.sy.model.GatherInfo; | 4 | import com.sy.model.GatherInfo; |
5 | import lombok.extern.slf4j.Slf4j; | 5 | import lombok.extern.slf4j.Slf4j; |
6 | -import org.apache.log4j.Logger; | ||
7 | import org.springframework.stereotype.Component; | 6 | import org.springframework.stereotype.Component; |
8 | 7 | ||
9 | import java.io.IOException; | 8 | import java.io.IOException; |
-
请 注册 或 登录 后发表评论