Commit f79e24ac authored by liwenbin's avatar liwenbin

你我贷风控数据对象更改

parent 73a04f28
......@@ -147,7 +147,8 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
compnayInfo.setProvince(userInfo.getProvince());
vo.setCompanyInfo(compnayInfo);
vo.setMnoData(new NiwodaiCostant.MnoData());
vo.setChannelRiskData(getUserTag(userLoanType, data));
NiwodaiCostant.RiskData riskData = getRiskData(userLoanType, data);
vo.setChannelRiskData(riskData);
return niwodaiService.incoming(vo, assetForm.getUuid());
}
......@@ -437,4 +438,30 @@ public class NiwodaiAssetServiceImpl implements INiwodaiAssetService {
}
}
}
/**
* 获取风控分数
* @param data
* @param key
* @return
*/
private BigDecimal getRiskScore(Map<String, Object> data, String key) {
return data.get(key) == null ? new BigDecimal(-9999999) : new BigDecimal(String.valueOf(data.get(key)));
}
/**
* 获取风控数据对象
* @param userLoanType
* @param data
* @return
*/
private NiwodaiCostant.RiskData getRiskData(int userLoanType, Map<String, Object> data) {
NiwodaiCostant.RiskData riskData = new NiwodaiCostant.RiskData();
riskData.setIn_label(String.valueOf(getUserTag(userLoanType, data)));
riskData.setRisk_score2(getRiskScore(data, "model_exec_data_source#xinyan_v5"));
riskData.setRisk_score3(getRiskScore(data, "third_data_source#tencent_md5_risk_new_riskScore"));
return riskData;
}
}
......@@ -51,7 +51,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log.error("你我贷准入检查时获取token失败, uuid : {}", uuid);
throw new QGException(QGExceptionType.GET_NIWODAI_TOKEN_ERROR);
}
String result = iHttpService.postNiwodaiJson(domain2 + dataImportCheckUrl, commonHeader(token), JSON.toJSONString(requestVO), false);
String result = iHttpService.postNiwodaiJson(domain2 + dataImportCheckUrl, commonHeader(token), JSON.toJSONString(requestVO), true);
log.info("你我贷准入检查接口调用结束, uuid : {}, requestVo : {}, response : {}", uuid, JSON.toJSONString(requestVO), result);
if (StringUtils.isNotEmpty(result)) {
NiwodaiDataImportCheckResponseVO vo = JSON.parseObject(result, NiwodaiDataImportCheckResponseVO.class);
......@@ -69,7 +69,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
log.error("你我贷进件时获取token失败, uuid : {}, bizNo : {}", uuid, requestVO.getOrderId());
throw new QGException(QGExceptionType.GET_NIWODAI_TOKEN_ERROR);
}
String result = iHttpService.postNiwodaiJson(domain2 + incomingUrl, commonHeader(token), JSON.toJSONString(requestVO),false);
String result = iHttpService.postNiwodaiJson(domain2 + incomingUrl, commonHeader(token), JSON.toJSONString(requestVO),true);
log.info("你我贷进件接口审核接口结束, uuid : {}, bizNo : {}, response : {}", uuid, requestVO.getOrderId(), result);
if (StringUtils.isNotEmpty(result)) {
NiwodaiIncomingResponseVO vo = JSON.parseObject(result, NiwodaiIncomingResponseVO.class);
......
......@@ -663,4 +663,27 @@ public class NiwodaiCostant {
*/
public static final Integer REJECT = 2;
}
/**
* 风控数据
*/
@Data
public static class RiskData {
/**
* 进件类型,1-自然流量,2-拒绝流量
*/
private String in_label;
/**
* 量子分8
*/
private BigDecimal risk_score2;
/**
* 量子分12
*/
private BigDecimal risk_score3;
}
}
......@@ -49,10 +49,9 @@ public class NiwodaiIncomingRequestVO implements Serializable {
private NiwodaiCostant.CreditRefData creditRefData;
/**
* 渠道风控信息,用与联合建模
* 1-自然流量,2-拒绝流量
* 风控数据对象
*/
private Integer channelRiskData;
private NiwodaiCostant.RiskData channelRiskData;
public Map<String,Object> toMap(){
return JSONObject.parseObject(JSON.toJSONString(this));
......
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