From e23edcf2619ad46fd77a710fca6c21de78234bc0 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 07 一月 2025 17:33:06 +0800
Subject: [PATCH] 核算重构完成

---
 ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OsdCheckResult.java |   80 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OsdCheckResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OsdCheckResult.java
index 83a1247..1c04824 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OsdCheckResult.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/OsdCheckResult.java
@@ -2,19 +2,22 @@
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ycl.platform.domain.result.BaseResult;
+import constant.ApiConstants;
+import enumeration.DeviceType;
 import lombok.Data;
-import org.springframework.data.mongodb.core.annotation.Collation;
+import org.springframework.data.mongodb.core.index.TextIndexed;
+import org.springframework.data.mongodb.core.mapping.Document;
 
 import java.util.Date;
 
 /**
- * python鑾峰彇osd鏁版嵁
+ * 鑾峰彇osd鏁版嵁
  *
  * @author锛歺p
  * @date锛�2024/8/8 19:35
  */
 @Data
-@Collation("osd_check_result")
+@Document(collection = "osd_check_result")
 public class OsdCheckResult extends BaseResult {
 
     /**
@@ -22,6 +25,15 @@
      */
     private String deviceNo;
 
+    /**
+     *  鎽勫儚鏈哄搧鐗�0/1/2 娴峰悍/澶у崕/瀹囪
+     */
+    private Integer deviceBrand;
+
+    /**
+     *  鎽勫儚鏈哄搧鐗�0/1/2 娴峰悍/澶у崕/瀹囪
+     */
+    private String deviceBrandStr;
     /**
      * 璁惧绫诲瀷
      */
@@ -44,6 +56,7 @@
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date setTime;
 
+
     /**
      * osd閫氶亾鍚�
      */
@@ -64,7 +77,7 @@
     private String osdPart;
 
     /**
-     * osd 宸︿笅瑙�
+     * osd宸︿笅瑙�
      */
     private String osdLB;
 
@@ -74,13 +87,29 @@
     private Integer osdTimeCorrect;
 
     /**
-     * osd閫氶亾鍚嶆槸鍚︽纭�
+     * osdTimeCorrect鏃堕棿鏄惁姝g‘
+     */
+    private Boolean osdTimeError;
+
+    /**
+     * osd閫氶亾鍚嶆槸鍚︽纭�   1姝g‘  0鏈煡  -1閿�
      */
     private Integer osdNameCorrect;
+
+    /**
+     * osd閫氶亾鍚嶆槸鍚︽纭�
+     */
+    private Boolean osdNameError;
+
     /**
      * osd鐪佹槸鍚︽纭�
      */
     private Integer osdProvinceCorrect;
+
+    /**
+     * osd鐪佹槸鍚︽纭�
+     */
+    private Boolean osdProvinceError;
 
     /**
      * osd甯傛槸鍚︽纭�
@@ -88,15 +117,56 @@
     private Integer osdCityCorrect;
 
     /**
+     * osd甯傛槸鍚︽纭�
+     */
+    private Boolean osdCityError;
+
+    /**
      * osd鍖烘槸鍚︽纭�
      */
     private Integer osdPartCorrect;
 
+    /**
+     * osd鍖烘槸鍚︽纭�
+     */
+    private Boolean osdPartError;
     /**
      * osd宸︿笅瑙掓槸鍚︽纭�
      */
     private Integer osdLbCorrect;
 
 
+    public static Boolean checkOsd(OsdCheckResult result) {
+        return ApiConstants.OSD_Correct.equals(result.getOsdTimeCorrect()) &&
+                ApiConstants.OSD_Correct.equals(result.getOsdNameCorrect()) &&
+                ApiConstants.OSD_Correct.equals(result.getOsdProvinceCorrect()) &&
+                ApiConstants.OSD_Correct.equals(result.getOsdCityCorrect()) &&
+                ApiConstants.OSD_Correct.equals(result.getOsdPartCorrect());
+    }
 
+    public static Boolean checkTime(OsdCheckResult result) {
+        return ApiConstants.OSD_Correct.equals(result.getOsdTimeCorrect());
+    }
+
+    public static void getError(OsdCheckResult result) {
+        if(ApiConstants.OSD_Correct.equals(result.getOsdTimeCorrect())) result.setOsdTimeError(Boolean.FALSE);
+        else {result.setOsdTimeError(Boolean.TRUE); }
+
+        if(ApiConstants.OSD_Correct.equals(result.getOsdNameCorrect())) result.setOsdNameError(Boolean.FALSE);
+        else { result.setOsdNameError(Boolean.TRUE); }
+
+        if(ApiConstants.OSD_Correct.equals(result.getOsdProvinceCorrect())) result.setOsdProvinceError(Boolean.FALSE);
+        else { result.setOsdProvinceError(Boolean.TRUE); }
+
+        if(ApiConstants.OSD_Correct.equals(result.getOsdCityCorrect())) result.setOsdCityError(Boolean.FALSE);
+        else { result.setOsdCityError(Boolean.TRUE); }
+
+        if(ApiConstants.OSD_Correct.equals(result.getOsdPartCorrect())) result.setOsdPartError(Boolean.FALSE);
+        else { result.setOsdPartError(Boolean.TRUE); }
+
+        if(DeviceType.DH.getType().equals(result.getDeviceBrand())) result.setDeviceBrandStr(DeviceType.DH.getDesc());
+        else if(DeviceType.HK.getType().equals(result.getDeviceBrand())) result.setDeviceBrandStr(DeviceType.HK.getDesc());
+        else if(DeviceType.YS.getType().equals(result.getDeviceBrand())) result.setDeviceBrandStr(DeviceType.YS.getDesc());
+        else { result.setDeviceBrandStr("鏈煡"); }
+    }
 }

--
Gitblit v1.8.0