|
|
@@ -63,28 +63,28 @@ public class ConsumptionEventHandler implements HikEventHandler {
|
|
|
// 调用现有原始消费请求接口
|
|
|
RemoteConsumeBo remoteBo = setParamBo(receive, consumptionEvent);
|
|
|
remoteBo.setTermNo(termVo.getTermNo());
|
|
|
-// log.info("transactionPreprocessingRequest 调用消费服务的消费请求接口,入参:{}", JSONUtil.toJsonStr(remoteBo));
|
|
|
- //RemoteResultDto result = remoteConsumeService.dealHikRequestConsume(remoteBo);
|
|
|
- //R<ErrorInfo> errorInfo = result.getErrorInfo();
|
|
|
- //RemoteConsumeBo updatedRemoteBo = result.getUpdatedRemoteBo();
|
|
|
- //String reason = "";
|
|
|
- //BigDecimal balance = updatedRemoteBo.getBalance();
|
|
|
- //BigDecimal consumeMoney = updatedRemoteBo.getConsumeMoney();
|
|
|
- //String deptName =updatedRemoteBo.getDeptName();
|
|
|
- //if (R.isError(errorInfo)) {
|
|
|
- // // 应答失败
|
|
|
- // bussiRs = false;
|
|
|
- // reason = errorInfo.getMsg();
|
|
|
- // ErrorInfo data = errorInfo.getData();
|
|
|
- // if(data != null){
|
|
|
- // reason = data.getMessage();
|
|
|
- // }
|
|
|
- //}
|
|
|
- // 直接应答成功
|
|
|
- String deptName = "";
|
|
|
+ log.info("transactionPreprocessingRequest 调用消费服务的消费请求接口,入参:{}", JSONUtil.toJsonStr(remoteBo));
|
|
|
+ RemoteResultDto result = remoteConsumeService.dealHikRequestConsume(remoteBo);
|
|
|
+ R<ErrorInfo> errorInfo = result.getErrorInfo();
|
|
|
+ RemoteConsumeBo updatedRemoteBo = result.getUpdatedRemoteBo();
|
|
|
String reason = "";
|
|
|
- BigDecimal balance = BigDecimal.ZERO;
|
|
|
- BigDecimal consumeMoney = remoteBo.getConsumeMoney();
|
|
|
+ BigDecimal balance = updatedRemoteBo.getBalance();
|
|
|
+ BigDecimal consumeMoney = updatedRemoteBo.getConsumeMoney();
|
|
|
+ String deptName =updatedRemoteBo.getDeptName();
|
|
|
+ if (R.isError(errorInfo)) {
|
|
|
+ // 应答失败
|
|
|
+ bussiRs = false;
|
|
|
+ reason = errorInfo.getMsg();
|
|
|
+ ErrorInfo data = errorInfo.getData();
|
|
|
+ if(data != null){
|
|
|
+ reason = data.getMessage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 直接应答成功
|
|
|
+// String deptName = "";
|
|
|
+// String reason = "";
|
|
|
+// BigDecimal balance = BigDecimal.ZERO;
|
|
|
+// BigDecimal consumeMoney = remoteBo.getConsumeMoney();
|
|
|
|
|
|
return answerEvent(consumptionEvent, bussiRs, balance, consumeMoney, reason, deptName);
|
|
|
} else if (TRANSACTION_CONFIRMING_REQUEST.equals(consumptionEvent.getMinor())) {
|
|
|
@@ -99,7 +99,7 @@ public class ConsumptionEventHandler implements HikEventHandler {
|
|
|
if (cancel != null && cancel) {
|
|
|
log.info("消费机消费请求确认事件,取消交易:{}", JSONUtil.toJsonStr(receive));
|
|
|
// 将原始记录标记为删除 termVo.getTermNo() consumptionEvent.getSerialNo() TermRecordId
|
|
|
-// remoteConsumeService.cancleDeal(termVo.getTermNo(), consumptionEvent.getSerialNo());
|
|
|
+ remoteConsumeService.cancleDeal(termVo.getTermNo(), consumptionEvent.getSerialNo());
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
@@ -109,8 +109,8 @@ public class ConsumptionEventHandler implements HikEventHandler {
|
|
|
remoteBo.setRecordId(0L);
|
|
|
remoteBo.setTermNo(termVo.getTermNo());
|
|
|
log.info("transactionConfirmingRequest 调用调用消费请求与入库接口,入参:{}", JSONUtil.toJsonStr(remoteBo));
|
|
|
- //RemoteResultDto result = remoteConsumeService.dealHikUploadRecord(remoteBo);
|
|
|
- RemoteResultDto result = remoteConsumeService.dealHikFullRecord(remoteBo);
|
|
|
+ RemoteResultDto result = remoteConsumeService.dealHikUploadRecord(remoteBo);
|
|
|
+// RemoteResultDto result = remoteConsumeService.dealHikFullRecord(remoteBo);
|
|
|
// log.info("消费机消费请求确认事件,结果:{}", JSONObject.toJSONString(result.getUpdatedRemoteBo()));
|
|
|
R<ErrorInfo> errorInfo = result.getErrorInfo();
|
|
|
if (R.isError(errorInfo)) {
|