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

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

...@@ -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);
...@@ -96,19 +96,19 @@ public class CarrierOwnerLoanRecordController { ...@@ -96,19 +96,19 @@ public class CarrierOwnerLoanRecordController {
return Result.ok(url); return Result.ok(url);
} }
@ApiOperation(value = "借款支付",notes = "<br>By:艾庆国") // @ApiOperation(value = "借款支付",notes = "<br>By:艾庆国")
@PostMapping("/updateOwnerLoanRecordPay") // @PostMapping("/updateOwnerLoanRecordPay")
public Result<Object> updateOwnerLoanRecordPay(@RequestBody @Validated CarrierOwnerLoanRecordPayParam param) { // public Result<Object> updateOwnerLoanRecordPay(@RequestBody @Validated CarrierOwnerLoanRecordPayParam param) {
ownerLoanRecordService.updateOwnerLoanRecordPay(param); // ownerLoanRecordService.updateOwnerLoanRecordPay(param);
return Result.ok(); // return Result.ok();
} // }
@ApiOperation(value = "借款重新支付",notes = "<br>By:艾庆国") // @ApiOperation(value = "借款重新支付",notes = "<br>By:艾庆国")
@PostMapping("/updateOwnerLoanRecordRepay") // @PostMapping("/updateOwnerLoanRecordRepay")
public Result<Object> updateOwnerLoanRecordRepay(@RequestBody @Validated CarrierOwnerLoanRecordRepayParam param) { // public Result<Object> updateOwnerLoanRecordRepay(@RequestBody @Validated CarrierOwnerLoanRecordRepayParam param) {
ownerLoanRecordService.updateOwnerLoanRecordRepay(param); // ownerLoanRecordService.updateOwnerLoanRecordRepay(param);
return Result.ok(); // return Result.ok();
} // }
@ApiOperation(value = "借款支付取消",notes = "<br>By:艾庆国") @ApiOperation(value = "借款支付取消",notes = "<br>By:艾庆国")
@PostMapping("/updateOwnerLoanRecordPayCancel") @PostMapping("/updateOwnerLoanRecordPayCancel")
......
...@@ -96,16 +96,9 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O ...@@ -96,16 +96,9 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
); );
} }
@Override
public boolean updatePaySuccess(OwnerLoanRecord item) {
return update(lUdWrapper()
.eq(OwnerLoanRecord::getId, item.getId())
.set(OwnerLoanRecord::getStatus, item.getStatus())
);
}
@Override @Override
public boolean updatePayFail(OwnerLoanRecord item) { public boolean updateStatusById(OwnerLoanRecord item) {
return update(lUdWrapper() return update(lUdWrapper()
.eq(OwnerLoanRecord::getId, item.getId()) .eq(OwnerLoanRecord::getId, item.getId())
.set(OwnerLoanRecord::getStatus, item.getStatus()) .set(OwnerLoanRecord::getStatus, item.getStatus())
......
...@@ -27,7 +27,7 @@ public interface OwnerLoanRecordDao extends BaseDao<OwnerLoanRecordMapper, Owner ...@@ -27,7 +27,7 @@ public interface OwnerLoanRecordDao extends BaseDao<OwnerLoanRecordMapper, Owner
Optional<OwnerLoanRecord> selectByMerchantRunningWaterNo(String merchantRunningWaterNo); Optional<OwnerLoanRecord> selectByMerchantRunningWaterNo(String merchantRunningWaterNo);
boolean updatePay(OwnerLoanRecord item); boolean updatePay(OwnerLoanRecord item);
boolean updatePaySuccess(OwnerLoanRecord item);
boolean updatePayFail(OwnerLoanRecord item); boolean updateStatusById(OwnerLoanRecord item);
} }
...@@ -52,17 +52,12 @@ import com.msl.user.data.UserSessionData; ...@@ -52,17 +52,12 @@ import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil; import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Consumer;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -509,7 +504,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -509,7 +504,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAY_FAIL.getCode()); ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAY_FAIL.getCode());
ownerLoanRecordDao.updatePayFail(ownerLoanRecord); ownerLoanRecordDao.updateStatusById(ownerLoanRecord);
} }
...@@ -543,7 +538,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -543,7 +538,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
initOwnerLoanRunningWaterRecord(ownerLoanRecord); initOwnerLoanRunningWaterRecord(ownerLoanRecord);
//生成还款记录 //生成还款记录
initOwnerRepayment(ownerLoanRecord); initOwnerRepayment(ownerLoanRecord);
ownerLoanRecordDao.updatePaySuccess(ownerLoanRecord); ownerLoanRecordDao.updateStatusById(ownerLoanRecord);
break; break;
} }
} }
...@@ -552,43 +547,11 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -552,43 +547,11 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
@Override @Override
public void ownerLoanRecordRetryPay(String loanNo) { public void ownerLoanRecordRetryPay(String loanNo) {
BankTrade bankTrade = bankTradeDao.selectByMerchantRunningWaterNo(loanNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, loanNo) OwnerLoanRecord ownerLoanRecord = ownerLoanRecordDao.getOneByField(OwnerLoanRecord::getLoanNo, loanNo)
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.APPROVE_WAIT.getCode());
borrowerConfigDao.selectByBorrowerIdAndType(ownerLoanRecord.getBorrowerId(), OwnerLoanRecordEnum.LoanType.FUND.getCode()) // 更新借款信息
.orElseThrow(PerformanceResultEnum.BORROWER_CONFIG_TYPE_NOT_SUPPORT_ERROR); ownerLoanRecordDao.updateStatusById(ownerLoanRecord);
Borrower borrower = borrowerDao.getEntityByKey(ownerLoanRecord.getBorrowerId())
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (BankTradeEnum.TradeType.ORDER_DIRECT_PAY.getCode().equals(bankTrade.getTradeType())) {
//资金 TODO 调宁波银企直连的产品,从诚联信账户中给鑫祥和执行转账
// 订单支付
NbBankOrderPayResultVO orderPayResultVO = bankService.orderDirectPay(Long.valueOf(loanNo),
ownerLoanRecord.getLoanBalance().intValue(), borrower.getOpenBankId(), borrower.getBankCardNo(), borrower.getName());
ownerLoanRecord.setRunningWaterOpenNo(orderPayResultVO.getTransSeqNo());
ownerLoanRecord.setMerchantRunningWaterNo(orderPayResultVO.getMerSeqNo());
ownerLoanRecord.setRemittanceIdentificationCode(null);
ownerLoanRecord.setStatus(OwnerLoanRecordEnum.Status.PAYING.getCode());
ownerLoanRecord.setLoanResidueBalance(ownerLoanRecord.getLoanBalance());
ownerLoanRecord.setLendingParty(borrower.getName());
ownerLoanRecord.setLendingPartyAccount(borrower.getBankCardNo());
}
else {
//资金 TODO 调宁波银企直连的产品,从诚联信账户中给鑫祥和执行转账
// 转账支付
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());
ownerLoanRecord.setLendingParty(null);
ownerLoanRecord.setLendingPartyAccount(null);
}
// 更新借款支付信息
ownerLoanRecordDao.updatePay(ownerLoanRecord);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论