|
|
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.text.CharSequenceUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
@@ -68,6 +69,7 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.Random;
|
|
|
import java.util.Set;
|
|
|
import java.util.concurrent.Executors;
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
@@ -92,6 +94,8 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
private RiskManageMapper riskManageMapper;
|
|
|
@Resource
|
|
|
private AppFeign appFeign;
|
|
|
+ @Value("${risk.banned.tips}")
|
|
|
+ private String tips;
|
|
|
/**
|
|
|
* 查询配置字段选项
|
|
|
*/
|
|
|
@@ -445,6 +449,10 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
return Result.resultOk(RepMessage.QUERY_SUCCESS);
|
|
|
}
|
|
|
|
|
|
+ private String getTipsMsg(){
|
|
|
+ String[] split = tips.split(",");
|
|
|
+ return split[RandomUtil.randomInt(tips.length())];
|
|
|
+ }
|
|
|
/**
|
|
|
* 校验风控规则322
|
|
|
*/
|
|
|
@@ -466,7 +474,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
for (int i = 1; i < regDateList.size(); i++) {
|
|
|
interval = DateUtil.between(first, regDateList.get(i), DateUnit.DAY);
|
|
|
if(days > interval){
|
|
|
- riskLockUser(dyzUser,"322","系统判定重复刷单用户限制","当前用户已被风控!");
|
|
|
+ riskLockUser(dyzUser,"322","系统判定重复刷单用户限制",getTipsMsg());
|
|
|
}
|
|
|
first = regDateList.get(i);
|
|
|
}
|
|
|
@@ -501,7 +509,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
}
|
|
|
int ipSameCount = Integer.parseInt(configMap.get("ipSameCount"));
|
|
|
if(intCount > ipSameCount){//校验同IP登录次数大于预设值,锁定用户
|
|
|
- riskLockUser(dyzUser,"313","系统判定登录IP限制","当前用户已被风控!");
|
|
|
+ riskLockUser(dyzUser,"313","系统判定登录IP限制",getTipsMsg());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -586,7 +594,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(dyzUser, "746","系统判定小于最低收益限制","用户已被风控,风控编码:746");
|
|
|
+ riskLockUser(dyzUser, "746","系统判定小于最低收益限制",getTipsMsg());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -612,7 +620,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
//判断小于预设值的视频数超出预设次数
|
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
|
if(exact>haveCount){
|
|
|
- riskLockUser(dyzUser,"742","系统判定激励视频ecpm值过低","用户已被风控,风控编码:742");
|
|
|
+ riskLockUser(dyzUser,"742","系统判定激励视频ecpm值过低",getTipsMsg());
|
|
|
}
|
|
|
}
|
|
|
}
|