From 6a9148db96ae24cb932ee50e9427269569348868 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期一, 28 四月 2025 09:14:53 +0800
Subject: [PATCH] 手册,海康接口调整
---
ycl-pojo/src/main/java/com/ycl/platform/domain/excel/VideoDailyExp.java | 64 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/excel/VideoDailyExp.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/excel/VideoDailyExp.java
index cc1bb92..9f73249 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/excel/VideoDailyExp.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/excel/VideoDailyExp.java
@@ -1,7 +1,12 @@
package com.ycl.platform.domain.excel;
import annotation.Excel;
+import com.ycl.platform.domain.result.SYS.TMonitorResult;
import lombok.Data;
+
+import java.lang.reflect.Field;
+import java.time.LocalDate;
+import java.util.List;
@Data
public class VideoDailyExp {
@@ -12,6 +17,14 @@
/** 璁惧鍚嶇О */
@Excel(name = "璁惧鍚嶇О",width = 20)
private String deviceName;
+
+ /** 璁惧绫诲瀷 **/
+ private String type;
+
+ /** 鏀硅澶囧綋鏈堝湪绾挎儏鍐� **/
+ private List<TMonitorResult> onlineStateList;
+ /** 鍐呴儴澶勭悊鐢� */
+ private LocalDate mongoCreateTime;
/** 鏍囩 */
@Excel(name = "鏍囩")
@@ -145,5 +158,56 @@
@Excel(name = "31",width = 10)
private String day31;
+ public boolean isAllOfflineByMonth() {
+ boolean allOffline = true;
+ try {
+ // 閬嶅巻 day1 鍒� day31
+ for (int i = 1; i <= 31; i++) {
+ // 鏋勯�犲瓧娈靛悕
+ String fieldName = "day" + i;
+ // 鑾峰彇瀛楁
+ Field field = this.getClass().getDeclaredField(fieldName);
+ // 纭繚瀛楁鏄鏈夌殑鍙互璁块棶
+ field.setAccessible(true);
+ // 鑾峰彇瀛楁鍊�
+ String value = (String) field.get(this);
+ // 妫�鏌ュ�兼槸鍚︿负 "绂荤嚎"
+ if (!"绂荤嚎".equals(value)) {
+ allOffline = false;
+ break;
+ }
+ }
+
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return allOffline;
+ }
+
+ public long getAllOnlineDayCountByMonth() {
+ long count = 0;
+ try {
+
+ // 閬嶅巻 day1 鍒� day31
+ for (int i = 1; i <= 31; i++) {
+ // 鏋勯�犲瓧娈靛悕
+ String fieldName = "day" + i;
+ // 鑾峰彇瀛楁
+ Field field = this.getClass().getDeclaredField(fieldName);
+ // 纭繚瀛楁鏄鏈夌殑鍙互璁块棶
+ field.setAccessible(true);
+ // 鑾峰彇瀛楁鍊�
+ String value = (String) field.get(this);
+ // 妫�鏌ュ�兼槸鍚︿负 "鍦ㄧ嚎"
+ if ("鍦ㄧ嚎".equals(value)) {
+ count++;
+ }
+ }
+
+ } catch (NoSuchFieldException | IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return count;
+ }
}
--
Gitblit v1.8.0