Commit ec4ec31b authored by BlackJokerCJ's avatar BlackJokerCJ

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/jqtx/windows/command/LoanSubmitCommand.java
parents a87120f8 ec979df4
package com.jqtx.windows.command; package com.jqtx.windows.command;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jqtx.windows.common.exception.BizException; import com.jqtx.windows.common.exception.BizException;
...@@ -46,10 +47,14 @@ public class LoanSubmitCommand extends AbstractCommand { ...@@ -46,10 +47,14 @@ public class LoanSubmitCommand extends AbstractCommand {
public JsonResult execute() { public JsonResult execute() {
String request = RuntimeContextHolder.currentRuntimeContext().getRequestBody(); String request = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
LoanSubmitResponse loanSubmitResponse = JSON.parseObject(request, LoanSubmitResponse.class); LoanSubmitResponse loanSubmitResponse = JSON.parseObject(request, LoanSubmitResponse.class);
CreditModel byOrderNo = creditComponent.getByOrderNo(loanSubmitResponse.getOrderNo()); CreditModel creditModel = creditComponent.getByOrderNo(loanSubmitResponse.getOrderNo());
if (Objects.isNull(byOrderNo)) { if (Objects.isNull(creditModel)) {
throw new BizException(ExceptionCodeEnum.BIZ_CREDIT_NOT_FOUND_ERROR); throw new BizException(ExceptionCodeEnum.BIZ_CREDIT_NOT_FOUND_ERROR);
} }
//查询loan表是否存在
LoanModel loanComponentByLoanNo = loanComponent.getByLoanNo(loanSubmitResponse.getLoanNo());
Assert.isFalse(loanComponentByLoanNo != null, "重新借款单");
// 保存windows_loan表 // 保存windows_loan表
LoanModel loanModel = new LoanModel(); LoanModel loanModel = new LoanModel();
loanModel.setOrderNo(loanSubmitResponse.getOrderNo()); loanModel.setOrderNo(loanSubmitResponse.getOrderNo());
...@@ -62,17 +67,17 @@ public class LoanSubmitCommand extends AbstractCommand { ...@@ -62,17 +67,17 @@ public class LoanSubmitCommand extends AbstractCommand {
throw new BizException(ExceptionCodeEnum.SYSTEM_SQL_INSERT_ERROR); throw new BizException(ExceptionCodeEnum.SYSTEM_SQL_INSERT_ERROR);
} }
JSONObject thirdCredit=new JSONObject(); JSONObject thirdCredit = new JSONObject();
thirdCredit.put("reqNo",loanSubmitResponse.getOrderNo()); thirdCredit.put("reqNo", loanSubmitResponse.getOrderNo());
thirdCredit.put("type","01"); thirdCredit.put("type", "01");
abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_APPLY.getCode()); abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_APPLY.getCode());
CreditModel creditModel=new CreditModel(); CreditModel creditModel=new CreditModel();
creditModel.setCreditThirdStatus("INIT"); creditModel.setCreditThirdStatus("INIT");
creditComponent.updateByOrderNo(loanSubmitResponse.getOrderNo(),creditModel); creditComponent.updateByOrderNo(loanSubmitResponse.getOrderNo(),creditModel);
// 提现授信 // 提现授信
LoanCreditSubmitModel loanCreditSubmitModel = new LoanCreditSubmitModel(); LoanCreditSubmitModel model = new LoanCreditSubmitModel();
loanCreditSubmitModel.setOrderNo(byOrderNo.getOrderNo()); model.setOrderNo(byOrderNo.getOrderNo());
JsonResult<Boolean> booleanJsonResult = wakandaFeignService.loanCredit(loanCreditSubmitModel); JsonResult<Boolean> booleanJsonResult = wakandaFeignService.loanCredit(model);
return JsonResult.success(booleanJsonResult.isSuccess()); return JsonResult.success(booleanJsonResult.isSuccess());
} }
} }
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