|
|
@@ -456,12 +456,15 @@ public class RiskServiceImpl implements RiskService {
|
|
|
s -> s.getLoginTime().after(yesterday) &&
|
|
|
s.getLoginTime().before(new Date())).collect(Collectors.toList());
|
|
|
int intCount = 0;
|
|
|
- if(!dayLoginList.isEmpty()){
|
|
|
- List<String> ipaddrList = dayLoginList.stream().map(
|
|
|
- YtDyzLoginRecord::getLoginIp).distinct().collect(Collectors.toList());
|
|
|
+ if(!dayLoginList.isEmpty() && configMap.get("ipPrefix") != null){
|
|
|
+ List<String> ipaddrList = dayLoginList.stream()
|
|
|
+ .map(YtDyzLoginRecord::getLoginIp).distinct()
|
|
|
+ .filter(StrUtil::isNotEmpty)
|
|
|
+ .collect(Collectors.toList());
|
|
|
List<String> ipResult = new ArrayList<>();
|
|
|
+ int ipPrefix = Integer.parseInt(configMap.get("ipPrefix"));
|
|
|
for (String ipaddr : ipaddrList) {
|
|
|
- ipResult.add(ipaddr.substring(0,Integer.parseInt(configMap.get("ipPrefix"))));
|
|
|
+ ipResult.add(ipaddr.substring(0, ipPrefix));
|
|
|
}
|
|
|
intCount = Math.toIntExact(ipResult.size());
|
|
|
}
|