From 090fb818449aab9edfe5ceedfa0cb10f3bd563e8 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 09 十月 2023 16:29:31 +0800
Subject: [PATCH] 去除 元数据 表

---
 src/main/java/com/moon/server/controller/data/PublishController.java |   94 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 86 insertions(+), 8 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 eb1240b..d006240 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":
@@ -136,13 +136,13 @@
 
         switch (type) {
             case "DOM":
-                return "type = 'DOM'";
+                return "a.type = 'DOM'";
             case "DEM":
-                return "type = 'DEM'";
+                return "a.type = 'DEM'";
             case "Vector":
-                return "type = 'Vector'";
+                return "a.type = 'Vector'";
             case "Model":
-                return "type = 'Model'";
+                return "a.type = 'Model'";
             default:
                 throw new Exception("鏁版嵁绫诲瀷涓嶅尮閰�");
         }
@@ -179,6 +179,26 @@
     }
 
     @SysLog()
+    @ApiOperation(value = "鏌ヨ鏁扮畝鍥惧眰")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "port", value = "绔彛", dataType = "int", paramType = "query", example = "50001")
+    })
+    @GetMapping(value = "/selectSjLayers")
+    public void selectSjLayers(Integer port, HttpServletRequest req, HttpServletResponse res) {
+        shuJianService.selectSjLayers(port, req, res);
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鏌ヨ鏁扮畝浠诲姟鐘舵��")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "浠诲姟ID", dataType = "int", paramType = "query", example = "10008101")
+    })
+    @GetMapping(value = "/selectSjMissionStatus")
+    public void selectSjMissionStatus(Integer id, HttpServletRequest req, HttpServletResponse res) {
+        shuJianService.selectSjMissionStatus(id, req, res);
+    }
+
+    @SysLog()
     @ApiOperation(value = "鎻掑叆鏁扮畝鏈嶅姟")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "PubEntity", paramType = "body")
@@ -193,15 +213,19 @@
             if (StringHelper.isEmpty(entity.getType())) {
                 return fail("鍙戝竷绫诲埆涓虹┖", null);
             }
+            if (!ShuJianService.TYPES.contains(entity.getType())) {
+                return fail("鍙戝竷绫诲埆涓嶆敮鎸�", null);
+            }
 
             UserEntity ue = tokenService.getCurrentUser(req);
             if (null != ue) {
                 entity.setUserId(ue.getId());
                 entity.setDepcode(ue.getDepcode());
             }
+            entity.setDefault();
 
             permsService.clearPermsCache();
-            Integer rows = shuJianService.insertSjService(entity, req, res);
+            Integer rows = shuJianService.insertSjService(entity);
 
             return success(rows);
         } catch (Exception ex) {
@@ -230,9 +254,10 @@
                 entity.setUserId(ue.getId());
                 entity.setDepcode(ue.getDepcode());
             }
+            entity.setDefault();
 
             permsService.clearPermsCache();
-            Integer rows = shuJianService.updateSjService(entity, req, res);
+            Integer rows = shuJianService.updateSjService(entity);
 
             return success(rows);
         } catch (Exception ex) {
@@ -245,7 +270,7 @@
     @ApiImplicitParams({
             @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "Integer", paramType = "query", allowMultiple = true, example = "1")
     })
-    @GetMapping(value = "/deletes")
+    @GetMapping(value = "/deletesSjServices")
     public ResponseMsg<Integer> deletesSjServices(@RequestParam List<Integer> ids) {
         try {
             if (null == ids || ids.isEmpty()) {
@@ -260,4 +285,57 @@
             return fail(ex.getMessage(), -1);
         }
     }
+
+    @SysLog()
+    @ApiOperation(value = "鏇存柊涓�鏉�")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "PublishEntity", paramType = "body")
+    })
+    @ResponseBody
+    @PostMapping(value = "/update", produces = "application/json; charset=UTF-8")
+    public ResponseMsg<Integer> update(@RequestBody PublishEntity entity, HttpServletRequest req) {
+        try {
+            UserEntity ue = tokenService.getCurrentUser(req);
+            if (ue != null) {
+                entity.setUpdateUser(ue.getId());
+            }
+            if (StringHelper.isEmpty(entity.getGeom())) {
+                entity.setGeom("null");
+            }
+
+            permsService.clearPermsCache();
+            int count = publishService.update(entity);
+
+            return success(count);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), -1);
+        }
+    }
+
+    @SysLog()
+    @ApiOperation(value = "鏇存柊鏁扮畝鍥惧眰鐨勬媺浼告柟寮�")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "PubEntity", paramType = "body")
+    })
+    @ResponseBody
+    @PostMapping(value = "/updateSjLayerStretch", produces = "application/json; charset=UTF-8")
+    public ResponseMsg<Integer> updateSjLayerStretch(@RequestBody PubEntity entity, HttpServletRequest req) {
+        try {
+            if (null == entity || null == entity.getLayerId()) {
+                return fail("瀹炰綋绫讳负绌烘垨鍥惧眰ID涓虹┖", 0);
+            }
+
+            UserEntity ue = tokenService.getCurrentUser(req);
+            if (null != ue) {
+                entity.setUserId(ue.getId());
+                entity.setDepcode(ue.getDepcode());
+            }
+
+            Integer rows = shuJianService.updateSjLayerStretch(entity);
+
+            return success(rows);
+        } catch (Exception ex) {
+            return fail(ex.getMessage(), -1);
+        }
+    }
 }

--
Gitblit v1.9.3