提交 568ef164 authored 作者: huyufan's avatar huyufan

异常处理

上级 e8f66793
package com.clx.performance.listener; package com.clx.performance.listener;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.clx.performance.param.OwnerBankNotifyMqParam;
import com.clx.performance.constant.RabbitKeyConstants; import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.enums.nbbank.NbBankStatusEnum; import com.clx.performance.enums.nbbank.NbBankStatusEnum;
import com.clx.performance.param.OwnerBankNotifyMqParam;
import com.clx.performance.service.loan.OwnerLoanAccountService; import com.clx.performance.service.loan.OwnerLoanAccountService;
import com.clx.performance.service.loan.OwnerLoanRecordService; import com.clx.performance.service.loan.OwnerLoanRecordService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -23,10 +23,10 @@ public class OwnerLoanPayNotifyListener { ...@@ -23,10 +23,10 @@ public class OwnerLoanPayNotifyListener {
private final OwnerLoanRecordService ownerLoanRecordService; private final OwnerLoanRecordService ownerLoanRecordService;
private final OwnerLoanAccountService ownerLoanAccountService;
@RabbitListener(queues = RabbitKeyConstants.OWNER_LOAN_PAY_QUEUE) @RabbitListener(queues = RabbitKeyConstants.OWNER_LOAN_PAY_QUEUE)
public void onMessage(String message) { public void onMessage(String message) {
try {
log.info("处理货主借款支付监听器执行,数据为{}", message); log.info("处理货主借款支付监听器执行,数据为{}", message);
OwnerBankNotifyMqParam param = JSONUtil.toBean(message, OwnerBankNotifyMqParam.class); OwnerBankNotifyMqParam param = JSONUtil.toBean(message, OwnerBankNotifyMqParam.class);
...@@ -34,10 +34,14 @@ public class OwnerLoanPayNotifyListener { ...@@ -34,10 +34,14 @@ public class OwnerLoanPayNotifyListener {
// 支付成功 // 支付成功
ownerLoanRecordService.paySuccess(param.getMerSeqNo()); ownerLoanRecordService.paySuccess(param.getMerSeqNo());
} } else if (Objects.equals(param.getPayStatus(), NbBankStatusEnum.Status.FAIL.getCode())) {
else if (Objects.equals(param.getPayStatus(), NbBankStatusEnum.Status.FAIL.getCode())) {
// 支付失败 // 支付失败
ownerLoanRecordService.payFail(param.getMerSeqNo()); ownerLoanRecordService.payFail(param.getMerSeqNo());
} }
} catch (Exception e) {
log.error("处理货主借款支付监听器异常,数据为{}", message, e);
}
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论