Commit f4a47251 authored by 张庆's avatar 张庆

Merge remote-tracking branch 'origin/master'

parents 45af3978 9b3a270e
...@@ -67,7 +67,7 @@ public class CreditSubmitCommand extends AbstractCommand { ...@@ -67,7 +67,7 @@ public class CreditSubmitCommand extends AbstractCommand {
String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody(); String requestBody = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
CreditSubmitRequest request = JSON.parseObject(requestBody, CreditSubmitRequest.class); CreditSubmitRequest request = JSON.parseObject(requestBody, CreditSubmitRequest.class);
JSONObject thirdDataReq=new JSONObject(); JSONObject thirdDataReq=new JSONObject();
thirdDataReq.put("orderNO",request.getOrderNo()); thirdDataReq.put("orderNo",request.getOrderNo());
windowsProducer.pullCreditThirdData(thirdDataReq); windowsProducer.pullCreditThirdData(thirdDataReq);
CreditModel order = creditComponent.getByOrderNo(request.getOrderNo()); CreditModel order = creditComponent.getByOrderNo(request.getOrderNo());
if (ObjectUtil.isNotNull(order)) { if (ObjectUtil.isNotNull(order)) {
......
package com.jqtx.windows.command; package com.jqtx.windows.command;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jqtx.infrastructure.oss.starter.config.OssUtils;
import com.jqtx.windows.common.factory.AbstractCommand; import com.jqtx.windows.common.factory.AbstractCommand;
import com.jqtx.windows.common.factory.RuntimeContextHolder;
import com.jqtx.windows.component.CreditComponent;
import com.jqtx.windows.component.model.CreditModel;
import com.jqtx.windows.web.request.RiskCreditRequest;
import com.jqtx.windows.web.response.JsonResult; import com.jqtx.windows.web.response.JsonResult;
import com.jqtx.windows.web.response.LoanSubmitResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class RiskQueryDataCommand extends AbstractCommand { public class RiskQueryDataCommand extends AbstractCommand {
@Override @Autowired
private CreditComponent creditComponent;
@Autowired
private OssUtils ossUtils;
public JsonResult execute() { public JsonResult execute() {
return null; String request = RuntimeContextHolder.currentRuntimeContext().getRequestBody();
RiskCreditRequest riskCreditRequest = JSON.parseObject(request, RiskCreditRequest.class);
CreditModel creditModel = creditComponent.getByOrderNo(riskCreditRequest.getOrderNo());
String data = ossUtils.getStringObject(creditModel.getCreditThirdUrl());
JSONObject jsonObject = JSONObject.parseObject(data);
return JsonResult.success(jsonObject.getJSONObject(riskCreditRequest.getApiCode()));
} }
} }
...@@ -43,14 +43,17 @@ public class CreditThirdDataListener extends AbstractMQConsumerHandler<JSONObjec ...@@ -43,14 +43,17 @@ public class CreditThirdDataListener extends AbstractMQConsumerHandler<JSONObjec
@Override @Override
public void run(JSONObject req) throws Exception { public void run(JSONObject req) throws Exception {
log.info("req:[{}]",req.toJSONString()); CreditModel creditModel= creditComponent.getByOrderNo(req.getString("orderNo"));
JSONObject thirdCredit = new JSONObject(); if(creditModel!=null&& creditModel.getCreditThirdStatus()!="INIT"){
thirdCredit.put("reqNo", req.getString("orderNo")); log.info("req:[{}]",req.toJSONString());
thirdCredit.put("type", "01"); JSONObject thirdCredit = new JSONObject();
abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_APPLY.getCode()); thirdCredit.put("reqNo", req.getString("orderNo"));
CreditModel creditModel1=new CreditModel(); thirdCredit.put("type", "01");
creditModel1.setCreditThirdStatus("INIT"); abcHttpClient.postRequest(thirdCredit.toJSONString(), ZNPostUrlEnum.CREDIT_APPLY.getCode());
creditComponent.updateByOrderNo(req.getString("orderNo"),creditModel1); CreditModel creditModel1=new CreditModel();
creditModel1.setCreditThirdStatus("INIT");
creditComponent.updateByOrderNo(req.getString("orderNo"),creditModel1);
}
} }
} }
package com.jqtx.windows.web.request;
import lombok.Data;
@Data
public class RiskCreditRequest {
private String orderNo;
private String clientName;
private String certNo;
private String clientCell;
private String apiCode;
}
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