From 86bf08ff8f700356de6b8c68fb4013409499fd55 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 13 九月 2023 13:28:44 +0800
Subject: [PATCH] 修改 发布类型 设置

---
 src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java   |   18 ++++++++++++++++++
 src/main/java/com/moon/server/service/data/ShuJianService.java       |   16 +++++++++++++---
 src/main/java/com/moon/server/controller/data/PublishController.java |    2 +-
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/moon/server/controller/data/PublishController.java b/src/main/java/com/moon/server/controller/data/PublishController.java
index f601d0a..6ac7752 100644
--- a/src/main/java/com/moon/server/controller/data/PublishController.java
+++ b/src/main/java/com/moon/server/controller/data/PublishController.java
@@ -84,7 +84,7 @@
     private String getType(String type) throws Exception {
         switch (type) {
             case "DOM":
-                return "type in ('tif', 'tiff', 'img', 'jp2', 'jpg') and mata_type in (1, 3, 4, 5)";
+                return "type in ('tif', 'tiff', 'img', 'jp2', 'jpg') and mata_type in (1, 2, 3, 4, 5)";
             case "DEM":
                 return "type in ('tif', 'tiff', 'dem') and mata_type = 2";
             case "Vector":
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 767245e..b4cbc62 100644
--- a/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java
+++ b/src/main/java/com/moon/server/entity/shujian/TaskResultEntity.java
@@ -52,16 +52,34 @@
         public Result() {
         }
 
+        /**
+         * 浠诲姟鍚嶇О
+         */
         private String name;
 
+        /**
+         * 浠诲姟鐘舵�侊紝0锛氬垱寤猴紝1锛氬垵濮嬪寲锛�2锛氭墽琛岋紝3锛氬畬鎴愶紝4锛氶敊璇紝5锛氬彇娑�
+         */
         private Integer status;
 
+        /**
+         * 浠诲姟缂栧彿
+         */
         private Integer data_id;
 
+        /**
+         * 鎻忚堪
+         */
         private String description;
 
+        /**
+         * 杩涘害
+         */
         private Double process;
 
+        /**
+         * 鎵ц鐨勫懡浠�
+         */
         private Integer command;
 
         public String getName() {
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 abcbe1b..c809e65 100644
--- a/src/main/java/com/moon/server/service/data/ShuJianService.java
+++ b/src/main/java/com/moon/server/service/data/ShuJianService.java
@@ -163,8 +163,7 @@
         CreateLayerEntity.Layer layer = entity.getLayer();
         layer.setName(pub.getName() + "_" + pub.getTime());
         layer.setProjection(getEpsg(pub));
-        // layer.setType(TYPES.indexOf(pub.getType()))
-        layer.setType(2);
+        layer.setType(getPublishType(pub));
         layer.setEnhance_type(pub.getEnhanceType());
         layer.setEnhance_factor(pub.getEnhanceFactor());
         layer.setNodata(getNoData(pub, metas));
@@ -181,6 +180,17 @@
         }
 
         return entity;
+    }
+
+    /**
+     * 鑾峰彇鍙戝竷绫诲瀷
+     */
+    private int getPublishType(PubEntity pub) {
+        if (null != pub.getColorTable() || null != pub.getGradientColorTable()) {
+            return StaticData.I2;
+        }
+
+        return TYPES.indexOf(pub.getType());
     }
 
     /**
@@ -419,7 +429,7 @@
     }
 
     /**
-     * 鎻掑叆鏁扮畝鏈嶅姟
+     * 鏇存柊鏁扮畝鏈嶅姟
      */
     public Integer updateSjService(PubEntity pub) {
         PublishEntity entity = publishService.selectById(pub.getPubid());

--
Gitblit v1.9.3