Commit 637aad6b authored by 张庆's avatar 张庆

防止重复提交

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