|
|
@@ -438,7 +438,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
}
|
|
|
int ipSameCount = Integer.parseInt(configMap.get("ipSameCount"));
|
|
|
if(intCount > ipSameCount){//校验同IP登录次数大于预设值,锁定用户
|
|
|
- riskLockUser(dyzUser.getUserId(), "313","系统判定登录IP限制","当前用户已被风控!");
|
|
|
+ riskLockUser(dyzUser.getUserId(), dyzUser.getAppId(),"313","系统判定登录IP限制","当前用户已被风控!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -462,7 +462,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
* 校验广告的默认风控配置
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result<?> checkAdRisk(String userId,BigDecimal userRevenue) {
|
|
|
+ public Result<?> checkAdRisk(String userId,String appId) {
|
|
|
ResultTable<YtDyzAdRecord> table = appFeign.adRecords(userId);
|
|
|
List<YtDyzAdRecord> records = table.getData();
|
|
|
if(records.isEmpty()){
|
|
|
@@ -476,10 +476,10 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
).sorted(Comparator.comparing(YtDyzAdRecord::getFinishTime)).collect(Collectors.toList());
|
|
|
//校验风控742规则
|
|
|
RiskTemplateView ecpmLimit= configMapper.getByCode("742");
|
|
|
- checkRisk742(ecpmLimit,userId,records);
|
|
|
+ checkRisk742(ecpmLimit,userId,appId,records);
|
|
|
//校验风控746规则
|
|
|
if(!records.isEmpty() && records.size()>1){
|
|
|
- checkRisk746(userId,records);
|
|
|
+ checkRisk746(userId,appId,records);
|
|
|
}
|
|
|
return Result.resultOk(RepMessage.QUERY_SUCCESS);
|
|
|
}
|
|
|
@@ -487,7 +487,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
/**
|
|
|
* 校验默认风控规则746
|
|
|
*/
|
|
|
- private void checkRisk746(String userId, List<YtDyzAdRecord> records) {
|
|
|
+ private void checkRisk746(String userId,String appId, List<YtDyzAdRecord> records) {
|
|
|
RiskTemplateView revenue = configMapper.getByCode("746");
|
|
|
Map<String, String> revenueMap = revenue.getConfigList().stream().collect(
|
|
|
Collectors.toMap(RiskConfigView::getFieldName, RiskConfigView::getConfigVal));
|
|
|
@@ -502,7 +502,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
//获取最先的两条
|
|
|
BigDecimal reduce = revenues.stream().map(YtDyzAdRecord::getRevenue).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if(reduce.compareTo(income)<0){
|
|
|
- riskLockUser(userId, "746","系统判定小于最低收益限制","用户已被风控,风控编码:746");
|
|
|
+ riskLockUser(userId,appId, "746","系统判定小于最低收益限制","用户已被风控,风控编码:746");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -510,7 +510,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
/**
|
|
|
* 校验默认风控规则742
|
|
|
*/
|
|
|
- private void checkRisk742(RiskTemplateView ecpmLimit,String userId,List<YtDyzAdRecord> records) {
|
|
|
+ private void checkRisk742(RiskTemplateView ecpmLimit,String userId,String appId,List<YtDyzAdRecord> records) {
|
|
|
Map<String, String> limitMap = ecpmLimit.getConfigList().stream().collect(
|
|
|
Collectors.toMap(RiskConfigView::getFieldName, RiskConfigView::getConfigVal));
|
|
|
int adCount = 0;
|
|
|
@@ -527,7 +527,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
//判断小于预设值的视频数超出预设次数
|
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
|
if(exact>haveCount){
|
|
|
- riskLockUser(userId, "742","系统判定激励视频ecpm值过低","用户已被风控,风控编码:742");
|
|
|
+ riskLockUser(userId, appId,"742","系统判定激励视频ecpm值过低","用户已被风控,风控编码:742");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -535,10 +535,11 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
/**
|
|
|
* 风控锁定用户
|
|
|
*/
|
|
|
- private void riskLockUser(String userId, String riskCode, String tempName, String errMsg) {
|
|
|
+ private void riskLockUser(String userId,String appId, String riskCode, String tempName, String errMsg) {
|
|
|
//增加用户风控记录
|
|
|
RiskBannedParam param = new RiskBannedParam();
|
|
|
param.setUserId(userId);
|
|
|
+ param.setAppId(appId);
|
|
|
param.setBannedLimit(24);
|
|
|
param.setOperator("系统风控");
|
|
|
param.setBannedReason(tempName);
|