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

异常处理

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