From 3b0516a2959e25576e4f3fda697a3b025d06c8c9 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期二, 24 六月 2025 14:09:07 +0800 Subject: [PATCH] 每日录像可用指标添加日志,修改大屏为查看当前月平均 --- ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/PicAccessResult.java | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/PicAccessResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/PicAccessResult.java index bd8c2f9..660c856 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/PicAccessResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/PicAccessResult.java @@ -5,6 +5,9 @@ import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; +import java.math.BigDecimal; +import java.math.RoundingMode; + /** * 鍥剧墖璁块棶鐩戞祴缁撴灉 * @@ -12,30 +15,28 @@ */ @Data @Document(collection = "hk_pic_access") +//鍙瓨浜嗚溅杈嗙殑 public class PicAccessResult extends BaseResult { + private Integer dataType; /** * 鏁版嵁绫诲瀷涓�1鏃惰〃绀哄崱鍙e唴鐮侊紝鏁版嵁绫诲瀷涓�2鎴�11鏃惰〃绀轰汉鑴搁噰闆嗚澶囧唴鐮� */ - @TextIndexed private String indexCode; /** * 璁惧鎴栧崱鍙e浗鏍囩紪鐮� */ - @TextIndexed private String externalIndexCode; /** * 璁惧鎴栧崱鍙e悕绉� */ - @TextIndexed private String deviceName; /** * 缁勭粐缂栧彿 */ - @TextIndexed private String orgCode; /** @@ -78,4 +79,15 @@ */ private int bigDisableCount; + public static BigDecimal calUrl(PicAccessResult result) { + BigDecimal url = BigDecimal.ZERO; + if (result.getSampleCount() != 0) { + //鍥剧墖璁块棶姝e父閲� = 鎶芥閲�-寮傚父閲� + BigDecimal picNormalCount = new BigDecimal(result.getSampleCount() - result.getExpCount()); + //鍥剧墖鎶芥閲� + BigDecimal sampleCount = new BigDecimal(result.getSampleCount()); + url = picNormalCount.divide(sampleCount, 4, RoundingMode.HALF_UP); + } + return url; + } } -- Gitblit v1.8.0