From 37a96c1edbdeaae66d888b798f2aa0dae0b3a8ec Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 08 八月 2024 21:17:23 +0800
Subject: [PATCH] 图像检测接口
---
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/ImageDetectionResult.java | 181 ++++++++++++++++++++++++++++++++++++
ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/ImageDetectionParam.java | 35 +++++++
ycl-server/src/main/java/com/ycl/task/UYTask.java | 36 +++++++
ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java | 3
ycl-server/src/main/java/com/ycl/feign/UYClient.java | 9 +
5 files changed, 263 insertions(+), 1 deletions(-)
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/ImageDetectionParam.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/ImageDetectionParam.java
new file mode 100644
index 0000000..bda14ab
--- /dev/null
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/param/UY/ImageDetectionParam.java
@@ -0,0 +1,35 @@
+package com.ycl.platform.domain.param.UY;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * 鎽勫儚澶村弬鏁�
+ *
+ * @author gonghl
+ * @since 2024/7/1 涓嬪崍 4:52
+ */
+
+@Data
+@Accessors(chain = true)
+public class ImageDetectionParam {
+
+ /**
+ * 鍒嗛〉
+ */
+ private Integer pageNum;
+
+ private Integer pageSize;
+
+ /**
+ * 寮傚父绫诲瀷
+ */
+ private String code = "1,2,3";
+
+ /**
+ * 鐘舵�侊細2鍏ㄩ儴 -1寮傚父 1姝e父
+ */
+ private Integer status = 2;
+
+
+}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/ImageDetectionResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/ImageDetectionResult.java
new file mode 100644
index 0000000..78e4031
--- /dev/null
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/ImageDetectionResult.java
@@ -0,0 +1,181 @@
+package com.ycl.platform.domain.result.UY;
+
+import com.ycl.platform.domain.result.BaseResult;
+import lombok.Data;
+import org.springframework.data.mongodb.core.annotation.Collation;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author锛歺p
+ * @date锛�2024/8/8 20:36
+ */
+@Data
+@Collation("uy_image_detection")
+public class ImageDetectionResult extends BaseResult {
+
+ /**
+ * 琛屾斂鍖哄煙
+ */
+ private String arealayerName;
+
+ /**
+ * 琛屾斂鍖哄煙璺緞
+ */
+ private String arealayerPath;
+
+ /**
+ * 琛屾斂鍖哄煙
+ */
+ private String arealayerno;
+
+
+ private Integer blur;
+
+
+ private Integer blurRaw;
+
+ /**
+ * 鐢婚潰鍋忚壊锛�1姝e父 0寮傚父
+ */
+ private Integer color;
+
+
+ private Integer colorRaw;
+
+ /**
+ * 瑙g爜鐘舵�佺爜
+ */
+ private Integer decodingCode;
+
+
+ private String deviceId;
+
+
+ private String deviceName;
+
+
+ private Integer image;
+
+
+ private String imagePath;
+
+
+ private String ipAddr;
+
+ /**
+ * 浜害锛�1姝e父 0寮傚父
+ */
+ private Integer light;
+
+
+ private Integer lightRaw;
+
+ /**
+ * 鏈�杩戞寔缁绾挎晠闅滄鏁�
+ */
+ private Integer olErrEverduring;
+
+
+ private Date olErrEverduringFirstTime;
+
+ /**
+ * 绱绂荤嚎鏁呴殰娆℃暟
+ */
+ private Integer olErrTotal;
+
+
+ private String olErrTotalRate;
+
+
+ private Integer olTotal;
+
+ /**
+ * 鐢婚潰閬尅锛�1姝e父 0寮傚父
+ */
+ private Integer shade;
+
+
+ private Integer shadeRaw;
+
+
+ private Integer shake;
+
+
+ private Integer shakeRaw;
+
+ /**
+ * 淇″彿鐘舵�侊細鍦ㄧ嚎锛�0寮傚父
+ */
+ private Integer signa1;
+
+
+ private Integer signa1Raw;
+
+
+ private Integer signal;
+
+ /**
+ * sip鐘舵�佺爜
+ */
+ private Integer sipCode;
+
+ /**
+ * 闆姳骞叉壈锛�1姝e父 0寮傚父
+ */
+ private Integer snow;
+
+
+ private Integer snowRaw;
+
+ /**
+ * 鐘舵�侊細1鍦ㄧ嚎
+ */
+ private Integer status;
+
+ /**
+ * 鏉$汗骞叉壈锛�1姝e父 0寮傚父
+ */
+ private Integer stripe;
+
+
+ private Integer stripeRaw;
+
+ /**
+ * 鏍囩
+ */
+ private String tagStr;
+
+
+ private List<String> tags;
+
+
+ private String tenantId;
+
+
+ private Integer vqdAtNight;
+
+
+ private Integer vqdErrEverduring;
+
+
+ private Date vqdErrEverduringFirstTime;
+
+
+ private Integer vqdErrTotal;
+
+ /**
+ * 鍥惧儚绱寮傚父鐜�
+ */
+ private String vqdErrTotalRate;
+
+
+ private Date vqdTime;
+
+
+ private Integer vqdTotal;
+
+
+
+}
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java
index 549786a..e41ad4b 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/PyOsdResult.java
@@ -1,5 +1,6 @@
package com.ycl.platform.domain.result.UY;
+import com.ycl.platform.domain.result.BaseResult;
import lombok.Data;
import org.springframework.data.mongodb.core.annotation.Collation;
@@ -11,7 +12,7 @@
*/
@Data
@Collation("py_osd")
-public class PyOsdResult {
+public class PyOsdResult extends BaseResult {
/**
* 鍥芥爣鐮�
diff --git a/ycl-server/src/main/java/com/ycl/feign/UYClient.java b/ycl-server/src/main/java/com/ycl/feign/UYClient.java
index d8a09fc..a8ad24b 100644
--- a/ycl-server/src/main/java/com/ycl/feign/UYClient.java
+++ b/ycl-server/src/main/java/com/ycl/feign/UYClient.java
@@ -29,6 +29,15 @@
JSONObject oneMachineFile(@SpringQueryMap OneMachineFileParam oneMachineFileParam);
/**
+ * 鍥惧儚妫�娴�
+ *
+ * @param imageDetectionParam 璇锋眰鍙傛暟
+ * @return
+ */
+ @GetMapping("/api/v1/vqdMonitor/list")
+ JSONObject imageDetection(@SpringQueryMap ImageDetectionParam imageDetectionParam);
+
+ /**
* 鐐逛綅鍦ㄧ嚎
*
* @param onlineParam 璇锋眰鍙傛暟
diff --git a/ycl-server/src/main/java/com/ycl/task/UYTask.java b/ycl-server/src/main/java/com/ycl/task/UYTask.java
index 129fc53..7ea01db 100644
--- a/ycl-server/src/main/java/com/ycl/task/UYTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/UYTask.java
@@ -54,6 +54,42 @@
@Value("${youYun.passwd}")
private String passwd;
+ // 鍥惧儚妫�娴�
+ public void imageDetection() {
+ log.info("寮�濮嬫墽琛屽浘鍍忔娴嬫暟鎹悓姝�");
+ ImageDetectionParam param = new ImageDetectionParam();
+ param.setPageNum(ApiConstants.PageNo);
+ param.setPageSize(ApiConstants.PageSize);
+ JSONObject jsonObject = uyClient.imageDetection(param);
+ if (jsonObject != null) {
+ log.info("鏁版嵁鏍煎紡" + jsonObject);
+ Integer statusCode = jsonObject.getInteger("statusCode");
+ if (ApiConstants.UYSuccessCode.equals(statusCode)) {
+ JSONObject data = jsonObject.getJSONObject("data");
+ if (data != null) {
+ List<ImageDetectionResult> records = data.getList("records", ImageDetectionResult.class);
+ if (!CollectionUtils.isEmpty(records)) {
+ //濡傛灉浠婂ぉ瀛樺湪涔嬪墠鐨勬暟鎹厛鍒犻櫎
+ Query query = new Query(Criteria
+ .where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date())));
+ DeleteResult result = mongoTemplate.remove(query, QueryVqdResult.class);
+ //瀛樻斁鍦╩ongo涓�
+ mongoTemplate.insertAll(records);
+ } else {
+ log.error("鍥惧儚鐩戞祴鏁版嵁涓虹┖{}", data);
+ }
+ } else {
+ log.error("鍥惧儚鐩戞祴鏁版嵁涓虹┖{}", jsonObject);
+ }
+ } else {
+ log.error("鍥惧儚鐩戞祴璇锋眰澶辫触{}", jsonObject);
+ }
+ } else {
+ log.error("鍥惧儚鐩戞祴鏁版嵁涓虹┖");
+ }
+ log.info("缁撴潫鎵ц鍥惧儚鐩戞祴鏁版嵁鍚屾");
+ }
+
//涓�鏈轰竴妗�
public void monitorTask() {
//涓�鏈轰竴妗e悎鏍肩巼
--
Gitblit v1.8.0