|
|
@@ -43,7 +43,10 @@ import cn.com.taiji.inss.config.VfjConfigProperties; |
|
|
|
import cn.com.taiji.inss.manager.model.inst.IssueOrderVO; |
|
|
|
import cn.com.taiji.inss.manager.model.inst.IssueSubmitModel; |
|
|
|
import cn.com.taiji.inss.manager.tools.InstTools; |
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Qualifier; |
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
@@ -125,6 +128,9 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { |
|
|
|
private QtkCard4XSectionRepo card4XSectionRepo; |
|
|
|
@Autowired |
|
|
|
private QtkObu4XSectionRepo obu4XSectionRepo; |
|
|
|
@Autowired |
|
|
|
@Qualifier("myExecutor") |
|
|
|
private ThreadPoolTaskExecutor executor; |
|
|
|
|
|
|
|
|
|
|
|
@PostConstruct |
|
|
@@ -177,7 +183,7 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { |
|
|
|
OqsCardQueryRequest oqsCardQueryRequest = new OqsCardQueryRequest(); |
|
|
|
oqsCardQueryRequest.setCardId(vo.getCardId()); |
|
|
|
OqsCardQueryResponse oqsCardQueryResponse = jsonPostRepeat(oqsCardQueryRequest, 1); |
|
|
|
if (oqsCardQueryResponse.getQtkCardInfo() != null && oqsCardQueryResponse.getQtkCardInfo().getCardStatus() == CardStatus.ZC) { |
|
|
|
if (oqsCardQueryResponse.getQtkCardInfo() != null && !oqsCardQueryResponse.getQtkCardInfo().getVehicleId().equals(vo.getVehicleId())) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该卡[" + vo.getCardId() + "]已发行"); |
|
|
|
} else { |
|
|
|
QtkCardInfo card = cardInfoRepo.findByCardId(vo.getCardId()); |
|
|
@@ -240,7 +246,7 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { |
|
|
|
OqsObuQueryRequest oqsObuQueryRequest = new OqsObuQueryRequest(); |
|
|
|
oqsObuQueryRequest.setObuId(vo.getObuId()); |
|
|
|
OqsObuQueryResponse oqsObuQueryResponse = jsonPostRepeat(oqsObuQueryRequest, 1); |
|
|
|
if (oqsObuQueryResponse.getQtkObuInfo() != null && oqsObuQueryResponse.getQtkObuInfo().getObuStatus() == ObuStatus.ZC) { |
|
|
|
if (oqsObuQueryResponse.getQtkObuInfo() != null && !oqsObuQueryResponse.getQtkObuInfo().getVehicleId().equals(vo.getVehicleId())) { |
|
|
|
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("该OBU[" + vo.getObuId() + "]已发行"); |
|
|
|
} else { |
|
|
|
QtkObuInfo obu = obuInfoRepo.findByObuId(vo.getObuId()); |
|
|
@@ -374,11 +380,18 @@ public class InstOnlineActiveMananger extends AbstractCallBackManager { |
|
|
|
persistTransaction(ISSUE_VEHICLE_SYNC, vo.getVehicleId(), "vehicle"); |
|
|
|
persistTransaction(ISSUE_CARD_SYNC, vo.getCardId(), "card"); |
|
|
|
persistTransaction(ISSUE_OBU_SYNC, vo.getObuId(), "obu"); |
|
|
|
//同步营改增 |
|
|
|
jsonPostRepeat(handleUser(submitModel.getCustomerInfo())); |
|
|
|
jsonPostRepeat(handleVehicle(submitModel.getVehicleInfo())); |
|
|
|
jsonPostRepeat(handleCard(vo.getCardId())); |
|
|
|
jsonPostRepeat(handleObu(obuInfo)); |
|
|
|
executor.execute(() -> { |
|
|
|
try { |
|
|
|
//同步营改增 |
|
|
|
jsonPostRepeat(handleUser(submitModel.getCustomerInfo())); |
|
|
|
jsonPostRepeat(handleVehicle(submitModel.getVehicleInfo())); |
|
|
|
jsonPostRepeat(handleCard(vo.getCardId())); |
|
|
|
jsonPostRepeat(handleObu(obuInfo)); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("订单[{}]激活调用营改增接口失败:{}", vo.getOrderId(), e.getMessage()); |
|
|
|
logger.error("", e); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|