|
@ -9,9 +9,8 @@ import org.dromara.business.domain.model.StatObj; |
|
|
import org.dromara.business.mapper.BusinessAlertMapper; |
|
|
import org.dromara.business.mapper.BusinessAlertMapper; |
|
|
import org.dromara.business.service.IBusinessAlertStatisticsService; |
|
|
import org.dromara.business.service.IBusinessAlertStatisticsService; |
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
import org.dromara.common.core.exception.ServiceException; |
|
|
import org.dromara.common.redis.utils.RedisOpsUtils; |
|
|
import org.dromara.common.redis.utils.RedisUtils; |
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
import org.dromara.common.tenant.helper.TenantHelper; |
|
|
|
|
|
import org.dromara.system.api.RemoteDeptService; |
|
|
import org.dromara.system.api.RemoteDeptService; |
|
|
import org.dromara.system.api.RemoteLabelPostService; |
|
|
import org.dromara.system.api.RemoteLabelPostService; |
|
|
import org.dromara.system.api.RemotePostService; |
|
|
import org.dromara.system.api.RemotePostService; |
|
@ -19,7 +18,7 @@ import org.dromara.system.api.domain.vo.RemoteAiLabelPostVo; |
|
|
import org.dromara.system.api.domain.vo.RemoteDeptVo; |
|
|
import org.dromara.system.api.domain.vo.RemoteDeptVo; |
|
|
import org.dromara.system.api.domain.vo.RemotePostVo; |
|
|
import org.dromara.system.api.domain.vo.RemotePostVo; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.dromara.common.redis.utils.RedisUtils; |
|
|
|
|
|
import java.math.BigDecimal; |
|
|
import java.math.BigDecimal; |
|
|
import java.math.RoundingMode; |
|
|
import java.math.RoundingMode; |
|
|
import java.time.LocalDate; |
|
|
import java.time.LocalDate; |
|
@ -55,7 +54,7 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 按照月份分类预警数量(包含权限) |
|
|
* 按照月份分类预警数量 |
|
|
* @param businessAlertBo |
|
|
* @param businessAlertBo |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
@ -157,11 +156,13 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList())); |
|
|
businessAlertBo.setAiLabelEnList(getAiLabel(businessAlertBo.getPostCode()).stream().map(RemoteAiLabelPostVo::getLabelEn).collect(Collectors.toList())); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
//获取飞行总架次、总时长
|
|
|
//获取飞行总架次、总时长
|
|
|
Map<String, Object> countMap = RedisUtils.getCacheMap(FLY_COUNT); |
|
|
Map<String, Object> countMap = RedisUtils.getCacheMap(FLY_COUNT); |
|
|
|
|
|
int flyCount; |
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(countMap)){ |
|
|
int 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) { |
|
@ -170,11 +171,15 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
return 0; |
|
|
return 0; |
|
|
}) |
|
|
}) |
|
|
.sum(); |
|
|
.sum(); |
|
|
|
|
|
} else { |
|
|
|
|
|
flyCount = 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Map<String, Object> accTimeMap = RedisUtils.getCacheMap(FLY_ACC_TIME); |
|
|
Map<String, Object> accTimeMap = RedisUtils.getCacheMap(FLY_ACC_TIME); |
|
|
|
|
|
double flyAccTime; |
|
|
|
|
|
|
|
|
double flyAccTime = accTimeMap.values().stream() |
|
|
if (ObjectUtil.isNotEmpty(accTimeMap)) { |
|
|
|
|
|
flyAccTime = accTimeMap.values().stream() |
|
|
.filter(Objects::nonNull) |
|
|
.filter(Objects::nonNull) |
|
|
.mapToDouble(value -> { |
|
|
.mapToDouble(value -> { |
|
|
if (value instanceof Number) { |
|
|
if (value instanceof Number) { |
|
@ -183,7 +188,11 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist |
|
|
return 0.0; |
|
|
return 0.0; |
|
|
}) |
|
|
}) |
|
|
.sum(); |
|
|
.sum(); |
|
|
|
|
|
} else { |
|
|
|
|
|
flyAccTime = 0.0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------获取飞行总架次、总时长----------------------------------------------
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> mapList = baseMapper.countPanelAlert(businessAlertBo); |
|
|
List<Map<String, Object>> mapList = baseMapper.countPanelAlert(businessAlertBo); |
|
|
|
|
|
|
|
|