Commit 03624105 authored by LSL's avatar LSL

Merge remote-tracking branch 'origin/master'

parents 23f1c6cf ab911575
......@@ -3,6 +3,7 @@ package com.jqtx.windows.command;
import com.alibaba.fastjson.JSONObject;
import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.infrastructure.oss.starter.properties.OssProperties;
import com.jqtx.windows.common.exception.BizException;
import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder;
......@@ -22,6 +23,8 @@ public class GetSignContractCommand extends AbstractCommand {
private IProtocalFeignService iProtocalFeignService;
@Autowired
private OssUtils ossUtils;
@Autowired
private OssProperties ossProperties;
@Override
......@@ -33,7 +36,7 @@ public class GetSignContractCommand extends AbstractCommand {
JsonResult<String> rongdanPdfJsonResult = iProtocalFeignService.getFilePathPdf(getSignContractModel.getLoanNo(), "own-rongdan");
if (rongdanPdfJsonResult.isSuccess() && StringUtils.isNotEmpty(rongdanPdfJsonResult.getResult())) {
getSignContractResponse.setSignStatus("SIGN");
String path = ossUtils.generateTempURLPrivateDomain(rongdanPdfJsonResult.getResult());
String path = ossProperties.getPrivateDomain() + rongdanPdfJsonResult.getResult();
getSignContractResponse.setContractFileUrl(path);
} else {
getSignContractResponse.setSignStatus("SIGN_ING");
......
......@@ -7,19 +7,26 @@ import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder;
import com.jqtx.windows.common.utils.ValidateUtil;
import com.jqtx.windows.component.CreditResultComponent;
import com.jqtx.windows.component.LoanComponent;
import com.jqtx.windows.component.model.CreditResultModel;
import com.jqtx.windows.component.model.LoanModel;
import com.jqtx.windows.web.request.SyncCreditResultRequest;
import com.jqtx.windows.web.response.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@Service
@Slf4j
public class SyncCreditCommand extends AbstractCommand {
@Autowired
private CreditResultComponent creditResultComponent;
@Autowired
private LoanComponent loanComponent;
@Override
public JsonResult execute() {
......@@ -31,6 +38,16 @@ public class SyncCreditCommand extends AbstractCommand {
CreditResultModel creditResultModel = BeanUtil.toBean(syncCreditResultRequest, CreditResultModel.class);
creditResultModel.setCreditStatus(syncCreditResultRequest.getStatus());
creditResultComponent.insert(creditResultModel);
if (StringUtils.isNotEmpty(creditResultModel.getLoanNo())) {
boolean pass=syncCreditResultRequest.getStatus().equals("1");
LoanModel loanModel = new LoanModel();
loanModel.setLoanNo(creditResultModel.getLoanNo());
loanModel.setLoanStatus(pass?"AUDITED":"CANCELED");
loanModel.setGmtModified(LocalDateTime.now());
loanComponent.updateByLoanNo(loanModel);
}
} catch (Exception e) {
log.error("同步授信结果授信编号:{},报错:{}", syncCreditResultRequest.getOrderNo(), e.getMessage(), e);
throw new BizException("同步授信结果错误");
......
......@@ -55,6 +55,7 @@ public class ExceptionConfig {
@ResponseBody
public JsonResult handleHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e,
HttpServletRequest request) {
log.error("全局异常捕捉:HttpRequestMethodNotSupportedException[url:{},message:{}]", request.getRequestURI(),
e.getMessage(), e);
return JsonResult.error(ExceptionCodeEnum.HTTP_METHOD_ERROR);
......
......@@ -27,7 +27,8 @@ public class ZyJsonResult<T> implements Serializable {
private T result;
@ApiModelProperty("扩展字段")
private JSONArray externalInfo;
@ApiModelProperty("返回码")
private String status ;
public JSONArray getExternalInfo() {
return externalInfo;
}
......@@ -79,4 +80,19 @@ public class ZyJsonResult<T> implements Serializable {
this.result = result;
}
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
......@@ -44,8 +44,10 @@ public class CreditThirdDataJob {
thirdCredit.put("reqNo", c.getOrderNo());
thirdCredit.put("type", "01");
ZyJsonResult zyJsonResult = abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_QUERY.getCode());
JSONArray jsonArray = zyJsonResult.getExternalInfo();
processThirdData(c.getClientCell(), c.getOrderNo(), jsonArray);
if("00".equalsIgnoreCase(zyJsonResult.getStatus())||"01".equalsIgnoreCase(zyJsonResult.getStatus())){
JSONArray jsonArray = zyJsonResult.getExternalInfo();
processThirdData(c.getClientCell(), c.getOrderNo(), jsonArray);
}
});
List<CreditModel> withdraw = creditComponent.getListModelByCreditThirdStatus("INIT-WITHDRAW");
......@@ -54,9 +56,13 @@ public class CreditThirdDataJob {
JSONObject thirdCredit = new JSONObject();
thirdCredit.put("reqNo", loanModel.getLoanNo());
thirdCredit.put("type", "02");
ZyJsonResult zyJsonResult = abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_QUERY.getCode());
JSONArray jsonArray = zyJsonResult.getExternalInfo();
processThirdData(w.getClientCell(), w.getOrderNo(), jsonArray);
if("00".equalsIgnoreCase(zyJsonResult.getStatus())||"01".equalsIgnoreCase(zyJsonResult.getStatus())){
JSONArray jsonArray = zyJsonResult.getExternalInfo();
processThirdData(w.getClientCell(), w.getOrderNo(), jsonArray);
}
});
}
......
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