|
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.ytpm.advertise.enums.AdSourceTypeEnum;
|
|
import com.ytpm.advertise.enums.AdSourceTypeEnum;
|
|
|
|
|
+import com.ytpm.agent.enums.UserStatusEnum;
|
|
|
import com.ytpm.agent.model.YtApp;
|
|
import com.ytpm.agent.model.YtApp;
|
|
|
import com.ytpm.agent.model.YtPlatformBanned;
|
|
import com.ytpm.agent.model.YtPlatformBanned;
|
|
|
import com.ytpm.agent.model.YtPlatformDeblocking;
|
|
import com.ytpm.agent.model.YtPlatformDeblocking;
|
|
@@ -80,6 +81,9 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
+import java.util.concurrent.ScheduledExecutorService;
|
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@Slf4j(topic = "风控服务")
|
|
@Slf4j(topic = "风控服务")
|
|
@@ -422,7 +426,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
).count();
|
|
).count();
|
|
|
//三天内注册的渠道数小于预设的渠道数通过校验,否则风控锁定用户
|
|
//三天内注册的渠道数小于预设的渠道数通过校验,否则风控锁定用户
|
|
|
if(ditchCount<uidCount)return;
|
|
if(ditchCount<uidCount)return;
|
|
|
- riskLockUser(dyzUser,"系统判定重复刷单用户限制",getTipsMsg());
|
|
|
|
|
|
|
+ riskLockUser(dyzUser,"322","系统判定重复刷单用户限制",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -454,7 +458,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
}
|
|
}
|
|
|
int ipSameCount = Integer.parseInt(configMap.get("ipSameCount"));
|
|
int ipSameCount = Integer.parseInt(configMap.get("ipSameCount"));
|
|
|
if(intCount > ipSameCount){//校验同IP登录次数大于预设值,锁定用户
|
|
if(intCount > ipSameCount){//校验同IP登录次数大于预设值,锁定用户
|
|
|
- riskLockUser(dyzUser,"系统判定登录IP限制",getTipsMsg());
|
|
|
|
|
|
|
+ riskLockUser(dyzUser,"313","系统判定登录IP限制",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -545,7 +549,7 @@ public class RiskServiceImpl extends ReflectUtil 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){
|
|
|
- riskLockUser(dyzUser, "系统判定小于最低收益限制",getTipsMsg());
|
|
|
|
|
|
|
+ riskLockUser(dyzUser, "746","系统判定小于最低收益限制",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -571,7 +575,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
//判断小于预设值的视频数超出预设次数
|
|
//判断小于预设值的视频数超出预设次数
|
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
int haveCount = Integer.parseInt(limitMap.get("haveCount"));
|
|
|
if(exact>haveCount){
|
|
if(exact>haveCount){
|
|
|
- riskLockUser(dyzUser,"系统判定激励视频ecpm值过低",getTipsMsg());
|
|
|
|
|
|
|
+ riskLockUser(dyzUser,"742","系统判定激励视频ecpm值过低",getTipsMsg());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -579,7 +583,7 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
/**
|
|
/**
|
|
|
* 风控锁定用户
|
|
* 风控锁定用户
|
|
|
*/
|
|
*/
|
|
|
- private void riskLockUser(YtDyzUser dyzUser, String tempName, String errMsg) {
|
|
|
|
|
|
|
+ private void riskLockUser(YtDyzUser dyzUser,String riskCode, String tempName, String errMsg) {
|
|
|
//增加用户风控记录
|
|
//增加用户风控记录
|
|
|
RiskBannedParam param = new RiskBannedParam();
|
|
RiskBannedParam param = new RiskBannedParam();
|
|
|
param.setUserId(dyzUser.getUserId());
|
|
param.setUserId(dyzUser.getUserId());
|
|
@@ -591,9 +595,21 @@ public class RiskServiceImpl extends ReflectUtil implements RiskService {
|
|
|
param.setOperatorName("系统风控");
|
|
param.setOperatorName("系统风控");
|
|
|
param.setAgentId(configMapper.getApplicationOwner(dyzUser.getAppId()));
|
|
param.setAgentId(configMapper.getApplicationOwner(dyzUser.getAppId()));
|
|
|
addBannedRecord(Collections.singletonList(dyzUser.getUserId()),param);
|
|
addBannedRecord(Collections.singletonList(dyzUser.getUserId()),param);
|
|
|
- redisService.setTimeOutStr("lock_"+dyzUser.getUserId(), dyzUser.getAppId(), 3000);
|
|
|
|
|
|
|
+ YtApp app = appMapper.selectRiskApp(dyzUser.getAppId());
|
|
|
|
|
+ YtPlatformUserApp appInfo = appMapper.selectParentApp(app.getSuperiorId());
|
|
|
|
|
+
|
|
|
|
|
+ ScheduledExecutorService scheduled = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
|
+ scheduled.schedule(()->{
|
|
|
|
|
+ YtDyzUser next = new YtDyzUser();
|
|
|
|
|
+ next.setUserId(dyzUser.getUserId());
|
|
|
|
|
+ next.setUserStatus(UserStatusEnum.LOCK.getCode());
|
|
|
|
|
+ next.setRiskCode(riskCode);
|
|
|
|
|
+ next.setRiskReason(tempName);
|
|
|
|
|
+ feignInvoker.invoke(appInfo.getServiceName(), "updateUserInfo",next);
|
|
|
|
|
+ },300, TimeUnit.MILLISECONDS);
|
|
|
//修改为解锁用户存入redis 24小时后进行解锁
|
|
//修改为解锁用户存入redis 24小时后进行解锁
|
|
|
redisService.setTimeOutHoursStr("unlock_"+dyzUser.getUserId(),dyzUser.getAppId(), 24);
|
|
redisService.setTimeOutHoursStr("unlock_"+dyzUser.getUserId(),dyzUser.getAppId(), 24);
|
|
|
|
|
+ scheduled.shutdown();
|
|
|
throw new CustomerException(errMsg);
|
|
throw new CustomerException(errMsg);
|
|
|
}
|
|
}
|
|
|
|
|
|