Commit 99598b8a authored by zhengjian's avatar zhengjian

你我贷

parent e5131dee
......@@ -52,27 +52,27 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
}
OCRIdCardRow ocrIdCardRow = list.get(0);
UserSysResult<UserInfo> userInfoByUuid = userSdkService.findUserInfoByUuid(uuid);
IdCardA idCardA = JSON.parseObject(ocrIdCardRow.getIdCardContentA(), IdCardA.class);
IdCardB idCardB = JSON.parseObject(ocrIdCardRow.getIdCardContentB(), IdCardB.class);
IdCardA idCardFront = JSON.parseObject(ocrIdCardRow.getIdCardContentA(), IdCardA.class);
IdCardB idCardBack = JSON.parseObject(ocrIdCardRow.getIdCardContentB(), IdCardB.class);
Map<String,String> addressMap = AddressResolutionUtil.addressResolution(idCardFront.getAddress());
NiwodaiIncomingRequestVO vo = new NiwodaiIncomingRequestVO();
vo.setOrderId(orderId);
NiwodaiCostant.UserInfo userInfo = new NiwodaiCostant.UserInfo();
userInfo.setRealName(idCardA.getName());
userInfo.setIdcardNumber(idCardA.getCitizen_id());
userInfo.setRealName(idCardFront.getName());
userInfo.setIdcardNumber(idCardFront.getCitizen_id());
userInfo.setPhone(userInfoByUuid.getData().getPhoneNo());
userInfo.setMaritalStatus(NiwodaiCostant.MaritalStatus.UNMARRIED.name());
userInfo.setGender("男".equals(idCardA.getGender()) ? NiwodaiCostant.Gender.MALE.name() : NiwodaiCostant.Gender.FEMALE.name());
userInfo.setGender("男".equals(idCardFront.getGender()) ? NiwodaiCostant.Gender.MALE.name() : NiwodaiCostant.Gender.FEMALE.name());
userInfo.setEducation(NiwodaiCostant.EducationalBackground.JUNIOR_SCHOOL_AND_BELOW.name());
userInfo.setOccupation(NiwodaiCostant.Occupation.WORKER.name());
userInfo.setIdcardValidity(idCardB.getValid_date_end());
userInfo.setIdcardValidity(idCardBack.getValid_date_end());
userInfo.setIdcardFront(ocrIdCardRow.getIdCardBaseContentA());
userInfo.setIdcardBack(ocrIdCardRow.getIdCardBaseContentB());
userInfo.setBioPhoto(ocrIdCardRow.getLivePhotoContent());
userInfo.setImageType("BASE64");
Map<String,String> addressMap = AddressResolutionUtil.addressResolution(userInfo.getAddress());
userInfo.setProvince(addressMap.get("province"));
userInfo.setCity(addressMap.get("city"));
userInfo.setAddress(idCardA.getAddress());
userInfo.setAddress(idCardFront.getAddress());
userInfo.setIndustry(NiwodaiCostant.Industry.ENTERTAINMENT.name());
userInfo.setIncome(NiwodaiCostant.Income.FOUR.name());
userInfo.setIncomeType(NiwodaiCostant.IncomeType.SALARY.name());
......
......@@ -11,6 +11,7 @@ import com.quantgroup.asset.distribution.service.redis.IRedisService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Base64;
......@@ -23,20 +24,20 @@ import static com.quantgroup.asset.distribution.exception.QGExceptionType.COMMON
@Slf4j
@Service
public class NiwodaiServiceImpl implements INiwodaiService {
final static String domain = "https://api.preprod.geerong.com:8443/test";
final static String domain2 = "https://api.preprod.geerong.com:8443/al/test/asset";
final static String dataImportCheckUrl = domain2 + "/std/v1/entry";
final static String authUrl = domain + "/oauth/token";
final static String incomingUrl = domain2 + "/std/v1/apply";
final static String clientId = "36c36b1e-5e60-4ef9-811c-6714fbf88d90";
final static String clientSecret = "3W8uCiQk7aM1Vxwgaltt2A0tDqN8YYoKnz62pj8rKxw0usZYN6fQRL8wB7Eq3XKy";
@Value("${niwodai.url.authDomain}")
private String domain;
@Value("${niwodai.url.dataDomain}")
private String domain2;
@Value("${niwodai.url.dataCheck}")
private String dataImportCheckUrl;
@Value("${niwodai.url.auth}")
private String authUrl;
@Value("${niwodai.url.incoming}")
private String incomingUrl;
@Value("${niwodai.client.id}")
private String clientId;
@Value("${niwodai.client.secret}")
private String clientSecret;
@Autowired
IRedisService<String> iRedisService;
......@@ -50,7 +51,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log.error("你我贷准入检查时获取token失败,requestVO : {}", JSON.toJSONString(requestVO));
throw new QGException("你我贷准入检查时获取token失败", COMMON_THIRD_PARTY_TIMEOUT);
}
String result = iHttpService.postNiwodaiJson(dataImportCheckUrl, commonHeader(token), JSON.toJSONString(requestVO), true);
String result = iHttpService.postNiwodaiJson(domain2 + dataImportCheckUrl, commonHeader(token), JSON.toJSONString(requestVO), true);
if (StringUtils.isNotEmpty(result)) {
return JSON.parseObject(result, NiwodaiDataImportCheckResponseVO.class);
}
......@@ -64,7 +65,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log.error("你我贷进件时获取token失败,requestVO : {}", JSON.toJSONString(requestVO));
throw new QGException("你我贷进件时获取token失败", COMMON_THIRD_PARTY_TIMEOUT);
}
String result = iHttpService.postNiwodaiJson(incomingUrl, commonHeader(token), JSON.toJSONString(requestVO),true);
String result = iHttpService.postNiwodaiJson(domain2 + incomingUrl, commonHeader(token), JSON.toJSONString(requestVO),true);
if (StringUtils.isNotEmpty(result)) {
return JSON.parseObject(result, NiwodaiIncomingResponseVO.class);
}
......@@ -93,7 +94,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
parameters.put("grant_type", "client_credentials");
String result = null;
try {
result = iHttpService.postNiwodai(authUrl, header, parameters, true);
result = iHttpService.postNiwodai(domain + authUrl, header, parameters, true);
} catch (Exception e) {
e.printStackTrace();
}
......
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