|
@ -186,57 +186,58 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
//获取飞行总架次、总时长
|
|
|
//获取飞行总架次、总时长
|
|
|
//获取机场信息根据当前登录人
|
|
|
//获取机场信息根据当前登录人
|
|
|
List<String> deviceSnList = ObjectUtil.isNotEmpty(feignDeviceGroup.listDevice(LoginHelper.getUserId()))?feignDeviceGroup.listDevice(LoginHelper.getUserId()):ListUtil.empty(); |
|
|
// List<String> deviceSnList = ObjectUtil.isNotEmpty(feignDeviceGroup.listDevice(LoginHelper.getUserId()))?feignDeviceGroup.listDevice(LoginHelper.getUserId()):ListUtil.empty();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//过滤redis中用户所拥有的设备
|
|
|
//过滤redis中用户所拥有的设备
|
|
|
Map<String, Object> countMap = Optional.ofNullable(RedisUtils.getCacheMap(FLY_COUNT)) |
|
|
// Map<String, Object> countMap = Optional.ofNullable(RedisUtils.getCacheMap(FLY_COUNT))
|
|
|
.map(map -> map.entrySet().stream() |
|
|
// .map(map -> map.entrySet().stream()
|
|
|
.filter(entry -> deviceSnList.contains(entry.getKey())) |
|
|
// .filter(entry -> deviceSnList.contains(entry.getKey()))
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))) |
|
|
// .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))
|
|
|
.orElse(new HashMap<>()); |
|
|
// .orElse(new HashMap<>());
|
|
|
|
|
|
|
|
|
int flyCount; |
|
|
// int flyCount;
|
|
|
|
|
|
//
|
|
|
if (ObjectUtil.isNotEmpty(countMap)){ |
|
|
// if (ObjectUtil.isNotEmpty(countMap)){
|
|
|
flyCount = countMap.values().stream() |
|
|
// flyCount = countMap.values().stream()
|
|
|
.filter(Objects::nonNull) |
|
|
// .filter(Objects::nonNull)
|
|
|
.mapToInt(value -> { |
|
|
// .mapToInt(value -> {
|
|
|
if (value instanceof Number) { |
|
|
// if (value instanceof Number) {
|
|
|
return ((Number) value).intValue(); |
|
|
// return ((Number) value).intValue();
|
|
|
} |
|
|
// }
|
|
|
return 0; |
|
|
// return 0;
|
|
|
}) |
|
|
// })
|
|
|
.sum(); |
|
|
// .sum();
|
|
|
} else { |
|
|
// } else {
|
|
|
flyCount = 0; |
|
|
// flyCount = 0;
|
|
|
} |
|
|
// }
|
|
|
|
|
|
|
|
|
//过滤redis中用户所拥有的设备
|
|
|
//过滤redis中用户所拥有的设备
|
|
|
Map<String, Object> accTimeMap = Optional.ofNullable(RedisUtils.getCacheMap(FLY_ACC_TIME)) |
|
|
// Map<String, Object> accTimeMap = Optional.ofNullable(RedisUtils.getCacheMap(FLY_ACC_TIME))
|
|
|
.map(map -> map.entrySet().stream() |
|
|
// .map(map -> map.entrySet().stream()
|
|
|
.filter(entry -> deviceSnList.contains(entry.getKey())) |
|
|
// .filter(entry -> deviceSnList.contains(entry.getKey()))
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))) |
|
|
// .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))
|
|
|
.orElse(new HashMap<>()); |
|
|
// .orElse(new HashMap<>());
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
double flyAccTime; |
|
|
// double flyAccTime;
|
|
|
|
|
|
//
|
|
|
if (ObjectUtil.isNotEmpty(accTimeMap)) { |
|
|
// if (ObjectUtil.isNotEmpty(accTimeMap)) {
|
|
|
flyAccTime = accTimeMap.values().stream() |
|
|
// flyAccTime = accTimeMap.values().stream()
|
|
|
.filter(Objects::nonNull) |
|
|
// .filter(Objects::nonNull)
|
|
|
.mapToDouble(value -> { |
|
|
// .mapToDouble(value -> {
|
|
|
if (value instanceof Number) { |
|
|
// if (value instanceof Number) {
|
|
|
return ((Number) value).doubleValue(); |
|
|
// return ((Number) value).doubleValue();
|
|
|
} |
|
|
// }
|
|
|
return 0.0; |
|
|
// return 0.0;
|
|
|
}) |
|
|
// })
|
|
|
.sum(); |
|
|
// .sum();
|
|
|
} else { |
|
|
// } else {
|
|
|
flyAccTime = 0.0; |
|
|
// flyAccTime = 0.0;
|
|
|
} |
|
|
// }
|
|
|
|
|
|
|
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
|
|
|
Map<String, Integer> devices = feignDeviceGroup.getDevices(); |
|
|
|
|
|
|
|
|
Map<String, Object> panel = baseMapper.countPanelAlert(businessAlertBo); |
|
|
Map<String, Object> panel = baseMapper.countPanelAlert(businessAlertBo); |
|
|
|
|
|
|
|
@ -245,8 +246,8 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
ObjectUtil.isEmpty(panel.get("total"))?0:panel.get("total"), |
|
|
ObjectUtil.isEmpty(panel.get("total"))?0:panel.get("total"), |
|
|
ObjectUtil.isEmpty(panel.get("finishCount"))?0:panel.get("finishCount"), |
|
|
ObjectUtil.isEmpty(panel.get("finishCount"))?0:panel.get("finishCount"), |
|
|
ObjectUtil.isEmpty(panel.get("cancelCount"))?0:panel.get("cancelCount"), |
|
|
ObjectUtil.isEmpty(panel.get("cancelCount"))?0:panel.get("cancelCount"), |
|
|
flyCount, |
|
|
ObjectUtil.isEmpty(devices.get("flyCount"))?0:devices.get("flyCount"), |
|
|
flyAccTime); |
|
|
ObjectUtil.isEmpty(devices.get("flyAccTime"))?0:devices.get("flyAccTime")); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|