From c83101eb62f5d4906b9c01ceea6b21a37f9e84d8 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 18 十一月 2025 09:24:53 +0800
Subject: [PATCH] bug修复
---
ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java
index d90e029..c68eb8f 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/HK/FaceDeviceInspectionResult.java
@@ -1,7 +1,11 @@
package com.ycl.platform.domain.result.HK;
import com.ycl.platform.domain.result.BaseResult;
+import com.ycl.platform.domain.vo.DataCenter.SnapClockVO;
import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
/**
@@ -11,6 +15,7 @@
*/
@Data
@Document(collection = "hk_face_device_inspection")
+@Slf4j
public class FaceDeviceInspectionResult extends BaseResult {
/**
@@ -68,6 +73,11 @@
*/
private Integer snapResult;
+ /**
+ * 鎶撴媿鏁版嵁閲忕洃娴嬬粨鏋滐紝1:姝e父 2:鏃犳暟鎹� 4:鏁版嵁閲忓皯
+ */
+ private String snapResultText;
+
// 浠ヤ笅涓哄祵濂楀璞$殑瀛楁
/**
@@ -90,6 +100,19 @@
*/
private SnapUnique snapUnique;
+ public String getSnapResultText() {
+ if (snapResult == 1) {
+ snapResultText = "姝e父";
+ }
+ if (snapResult == 2) {
+ snapResultText = "鏃犳暟鎹�";
+ }
+ if (snapResult == 4) {
+ snapResultText = "鏁版嵁閲忓皯";
+ }
+ return snapResultText;
+ }
+
// 鍐呭祵瀵硅薄瀹氫箟
@Data
@@ -110,6 +133,11 @@
private Integer todayClockResult;
/**
+ * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹椂閽熷噯纭�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
+ */
+ private String todayClockResultText;
+
+ /**
* 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鏁版嵁閲�
*/
private Integer allClockCount;
@@ -118,6 +146,31 @@
* 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
*/
private Integer allClockResult;
+
+ /**
+ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鏃堕挓鍑嗙‘鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
+ */
+ private String allClockResultText;
+
+ public String getTodayClockResultText() {
+ if (todayClockResult == 1) {
+ todayClockResultText = "鍚堟牸";
+ }
+ if (todayClockResult == 0) {
+ todayClockResultText = "涓嶅悎鏍�";
+ }
+ return todayClockResultText;
+ }
+
+ public String getAllClockResultText() {
+ if (allClockResult == 1) {
+ allClockResultText = "鍚堟牸";
+ }
+ if (allClockResult == 0) {
+ allClockResultText = "涓嶅悎鏍�";
+ }
+ return allClockResultText;
+ }
}
@Data
@@ -153,6 +206,11 @@
private Integer todayTimelyResult;
/**
+ * 褰撴棩鎺ユ敹鐨勫綋鏃ユ姄鎷嶆暟鎹強鏃舵�у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
+ */
+ private String todayTimelyResultText;
+
+ /**
* 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑寤惰繜鏁版嵁閲�
*/
private Integer allDelayCount;
@@ -176,6 +234,31 @@
* 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鍙婃椂鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
*/
private Integer allTimelyResult;
+
+ /**
+ * 褰撴棩鎺ユ敹鐨勫叏閮ㄦ姄鎷嶆暟鎹腑鍙婃椂鎬у垽瀹氱粨鏋滐細1鏄悎鏍硷紝0鏄笉鍚堟牸
+ */
+ private String allTimelyResultText;
+
+ public String getTodayTimelyResultText() {
+ if (todayTimelyResult == 1) {
+ todayTimelyResultText = "鍚堟牸";
+ }
+ if (todayTimelyResult == 0) {
+ todayTimelyResultText = "涓嶅悎鏍�";
+ }
+ return todayTimelyResultText;
+ }
+
+ public String getAllTimelyResultText() {
+ if (allTimelyResult == 1) {
+ allTimelyResultText = "鍚堟牸";
+ }
+ if (allTimelyResult == 0) {
+ allTimelyResultText = "涓嶅悎鏍�";
+ }
+ return allTimelyResultText;
+ }
}
@Data
@@ -223,4 +306,37 @@
*/
private Integer nouniqueCount;
}
+
+ public static SnapClockVO getVO(FaceDeviceInspectionResult result){
+ SnapClockVO snapClockVO = new SnapClockVO();
+ BeanUtils.copyProperties(result,snapClockVO);
+ SnapClock snapClock = result.getSnapClock();
+ if (snapClock != null) {
+ snapClockVO.setClockPercent(snapClock.getClockPercent());
+ snapClockVO.setTodayClockCount(snapClock.getTodayClockCount());
+ snapClockVO.setTodayClockResult(snapClock.getTodayClockResult());
+ snapClockVO.setAllClockCount(snapClock.getAllClockCount());
+ snapClockVO.setAllClockResult(snapClock.getAllClockResult());
+ snapClockVO.setAllClockResultText(snapClock.getAllClockResultText());
+ snapClockVO.setTodayClockResultText(snapClock.getTodayClockResultText());
+ } else {
+ log.info("鍑虹幇绌烘暟鎹��:{}",result);
+ // 绌哄�煎厹搴曪細缁� VO 瀛楁璧嬮粯璁ゅ�硷紝闃叉鍓嶇鎺ユ敹 null 鎶ラ敊
+ snapClockVO.setClockPercent(0.0f); // 鏁板�煎瀷榛樿 0.0
+ snapClockVO.setTodayClockCount(0); // 璁℃暟鍨嬮粯璁� 0
+ snapClockVO.setTodayClockResult(0); // 缁撴灉鐘舵�侀粯璁� 0锛堝彲鏍规嵁涓氬姟璋冩暣锛�
+ snapClockVO.setAllClockCount(0);
+ snapClockVO.setAllClockResult(0);
+ snapClockVO.setAllClockResultText(""); // 鏂囨湰鍨嬮粯璁ょ┖瀛楃涓�
+ snapClockVO.setTodayClockResultText("");
+ }
+// snapClockVO.setClockPercent(result.getSnapClock().getClockPercent());
+// snapClockVO.setTodayClockCount(result.getSnapClock().getTodayClockCount());
+// snapClockVO.setTodayClockResult(result.getSnapClock().getTodayClockResult());
+// snapClockVO.setAllClockCount(result.getSnapClock().getAllClockCount());
+// snapClockVO.setAllClockResult(result.getSnapClock().getAllClockResult());
+// snapClockVO.setAllClockResultText(result.getSnapClock().getAllClockResultText());
+// snapClockVO.setTodayClockResultText(result.getSnapClock().getTodayClockResultText());
+ return snapClockVO;
+ }
}
--
Gitblit v1.8.0