作者 朱兆平

update:获取电子车牌统一更改为GETIc卡字段

bugFix:为备案以及未申请流转的车辆获取不到二维码信息报错nullException的问题
@@ -187,7 +187,7 @@ class G2X21Notice extends Script implements ChannelCheckScript{ @@ -187,7 +187,7 @@ class G2X21Notice extends Script implements ChannelCheckScript{
187 JSONObject yard = chanel.getJSONObject("yard"); 187 JSONObject yard = chanel.getJSONObject("yard");
188 String stationG2 = yard.getString("stationIdG2"); 188 String stationG2 = yard.getString("stationIdG2");
189 log.info("[G2-YARD]-{}",stationG2); 189 log.info("[G2-YARD]-{}",stationG2);
190 - String rfidNo = ve.getVeCustomsNo(); 190 + String rfidNo = ve.getIcCode();
191 if (StringUtils.isEmpty(rfidNo)){ 191 if (StringUtils.isEmpty(rfidNo)){
192 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename()); 192 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
193 record(gatherInfo,false,"车辆电子车牌信息未备案",null); 193 record(gatherInfo,false,"车辆电子车牌信息未备案",null);
@@ -154,7 +154,7 @@ class G2X21NoticeToSamples extends Script implements ChannelCheckScript{ @@ -154,7 +154,7 @@ class G2X21NoticeToSamples extends Script implements ChannelCheckScript{
154 JSONObject yard = chanel.getJSONObject("yard"); 154 JSONObject yard = chanel.getJSONObject("yard");
155 String stationG2 = yard.getString("stationIdG2"); 155 String stationG2 = yard.getString("stationIdG2");
156 log.info("[G2-YARD]-{}",stationG2); 156 log.info("[G2-YARD]-{}",stationG2);
157 - String rfidNo = ve.getVeCustomsNo(); 157 + String rfidNo = ve.getIcCode();
158 if (StringUtils.isEmpty(rfidNo)){ 158 if (StringUtils.isEmpty(rfidNo)){
159 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename()); 159 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
160 record(gatherInfo,false,"车辆电子车牌信息未备案",null); 160 record(gatherInfo,false,"车辆电子车牌信息未备案",null);
@@ -23,6 +23,7 @@ import java.nio.charset.Charset @@ -23,6 +23,7 @@ import java.nio.charset.Charset
23 import java.text.SimpleDateFormat 23 import java.text.SimpleDateFormat
24 24
25 /** 25 /**
  26 + * 适用于区港调拨业务
26 * 特殊区域本地调拨分拨验放-综保区西货站 27 * 特殊区域本地调拨分拨验放-综保区西货站
27 * 返回true 无后续返回,没有验放指令配合 28 * 返回true 无后续返回,没有验放指令配合
28 * todo:需要改造成验放型.返回true false,某些业务类型需要强制走金二验放,海关智能卡口配置端也是根据通道进行配置的 29 * todo:需要改造成验放型.返回true false,某些业务类型需要强制走金二验放,海关智能卡口配置端也是根据通道进行配置的
@@ -189,7 +190,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{ @@ -189,7 +190,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{
189 JSONObject yard = chanel.getJSONObject("yard"); 190 JSONObject yard = chanel.getJSONObject("yard");
190 String stationG2 = yard.getString("stationIdG2"); 191 String stationG2 = yard.getString("stationIdG2");
191 log.info("[G2-YARD]-{}",stationG2); 192 log.info("[G2-YARD]-{}",stationG2);
192 - String rfidNo = ve.getVeCustomsNo(); 193 + String rfidNo = ve.getIcCode();
193 if (StringUtils.isEmpty(rfidNo)){ 194 if (StringUtils.isEmpty(rfidNo)){
194 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename()); 195 log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
195 record(gatherInfo,false,"车辆电子车牌信息未备案",null); 196 record(gatherInfo,false,"车辆电子车牌信息未备案",null);
@@ -128,7 +128,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{ @@ -128,7 +128,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{
128 JSONObject yard = chanel.getJSONObject("yard"); 128 JSONObject yard = chanel.getJSONObject("yard");
129 String stationG2 = yard.getString("stationIdG2"); 129 String stationG2 = yard.getString("stationIdG2");
130 log.info("[G2-YARD]-{}",stationG2); 130 log.info("[G2-YARD]-{}",stationG2);
131 - log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getVeCustomsNo()); 131 + log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getIcCode());
132 132
133 String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype()) 133 String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype())
134 .replace("#{area_id}",stationG2) 134 .replace("#{area_id}",stationG2)
@@ -136,7 +136,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{ @@ -136,7 +136,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{
136 .replace("#{session_id}",gatherInfo.getSeqno()) 136 .replace("#{session_id}",gatherInfo.getSeqno())
137 .replace("#{ve_license_no}",gatherInfo.getVename()) 137 .replace("#{ve_license_no}",gatherInfo.getVename())
138 .replace("#{gross_wt}",gatherInfo.getGrosswt().toString()) 138 .replace("#{gross_wt}",gatherInfo.getGrosswt().toString())
139 - .replace("#{rfid_id}",ve.getVeCustomsNo()) 139 + .replace("#{rfid_id}",ve.getIcCode())
140 .replace("#{ve_wt}",ve.getSelfWt()) 140 .replace("#{ve_wt}",ve.getSelfWt())
141 .replace("#{operate_time}",startTime); 141 .replace("#{operate_time}",startTime);
142 log.info("[X21-TO-X81]-{}",x81XML); 142 log.info("[X21-TO-X81]-{}",x81XML);
@@ -128,7 +128,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{ @@ -128,7 +128,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{
128 JSONObject yard = chanel.getJSONObject("yard"); 128 JSONObject yard = chanel.getJSONObject("yard");
129 String stationG2 = yard.getString("stationIdG2"); 129 String stationG2 = yard.getString("stationIdG2");
130 log.info("[G2-YARD]-{}",stationG2); 130 log.info("[G2-YARD]-{}",stationG2);
131 - log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getVeCustomsNo()); 131 + log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getIcCode());
132 132
133 String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype()) 133 String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype())
134 .replace("#{area_id}",stationG2) 134 .replace("#{area_id}",stationG2)
@@ -136,7 +136,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{ @@ -136,7 +136,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{
136 .replace("#{session_id}",gatherInfo.getSeqno()) 136 .replace("#{session_id}",gatherInfo.getSeqno())
137 .replace("#{ve_license_no}",gatherInfo.getVename()) 137 .replace("#{ve_license_no}",gatherInfo.getVename())
138 .replace("#{gross_wt}",gatherInfo.getGrosswt().toString()) 138 .replace("#{gross_wt}",gatherInfo.getGrosswt().toString())
139 - .replace("#{rfid_id}",ve.getVeCustomsNo()) 139 + .replace("#{rfid_id}",ve.getIcCode())
140 .replace("#{ve_wt}",ve.getSelfWt()) 140 .replace("#{ve_wt}",ve.getSelfWt())
141 .replace("#{operate_time}",startTime); 141 .replace("#{operate_time}",startTime);
142 log.info("[X21-TO-X81]-{}",x81XML); 142 log.info("[X21-TO-X81]-{}",x81XML);
1 package com.sy.service.impl; 1 package com.sy.service.impl;
2 2
3 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
4 import com.sy.mapper.RuleChannelConfigDao; 5 import com.sy.mapper.RuleChannelConfigDao;
5 import com.sy.model.*; 6 import com.sy.model.*;
6 import com.sy.service.*; 7 import com.sy.service.*;
@@ -136,22 +137,38 @@ public class EnginCheckServiceImpl implements EnginCheckService { @@ -136,22 +137,38 @@ public class EnginCheckServiceImpl implements EnginCheckService {
136 executeParams.put("selfWt", 0.0); 137 executeParams.put("selfWt", 0.0);
137 executeParams.put("goodsWt", 0.0); 138 executeParams.put("goodsWt", 0.0);
138 139
139 - //适应高清车牌采集,反向填充二维码 gatherInfo中没有二维码信息的情况 140 + /**
  141 + * 适应高清车牌采集,反向填充二维码 gatherInfo中没有二维码信息的情况
  142 + * 需要注意排除一些行政车辆,没有申请信息等问题
  143 + */
  144 + String carBarcode = "";
140 if (StringUtils.isEmpty(gatherInfo.getBarcode())) { 145 if (StringUtils.isEmpty(gatherInfo.getBarcode())) {
141 //从申请缓存获取二维码信息 146 //从申请缓存获取二维码信息
142 String landBusnessInfoJsonStr = redisService.get(gatherInfo.getVename()); 147 String landBusnessInfoJsonStr = redisService.get(gatherInfo.getVename());
143 - JSONArray array = JSONArray.parseArray(landBusnessInfoJsonStr);  
144 - String carBarcode = array.getJSONObject(0).getString("barcode");  
145 - if (StringUtils.isEmpty(carBarcode)){  
146 - log.error("[BARCODE-RESET-ERR]-从流转申请信息反向填充车辆{}二维码失败",gatherInfo.getVename());  
147 - }else {  
148 - gatherInfo.setBarcode(carBarcode);  
149 - log.info("[BARCODE-RESET]-车牌{}流转申请二维码重置为{}",gatherInfo.getVename(),carBarcode);  
150 - }  
151 - } 148 + if (StringUtils.isEmpty(landBusnessInfoJsonStr)) {
  149 + log.error("[BARCODE-RESET-ERR]-未找到车辆申报信息");
  150 + CommandClient.Client(gatherInfo, "未找到车辆流转申请信息");
  151 + }else{
  152 + JSONArray array = JSONArray.parseArray(landBusnessInfoJsonStr);
  153 + if (array!=null && !array.isEmpty()){
  154 + JSONObject landBusness= array.getJSONObject(0);
  155 + if (landBusness!=null){
  156 + if(landBusness.containsKey("barcode")){
  157 + carBarcode = landBusness.getString("barcode");
  158 + if (StringUtils.isEmpty(carBarcode)){
  159 + log.error("[BARCODE-RESET-ERR]-从流转申请信息反向填充车辆{}二维码失败",gatherInfo.getVename());
  160 + }else {
  161 + gatherInfo.setBarcode(carBarcode);
  162 + log.info("[BARCODE-RESET]-车牌{}流转申请二维码重置为{}",gatherInfo.getVename(),carBarcode);
  163 + }
  164 + }
  165 + }
152 166
  167 + }
153 168
  169 + }
154 170
  171 + }
155 172
156 //车辆备案信息 173 //车辆备案信息
157 LandRoadVe ve = veService.selectByFrameNo(gatherInfo.getVename()); 174 LandRoadVe ve = veService.selectByFrameNo(gatherInfo.getVename());
@@ -242,7 +259,7 @@ public class EnginCheckServiceImpl implements EnginCheckService { @@ -242,7 +259,7 @@ public class EnginCheckServiceImpl implements EnginCheckService {
242 redisService.incr("kako-total",1); 259 redisService.incr("kako-total",1);
243 } else { 260 } else {
244 CommandClient.Client(info, reason); 261 CommandClient.Client(info, reason);
245 - log.info("=============>>>>>>>>重量异常报文发送成功<<<<<<<<<=============="); 262 + log.info("=============>>>>>>>>放行异常报文发送成功<<<<<<<<<==============");
246 } 263 }
247 commandlog(info,check,reason,executeParams); 264 commandlog(info,check,reason,executeParams);
248 } 265 }
@@ -4,6 +4,7 @@ import com.sy.bwAnalysis.MessageAnalysis; @@ -4,6 +4,7 @@ import com.sy.bwAnalysis.MessageAnalysis;
4 import com.sy.bwAssist.Message; 4 import com.sy.bwAssist.Message;
5 import com.sy.service.router.MessageRouter; 5 import com.sy.service.router.MessageRouter;
6 import com.sy.service.router.RouterContext; 6 import com.sy.service.router.RouterContext;
  7 +import lombok.extern.slf4j.Slf4j;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.beans.factory.annotation.Qualifier; 9 import org.springframework.beans.factory.annotation.Qualifier;
9 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
@@ -14,6 +15,7 @@ import javax.annotation.PostConstruct; @@ -14,6 +15,7 @@ import javax.annotation.PostConstruct;
14 * 本地报文处理器 15 * 本地报文处理器
15 */ 16 */
16 @Component 17 @Component
  18 +@Slf4j
17 public class LocalFileTaskHandle implements Runnable{ 19 public class LocalFileTaskHandle implements Runnable{
18 20
19 private static LocalFileTaskHandle localFileTaskHandle; 21 private static LocalFileTaskHandle localFileTaskHandle;
@@ -35,12 +37,18 @@ public class LocalFileTaskHandle implements Runnable{ @@ -35,12 +37,18 @@ public class LocalFileTaskHandle implements Runnable{
35 37
36 @Override 38 @Override
37 public void run() { 39 public void run() {
38 - String string = message.replace("Msg","MSG");  
39 - MessageAnalysis analysis = new MessageAnalysis();  
40 - Message message = analysis.readTicketsXml(string); 40 + try{
  41 + log.info("\n[LocalFileTaskHandle-XML-MESSAGE]-开始处理采集报文:\n{}\n",message);
  42 + String xmlMessage = message.replace("Msg","MSG");
  43 + MessageAnalysis analysis = new MessageAnalysis();
  44 + Message message = analysis.readTicketsXml(xmlMessage);
41 45
42 46
43 - mesageHandle(message); 47 + mesageHandle(message);
  48 + }catch (Exception e){
  49 + log.error("\n[LocalFileTaskHandle-ERR]-抓取到异常信息:",e);
  50 + }
  51 +
44 } 52 }
45 53
46 public void mesageHandle(Message message){ 54 public void mesageHandle(Message message){