提交 cddd686f authored 作者: huyufan's avatar huyufan

处理结算金额BUg

上级 aed8e053
......@@ -6,7 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class OwnerLoanPayNotifyMqParam {
public class OwnerBankNotifyMqParam {
@NotNull(message = "流水号不能为空")
@ApiModelProperty("流水号")
......
......@@ -179,6 +179,9 @@ public class OrderChildLoanComponent {
@Transactional(rollbackFor = Exception.class)
public void childLoanConfirmAfterProcess(SettlementDriverDetail settlementDriverDetail, SettlementOwnerDetail settlementOwnerDetail, OrderChild orderChild) {
log.info("1.运单确认收货后借款相关处理执行");
//临时结算金额,借款抵扣后需要重新赋值结算金额为0,如果不需要借款相关逻辑,正常设置结算金额
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
OwnerQuotationDetailVO quotationDetailVO = orderFeign.getQuotationByOrderNo(settlementDriverDetail.getOrderNo()).getData();
BigDecimal freightFreezeRate = quotationDetailVO.getFreightFreezeRate();
......@@ -202,8 +205,6 @@ public class OrderChildLoanComponent {
List<OwnerLoanAccountRunningWaterRecord> runningWaterRecordList = ownerLoanAccountRunningWaterRecordDao.getListByOrderNoAndRunningWaterType
(childNo, OwnerLoanAccountRunningWaterRecordEnum.RunWaterType.APPROVE_FROZEN.getCode());
//临时结算金额,借款抵扣后需要重新赋值结算金额为0
settlementOwnerDetail.setSettlementFreight(settlementFreightCalc(orderChild.getSettlementWay(), settlementOwnerDetail));
log.info("4.查询当前运单号:{}, 当前货主,{}, 此运单借款冻结记录:{}", childNo, settlementOwnerDetail.getOwnerUserNo(), JSONUtil.parse(runningWaterRecordList));
if (CollectionUtil.isEmpty(runningWaterRecordList)) {
......
package com.clx.performance.listener;
import cn.hutool.json.JSONUtil;
import com.clx.performance.param.OwnerLoanPayNotifyMqParam;
import com.clx.performance.param.OwnerBankNotifyMqParam;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.enums.nbbank.NbBankStatusEnum;
import com.clx.performance.service.loan.OwnerLoanAccountService;
......@@ -28,7 +28,7 @@ public class OwnerLoanPayNotifyListener {
@RabbitListener(queues = RabbitKeyConstants.OWNER_LOAN_PAY_QUEUE)
public void onMessage(String message) {
log.info("处理货主借款支付监听器执行,数据为{}", message);
OwnerLoanPayNotifyMqParam param = JSONUtil.toBean(message, OwnerLoanPayNotifyMqParam.class);
OwnerBankNotifyMqParam param = JSONUtil.toBean(message, OwnerBankNotifyMqParam.class);
if (Objects.equals(param.getPayStatus(), NbBankStatusEnum.Status.SUCCESS.getCode())) {
// 支付成功
......
package com.clx.performance.listener;
import cn.hutool.json.JSONUtil;
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;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
* 处理货主还款支付监听器
*/
@Slf4j
@Component
@AllArgsConstructor
public class OwnerRepaymentPayNotifyListener {
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);
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());
}
}
}
......@@ -2,7 +2,7 @@ package com.clx.performance.service.impl.thirdparty.nbbank;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.clx.performance.param.OwnerLoanPayNotifyMqParam;
import com.clx.performance.param.OwnerBankNotifyMqParam;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.loan.BankTradeDao;
......@@ -237,7 +237,7 @@ public class NbBankServiceImpl implements NbBankService {
bankTradeDao.updateStatus(bankTrade);
// 货主借款支付回调
if (Objects.equals(bankTrade.getOrderType(), BankTradeEnum.OrderType.OWNER_LOAN_RECORD.getCode())){
OwnerLoanPayNotifyMqParam param = new OwnerLoanPayNotifyMqParam();
OwnerBankNotifyMqParam param = new OwnerBankNotifyMqParam();
param.setMerSeqNo(merSeqNo);
param.setPayStatus(transStatus);
Message message = MessageBuilder.withBody(JSONUtil.parse(param).toString().getBytes()).build();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论