提交 61e8b14d authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118'…

Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into v10.7_borrowing_and_repayment_20240118
...@@ -253,8 +253,9 @@ public class OrderChildLoanComponent { ...@@ -253,8 +253,9 @@ public class OrderChildLoanComponent {
//大于,则生成核销后,释放冻结的借款 //大于,则生成核销后,释放冻结的借款
log.info("4.3 大于,则生成核销后,释放冻结的借款"); log.info("4.3 大于,则生成核销后,释放冻结的借款");
// 需求解冻的金额 // 需求解冻的金额
BigDecimal thawBigdecimal = (settlementOwnerDetail.getSettlementFreight().subtract(alterationBalance)).negate(); BigDecimal thawBigdecimal = alterationBalance.subtract(settlementOwnerDetail.getSettlementFreight());
BigDecimal alterationBalanceTemp = alterationBalance; BigDecimal alterationBalanceTemp = settlementOwnerDetail.getSettlementFreight();
log.info("4.4 当前需要解冻金额:{}, 抵扣金额:{}",thawBigdecimal, alterationBalanceTemp);
List<OwnerLoanAccountRunningWaterRecord> frozenList = new LinkedList<>(); List<OwnerLoanAccountRunningWaterRecord> frozenList = new LinkedList<>();
List<OwnerLoanAccountRunningWaterRecord> thawList = new LinkedList<>(); List<OwnerLoanAccountRunningWaterRecord> thawList = new LinkedList<>();
...@@ -336,14 +337,14 @@ public class OrderChildLoanComponent { ...@@ -336,14 +337,14 @@ public class OrderChildLoanComponent {
update.setId(account.getId()); update.setId(account.getId());
update.setModifiedTime(account.getModifiedTime()); update.setModifiedTime(account.getModifiedTime());
if (OwnerLoanRecordEnum.LoanType.VIRTUAL_CURRENCY.getCode().equals(loanType)) { if (OwnerLoanRecordEnum.LoanType.VIRTUAL_CURRENCY.getCode().equals(loanType)) {
update.setVirtuallyAccountBalance(balance); update.setVirtuallyAccountBalance(BigDecimal.ZERO);
update.setVirtuallyFrozenBalance(balance); update.setVirtuallyFrozenBalance(balance);
update.setVirtuallyUsableBalance(balance); update.setVirtuallyUsableBalance(balance);
update.setFundingUsableBalance(BigDecimal.ZERO); update.setFundingUsableBalance(BigDecimal.ZERO);
update.setFundingAccountBalance(BigDecimal.ZERO); update.setFundingAccountBalance(BigDecimal.ZERO);
update.setFundingFrozenBalance(BigDecimal.ZERO); update.setFundingFrozenBalance(BigDecimal.ZERO);
} else { } else {
update.setFundingAccountBalance(balance); update.setFundingAccountBalance(BigDecimal.ZERO);
update.setFundingFrozenBalance(balance); update.setFundingFrozenBalance(balance);
update.setFundingUsableBalance(balance); update.setFundingUsableBalance(balance);
update.setVirtuallyAccountBalance(BigDecimal.ZERO); update.setVirtuallyAccountBalance(BigDecimal.ZERO);
......
...@@ -90,6 +90,7 @@ public class OwnerRepaymentDaoImpl extends BaseDaoImpl<OwnerRepaymentMapper, Own ...@@ -90,6 +90,7 @@ public class OwnerRepaymentDaoImpl extends BaseDaoImpl<OwnerRepaymentMapper, Own
public void updateStatusById(OwnerRepayment ownerRepayment) { public void updateStatusById(OwnerRepayment ownerRepayment) {
update(lUdWrapper().eq(OwnerRepayment::getId, ownerRepayment.getId()) update(lUdWrapper().eq(OwnerRepayment::getId, ownerRepayment.getId())
.set(OwnerRepayment::getStatus, ownerRepayment.getStatus()) .set(OwnerRepayment::getStatus, ownerRepayment.getStatus())
.set(OwnerRepayment::getOperateBy, ownerRepayment.getOperateBy())
); );
} }
......
package com.clx.performance.service.impl.loan; package com.clx.performance.service.impl.loan;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.OwnerBindCardRecordDao;
import com.clx.performance.dao.loan.BankTradeDao; import com.clx.performance.dao.loan.BankTradeDao;
import com.clx.performance.dao.loan.OwnerLoanAccountDao; import com.clx.performance.dao.loan.OwnerLoanAccountDao;
import com.clx.performance.dao.loan.OwnerLoanRecordDao; import com.clx.performance.dao.loan.OwnerLoanRecordDao;
...@@ -9,6 +10,7 @@ import com.clx.performance.enums.OwnerAccountEnum; ...@@ -9,6 +10,7 @@ import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.enums.loan.BankTradeEnum; import com.clx.performance.enums.loan.BankTradeEnum;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum; import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.extranal.user.OwnerInfoService; import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.model.OwnerBindCardRecord;
import com.clx.performance.model.loan.BankTrade; import com.clx.performance.model.loan.BankTrade;
import com.clx.performance.model.loan.OwnerLoanAccount; import com.clx.performance.model.loan.OwnerLoanAccount;
import com.clx.performance.model.loan.OwnerLoanRecord; import com.clx.performance.model.loan.OwnerLoanRecord;
...@@ -58,6 +60,8 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService { ...@@ -58,6 +60,8 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
private final OwnerLoanRecordDao ownerLoanRecordDao; private final OwnerLoanRecordDao ownerLoanRecordDao;
private final OwnerBindCardRecordDao ownerBindCardRecordDao;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void openOwnerLoanAccount(Long ownerUserNo, String ownerUserName, String mobile) { public void openOwnerLoanAccount(Long ownerUserNo, String ownerUserName, String mobile) {
...@@ -105,11 +109,13 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService { ...@@ -105,11 +109,13 @@ public class OwnerLoanAccountServiceImpl implements OwnerLoanAccountService {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, param.getRepaymentNo()).get(); OwnerRepayment ownerRepayment = ownerRepaymentDao.getOneByField(OwnerRepayment::getRepaymentNo, param.getRepaymentNo()).get();
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, ownerRepayment.getLoanNo()).get(); OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, ownerRepayment.getLoanNo()).get();
BankTrade bankTrade = new BankTrade(); BankTrade bankTrade = new BankTrade();
OwnerBindCardRecord ownerBindCardRecord = ownerBindCardRecordDao.getOwnerBindCardByUserNo(ownerRepayment.getLoanNo());
if (OwnerLoanRecordEnum.PayChannel.ORDER_DIRECT_PAY.getCode().equals(param.getPayChannel())) { if (OwnerLoanRecordEnum.PayChannel.ORDER_DIRECT_PAY.getCode().equals(param.getPayChannel())) {
// 订单支付 // 订单支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderDirectPay(ownerRepayment.getRepaymentNo(), "还款单", NbBankOrderPayResultVO orderPayResultVO = bankService.orderDirectPay(ownerRepayment.getRepaymentNo(), "还款单",
ownerRepayment.getRepaymentBalance().intValue(), ownerLoanRecord.getLendingPartyBankCode(), ownerRepayment.getRepaymentBalance().intValue(), ownerLoanRecord.getLendingPartyBankCode(),
ownerLoanRecord.getLendingPartyAccount(), ownerLoanRecord.getLendingParty()); ownerLoanRecord.getLendingPartyAccount(), ownerBindCardRecord.getAccountBankName());
ownerRepayment.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo()); ownerRepayment.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerRepayment.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo()); ownerRepayment.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
......
...@@ -275,10 +275,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -275,10 +275,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo()); ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode()); ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance()); ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
ownerLoanRecord.setLendingParty(borrower.getName());
ownerLoanRecord.setLendingPartyAccount(borrower.getBankCardNo());
bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_DIRECT_PAY.getCode()); bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_DIRECT_PAY.getCode());
} else { } else {
// 转账支付 // 转账支付
......
...@@ -351,18 +351,23 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService { ...@@ -351,18 +351,23 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void adjust(Integer id) { public void adjust(Integer id) {
OwnerRepayment ownerRepayment = ownerRepaymentDao.getEntityByKey(id).orElseThrow(ResultEnum.DATA_NOT_FIND); OwnerRepayment ownerRepayment = ownerRepaymentDao.getEntityByKey(id).orElseThrow(ResultEnum.DATA_NOT_FIND);
if (!ownerRepayment.getStatus().equals(OwnerRePaymentEnum.Status.PAYING.getCode())) { if (!ownerRepayment.getStatus().equals(OwnerRePaymentEnum.Status.PAYING.getCode())) {
log.info("还款记录状态异常,不是付款中,不能核销"); log.info("还款记录状态异常,不是付款中,不能核销");
throw new ServiceSystemException(PerformanceResultEnum.OWNER_LOAN_RECORD_ADJUST_STATUS_ERROR); throw new ServiceSystemException(PerformanceResultEnum.OWNER_LOAN_RECORD_ADJUST_STATUS_ERROR);
} }
NbBankOrderResultVO resultVO = bankService.adjust(ownerRepayment.getMerchantRunningWaterNo(),ownerRepayment.getRepaymentBalance().intValue()); NbBankOrderResultVO resultVO = bankService.adjust(ownerRepayment.getMerchantRunningWaterNo(),ownerRepayment.getRepaymentBalance().intValue());
if(Objects.equals(resultVO.getStatus(),NbBankStatusEnum.Status.SUCCESS.getCode())){ if(Objects.equals(resultVO.getStatus(),NbBankStatusEnum.Status.SUCCESS.getCode())){
ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_SUCCESS.getCode()); ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_SUCCESS.getCode());
this.paySuccess(ownerRepayment.getMerchantRunningWaterNo());
}else{ }else{
ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_FAIL.getCode()); ownerRepayment.setStatus(OwnerRePaymentEnum.Status.PAY_FAIL.getCode());
} }
ownerRepayment.setOperateBy(TokenUtil.getLoginUserInfo().getUserName());
// 更新借款信息 // 更新借款信息
ownerRepaymentDao.updateStatusById(ownerRepayment); ownerRepaymentDao.updateStatusById(ownerRepayment);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论