From 43b117a39fb4096d299c911a7ca0a304965f4f5c Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 13 九月 2023 10:37:46 +0800
Subject: [PATCH] 修改颜色表对应的实体类

---
 src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java    |    2 
 src/main/java/com/moon/server/entity/ctrl/PubEntity.java              |   13 ++++
 src/main/java/com/moon/server/entity/shujian/CreateLayerEntity.java   |  103 ++++++++++++++++++++++------------
 src/main/java/com/moon/server/entity/shujian/DeleteEntity.java        |    2 
 src/main/java/com/moon/server/entity/shujian/LayerResultEntity.java   |    2 
 src/main/java/com/moon/server/entity/shujian/CreateServiceEntity.java |    8 +-
 src/main/java/com/moon/server/service/data/ShuJianService.java        |    7 +-
 7 files changed, 91 insertions(+), 46 deletions(-)

diff --git a/src/main/java/com/moon/server/entity/ctrl/PubEntity.java b/src/main/java/com/moon/server/entity/ctrl/PubEntity.java
index 1c0d176..8ce0554 100644
--- a/src/main/java/com/moon/server/entity/ctrl/PubEntity.java
+++ b/src/main/java/com/moon/server/entity/ctrl/PubEntity.java
@@ -117,6 +117,11 @@
     private List<Integer> ids;
 
     /**
+     * 棰滆壊琛↖D
+     */
+    private int colorTableId;
+
+    /**
      * 棰滆壊琛�
      */
     private List<ColorTableEntity> colorTable;
@@ -243,6 +248,14 @@
         this.ids = ids;
     }
 
+    public int getColorTableId() {
+        return colorTableId;
+    }
+
+    public void setColorTableId(int colorTableId) {
+        this.colorTableId = colorTableId;
+    }
+
     public List<ColorTableEntity> getColorTable() {
         return colorTable;
     }
diff --git a/src/main/java/com/moon/server/entity/shujian/CreateLayerEntity.java b/src/main/java/com/moon/server/entity/shujian/CreateLayerEntity.java
index 17e63fb..ff59cce 100644
--- a/src/main/java/com/moon/server/entity/shujian/CreateLayerEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/CreateLayerEntity.java
@@ -38,10 +38,10 @@
     private Integer create_service;
 
     public CreateLayerEntity() {
-        create_service = 0;
-        layer = new Layer();
-        image_ovr = new ImageOvr();
-        image_path_list = new ArrayList<>();
+        this.create_service = 0;
+        this.layer = new Layer();
+        this.image_ovr = new ImageOvr();
+        this.image_path_list = new ArrayList<>();
     }
 
     public Layer getLayer() {
@@ -151,15 +151,15 @@
         private Integer boundary_cal_mode;
 
         public Layer() {
-            projection = "ESRI:104903";
-            trans_color = "-1,-1,-1";
-            tile_rgb = "1,2,3";
-            end_scale = 1.0;
-            start_scale = 1048576000.0;
-            stats_type = 1;
-            enhance_type = 0;
-            enhance_factor = null;
-            boundary_cal_mode = 0;
+            this.projection = "ESRI:104903";
+            this.trans_color = "-1,-1,-1";
+            this.tile_rgb = "1,2,3";
+            this.end_scale = 1.0;
+            this.start_scale = 1048576000.0;
+            this.stats_type = 1;
+            this.enhance_type = 0;
+            this.enhance_factor = null;
+            this.boundary_cal_mode = 0;
         }
 
         public String getName() {
@@ -310,9 +310,9 @@
         private Object attr_filter;
 
         public ImagePathList() {
-            datasource = "Local";
-            recursion = 0;
-            filter = new ArrayList<>();
+            this.datasource = "Local";
+            this.recursion = 0;
+            this.filter = new ArrayList<>();
         }
 
         public String getDatasource() {
@@ -384,9 +384,9 @@
         private Integer sample_type;
 
         public ImageOvr() {
-            same_path = 1;
-            force_del = 0;
-            sample_type = 0;
+            this.same_path = 1;
+            this.force_del = 0;
+            this.sample_type = 0;
         }
 
         public Integer getSame_path() {
@@ -418,18 +418,33 @@
      * 棰滆壊琛ㄩ厤缃�
      */
     public class Config {
-        private Process process;
+        // private Process process
+        private Integer optm;
 
-        public Config(Integer type, List<?> levels) {
-            process = new Process(type, levels);
+        private List<Process> online_process;
+
+        public Config(Integer colorTableId ,Integer type, List<?> levels) {
+            Process process = new Process(colorTableId,type, levels);
+            this.online_process = new ArrayList<>();
+            this.online_process.add(process);
+
+            this.optm = 1;
         }
 
-        public Process getProcess() {
-            return process;
+        public Integer getOptm() {
+            return optm;
         }
 
-        public void setProcess(Process process) {
-            this.process = process;
+        public void setOptm(Integer optm) {
+            this.optm = optm;
+        }
+
+        public List<Process> getOnline_process() {
+            return online_process;
+        }
+
+        public void setOnline_process(List<Process> online_process) {
+            this.online_process = online_process;
         }
     }
 
@@ -441,14 +456,17 @@
 
         private String name;
 
+        private Integer color_table_id;
+
         private Map<String, Object> config;
 
         public Process() {
-            uuid = StringHelper.getGuid();
-            name = "color_table";
+            this.uuid = StringHelper.getGuid();
+            this.name = "color_table";
+            this.color_table_id = 0;
 
-            config = new HashMap<>();
-            config.put("default", new Default());
+            this.config = new HashMap<>();
+            this.config.put("default", new Default());
         }
 
         /**
@@ -457,10 +475,15 @@
          * @param type   0-榛樿鑹叉澘锛�1-娓愬彉鑹叉澘
          * @param levels 灞傜骇
          */
-        public Process(Integer type, List<?> levels) {
+        public Process(Integer colorTableId ,Integer type, List<?> levels) {
             this();
-            config.put("type", type);
-            config.put("levels", levels);
+            this.color_table_id = colorTableId;
+
+            this.config.put("type", type);
+            this.config.put("levels", levels);
+            if (type > 0) {
+                this. config.put("gradation", "visibility");
+            }
         }
 
         /**
@@ -487,6 +510,14 @@
             this.name = name;
         }
 
+        public Integer getColor_table_id() {
+            return color_table_id;
+        }
+
+        public void setColor_table_id(Integer color_table_id) {
+            this.color_table_id = color_table_id;
+        }
+
         public Map<String, Object> getConfig() {
             return config;
         }
@@ -507,9 +538,9 @@
         private Short b;
 
         public Default() {
-            r = -1;
-            b = -1;
-            g = -1;
+            this.r = -1;
+            this.b = -1;
+            this.g = -1;
         }
 
         public Short getR() {
diff --git a/src/main/java/com/moon/server/entity/shujian/CreateServiceEntity.java b/src/main/java/com/moon/server/entity/shujian/CreateServiceEntity.java
index 2f4cec3..5ccf348 100644
--- a/src/main/java/com/moon/server/entity/shujian/CreateServiceEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/CreateServiceEntity.java
@@ -24,8 +24,8 @@
     private Services service;
 
     public CreateServiceEntity() {
-        service = new Services();
-        layer_list = new ArrayList<>();
+        this.service = new Services();
+        this.layer_list = new ArrayList<>();
     }
 
     public List<Integer> getLayer_list() {
@@ -218,7 +218,7 @@
         private Watermark watermark;
 
         public Config() {
-            watermark = new Watermark();
+            this.watermark = new Watermark();
         }
 
         public Watermark getWatermark() {
@@ -240,7 +240,7 @@
         private String watermark_id;
 
         public Watermark() {
-            watermark_id = "";
+            this.watermark_id = "";
         }
 
         public String getWatermark_id() {
diff --git a/src/main/java/com/moon/server/entity/shujian/DeleteEntity.java b/src/main/java/com/moon/server/entity/shujian/DeleteEntity.java
index 0f165ef..f8f1e9f 100644
--- a/src/main/java/com/moon/server/entity/shujian/DeleteEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/DeleteEntity.java
@@ -17,7 +17,7 @@
     private List<Integer> id_list;
 
     public DeleteEntity() {
-        id_list = new ArrayList<>();
+        this.id_list = new ArrayList<>();
     }
 
     public List<Integer> getId_list() {
diff --git a/src/main/java/com/moon/server/entity/shujian/LayerResultEntity.java b/src/main/java/com/moon/server/entity/shujian/LayerResultEntity.java
index b8860bb..062cebe 100644
--- a/src/main/java/com/moon/server/entity/shujian/LayerResultEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/LayerResultEntity.java
@@ -18,7 +18,7 @@
     private String command;
 
     public LayerResultEntity() {
-        result = new Result();
+        this.result = new Result();
     }
 
     public class Result {
diff --git a/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java b/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java
index cbf1123..767245e 100644
--- a/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java
@@ -15,7 +15,7 @@
     private static final long serialVersionUID = -6420150955559673365L;
 
     public TaskResultEntity() {
-        result = new ArrayList<>();
+        this.result = new ArrayList<>();
     }
 
     private String command;
diff --git a/src/main/java/com/moon/server/service/data/ShuJianService.java b/src/main/java/com/moon/server/service/data/ShuJianService.java
index bd3adf0..abcbe1b 100644
--- a/src/main/java/com/moon/server/service/data/ShuJianService.java
+++ b/src/main/java/com/moon/server/service/data/ShuJianService.java
@@ -163,7 +163,8 @@
         CreateLayerEntity.Layer layer = entity.getLayer();
         layer.setName(pub.getName() + "_" + pub.getTime());
         layer.setProjection(getEpsg(pub));
-        layer.setType(TYPES.indexOf(pub.getType()));
+        // layer.setType(TYPES.indexOf(pub.getType()))
+        layer.setType(2);
         layer.setEnhance_type(pub.getEnhanceType());
         layer.setEnhance_factor(pub.getEnhanceFactor());
         layer.setNodata(getNoData(pub, metas));
@@ -231,7 +232,7 @@
         Integer type = null != pub.getColorTable() ? 0 : 1;
         List<?> levels = null != pub.getColorTable() ? pub.getColorTable() : pub.getGradientColorTable();
 
-        return entity.new Config(type, levels);
+        return entity.new Config(pub.getColorTableId(), type, levels);
     }
 
     /**
@@ -617,7 +618,7 @@
      */
     public List<TaskResultEntity.Result> getTaskStatus(List<Integer> list) {
         String url = String.format("%s/sj_raster/v6/api/mission?op=bulk_get_mission_status&%s", sjUrl5, ak);
-        Map<String, Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>(1);
         map.put("cmd_list", list);
 
         TaskResultEntity rs = postForRest(url, map, TaskResultEntity.class);

--
Gitblit v1.9.3