From 01d6f8f32113137b83dffa888fdd80e293457646 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 31 十月 2024 18:18:30 +0800
Subject: [PATCH] 测点导入功能修改,增加计算点,常量点导入导出功能

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/PointTypeEnum.java |   42 +++++++++++++++++++-----------------------
 1 files changed, 19 insertions(+), 23 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/PointTypeEnum.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/PointTypeEnum.java
index fd9cd3a..2d6e959 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/PointTypeEnum.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/PointTypeEnum.java
@@ -1,37 +1,33 @@
 package com.iailab.module.data.point.common;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
 /**
  * @author PanZhibao
  * @date 2021年04月25日 11:41
  */
-
+@Getter
+@AllArgsConstructor
 public enum PointTypeEnum {
-    MEASURE_POINT("MEASURE", "MEASURE"),
-    CALCULATE_POINT("CALCULATE", "CALCULATE"),
-    CONSTANT("CONSTANT", "CONSTANT");
+    MEASURE_POINT("MEASURE", "测量点"),
+    CALCULATE_POINT("CALCULATE", "计算点"),
+    CONSTANT("CONSTANT", "常量点");
 
     private String code;
 
-    private String name;
+    private String desc;
 
-    PointTypeEnum(String code, String name){
-        this.code = code;
-        this.name = name;
-    }
+    public static PointTypeEnum getEumByCode(String code) {
+        if (code == null) {
+            return null;
+        }
 
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
+        for (PointTypeEnum statusEnum : PointTypeEnum.values()) {
+            if (statusEnum.getCode().equals(code)) {
+                return statusEnum;
+            }
+        }
+        return null;
     }
 }

--
Gitblit v1.9.3