From 514705c874699fb016ca405961e50dcb15af2648 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 28 十一月 2023 10:28:16 +0800
Subject: [PATCH] 栅格分析返回值添加图层单位字段

---
 src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java |   97 ++++++++++++++++++++++++++++++++++++------------
 1 files changed, 72 insertions(+), 25 deletions(-)

diff --git a/src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java b/src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java
index a1c1d1b..8f64e3b 100644
--- a/src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java
+++ b/src/main/java/com/moon/server/entity/data/AnalysisResultEntity.java
@@ -2,7 +2,6 @@
 
 import com.moon.server.helper.WebHelper;
 
-import java.io.DataOutput;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
@@ -17,30 +16,59 @@
 
     public AnalysisResultEntity() {
         this.code = 200;
+        this.minList = new ArrayList<>();
+        this.avgList = new ArrayList<>();
+        this.maxList = new ArrayList<>();
         this.points = new ArrayList<>();
+    }
+
+    public AnalysisResultEntity(String token) {
+        this();
+        this.token = token;
     }
 
     /**
      * 娣诲姞鐐�
      */
-    public void addPoint(Double x, Double y, List<Double> vals) {
-        Point point = new Point(x, y, vals);
+    public void addPoint(double x, double y, double len, List<Double> vals) {
+        Point point = new Point(x, y, len, vals);
         this.points.add(point);
     }
 
+    /**
+     * 娣诲姞Band鍊�
+     */
+    public void addBandVals(double min, double avg, double max) {
+        this.minList.add(WebHelper.round(min, 3));
+        this.avgList.add(WebHelper.round(avg, 3));
+        this.maxList.add(WebHelper.round(max, 3));
+    }
+
+    private String token;
+
     private String layerName;
 
-    private Double min;
+    private List<Double> minList;
 
-    private Double avg;
+    private List<Double> avgList;
 
-    private Double max;
+    private List<Double> maxList;
 
     private int code;
 
     private String info;
 
+    private String unit;
+
     private List<Point> points;
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
 
     public String getLayerName() {
         return layerName;
@@ -50,28 +78,28 @@
         this.layerName = layerName;
     }
 
-    public Double getMin() {
-        return min;
+    public List<Double> getMinList() {
+        return minList;
     }
 
-    public void setMin(Double min) {
-        this.min = WebHelper.round(min, 3);
+    public void setMinList(List<Double> minList) {
+        this.minList = minList;
     }
 
-    public Double getAvg() {
-        return avg;
+    public List<Double> getAvgList() {
+        return avgList;
     }
 
-    public void setAvg(Double avg) {
-        this.avg = avg;
+    public void setAvgList(List<Double> avgList) {
+        this.avgList = avgList;
     }
 
-    public Double getMax() {
-        return max;
+    public List<Double> getMaxList() {
+        return maxList;
     }
 
-    public void setMax(Double max) {
-        this.max = max;
+    public void setMaxList(List<Double> maxList) {
+        this.maxList = maxList;
     }
 
     public int getCode() {
@@ -90,6 +118,14 @@
         this.info = info;
     }
 
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
     public List<Point> getPoints() {
         return points;
     }
@@ -99,37 +135,48 @@
     }
 
     public static class Point {
-        private Double x;
+        private double x;
 
-        private Double y;
+        private double y;
+
+        private double len;
 
         private List<Double> vals;
 
         public Point() {
         }
 
-        public Point(Double x, Double y, List<Double> vals) {
+        public Point(double x, double y, double len, List<Double> vals) {
             this.x = x;
             this.y = y;
+            this.len = WebHelper.round(len, 3);
             this.vals = vals;
         }
 
-        public Double getX() {
+        public double getX() {
             return x;
         }
 
-        public void setX(Double x) {
+        public void setX(double x) {
             this.x = x;
         }
 
-        public Double getY() {
+        public double getY() {
             return y;
         }
 
-        public void setY(Double y) {
+        public void setY(double y) {
             this.y = y;
         }
 
+        public double getLen() {
+            return len;
+        }
+
+        public void setLen(double len) {
+            this.len = len;
+        }
+
         public List<Double> getVals() {
             return vals;
         }

--
Gitblit v1.9.3