提交 b6416950 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
...@@ -387,7 +387,7 @@ public class OrderChildLoanComponent { ...@@ -387,7 +387,7 @@ public class OrderChildLoanComponent {
try { try {
lock = redissonClient.getLock(RedissonConstants.ORDER_CHILD_LOAN_OWNER_USERID_LOCK + dto.getOwnerUserNo()); lock = redissonClient.getLock(RedissonConstants.ORDER_CHILD_LOAN_OWNER_USERID_LOCK + dto.getOwnerUserNo());
boolean flag = lock.tryLock(15, 30, TimeUnit.SECONDS); boolean flag = lock.tryLock(3, 5, TimeUnit.SECONDS);
if (!flag) { if (!flag) {
throw new ServiceSystemException(PerformanceResultEnum.GET_LOAN_RECORD); throw new ServiceSystemException(PerformanceResultEnum.GET_LOAN_RECORD);
} }
......
...@@ -48,7 +48,7 @@ public class CarrierOwnerLoanRecordController { ...@@ -48,7 +48,7 @@ public class CarrierOwnerLoanRecordController {
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "重新支付(只更改借款状态)",notes = "<br>By:胡宇帆") @ApiOperation(value = "借款重新支付(只更改借款状态)",notes = "<br>By:胡宇帆")
@GetMapping("/ownerLoanRecordRetryPay") @GetMapping("/ownerLoanRecordRetryPay")
public Result<Object> ownerLoanRecordRetryPay(@RequestParam(value = "loanNo") @NotBlank String loanNo) { public Result<Object> ownerLoanRecordRetryPay(@RequestParam(value = "loanNo") @NotBlank String loanNo) {
ownerLoanRecordService.ownerLoanRecordRetryPay(loanNo); ownerLoanRecordService.ownerLoanRecordRetryPay(loanNo);
......
...@@ -69,11 +69,11 @@ public class OwnerLoanRecord implements HasKey<Integer> { ...@@ -69,11 +69,11 @@ public class OwnerLoanRecord implements HasKey<Integer> {
private BigDecimal loanResidueBalance; private BigDecimal loanResidueBalance;
@TableField("borrower_id") @TableField("borrower_id")
@ApiModelProperty("借方Id") @ApiModelProperty("借方Id")
private Integer borrowerId; private Integer borrowerId;
@TableField("borrower") @TableField("borrower")
@ApiModelProperty("借方") @ApiModelProperty("借方")
private String borrower; private String borrower;
@ApiModelProperty("借款方账户") @ApiModelProperty("借款方账户")
...@@ -90,7 +90,7 @@ public class OwnerLoanRecord implements HasKey<Integer> { ...@@ -90,7 +90,7 @@ public class OwnerLoanRecord implements HasKey<Integer> {
private String lendingParty; private String lendingParty;
@TableField("lending_party_account") @TableField("lending_party_account")
@ApiModelProperty("借方账户") @ApiModelProperty("借方账户")
private String lendingPartyAccount; private String lendingPartyAccount;
@TableField("payee") @TableField("payee")
......
...@@ -128,9 +128,13 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -128,9 +128,13 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
entity.setOwnerUserName(loginUserInfo.getUserName()); entity.setOwnerUserName(loginUserInfo.getUserName());
entity.setMobile(loginUserInfo.getUserMobile()); entity.setMobile(loginUserInfo.getUserMobile());
entity.setLoanBalance(param.getLoanBalance()); entity.setLoanBalance(param.getLoanBalance());
entity.setBorrowerId(param.getBorrowerId());
entity.setBorrower(param.getBorrower()); entity.setBorrower(param.getBorrower());
entity.setBorrowerAccount(ownerBindCardRecord.getBankCardNumber());
entity.setLendingParty(param.getLendingParty()); entity.setLendingParty(param.getLendingParty());
entity.setLendingPartyAccount(ownerBindCardRecord.getBankCardNumber());
entity.setPayee(param.getPayee()); entity.setPayee(param.getPayee());
entity.setPayeeAccount(param.getPayeeAccount()); entity.setPayeeAccount(param.getPayeeAccount());
entity.setCreateBy(loginUserInfo.getUserName()); entity.setCreateBy(loginUserInfo.getUserName());
...@@ -152,43 +156,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -152,43 +156,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord.setLoanType(param.getLoanType()); ownerLoanRecord.setLoanType(param.getLoanType());
if (OwnerLoanRecordEnum.LoanType.FUND.getCode().equals(param.getLoanType())) { if (OwnerLoanRecordEnum.LoanType.FUND.getCode().equals(param.getLoanType())) {
//资金 //ownerLoanRecord.setStatus()
BankTrade bankTrade = new BankTrade(); fundPayProcess(param, ownerLoanRecord, borrower);
if (OwnerLoanRecordEnum.PayChannel.ORDER_DIRECT_PAY.getCode().equals(param.getPayChannel())) {
// 订单支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderDirectPay(param.getLoanNo(),
ownerLoanRecord.getLoanBalance().intValue(), borrower.getOpenBankId(), borrower.getBankCardNo(), borrower.getName());
ownerLoanRecord.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
ownerLoanRecord.setLendingParty(borrower.getName());
ownerLoanRecord.setLendingPartyAccount(borrower.getBankCardNo());
bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_DIRECT_PAY.getCode());
} else {
// 转账支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderTransferPay(ownerLoanRecord.getLoanBalance().intValue());
ownerLoanRecord.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setRemittanceIdentificationCode(orderPayResultVO.getSignNo());
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_TRANSFER_PAY.getCode());
}
// 更新借款支付信息
ownerLoanRecordDao.updatePay(ownerLoanRecord);
bankTrade.setRelationNo(ownerLoanRecord.getLoanNo().toString());
bankTrade.setOrderType(BankTradeEnum.OrderType.OWNER_LOAN_RECORD.getCode());
bankTrade.setAmount(ownerLoanRecord.getLoanBalance());
bankTrade.setMerchantRunningWaterNo(ownerLoanRecord.getMerchantRunningWaterNo());
bankTrade.setRunningWaterOpenNo(ownerLoanRecord.getRunningWaterOpenNo());
// 保存银行交易记录
bankTradeDao.saveEntity(bankTrade);
} else { } else {
// 虚拟币 直接增加 更改状态审批通过 // 虚拟币 直接增加 更改状态审批通过
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.APPROVE_PASS.getCode()); ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.APPROVE_PASS.getCode());
...@@ -208,8 +177,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -208,8 +177,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
if (flag == 1) { if (flag == 1) {
//生成借款流水 //生成借款流水
initOwnerLoanRunningWaterRecord(ownerLoanRecord); initOwnerLoanRunningWaterRecord(ownerLoanRecord);
/* //生成还款记录 //生成还款记录
initOwnerRepayment(ownerLoanRecord);*/ initOwnerRepayment(ownerLoanRecord);
break; break;
} }
} }
...@@ -224,6 +193,46 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -224,6 +193,46 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecordDao.updateEntityByKey(ownerLoanRecord); ownerLoanRecordDao.updateEntityByKey(ownerLoanRecord);
} }
private void fundPayProcess(CarrierOwnerLoanRecordApproveParam param, OwnerLoanRecord ownerLoanRecord, Borrower borrower) {
//资金
BankTrade bankTrade = new BankTrade();
if (OwnerLoanRecordEnum.PayChannel.ORDER_DIRECT_PAY.getCode().equals(param.getPayChannel())) {
// 订单支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderDirectPay(param.getLoanNo(),
ownerLoanRecord.getLoanBalance().intValue(), borrower.getOpenBankId(), borrower.getBankCardNo(), borrower.getName());
ownerLoanRecord.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
ownerLoanRecord.setLendingParty(borrower.getName());
ownerLoanRecord.setLendingPartyAccount(borrower.getBankCardNo());
bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_DIRECT_PAY.getCode());
} else {
// 转账支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderTransferPay(ownerLoanRecord.getLoanBalance().intValue());
ownerLoanRecord.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setRemittanceIdentificationCode(orderPayResultVO.getSignNo());
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
bankTrade.setTradeType(BankTradeEnum.TradeType.ORDER_TRANSFER_PAY.getCode());
}
// 更新借款支付信息
ownerLoanRecordDao.updatePay(ownerLoanRecord);
bankTrade.setRelationNo(ownerLoanRecord.getLoanNo().toString());
bankTrade.setOrderType(BankTradeEnum.OrderType.OWNER_LOAN_RECORD.getCode());
bankTrade.setAmount(ownerLoanRecord.getLoanBalance());
bankTrade.setMerchantRunningWaterNo(ownerLoanRecord.getMerchantRunningWaterNo());
bankTrade.setRunningWaterOpenNo(ownerLoanRecord.getRunningWaterOpenNo());
// 保存银行交易记录
bankTradeDao.saveEntity(bankTrade);
}
@Override @Override
public IPage<OwnerLoanRecordVO> pageOwnerLoanRecordOfOwner(PageOwnerLoanRecordOfOwner param) { public IPage<OwnerLoanRecordVO> pageOwnerLoanRecordOfOwner(PageOwnerLoanRecordOfOwner param) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论