作者 朱兆平

Merge branch 'ver_bh_g2_engin_dev' into ver_bh_g2_engin

... ... @@ -187,7 +187,7 @@ class G2X21Notice extends Script implements ChannelCheckScript{
JSONObject yard = chanel.getJSONObject("yard");
String stationG2 = yard.getString("stationIdG2");
log.info("[G2-YARD]-{}",stationG2);
String rfidNo = ve.getVeCustomsNo();
String rfidNo = ve.getIcCode();
if (StringUtils.isEmpty(rfidNo)){
log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
record(gatherInfo,false,"车辆电子车牌信息未备案",null);
... ...
... ... @@ -154,7 +154,7 @@ class G2X21NoticeToSamples extends Script implements ChannelCheckScript{
JSONObject yard = chanel.getJSONObject("yard");
String stationG2 = yard.getString("stationIdG2");
log.info("[G2-YARD]-{}",stationG2);
String rfidNo = ve.getVeCustomsNo();
String rfidNo = ve.getIcCode();
if (StringUtils.isEmpty(rfidNo)){
log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
record(gatherInfo,false,"车辆电子车牌信息未备案",null);
... ...
... ... @@ -23,6 +23,7 @@ import java.nio.charset.Charset
import java.text.SimpleDateFormat
/**
* 适用于区港调拨业务
* 特殊区域本地调拨分拨验放-综保区西货站
* 返回true 无后续返回,没有验放指令配合
* todo:需要改造成验放型.返回true false,某些业务类型需要强制走金二验放,海关智能卡口配置端也是根据通道进行配置的
... ... @@ -189,7 +190,7 @@ class G2X21NoticeWithTrue extends Script implements ChannelCheckScript{
JSONObject yard = chanel.getJSONObject("yard");
String stationG2 = yard.getString("stationIdG2");
log.info("[G2-YARD]-{}",stationG2);
String rfidNo = ve.getVeCustomsNo();
String rfidNo = ve.getIcCode();
if (StringUtils.isEmpty(rfidNo)){
log.error("[VE-RFID-NO-ERR]:车辆-{}电子车牌信息未备案",gatherInfo.getVename());
record(gatherInfo,false,"车辆电子车牌信息未备案",null);
... ...
... ... @@ -128,7 +128,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{
JSONObject yard = chanel.getJSONObject("yard");
String stationG2 = yard.getString("stationIdG2");
log.info("[G2-YARD]-{}",stationG2);
log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getVeCustomsNo());
log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getIcCode());
String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype())
.replace("#{area_id}",stationG2)
... ... @@ -136,7 +136,7 @@ class G2X81Notice extends Script implements ChannelCheckScript{
.replace("#{session_id}",gatherInfo.getSeqno())
.replace("#{ve_license_no}",gatherInfo.getVename())
.replace("#{gross_wt}",gatherInfo.getGrosswt().toString())
.replace("#{rfid_id}",ve.getVeCustomsNo())
.replace("#{rfid_id}",ve.getIcCode())
.replace("#{ve_wt}",ve.getSelfWt())
.replace("#{operate_time}",startTime);
log.info("[X21-TO-X81]-{}",x81XML);
... ...
... ... @@ -128,7 +128,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{
JSONObject yard = chanel.getJSONObject("yard");
String stationG2 = yard.getString("stationIdG2");
log.info("[G2-YARD]-{}",stationG2);
log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getVeCustomsNo());
log.info("[VE-RFID-NO]:车辆电子车牌号:{}",ve.getIcCode());
String x81XML= G2X81Template.template.replace("#{ie_flag}",gatherInfo.getIetype())
.replace("#{area_id}",stationG2)
... ... @@ -136,7 +136,7 @@ class ZBQX81Notice extends Script implements ChannelCheckScript{
.replace("#{session_id}",gatherInfo.getSeqno())
.replace("#{ve_license_no}",gatherInfo.getVename())
.replace("#{gross_wt}",gatherInfo.getGrosswt().toString())
.replace("#{rfid_id}",ve.getVeCustomsNo())
.replace("#{rfid_id}",ve.getIcCode())
.replace("#{ve_wt}",ve.getSelfWt())
.replace("#{operate_time}",startTime);
log.info("[X21-TO-X81]-{}",x81XML);
... ...
package com.sy.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.sy.mapper.RuleChannelConfigDao;
import com.sy.model.*;
import com.sy.service.*;
... ... @@ -136,22 +137,38 @@ public class EnginCheckServiceImpl implements EnginCheckService {
executeParams.put("selfWt", 0.0);
executeParams.put("goodsWt", 0.0);
//适应高清车牌采集,反向填充二维码 gatherInfo中没有二维码信息的情况
/**
* 适应高清车牌采集,反向填充二维码 gatherInfo中没有二维码信息的情况
* 需要注意排除一些行政车辆,没有申请信息等问题
*/
String carBarcode = "";
if (StringUtils.isEmpty(gatherInfo.getBarcode())) {
//从申请缓存获取二维码信息
String landBusnessInfoJsonStr = redisService.get(gatherInfo.getVename());
JSONArray array = JSONArray.parseArray(landBusnessInfoJsonStr);
String carBarcode = array.getJSONObject(0).getString("barcode");
if (StringUtils.isEmpty(carBarcode)){
log.error("[BARCODE-RESET-ERR]-从流转申请信息反向填充车辆{}二维码失败",gatherInfo.getVename());
}else {
gatherInfo.setBarcode(carBarcode);
log.info("[BARCODE-RESET]-车牌{}流转申请二维码重置为{}",gatherInfo.getVename(),carBarcode);
}
}
if (StringUtils.isEmpty(landBusnessInfoJsonStr)) {
log.error("[BARCODE-RESET-ERR]-未找到车辆申报信息");
CommandClient.Client(gatherInfo, "未找到车辆流转申请信息");
}else{
JSONArray array = JSONArray.parseArray(landBusnessInfoJsonStr);
if (array!=null && !array.isEmpty()){
JSONObject landBusness= array.getJSONObject(0);
if (landBusness!=null){
if(landBusness.containsKey("barcode")){
carBarcode = landBusness.getString("barcode");
if (StringUtils.isEmpty(carBarcode)){
log.error("[BARCODE-RESET-ERR]-从流转申请信息反向填充车辆{}二维码失败",gatherInfo.getVename());
}else {
gatherInfo.setBarcode(carBarcode);
log.info("[BARCODE-RESET]-车牌{}流转申请二维码重置为{}",gatherInfo.getVename(),carBarcode);
}
}
}
}
}
}
//车辆备案信息
LandRoadVe ve = veService.selectByFrameNo(gatherInfo.getVename());
... ... @@ -242,7 +259,7 @@ public class EnginCheckServiceImpl implements EnginCheckService {
redisService.incr("kako-total",1);
} else {
CommandClient.Client(info, reason);
log.info("=============>>>>>>>>重量异常报文发送成功<<<<<<<<<==============");
log.info("=============>>>>>>>>放行异常报文发送成功<<<<<<<<<==============");
}
commandlog(info,check,reason,executeParams);
}
... ...
... ... @@ -4,6 +4,7 @@ import com.sy.bwAnalysis.MessageAnalysis;
import com.sy.bwAssist.Message;
import com.sy.service.router.MessageRouter;
import com.sy.service.router.RouterContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
... ... @@ -14,6 +15,7 @@ import javax.annotation.PostConstruct;
* 本地报文处理器
*/
@Component
@Slf4j
public class LocalFileTaskHandle implements Runnable{
private static LocalFileTaskHandle localFileTaskHandle;
... ... @@ -35,12 +37,18 @@ public class LocalFileTaskHandle implements Runnable{
@Override
public void run() {
String string = message.replace("Msg","MSG");
MessageAnalysis analysis = new MessageAnalysis();
Message message = analysis.readTicketsXml(string);
try{
log.info("\n[LocalFileTaskHandle-XML-MESSAGE]-开始处理采集报文:\n{}\n",message);
String xmlMessage = message.replace("Msg","MSG");
MessageAnalysis analysis = new MessageAnalysis();
Message message = analysis.readTicketsXml(xmlMessage);
mesageHandle(message);
mesageHandle(message);
}catch (Exception e){
log.error("\n[LocalFileTaskHandle-ERR]-抓取到异常信息:",e);
}
}
public void mesageHandle(Message message){
... ...