|
@@ -43,7 +43,7 @@ public class TransactionRecordEventHandler implements HikEventHandler {
|
|
|
|
|
|
|
|
private final IXfConsumeDetailService consumeDetailService;
|
|
private final IXfConsumeDetailService consumeDetailService;
|
|
|
|
|
|
|
|
- private final IConsumeDetailOriginalService consumeDetailOriginalService;
|
|
|
|
|
|
|
+// private final IConsumeDetailOriginalService consumeDetailOriginalService;
|
|
|
|
|
|
|
|
private final IXfFailedRecordService failedRecordService;
|
|
private final IXfFailedRecordService failedRecordService;
|
|
|
|
|
|
|
@@ -101,13 +101,14 @@ public class TransactionRecordEventHandler implements HikEventHandler {
|
|
|
}else{
|
|
}else{
|
|
|
// 在线交易,调用消费记录入库的接口
|
|
// 在线交易,调用消费记录入库的接口
|
|
|
// 根据机号和交易记录流水号查询消费记录
|
|
// 根据机号和交易记录流水号查询消费记录
|
|
|
- // 睡眠一秒,等待消费记录入库成功
|
|
|
|
|
- Thread.sleep(1000);
|
|
|
|
|
- List<XfConsumeDetailVo> vos = consumeDetailService.queryByTermNoAndRecordId(termNo, transactionRecordEvent.getSerialNo().longValue());
|
|
|
|
|
|
|
+ // 睡眠2秒,等待消费记录入库成功
|
|
|
|
|
+ Thread.sleep(2000);
|
|
|
|
|
+ List<XfConsumeDetailVo> vos = consumeDetailService.queryByTermNoAndRecordId(termNo,
|
|
|
|
|
+ transactionRecordEvent.getSerialNo().longValue(),remoteBo.getConsumeDate(), remoteBo.getConsumeMoney());
|
|
|
if (CollectionUtils.isEmpty(vos)){
|
|
if (CollectionUtils.isEmpty(vos)){
|
|
|
// 组装参数,调用消费记录入库的接口 // 如果失败要记录入库
|
|
// 组装参数,调用消费记录入库的接口 // 如果失败要记录入库
|
|
|
- log.info("TransactionRecordEvent调用消费入库接口,入参,{}", JSONUtil.toJsonStr(remoteBo));
|
|
|
|
|
- RemoteResultDto remoteResultDto = remoteConsumeService.dealHikUploadRecord(remoteBo);
|
|
|
|
|
|
|
+ log.info("TransactionRecordEvent调用消费请求与入库接口,入参,{}", JSONUtil.toJsonStr(remoteBo));
|
|
|
|
|
+ RemoteResultDto remoteResultDto = remoteConsumeService.dealHikFullRecord(remoteBo);
|
|
|
errorInfo = remoteResultDto.getErrorInfo();
|
|
errorInfo = remoteResultDto.getErrorInfo();
|
|
|
RemoteConsumeBo updatedRemoteBo = remoteResultDto.getUpdatedRemoteBo();
|
|
RemoteConsumeBo updatedRemoteBo = remoteResultDto.getUpdatedRemoteBo();
|
|
|
if(updatedRemoteBo !=null) {
|
|
if(updatedRemoteBo !=null) {
|
|
@@ -208,6 +209,19 @@ public class TransactionRecordEventHandler implements HikEventHandler {
|
|
|
if (!error) {
|
|
if (!error) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ String msg = errorInfo.getMsg();
|
|
|
|
|
+ ErrorInfo data = errorInfo.getData();
|
|
|
|
|
+ if(data != null){
|
|
|
|
|
+ msg = data.getMessage();
|
|
|
|
|
+ }
|
|
|
|
|
+ if(StringUtils.isNotBlank(msg) && msg.length() >= 2000){
|
|
|
|
|
+ msg = msg.substring(0, 2000);
|
|
|
|
|
+ }
|
|
|
|
|
+ // 消费记录已上传 原始消费记录存在 已处理过的请求不在继续处理,不入库
|
|
|
|
|
+ if("消费记录已上传".equals(msg)|| "原始消费记录存在".equals(msg)){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
XfFailedRecordBo bo = new XfFailedRecordBo();
|
|
XfFailedRecordBo bo = new XfFailedRecordBo();
|
|
|
TransactionRecordEventDetail recordEvent = info.getTransactionRecordEvent();
|
|
TransactionRecordEventDetail recordEvent = info.getTransactionRecordEvent();
|
|
|
String consumeMoney;
|
|
String consumeMoney;
|
|
@@ -232,14 +246,6 @@ public class TransactionRecordEventHandler implements HikEventHandler {
|
|
|
}
|
|
}
|
|
|
bo.setStatus("f");
|
|
bo.setStatus("f");
|
|
|
bo.setFactoryId(recordEvent.getCardNo());
|
|
bo.setFactoryId(recordEvent.getCardNo());
|
|
|
- String msg = errorInfo.getMsg();
|
|
|
|
|
- ErrorInfo data = errorInfo.getData();
|
|
|
|
|
- if(data != null){
|
|
|
|
|
- msg = data.getMessage();
|
|
|
|
|
- }
|
|
|
|
|
- if(StringUtils.isNotBlank(msg) && msg.length() >= 2000){
|
|
|
|
|
- msg = msg.substring(0, 2000);
|
|
|
|
|
- }
|
|
|
|
|
bo.setFailMsg(msg);
|
|
bo.setFailMsg(msg);
|
|
|
bo.setConsumeType(modeType);
|
|
bo.setConsumeType(modeType);
|
|
|
|
|
|