Commit fc88cc7c authored by BlackJokerCJ's avatar BlackJokerCJ

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jqtx/windows/component/impl/LoanComponentImpl.java
parents 29ef77d7 e3854e89
......@@ -50,7 +50,9 @@ public class LoanSubmitCommand extends AbstractCommand {
//查询loan表是否存在
LoanModel loanComponentByLoanNo = loanComponent.getByLoanNo(loanSubmitResponse.getLoanNo());
Assert.isFalse(loanComponentByLoanNo != null, "重新借款单");
//防止重复提交
LoanModel loanComponentByOrderNoInit = loanComponent.getByOrderNoInit(loanSubmitResponse.getOrderNo());
Assert.isFalse(loanComponentByOrderNoInit != null, "提现风控未出结果,请勿重复操作");
// 保存windows_loan表
LoanModel loanModel = new LoanModel();
loanModel.setOrderNo(loanSubmitResponse.getOrderNo());
......@@ -62,8 +64,6 @@ public class LoanSubmitCommand extends AbstractCommand {
if (!insert) {
throw new BizException(ExceptionCodeEnum.SYSTEM_SQL_INSERT_ERROR);
}
// 提现授信
LoanCreditSubmitModel model = new LoanCreditSubmitModel();
model.setOrderNo(loanSubmitResponse.getOrderNo());
......
......@@ -35,7 +35,7 @@ public class LoanResultListener extends AbstractMQConsumerHandler<CreditResultMo
@Override
public void run(CreditResultModel creditResultModel) throws Exception {
LoanModel byOrderNo = loanComponent.getByOrderNo(creditResultModel.getOrderNo());
LoanModel byOrderNo = loanComponent.getByOrderNoInit(creditResultModel.getOrderNo());
if (ObjectUtil.isNull(byOrderNo) || !CreditResultStatusEnum.INIT.name().equals(byOrderNo.getLoanCreditResult())) {
return;
}
......
......@@ -14,4 +14,6 @@ public interface LoanComponent {
Boolean insert(LoanModel loanModel);
LoanModel getByOrderNo(String orderNo);
LoanModel getByOrderNoInit(String orderNo);
}
......@@ -51,4 +51,16 @@ public class LoanComponentImpl implements LoanComponent {
List<WindowsLoan> windowsLoans = windowsLoanMapper.selectByExample(example);
return windowsLoans.stream().map(m -> BeanUtil.toBean(m, LoanModel.class)).findFirst().orElse(null);
}
@Override
public LoanModel getByOrderNoInit(String orderNo) {
WindowsLoanExample example = new WindowsLoanExample();
WindowsLoanExample.Criteria criteria = example.createCriteria();
criteria.andOrderNoEqualTo(orderNo);
criteria.andLoanCreditResultEqualTo("INIT");
example.setOrderByClause("id desc");
example.setOrderByClause("id desc");
List<WindowsLoan> windowsLoans = windowsLoanMapper.selectByExample(example);
return windowsLoans.stream().map(m -> BeanUtil.toBean(m, LoanModel.class)).findFirst().orElse(null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment