|
|
@@ -2,7 +2,6 @@ package com.ytpm.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.collection.ConcurrentHashSet;
|
|
|
import cn.hutool.core.date.DateField;
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
@@ -13,7 +12,6 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.ytpm.advertise.enums.AdSourceTypeEnum;
|
|
|
@@ -61,7 +59,6 @@ import com.ytpm.service.RiskService;
|
|
|
import com.ytpm.util.FeignClientInvoker;
|
|
|
import com.ytpm.util.IPUtil;
|
|
|
import com.ytpm.util.RedisService;
|
|
|
-import com.ytpm.util.ResourceUtils;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -71,7 +68,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.io.IOException;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
@@ -88,7 +84,6 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
-import java.util.concurrent.ConcurrentSkipListSet;
|
|
|
import java.util.concurrent.CopyOnWriteArraySet;
|
|
|
import java.util.concurrent.ScheduledExecutorService;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
@@ -1080,21 +1075,27 @@ public class RiskServiceImpl implements RiskService {
|
|
|
}
|
|
|
param.setAgentId(configMapper.getApplicationOwner(dyzUser.getAppId()));
|
|
|
addBannedRecord(Collections.singletonList(dyzUser.getUserId()),param);
|
|
|
- YtPlatformUserApp userApp;
|
|
|
+ YtPlatformUserApp userApp = null;
|
|
|
if (dyzUser.getIosId() != null) {
|
|
|
userApp = appMapper.selectParentApp(dyzUser.getAppId());
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ if (userApp == null && dyzUser.getAppId() != null) {
|
|
|
YtApp ytApp = appMapper.selectRiskApp(dyzUser.getAppId());
|
|
|
- userApp = appMapper.selectParentApp(ytApp.getSuperiorId());
|
|
|
+ userApp = ytApp == null ? null : appMapper.selectParentApp(ytApp.getSuperiorId());
|
|
|
+ }
|
|
|
+ if (userApp != null) {
|
|
|
+ YtPlatformUserApp finalUserApp = userApp;
|
|
|
+ scheduledExecutorService.schedule(()->{
|
|
|
+ YtDyzUser next = new YtDyzUser();
|
|
|
+ next.setUserId(dyzUser.getUserId());
|
|
|
+ next.setUserStatus(UserStatusEnum.VISITOR_LOCK.getCode());
|
|
|
+ next.setRiskCode("344");
|
|
|
+ next.setRiskReason("预估收益不到上限游客用户风控");
|
|
|
+ feignInvoker.invoke(finalUserApp.getServiceName(), "updateUserInfo",next);
|
|
|
+ },300, TimeUnit.MILLISECONDS);
|
|
|
+ } else {
|
|
|
+ log.error("[checkLoginRisk] 未找到下游服务 无法回调updateUserInfo appId:{}", dyzUser.getAppId());
|
|
|
}
|
|
|
- scheduledExecutorService.schedule(()->{
|
|
|
- YtDyzUser next = new YtDyzUser();
|
|
|
- next.setUserId(dyzUser.getUserId());
|
|
|
- next.setUserStatus(UserStatusEnum.VISITOR_LOCK.getCode());
|
|
|
- next.setRiskCode("344");
|
|
|
- next.setRiskReason("预估收益不到上限游客用户风控");
|
|
|
- feignInvoker.invoke(userApp.getServiceName(), "updateUserInfo",next);
|
|
|
- },300, TimeUnit.MILLISECONDS);
|
|
|
//修改为解锁用户存入redis 24小时后进行解锁
|
|
|
log.debug(StrUtil.format("[checkLoginRisk] appId:{} (end - start):{}",
|
|
|
dyzUser.getAppId(), System.currentTimeMillis() - start));
|