From 3b0516a2959e25576e4f3fda697a3b025d06c8c9 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 24 六月 2025 14:09:07 +0800 Subject: [PATCH] 每日录像可用指标添加日志,修改大屏为查看当前月平均 --- ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java b/ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java index 78edba5..9a8ed07 100644 --- a/ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java +++ b/ycl-server/src/main/java/com/ycl/calculate/VideoOnlineCalculation.java @@ -1,11 +1,13 @@ package com.ycl.calculate; import com.ycl.platform.domain.entity.CheckIndexVideo; +import com.ycl.platform.domain.result.SYS.TMonitorResult; import com.ycl.platform.domain.result.UY.VideoOnlineResult; import com.ycl.platform.mapper.CheckIndexVideoMapper; import com.ycl.platform.mapper.TMonitorMapper; import com.ycl.platform.service.ICheckIndexVideoService; import constant.ApiConstants; +import constant.CheckConstants; import constant.CheckThreadConstants; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -17,6 +19,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 璁$畻瑙嗛璁惧鐐逛綅鍦ㄧ嚎鐜囥�侀噸鐐圭偣浣嶅湪绾跨巼銆侀噸鐐规寚鎸ュ浘鍍忓湪绾跨巼銆侀儴绾х偣浣嶅湪绾跨巼 @@ -50,7 +53,7 @@ @Override public void calculate(List<VideoOnlineResult> list) { //鑾峰彇鍒嗗尯鍩熺殑鎸囨爣鏁伴噺 - Map<String, VideoOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list); + Map<String, VideoOnlineCalculation.AreaStats> areaStatsMap = getAreaStatsMap(list,Boolean.TRUE); if (areaStatsMap == null) return; // 鏌ヨ鏄惁index琛ㄥ凡缁忓瓨鍦ㄤ粖鏃ユ暟鎹� @@ -64,7 +67,16 @@ } } }); - + //閲嶇偣鎸囨尌鍥惧儚鐗规畩澶勭悊锛岀粺涓�閲囩敤鍖哄幙鏁版嵁 + Map<Long, BigDecimal> keyCommandMap = checkIndexVideos.stream().filter(checkIndexVideo -> CheckConstants.Examine_Tag_County.equals(checkIndexVideo.getExamineTag())) + .collect(Collectors.toMap(checkIndexVideo -> checkIndexVideo.getDeptId(), checkIndexVideo -> checkIndexVideo.getKeyCommandImageOnline())); + for (CheckIndexVideo checkIndexVideo : checkIndexVideos) { + //鏇挎崲鐪佸巺鍜岄儴绾� 閲嶇偣鎸囨尌鍥惧儚 + if(CheckConstants.Examine_Tag_Province.equals(checkIndexVideo.getExamineTag()) || CheckConstants.Examine_Tag_Dept.equals(checkIndexVideo.getExamineTag())){ + BigDecimal keyCommand = keyCommandMap.get(checkIndexVideo.getDeptId()); + checkIndexVideo.setKeyCommandImageOnline(keyCommand); + } + } checkIndexVideoService.saveOrUpdateBatch(checkIndexVideos); } @@ -116,7 +128,7 @@ BigDecimal siteOnline = siteOnline(param); checkIndexVideo.setSiteOnline(siteOnline); //鍖哄幙涓嶅皯浜�100璺� - if(stats.totalSites < CheckThreadConstants.Check_Video_SiteOnline){ + if(!key.startsWith(ApiConstants.Dept) && stats.totalSites < CheckThreadConstants.Check_Video_SiteOnline){ checkIndexVideo.setSiteOnline(BigDecimal.ZERO); } //璋冪敤鐐逛綅鍦ㄧ嚎鐜囪绠楁柟娉� 璁$畻閲嶇偣鐐逛綅鍦ㄧ嚎鐜� @@ -131,7 +143,7 @@ } //鍖哄幙瑙嗛閲嶇偣鐐逛綅鏁颁笉灏戜簬10璺� - if(stats.importantSites<CheckThreadConstants.Check_Video_ImportantSite){ + if(!key.startsWith(ApiConstants.Dept) && stats.importantSites < CheckThreadConstants.Check_Video_ImportantSite){ checkIndexVideo.setKeySiteOnline(BigDecimal.ZERO); } -- Gitblit v1.8.0