|
@@ -529,12 +529,12 @@ public class RiskServiceImpl implements RiskService {
|
|
|
adRecords = adRecords.stream().filter(s ->
|
|
adRecords = adRecords.stream().filter(s ->
|
|
|
DateUtil.isSameDay(DateUtil.parse(s.getFinishTime()), new Date())
|
|
DateUtil.isSameDay(DateUtil.parse(s.getFinishTime()), new Date())
|
|
|
).sorted(Comparator.comparing(YtDyzAdRecord::getFinishTime)).collect(Collectors.toList());
|
|
).sorted(Comparator.comparing(YtDyzAdRecord::getFinishTime)).collect(Collectors.toList());
|
|
|
- //校验风控742规则
|
|
|
|
|
|
|
+ //校验风控742规则 当日观看视频数已经达到风控条件预设的视频数
|
|
|
checkRisk742(dyzUser, adRecords);
|
|
checkRisk742(dyzUser, adRecords);
|
|
|
if (!adRecords.isEmpty() && adRecords.size() > 1) {
|
|
if (!adRecords.isEmpty() && adRecords.size() > 1) {
|
|
|
- //校验风控746规则
|
|
|
|
|
|
|
+ //校验风控746规则 判断当日获得收益的广告达到预设数值
|
|
|
checkRisk746(dyzUser, adRecords);
|
|
checkRisk746(dyzUser, adRecords);
|
|
|
- // 校验风控766规则
|
|
|
|
|
|
|
+ // 校验风控766规则 当日用户获得{}个获得奖励的激励视频,近期前{}个获得奖励的激励视频平均收益<{}
|
|
|
checkRisk766(dyzUser, adRecords);
|
|
checkRisk766(dyzUser, adRecords);
|
|
|
}
|
|
}
|
|
|
} catch (CommonException e) {
|
|
} catch (CommonException e) {
|
|
@@ -566,7 +566,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
if (revenues.size() > hourTaskLimit) {
|
|
if (revenues.size() > hourTaskLimit) {
|
|
|
String format = StrUtil.emptyToDefault(dyzUser.getPowerLimitTip(), "当前设备完成任务次数过多,请{}后重试!");
|
|
String format = StrUtil.emptyToDefault(dyzUser.getPowerLimitTip(), "当前设备完成任务次数过多,请{}后重试!");
|
|
|
- log.warn(StrUtil.format("[risk 768] adRecord count[{}] > hour limit[{}]", revenues.size(), hourTaskLimit));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 768]appId:{} userId:{} adRecordCount:{} hourLimit:{}",
|
|
|
|
|
+ dyzUser.getAppId(),dyzUser.getUserId(), revenues.size(), hourTaskLimit));
|
|
|
throw new CommonException(StrUtil.format(format,StrUtil.format("{}小时", hourCount)));
|
|
throw new CommonException(StrUtil.format(format,StrUtil.format("{}小时", hourCount)));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -602,7 +603,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
recordCount = revenues.size();
|
|
recordCount = revenues.size();
|
|
|
}
|
|
}
|
|
|
if (recordCount > monthTaskLimit) {
|
|
if (recordCount > monthTaskLimit) {
|
|
|
- log.warn(StrUtil.format("[risk 767] adRecord count[{}] > limit[{}]", recordCount, monthTaskLimit));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 767]appId:{} userId:{} adRecordCount:{} monthTaskLimit:{}",
|
|
|
|
|
+ dyzUser.getAppId(),dyzUser.getUserId(), recordCount, monthTaskLimit));
|
|
|
String format = StrUtil.emptyToDefault(dyzUser.getPowerLimitTip(), "当前设备完成任务次数过多,请{}后重试!");
|
|
String format = StrUtil.emptyToDefault(dyzUser.getPowerLimitTip(), "当前设备完成任务次数过多,请{}后重试!");
|
|
|
throw new CommonException(StrUtil.format(format, StrUtil.format("{}月", monthCount)));
|
|
throw new CommonException(StrUtil.format(format, StrUtil.format("{}月", monthCount)));
|
|
|
}
|
|
}
|
|
@@ -670,7 +672,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
.divide(new BigDecimal(count), RoundingMode.HALF_UP);
|
|
.divide(new BigDecimal(count), RoundingMode.HALF_UP);
|
|
|
}
|
|
}
|
|
|
if (averageRevenue.compareTo(averageRevenueLimit) < 0) {
|
|
if (averageRevenue.compareTo(averageRevenueLimit) < 0) {
|
|
|
- log.warn(StrUtil.format("[risk 766] averageRevenue{} averageRevenueLimit {}", averageRevenue, averageRevenueLimit));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 766]appId:{} userId:{} averageRevenue{} averageRevenueLimit {}",
|
|
|
|
|
+ dyzUser.getAppId(), dyzUser.getUserId(), averageRevenue, averageRevenueLimit));
|
|
|
// 自定义响应
|
|
// 自定义响应
|
|
|
throw new CommonException("766");
|
|
throw new CommonException("766");
|
|
|
}
|
|
}
|
|
@@ -696,8 +699,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
//获取最先的两条
|
|
//获取最先的两条
|
|
|
BigDecimal reduce = revenues.stream().map(YtDyzAdRecord::getRevenue).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
BigDecimal reduce = revenues.stream().map(YtDyzAdRecord::getRevenue).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
if(reduce.compareTo(income)<0){
|
|
if(reduce.compareTo(income)<0){
|
|
|
- log.warn(StrUtil.format("[risk 746] userId:{} reduce:{} income:{}",
|
|
|
|
|
- dyzUser.getUserId(), reduce, income));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 746]appId:{} userId:{} reduce:{} income:{}",
|
|
|
|
|
+ dyzUser.getAppId(), dyzUser.getUserId(), reduce, income));
|
|
|
riskLockUser(dyzUser, "746","系统判定小于最低收益限制",getTipsMsg());
|
|
riskLockUser(dyzUser, "746","系统判定小于最低收益限制",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -725,7 +728,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
//判断小于预设值的视频数超出预设次数
|
|
//判断小于预设值的视频数超出预设次数
|
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
|
if(exact>haveCount){
|
|
if(exact>haveCount){
|
|
|
- log.warn(StrUtil.format("[risk 742] exact{} > haveCount {}", exact, haveCount));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 742]appId:{} userId:{} exact:{} haveCount:{}",
|
|
|
|
|
+ dyzUser.getAppId(), dyzUser.getUserId(), exact, haveCount));
|
|
|
riskLockUser(dyzUser,"742","系统判定激励视频ecpm值过低",getTipsMsg());
|
|
riskLockUser(dyzUser,"742","系统判定激励视频ecpm值过低",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1121,8 +1125,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
BigDecimal limitValue = getLimitValue(view, "revenueLimit");
|
|
BigDecimal limitValue = getLimitValue(view, "revenueLimit");
|
|
|
checkResult = totalRevenue.compareTo(limitValue) >= 0;
|
|
checkResult = totalRevenue.compareTo(limitValue) >= 0;
|
|
|
if (!checkResult) {
|
|
if (!checkResult) {
|
|
|
- log.warn(StrUtil.format("[risk 344] userId:{},totalRevenue:{} revenueLimit:{}",
|
|
|
|
|
- dyzUser.getUserId(), totalRevenue, limitValue));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 344]appId:{} userId:{} totalRevenue:{} revenueLimit:{}",
|
|
|
|
|
+ dyzUser.getAppId(), dyzUser.getUserId(), totalRevenue, limitValue));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
// 校验总ecpm
|
|
// 校验总ecpm
|
|
@@ -1130,8 +1134,8 @@ public class RiskServiceImpl implements RiskService {
|
|
|
BigDecimal limitValue = getLimitValue(view2, "ecpmLimit");
|
|
BigDecimal limitValue = getLimitValue(view2, "ecpmLimit");
|
|
|
checkResult = checkResult && totalEcpm.compareTo(limitValue) >= 0;
|
|
checkResult = checkResult && totalEcpm.compareTo(limitValue) >= 0;
|
|
|
if (!checkResult) {
|
|
if (!checkResult) {
|
|
|
- log.warn(StrUtil.format("[risk 345] userId:{}, totalEcpm:{} > ecpmLimit:{}",
|
|
|
|
|
- dyzUser.getUserId(), totalEcpm, limitValue));
|
|
|
|
|
|
|
+ log.warn(StrUtil.format("[risk 345]]appId:{} userId:{}, totalEcpm:{} ecpmLimit:{}",
|
|
|
|
|
+ dyzUser.getAppId(), dyzUser.getUserId(), totalEcpm, limitValue));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|