Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

master
yangpeilai 1 dzień temu
rodzic
commit
a53056f899

+ 3
- 1
zhywpt-service-inss/src/main/java/cn/com/taiji/inss/manager/inst/AbstractCallBackManager.java Wyświetl plik

@@ -40,7 +40,7 @@ public abstract class AbstractCallBackManager extends AbstractCommManager implem
//读缓存
IssueOrderVO vo = readCache(request.getTransOrderId());
//特殊处理
if (needSpecialHandle(request, vo)){
if (needSpecialHandle(request, vo)) {
logger.info("进入特殊处理逻辑");
InstCallBackResponse response = specialHandle(request, vo);
writeCache(vo);
@@ -104,6 +104,8 @@ public abstract class AbstractCallBackManager extends AbstractCommManager implem
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("指令与指令结果的数量不一致");
}
for (String result : cmdResults) {
if (result.length() < 4)
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("指令结果内容异常");
String resultCode = result.substring(result.length() - 4);
if (!CMD_SUCCESS.equals(resultCode)) {
logger.error("指令执行结果:{}", resultCode);

+ 2
- 0
zhywpt-service-inss/src/main/java/cn/com/taiji/inss/manager/inst/AbstractCommandHandler.java Wyświetl plik

@@ -64,6 +64,8 @@ public abstract class AbstractCommandHandler extends AbstractCommManager impleme
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("指令与指令结果的数量不一致");
}
for (String result : cmdResults) {
if (result.length() < 4)
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("指令结果内容异常");
String resultCode = result.substring(result.length() - 4);
if (!CMD_SUCCESS.equals(resultCode)) {
logger.error("指令执行结果:{}", resultCode);

+ 54
- 16
zhywpt-service-inss/src/main/java/cn/com/taiji/inss/manager/inst/InstOnlineActiveMananger.java Wyświetl plik

@@ -26,6 +26,10 @@ import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzUserUploadRequest;
import cn.com.taiji.core.model.comm.protocol.ias.ygz.YgzVehicleUploadRequest;
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackRequest;
import cn.com.taiji.core.model.comm.protocol.inss.inst.InstCallBackResponse;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsCardQueryRequest;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsCardQueryResponse;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsObuQueryRequest;
import cn.com.taiji.core.model.comm.protocol.ods.oqs.issue.OqsObuQueryResponse;
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError;
import cn.com.taiji.core.repo.jpa.basic.*;
import cn.com.taiji.core.repo.jpa.invw.InvwCardDetailsRepo;
@@ -153,25 +157,41 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager {
if (!hasText(vo.getCardId()) || vo.getCardId().length() != 20) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("卡号异常");
}
// 重复申请卡
QtkCardInfo card = cardInfoRepo.findByCardId(vo.getCardId());
if (card != null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该卡已发行,请先取消原订单后再进行操作");
}
// 用户信息校验
QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(vo.getUserId());
if (customerInfo == null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("没有开卡人用户信息,请先开户");
}
submitModel.setCustomerInfo(customerInfo);
// 车辆信息校验
List<QtkCardInfo> cardInfoOnVehicles = cardInfoRepo.listByVehicleIdInUse(vo.getVehicleId(), new CardStatus[]{CardStatus.SQ, CardStatus.ZC});
if (!isEmpty(cardInfoOnVehicles)) {
for (QtkCardInfo cardInfoOnVehicle : cardInfoOnVehicles) {
OqsCardQueryRequest oqsCardQueryRequest = new OqsCardQueryRequest();
oqsCardQueryRequest.setCardId(cardInfoOnVehicle.getCardId());
OqsCardQueryResponse oqsCardQueryResponse = jsonPostRepeat(oqsCardQueryRequest, 1);
if (oqsCardQueryResponse.getQtkCardInfo() == null)
logger.error("老发行库数据同步异常,缺少cardId为{}的数据", cardInfoOnVehicle.getCardId());
if (!cardInfoOnVehicle.getCardId().equals(vo.getCardId()))
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("车辆下已存在卡信息");
else
cardInfoRepo.updateCardStatus(oqsCardQueryResponse.getQtkCardInfo().getCardId(), oqsCardQueryResponse.getQtkCardInfo().getCardStatus());
}
}

// 重复申请卡
OqsCardQueryRequest oqsCardQueryRequest = new OqsCardQueryRequest();
oqsCardQueryRequest.setCardId(vo.getCardId());
OqsCardQueryResponse oqsCardQueryResponse = jsonPostRepeat(oqsCardQueryRequest, 1);
if (oqsCardQueryResponse.getQtkCardInfo() != null && oqsCardQueryResponse.getQtkCardInfo().getCardStatus() == CardStatus.ZC) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该卡[" + vo.getCardId() + "]已发行");
} else {
QtkCardInfo card = cardInfoRepo.findByCardId(vo.getCardId());
if (card != null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该卡已发行,请先取消原订单后再进行操作");
}
}
// 用户信息校验
QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(vo.getUserId());
if (customerInfo == null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("没有开卡人用户信息,请先开户");
}
submitModel.setCustomerInfo(customerInfo);

QtkVehicleInfo vehicleInfo = vehicleInfoRepo.findByVehicleId(vo.getVehicleId());
if (vehicleInfo == null)
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("没有开卡车辆信息,请先录入.");
@@ -202,15 +222,33 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager {
List<QtkObuInfo> obuInfoOnVehicles = obuInfoRepo.listObuByVehicleIdInUse(vo.getVehicleId(), new ObuStatus[]{ObuStatus.DAZ, ObuStatus.ZC});
if (!isEmpty(obuInfoOnVehicles)) {
for (QtkObuInfo obuInfoOnVehicle : obuInfoOnVehicles) {
if (!obuInfoOnVehicle.getObuId().equals(vo.getObuId()))
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("车辆下已存在签信息");
if (!obuInfoOnVehicle.getObuId().equals(vo.getObuId())) {
OqsObuQueryRequest oqsObuQueryRequest = new OqsObuQueryRequest();
oqsObuQueryRequest.setObuId(obuInfoOnVehicle.getObuId());
OqsObuQueryResponse oqsObuQueryResponse = jsonPostRepeat(oqsObuQueryRequest, 1);
if (oqsObuQueryResponse.getQtkObuInfo() == null)
logger.error("老发行库数据同步异常,缺少ObuId为{}的数据", obuInfoOnVehicle.getObuId());
else if (oqsObuQueryResponse.getQtkObuInfo().getObuStatus() == ObuStatus.ZC)
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("车辆下已存在签信息");
else
obuInfoRepo.updateObuStatus(oqsObuQueryResponse.getQtkObuInfo().getObuId(), oqsObuQueryResponse.getQtkObuInfo().getObuStatus());
}
}
}

// 重复申请OBU
QtkObuInfo obu = obuInfoRepo.findByObuId(vo.getObuId());
if (obu != null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该OBU已完成发行!请先取消原订单后再进行操作");
OqsObuQueryRequest oqsObuQueryRequest = new OqsObuQueryRequest();
oqsObuQueryRequest.setObuId(vo.getObuId());
OqsObuQueryResponse oqsObuQueryResponse = jsonPostRepeat(oqsObuQueryRequest, 1);
if (oqsObuQueryResponse.getQtkObuInfo() != null && oqsObuQueryResponse.getQtkObuInfo().getObuStatus() == ObuStatus.ZC) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该卡[" + vo.getCardId() + "]已发行");
} else {
QtkObuInfo obu = obuInfoRepo.findByObuId(vo.getObuId());
if (obu != null) {
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该OBU已完成发行!请先取消原订单后再进行操作");
}
}

QtkCustomerInfo customerInfo = customerInfoRepo.findByCustomerId(vo.getUserId());
if (customerInfo == null)
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("没有用户信息,请先开户.");

Ładowanie…
Anuluj
Zapisz