|
@@ -5,8 +5,11 @@ import com.hrsk.cloud.eg.app.constant.ServerCodeEnums;
|
|
import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
|
|
import com.hrsk.cloud.eg.app.threedocking.LoanDockingApi;
|
|
import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
|
|
import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
|
|
import com.hrsk.cloud.eg.dto.data.user.UserBaseInfoDto;
|
|
import com.hrsk.cloud.eg.dto.data.user.UserBaseInfoDto;
|
|
|
|
+import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
|
|
import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
|
|
import com.hrsk.cloud.eg.infrastructure.config.client.config.RetryRestTemplate;
|
|
|
|
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.EgLoanApiConfigInfoDo;
|
|
import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
|
|
import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
|
|
|
|
+import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
|
|
import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
|
|
import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
|
|
import com.hrsk.cloud.eg.vo.response.DataVo;
|
|
import com.hrsk.cloud.eg.vo.response.DataVo;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
@@ -27,7 +30,7 @@ import java.util.Objects;
|
|
public class OpenApiCreditService implements LoanDockingApi {
|
|
public class OpenApiCreditService implements LoanDockingApi {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
- private ProductBusinessApiInfoService apiInfoService;
|
|
|
|
|
|
+ private EgApiService egApiService;
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private RetryRestTemplate httpRestTemplate;
|
|
private RetryRestTemplate httpRestTemplate;
|
|
@@ -57,14 +60,16 @@ public class OpenApiCreditService implements LoanDockingApi {
|
|
public DataVo qualityCheck(UserBaseInfoDto userInfo, PlanDto product) {
|
|
public DataVo qualityCheck(UserBaseInfoDto userInfo, PlanDto product) {
|
|
log.info("credit OpenApiCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
|
|
log.info("credit OpenApiCreditService qualityCheck begin...userId:{}", userInfo.getUserId());
|
|
try {
|
|
try {
|
|
- ProductBusinessApiInfoDo apiInfo = apiInfoService.getById(product.getApiId());
|
|
|
|
- if (StringUtils.isAnyEmpty(apiInfo.getOpenapiCheckUrl(), apiInfo.getOpenapiAccessKeySecret())) {
|
|
|
|
|
|
+ EgLoanApiConfigInfoDo loanApiConfigInfo = egApiService.getLoanApiConfigInfo(product.getApiId());
|
|
|
|
+ String config = HessianUtils.deserialize(loanApiConfigInfo.getRequestConfig()).toString();
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(config);
|
|
|
|
+ if (StringUtils.isAnyEmpty(jsonObject.getString("openapiCheckUrl"), jsonObject.getString("openapiAccessKeySecret"))) {
|
|
return DataVo.fail(product.getPlanName(), product.getPlanId());
|
|
return DataVo.fail(product.getPlanName(), product.getPlanId());
|
|
}
|
|
}
|
|
CheckInfo checkInfo = new CheckInfo();
|
|
CheckInfo checkInfo = new CheckInfo();
|
|
checkInfo.setPhoneMd5(userInfo.getPhoneMd5());
|
|
checkInfo.setPhoneMd5(userInfo.getPhoneMd5());
|
|
checkInfo.setCity(userInfo.getCompanyCity());
|
|
checkInfo.setCity(userInfo.getCompanyCity());
|
|
- String url = apiInfo.getOpenapiCheckUrl();
|
|
|
|
|
|
+ String url = jsonObject.getString("openapiCheckUrl");
|
|
log.info("credit qualityCheck OpenApiCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
|
|
log.info("credit qualityCheck OpenApiCreditService request userId:{}, url:{}, CheckInfo:{}", userInfo.getUserId(), url, checkInfo);
|
|
Result response = null;
|
|
Result response = null;
|
|
try {
|
|
try {
|