...
|
...
|
@@ -3,6 +3,7 @@ package com.sy.service.router; |
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.sy.bwAnalysis.CommandInfoAnalysis;
|
|
|
import com.sy.bwAssist.Message;
|
|
|
import com.sy.model.G2Bean;
|
|
|
import com.sy.model.GatherInfo;
|
|
|
import com.sy.model.LandBusinessTypeList;
|
|
|
import com.sy.model.CommandInfoX22;
|
...
|
...
|
@@ -20,6 +21,14 @@ import org.springframework.stereotype.Service; |
|
|
@Slf4j
|
|
|
public class MessageRouterX22 implements MessageRouter {
|
|
|
|
|
|
/**
|
|
|
* 金二与本地认证兼容性开关
|
|
|
* Y 是金二业务必须走金二
|
|
|
* N 车辆扫二维码或本地和金二都可进出区验放
|
|
|
*/
|
|
|
@Autowired
|
|
|
private G2Bean g2Bean;
|
|
|
|
|
|
@Autowired
|
|
|
private RedisService redisService;
|
|
|
|
...
|
...
|
@@ -44,47 +53,56 @@ public class MessageRouterX22 implements MessageRouter { |
|
|
@Override
|
|
|
public void route(Message message) {
|
|
|
try {
|
|
|
log.info("处理X22:CommandInfo");
|
|
|
log.info("[X22]-处理CommandInfo;\n[switch]-G2开关状态:[{}]",g2Bean.getOnoff());
|
|
|
CommandInfoAnalysis commandInfoAnalysis = new CommandInfoAnalysis();
|
|
|
CommandInfoX22 commandInfoX22 = commandInfoAnalysis.toJavaBean(message);
|
|
|
|
|
|
if (commandInfoX22!=null){
|
|
|
/**
|
|
|
* 根据SEQNO 读取缓存 确定是否金二指令
|
|
|
*/
|
|
|
GatherInfo gatherInfo = readCacheWithSeqno(commandInfoX22);
|
|
|
//是金二指令
|
|
|
if (gatherInfo!=null && gatherInfo.getChnlno().equals(commandInfoX22.getChnlNo())){
|
|
|
/**
|
|
|
* 如果金二验放关闭,则不用再处理X22指令报文.
|
|
|
*/
|
|
|
if (g2Bean.getOnoff()) {
|
|
|
if (commandInfoX22!=null){
|
|
|
/**
|
|
|
* 1. 判断指令是否放行
|
|
|
* 根据SEQNO 读取缓存 确定是否金二指令
|
|
|
*/
|
|
|
if (commandInfoX22.getCheckResult().equals(CODE_RELEASE_I) || commandInfoX22.getCheckResult().equals(CODE_RELEASE_E)) {
|
|
|
/**
|
|
|
* todo:第一种.收到G2指令直接放行.并记录过卡与流转申请的核销
|
|
|
*/
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 第二种,结合本地指令进行放行.
|
|
|
*/
|
|
|
record(gatherInfo,true,commandInfoX22.getOpHint(),null);
|
|
|
GatherInfoHandle gatherInfoHandle = new GatherInfoHandle();
|
|
|
gatherInfoHandle.handel(gatherInfo);
|
|
|
return;
|
|
|
}else {
|
|
|
GatherInfo gatherInfo = readCacheWithSeqno(commandInfoX22);
|
|
|
//是金二指令
|
|
|
if (gatherInfo!=null && gatherInfo.getChnlno().equals(commandInfoX22.getChnlNo())){
|
|
|
/**
|
|
|
* 是金二指令,但是是未放行指令
|
|
|
* 记录未放行原因.
|
|
|
* 通知卡口
|
|
|
* 1. 判断指令是否放行
|
|
|
*/
|
|
|
CommandClient.Client(gatherInfo,commandInfoX22.getOpHint());
|
|
|
record(gatherInfo,false,gatherInfo.getSeqno()+"-金二验放失败:"+commandInfoX22.getOpHint(),null);
|
|
|
if (commandInfoX22.getCheckResult().equals(CODE_RELEASE_I) || commandInfoX22.getCheckResult().equals(CODE_RELEASE_E)) {
|
|
|
/**
|
|
|
* todo:第一种.收到G2指令直接放行.并记录过卡与流转申请的核销
|
|
|
*/
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 第二种,结合本地指令进行放行.
|
|
|
*/
|
|
|
record(gatherInfo,true,commandInfoX22.getOpHint(),null);
|
|
|
GatherInfoHandle gatherInfoHandle = new GatherInfoHandle();
|
|
|
gatherInfoHandle.handel(gatherInfo);
|
|
|
return;
|
|
|
}else {
|
|
|
/**
|
|
|
* 是金二指令,但是是未放行指令
|
|
|
* 记录未放行原因.
|
|
|
* 通知卡口
|
|
|
*/
|
|
|
CommandClient.Client(gatherInfo,commandInfoX22.getOpHint());
|
|
|
record(gatherInfo,false,gatherInfo.getSeqno()+"-金二验放失败:"+commandInfoX22.getOpHint(),null);
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
log.info("[X22-ERROR]:未找到对应的SEQNO:[{}]及通道的过卡缓存数据,不属于金二验放指令,不进行处理",commandInfoX22.getSeqNo());
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
log.info("[X22-ERROR]:未找到对应的SEQNO:[{}]及通道的过卡缓存数据,不属于金二验放指令,不进行处理",commandInfoX22.getSeqNo());
|
|
|
}
|
|
|
}else{
|
|
|
log.info("[X22]-金二开关状态为{}关闭,本地验放不处理X22指令.",g2Bean.getOnoff());
|
|
|
}
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
log.error("[X22-ERROR]:",e);
|
|
|
}
|
...
|
...
|
|