提交 71abd0e6 authored 作者: huningning's avatar huningning

审核添加逻辑限制

上级 b200a2e6
...@@ -118,6 +118,9 @@ public enum PerformanceResultEnum implements ResultEnum { ...@@ -118,6 +118,9 @@ public enum PerformanceResultEnum implements ResultEnum {
BORROWER_CONFIG_BORROWER_ID_EXIST(1703, "数据重复,请核实后重新提交"), BORROWER_CONFIG_BORROWER_ID_EXIST(1703, "数据重复,请核实后重新提交"),
BORROWER_CONFIG_DELETE_ENABLE_ERROR(1704, "无法删除启用数据"), BORROWER_CONFIG_DELETE_ENABLE_ERROR(1704, "无法删除启用数据"),
BORROWER_CONFIG_TYPE_NOT_SUPPORT_ERROR(1705, "借款类型不支持"), BORROWER_CONFIG_TYPE_NOT_SUPPORT_ERROR(1705, "借款类型不支持"),
BORROWER_CONFIG_DELETE_ENABLE_STATUS_ERROR(1706, "借款配置已禁用,不允许借款。"),
BORROWER_DELETE_ENABLE_STATUS_ERROR(1707, "借出方已禁用,不允许借款。"),
NB_BANK_API_ERROR(1800, "宁波银行api调用失败"), NB_BANK_API_ERROR(1800, "宁波银行api调用失败"),
NB_BANK_NOTIFY_ERROR(1801, "宁波银行回调失败"), NB_BANK_NOTIFY_ERROR(1801, "宁波银行回调失败"),
......
...@@ -29,10 +29,7 @@ import com.clx.performance.dto.LoanBalanceDTO; ...@@ -29,10 +29,7 @@ import com.clx.performance.dto.LoanBalanceDTO;
import com.clx.performance.dao.loan.*; import com.clx.performance.dao.loan.*;
import com.clx.performance.dto.OwnerLoanMqDTO; import com.clx.performance.dto.OwnerLoanMqDTO;
import com.clx.performance.enums.PerformanceResultEnum; import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.loan.BankTradeEnum; import com.clx.performance.enums.loan.*;
import com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum;
import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import com.clx.performance.enums.loan.OwnerRePaymentEnum;
import com.clx.performance.enums.nbbank.NbBankStatusEnum; import com.clx.performance.enums.nbbank.NbBankStatusEnum;
import com.clx.performance.event.OwnerLoanEvent; import com.clx.performance.event.OwnerLoanEvent;
import com.clx.performance.event.OwnerLoanThawEvent; import com.clx.performance.event.OwnerLoanThawEvent;
...@@ -191,9 +188,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService { ...@@ -191,9 +188,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
if (param.getStatus()) { if (param.getStatus()) {
BorrowerConfig borrowerConfig = borrowerConfigDao.selectByBorrowerIdAndType(ownerLoanRecord.getBorrowerId(), BorrowerConfig borrowerConfig = borrowerConfigDao.selectByBorrowerIdAndType(ownerLoanRecord.getBorrowerId(),
param.getLoanType()).orElseThrow(PerformanceResultEnum.BORROWER_CONFIG_TYPE_NOT_SUPPORT_ERROR); param.getLoanType()).orElseThrow(PerformanceResultEnum.BORROWER_CONFIG_TYPE_NOT_SUPPORT_ERROR);
// 借出方借款配置中,将借款类型为虚拟币的数据禁用,此时进行借款审核时,不应该再可以选择虚拟币;将资金禁用同理。
if ( Objects.equals(param.getLoanType(),borrowerConfig.getStatus()) &&
Objects.equals(borrowerConfig.getStatus(), BorrowerConfigEnum.Status.DISABLE.getCode())){
throw new ServiceSystemException(PerformanceResultEnum.BORROWER_CONFIG_DELETE_ENABLE_STATUS_ERROR);
}
Borrower borrower = borrowerDao.getEntityByKey(ownerLoanRecord.getBorrowerId()) Borrower borrower = borrowerDao.getEntityByKey(ownerLoanRecord.getBorrowerId())
.orElseThrow(PerformanceResultEnum.DATA_NOT_FIND); .orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
if (Objects.equals(borrower.getStatus(), BorrowerEnum.Status.DISABLE.getCode())){
throw new ServiceSystemException(PerformanceResultEnum.BORROWER_DELETE_ENABLE_STATUS_ERROR);
}
//同意 //同意
ownerLoanRecord.setLoanType(param.getLoanType()); ownerLoanRecord.setLoanType(param.getLoanType());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论