浏览代码

江门智慧城市首次提交

wuweihao 4 年之前
父节点
当前提交
c7f19bc6f7
共有 100 个文件被更改,包括 7222 次插入0 次删除
  1. 47 0
      cesium_manage/gis_application/pom.xml
  2. 13 0
      cesium_manage/gis_application/src/main/java/com/gis/ManageApplication.java
  3. 13 0
      cesium_manage/gis_application/src/main/java/com/gis/ServletInitializer.java
  4. 80 0
      cesium_manage/gis_application/src/main/resources/application-dev.properties
  5. 83 0
      cesium_manage/gis_application/src/main/resources/application-sit.properties
  6. 29 0
      cesium_manage/gis_application/src/main/resources/application.properties
  7. 156 0
      cesium_manage/gis_application/src/main/resources/logback-spring.xml
  8. 5 0
      cesium_manage/gis_application/src/main/resources/static/demslice.sh
  9. 11 0
      cesium_manage/gis_application/src/main/resources/static/shutdown.sh
  10. 29 0
      cesium_manage/gis_application/src/main/resources/static/start.sh
  11. 145 0
      cesium_manage/gis_common/pom.xml
  12. 59 0
      cesium_manage/gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  13. 93 0
      cesium_manage/gis_common/src/main/java/com/gis/common/config/Swagger2.java
  14. 78 0
      cesium_manage/gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java
  15. 190 0
      cesium_manage/gis_common/src/main/java/com/gis/common/constant/Command.java
  16. 65 0
      cesium_manage/gis_common/src/main/java/com/gis/common/constant/ConfigConstant.java
  17. 49 0
      cesium_manage/gis_common/src/main/java/com/gis/common/constant/TypeCode.java
  18. 35 0
      cesium_manage/gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java
  19. 34 0
      cesium_manage/gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java
  20. 239 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java
  21. 181 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/CmdUtils.java
  22. 140 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/FileUtils.java
  23. 194 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/PasswordUtils.java
  24. 69 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/RegexUtils.java
  25. 101 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/Result.java
  26. 66 0
      cesium_manage/gis_common/src/main/java/com/gis/common/util/StreamGobbler.java
  27. 22 0
      cesium_manage/gis_domain/pom.xml
  28. 38 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java
  29. 33 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/DemEntity.java
  30. 35 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/FileEntity.java
  31. 42 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/ModelEntity.java
  32. 48 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/RasterEntity.java
  33. 31 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysDeptEntity.java
  34. 56 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysResourceEntity.java
  35. 30 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysRoleEntity.java
  36. 58 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java
  37. 51 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/VectorEntity.java
  38. 23 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/DeptRequest.java
  39. 21 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/LoginRequest.java
  40. 27 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/PageDateRequest.java
  41. 26 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/PageDto.java
  42. 27 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/RoleAccreditRequest.java
  43. 28 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/RoleRequest.java
  44. 38 0
      cesium_manage/gis_domain/src/main/java/com/gis/domain/request/UserRequest.java
  45. 21 0
      cesium_manage/gis_mapper/pom.xml
  46. 19 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/DemMapper.java
  47. 18 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java
  48. 19 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/ModelMapper.java
  49. 14 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/RasterMapper.java
  50. 12 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysDeptMapper.java
  51. 21 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysResourceMapper.java
  52. 18 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysRoleMapper.java
  53. 27 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  54. 14 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/VectorMapper.java
  55. 36 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/provider/DemProvider.java
  56. 36 0
      cesium_manage/gis_mapper/src/main/java/com/gis/mapper/provider/ModelProvider.java
  57. 23 0
      cesium_manage/gis_service/pom.xml
  58. 23 0
      cesium_manage/gis_service/src/main/java/com/gis/service/DemService.java
  59. 47 0
      cesium_manage/gis_service/src/main/java/com/gis/service/IBaseService.java
  60. 25 0
      cesium_manage/gis_service/src/main/java/com/gis/service/ModelService.java
  61. 26 0
      cesium_manage/gis_service/src/main/java/com/gis/service/RasterService.java
  62. 13 0
      cesium_manage/gis_service/src/main/java/com/gis/service/SysDeptService.java
  63. 19 0
      cesium_manage/gis_service/src/main/java/com/gis/service/SysResourceService.java
  64. 16 0
      cesium_manage/gis_service/src/main/java/com/gis/service/SysRoleService.java
  65. 21 0
      cesium_manage/gis_service/src/main/java/com/gis/service/SysUserService.java
  66. 27 0
      cesium_manage/gis_service/src/main/java/com/gis/service/VectorService.java
  67. 165 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/DemServiceImpl.java
  68. 186 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/IBaseServiceImpl.java
  69. 171 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/ModelServiceImpl.java
  70. 345 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/RasterServiceImpl.java
  71. 27 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysDeptServiceImpl.java
  72. 38 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysResourceServiceImpl.java
  73. 35 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysRoleServiceImpl.java
  74. 49 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java
  75. 523 0
      cesium_manage/gis_service/src/main/java/com/gis/service/impl/VectorServiceImpl.java
  76. 51 0
      cesium_manage/gis_service/src/main/java/com/gis/service/util/ResourceTree.java
  77. 106 0
      cesium_manage/gis_service/src/main/java/com/gis/service/util/ResourceTreeUtil.java
  78. 27 0
      cesium_manage/gis_web/pom.xml
  79. 13 0
      cesium_manage/gis_web/src/main/java/com/gis/web/aop/WebControllerLog.java
  80. 122 0
      cesium_manage/gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java
  81. 71 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/BaseController.java
  82. 73 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/DemController.java
  83. 144 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/ExceptionController.java
  84. 46 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/FileController.java
  85. 105 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/IndexController.java
  86. 67 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/ModelController.java
  87. 86 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/RasterController.java
  88. 92 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysDeptController.java
  89. 144 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysRoleController.java
  90. 156 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysUserController.java
  91. 22 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/TestController.java
  92. 85 0
      cesium_manage/gis_web/src/main/java/com/gis/web/controller/VectorController.java
  93. 159 0
      cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JWTFilter.java
  94. 23 0
      cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JWTToken.java
  95. 253 0
      cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JwtUtil.java
  96. 110 0
      cesium_manage/gis_web/src/main/java/com/gis/web/shiro/MyRealm.java
  97. 114 0
      cesium_manage/gis_web/src/main/java/com/gis/web/shiro/ShiroConfig.java
  98. 255 0
      cesium_manage/pom.xml
  99. 26 0
      cesium_manage/remark.md
  100. 0 0
      gmap/CHANGELOG.md

+ 47 - 0
cesium_manage/gis_application/pom.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+
+
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+
+
+    <groupId>com.gis</groupId>
+    <artifactId>gis_application</artifactId>
+    <version>1.0.0</version>
+    <!--<packaging>war</packaging>-->
+    <packaging>jar</packaging>
+    <name>gis_application</name>
+    <description>项目入口</description>
+
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_web</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+        <finalName>cesium_manage_jm</finalName>
+    </build>
+
+
+
+</project>

+ 13 - 0
cesium_manage/gis_application/src/main/java/com/gis/ManageApplication.java

@@ -0,0 +1,13 @@
+package com.gis;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class ManageApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(ManageApplication.class, args);
+    }
+
+}

+ 13 - 0
cesium_manage/gis_application/src/main/java/com/gis/ServletInitializer.java

@@ -0,0 +1,13 @@
+//package com.gis;
+//
+//import org.springframework.boot.builder.SpringApplicationBuilder;
+//import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+//
+//public class ServletInitializer extends SpringBootServletInitializer {
+//
+//    @Override
+//    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+//        return application.sources(ManageApplication.class);
+//    }
+//
+//}

+ 80 - 0
cesium_manage/gis_application/src/main/resources/application-dev.properties

@@ -0,0 +1,80 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+#spring.datasource.druid.url=jdbc:mysql://localhost:3306/gis_cms?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=root
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.password=
+# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4 \u5355\u4F4D ms\uFF08\u6BEB\u79D2\uFF09
+spring.redis.timeout=3000ms
+# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F8\u3002
+spring.redis.jedis.pool.max-idle=8
+#\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F0\u3002
+spring.redis.jedis.pool.min-idle=0
+# \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
+spring.redis.jedis.pool.max-active=8
+# \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
+spring.redis.jedis.pool.max-wait=-1ms
+
+# oss info
+# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04BB\uFFFD\u38EC\u05BB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u06B0\uFFFD\uFFFD\uFFFD\uFFFD\u01B5\u0137\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDoss\uFFFD\uFFFD\uFFFD\uFFFD\u0427\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0637\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F2\uFFFD\uFFFD\uFFFD
+#oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
+oss.point=http://oss-cn-shenzhen.aliyuncs.com
+oss.key=LTAIUrvuHqj8pvry
+oss.secrecy=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+oss.bucket=oss-xiaoan
+oss.type=oss
+oss.file.path=${project.name}/
+oss.domain=http://ossxiaoan.4dage.com/
+
+# swagger2
+swagger.package=com.gis.web.controller
+swagger.title=cesium dev \u6C5F\u95E8\u6570\u636E\u7BA1\u7406\u5E73\u53F0
+swagger.description=cesium dev \u6C5F\u95E8\u6570\u636E\u7BA1\u7406\u5E73\u53F0
+swagger.version=1.0
+
+
+#log
+logging.path=E:/javaProject/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+# \uFFFD\u03F4\uFFFD\uFFFD\u013C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+# \uFFFD\uFFFD\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+server.file.path=F:\\test\\ngin\\${project.name}_data\\
+server.domain =http://192.168.0.135/data/
+
+
+

+ 83 - 0
cesium_manage/gis_application/src/main/resources/application-sit.properties

@@ -0,0 +1,83 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkankan4dage
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.password=
+# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4 \u5355\u4F4D ms\uFF08\u6BEB\u79D2\uFF09
+spring.redis.timeout=3000ms
+# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F8\u3002
+spring.redis.jedis.pool.max-idle=8
+#\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F0\u3002
+spring.redis.jedis.pool.min-idle=0
+# \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
+spring.redis.jedis.pool.max-active=8
+# \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
+spring.redis.jedis.pool.max-wait=-1ms
+
+
+# oss info
+# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04BB\uFFFD\u38EC\u05BB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u06B0\uFFFD\uFFFD\uFFFD\uFFFD\u01B5\u0137\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDoss\uFFFD\uFFFD\uFFFD\uFFFD\u0427\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0637\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F2\uFFFD\uFFFD\uFFFD
+oss.point=http://oss-cn-shenzhen-internal.aliyuncs.com
+oss.key=LTAIUrvuHqj8pvry
+oss.secrecy=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+oss.bucket=oss-xiaoan
+oss.type=oss
+oss.file.path=${project.name}/
+oss.domain=http://ossxiaoan.4dage.com/
+
+# swagger2
+swagger.package=com.gis.web.controller
+swagger.title=cesium sit \u6C5F\u95E8\u6570\u636E\u7BA1\u7406\u5E73\u53F0 
+swagger.description=cesium sit \u6C5F\u95E8\u6570\u636E\u7BA1\u7406\u5E73\u53F0 
+swagger.version=1.0
+
+
+
+# \uFFFD\uFFFD\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+server.file.path=/mnt/${project.name}_data/
+server.domain =http://192.168.0.135/data/
+
+#log
+logging.path=/root/user/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+
+
+
+
+
+

+ 29 - 0
cesium_manage/gis_application/src/main/resources/application.properties

@@ -0,0 +1,29 @@
+server.port=8003
+
+spring.profiles.active=dev
+
+# \uFFFD\uFFFD\u013F\uFFFD\uFFFD\uFFFD\uFFFD
+project.name=cesium_manage_jm
+
+# \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E
+spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/
+
+#\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=2048MB
+spring.servlet.multipart.max-request-size=2048MB
+
+
+
+#\u914D\u7F6E\u81EA\u52A8\u8BC6\u522B\u5B57\u6BB5\u8F6C\u6362
+mybatis.configuration.mapUnderscoreToCamelCase=true
+mapper.identity=MYSQL
+mapper.mappers=tk.mybatis.mapper.common.Mapper
+#pager
+pagehelper.helper-dialect=mysql
+pagehelper.params=count=countSql
+pagehelper.reasonable=false
+pagehelper.support-methods-arguments=true
+
+
+

+ 156 - 0
cesium_manage/gis_application/src/main/resources/logback-spring.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds" debug="false">
+    <property name="LOG_MAX_HISTORY" value="180"/>
+    <springProperty scope="context" name="LOG_PATH" source="logging.path"/>
+
+    <!-- 控制台输出 -->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>${LOG_PATH}/%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+    </appender>
+    <!-- 按照每天生成日志文件:主项目日志 -->
+    <appender name="file.all" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <!-- 追加日志到原文件结尾 -->
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 -->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{500} - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+    </appender>
+
+    <!--info日志统一输出到这里-->
+    <appender name="file.info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 每小时生成日志文件 -->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/info/console-info.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录info级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>INFO</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--错误日志统一输出到这里-->
+    <appender name="file.error" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/error/console-error.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录error级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>ERROR</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--warn日志统一输出到这里-->
+    <appender name="file.warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 按小时生成日志-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/warn/console-warn.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <!-- 除按日志记录之外,还配置了日志文件不能超过10M(默认),若超过10M,日志文件会以索引0开始, -->
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录warn级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>WARN</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY</onMismatch>
+        </filter>
+    </appender>
+
+    <!--debug级别日志统一输出到这里-->
+    <appender name="file.debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <!--日志文件输出的文件名 按小时生成日志-->
+            <FileNamePattern>${LOG_PATH}/%d{yyyy-MM-dd}/debug/console-debug.%d{yyyy-MM-dd-HH}.%i.log</FileNamePattern>
+            <!--日志文件保留天数-->
+            <MaxHistory>${LOG_MAX_HISTORY}</MaxHistory>
+            <!-- 除按日志记录之外,还配置了日志文件不能超过5M,若超过5M,日志文件会以索引0开始,命名日志文件,例如console-debug.2018-08-24-09.1.log -->
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>10MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+        </rollingPolicy>
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度 %method 方法名  %L 行数 %msg:日志消息,%n是换行符-->
+            <pattern> %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56}.%method:%L - %msg%n</pattern>
+            <!--<charset>utf-8</charset>-->
+        </encoder>
+        <!-- 此日志文件只记录debug级别的 -->
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <level>DEBUG</level>
+            <onMatch>ACCEPT</onMatch>
+            <onMismatch>DENY </onMismatch>
+        </filter>
+    </appender>
+
+    <!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
+    <appender name="file.async" class="ch.qos.logback.classic.AsyncAppender">
+        <discardingThreshold>0</discardingThreshold>
+        <queueSize>256</queueSize>
+        <includeCallerData>true</includeCallerData>
+        <appender-ref ref="file.all" />
+    </appender>
+
+    <!--  日志输出级别 -->
+    <!-- TRACE\DEBUG\INFO\WARN\ERROR\FATAL\OFF -->
+    <root level="INFO">
+        <appender-ref ref="console" />
+        <appender-ref ref="file.async"/>
+        <appender-ref ref="file.error" />
+        <appender-ref ref="file.info" />
+        <appender-ref ref="file.debug" />
+        <appender-ref ref="file.warn" />
+    </root>
+
+</configuration>

+ 5 - 0
cesium_manage/gis_application/src/main/resources/static/demslice.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+directory=$1
+fileurl=$2
+`echo docker run --rm -v /mnt:/mnt tumgis/ctb-quantized-mesh:latest ctb-tile -f Mesh -C -N -o $directory $fileurl && docker run --rm -v /mnt:/mnt tumgis/ctb-quantized-mesh:latest ctb-tile -f Mesh -C -N -l -o $directory $fileurl`
+docker run --rm -v /mnt:/mnt tumgis/ctb-quantized-mesh:latest ctb-tile -f Mesh -C -N -o $directory $fileurl && docker run --rm -v /mnt:/mnt tumgis/ctb-quantized-mesh:latest ctb-tile -f Mesh -C -N -l -o $directory $fileurl

+ 11 - 0
cesium_manage/gis_application/src/main/resources/static/shutdown.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+RESOURCE_NAME=cesium_manage_jm.jar
+   tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
+
+if [ ${tpid} ]; then
+echo 'Kill Process!'
+kill -9 $tpid
+else
+echo 'Stop Success!'
+fi
+

+ 29 - 0
cesium_manage/gis_application/src/main/resources/static/start.sh

@@ -0,0 +1,29 @@
+#!/bin/sh
+RESOURCE_NAME=cesium_manage_jm.jar
+tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
+if [ ${tpid} ]; then
+echo 'Stop Process...'
+kill -15 $tpid
+fi
+
+sleep 5
+
+tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
+
+if [ ${tpid} ]; then
+echo 'Kill Process!'
+kill -9 $tpid
+else
+echo 'Stop Success!'
+fi
+
+tpid=`ps -ef|grep $RESOURCE_NAME|grep -v grep|grep -v kill|awk '{print $2}'`
+if [ ${tpid} ]; then
+    echo 'App is running.'
+else
+    echo 'App is NOT running.'
+fi
+rm -f tpid
+nohup java -jar ./$RESOURCE_NAME --spring.profiles.active=sit  &
+echo $! > tpid
+echo Start Success!

+ 145 - 0
cesium_manage/gis_common/pom.xml

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_common</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+
+        <!--springboot-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- JPA -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!--springboot中的redis依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- rabbit MQ-->
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.boot</groupId>-->
+            <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+        <!--</dependency>-->
+
+        <!-- lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+
+        <!-- mysql -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!--阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!-- knife4j aip 包-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- 工具类 -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+
+        <!-- shiro -->
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+        </dependency>
+
+
+        <!-- jwt -->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+        </dependency>
+
+        <!--aliyun sdk-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+        </dependency>
+
+
+        <!--tk.mybatis 依赖-->
+        <dependency>
+            <groupId>tk.mybatis</groupId>
+            <artifactId>mapper-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!--分页插件-->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+
+
+
+    </dependencies>
+
+
+</project>

+ 59 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java

@@ -0,0 +1,59 @@
+package com.gis.common.config;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Slf4j
+@Component
+public class CommonInterceptor implements HandlerInterceptor {
+
+//    @Value("${spring.profiles.active}")
+//    private String active;
+
+    @Override
+    public boolean preHandle(HttpServletRequest request,
+                             HttpServletResponse response, Object handler) throws Exception {
+        if(!request.getRequestURI().contains("/static/") && !request.getRequestURI().contains("/sendUserInfo")
+                && !request.getRequestURI().contains(".json") && !request.getRequestURI().contains(".png")
+                && !request.getRequestURI().contains(".html") && !request.getRequestURI().contains(".mp3")){
+//            log.warn("start : {}", request.getRequestURI());
+        }
+
+
+        // uat环境禁止访问api文档
+//        if (active.equals("uat")) {
+//            log.info("访问api文档拦截");
+//            return !request.getRequestURI().contains("doc.html");
+//        }
+
+        return true;
+    }
+
+    @Override
+    public void postHandle(HttpServletRequest request,
+                           HttpServletResponse response, Object handler,
+                           ModelAndView modelAndView) throws Exception {
+        request.setAttribute("ctx", request.getContextPath());
+    }
+
+    @Override
+    public void afterCompletion(HttpServletRequest request,
+                                HttpServletResponse response, Object handler, Exception ex)
+            throws Exception {
+        if(!request.getRequestURI().contains("/static/") && !request.getRequestURI().contains("/sendUserInfo")
+                && !request.getRequestURI().contains(".json") && !request.getRequestURI().contains(".png")
+                && !request.getRequestURI().contains(".html") && !request.getRequestURI().contains(".mp3")){
+//            log.warn("end : {}", request.getRequestURI());
+        }
+    }
+
+
+
+
+}

+ 93 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/config/Swagger2.java

@@ -0,0 +1,93 @@
+package com.gis.common.config;
+
+import com.gis.common.constant.ConfigConstant;
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import com.google.common.collect.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18
+ *
+ * 集成Swagger有3步:
+ * 1.pom.xml添加依赖
+ * 2.添加Swagger2.class
+ * 3.Application.class 加上注解@EnableSwagger2 表示开启Swagger
+ * 4.http://localhost:8080/doc.html#/
+ *
+ * 2.9.2 不需要字启动类配置注解
+ */
+@Configuration
+@EnableSwagger2
+@EnableKnife4j
+public class Swagger2 {
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Bean
+    public Docket createRestApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage(configConstant.swaggerPackage))
+                .paths(PathSelectors.any())
+                .build()
+                //添加登录认证,可以使用token
+                .securityContexts(securityContexts())
+                .securitySchemes(securitySchemes())
+                ;
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title(configConstant.swaggerTitle)
+                .description(configConstant.swaggerDescription)
+                .version(configConstant.swaggerVersion)
+                .build();
+    }
+
+    private List<ApiKey> securitySchemes() {
+        //设置请求头信息
+        List<ApiKey> result = new ArrayList<>();
+        ApiKey apiKey = new ApiKey("Authorization", "token", "header");
+        result.add(apiKey);
+        return result;
+
+    }
+
+
+    private List<SecurityContext> securityContexts() {
+
+        SecurityContext context = SecurityContext.builder()
+                .securityReferences(defaultAuth())
+                .build();
+
+        return Lists.newArrayList(context);
+
+    }
+
+    private List<SecurityReference> defaultAuth() {
+        List<SecurityReference> result = new ArrayList<>();
+        AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
+        AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
+        authorizationScopes[0] = authorizationScope;
+        result.add(new SecurityReference("Authorization", authorizationScopes));
+        return result;
+    }
+}

+ 78 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java

@@ -0,0 +1,78 @@
+package com.gis.common.config;
+
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import com.alibaba.fastjson.support.config.FastJsonConfig;
+import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.MediaType;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18 0018 12:01
+ */
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer {
+
+    @Autowired
+    private CommonInterceptor commonInterceptor;
+
+    /**
+     * 配置全局跨域
+     */
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowedOrigins("*")
+                .allowCredentials(true)
+                .allowedMethods("GET", "POST", "DELETE", "PUT", "OPTIONS")
+                .maxAge(3600);
+    }
+
+
+    /**
+     * 添加拦截器
+     */
+    @Override
+    public void addInterceptors(InterceptorRegistry registry) {
+        registry.addInterceptor(commonInterceptor).addPathPatterns("/**");
+    }
+
+    /**
+     * fastJson相关设置
+     * Dto包含json,需要配置不然会异常
+     * @return
+     */
+    @Bean
+    public HttpMessageConverters customConverters() {
+
+        FastJsonHttpMessageConverter fastJson = new FastJsonHttpMessageConverter();
+        // 创建FastJson信息转换对象
+        FastJsonConfig fastJsonConfig = new FastJsonConfig();
+
+
+        // 设置全程返回时间
+        fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
+        // 设置返回值为null是时输出,不写的话,null 字段 不返回。也可以设置返回空串, 可以同时设置多个
+        fastJsonConfig.setSerializerFeatures(SerializerFeature.WriteMapNullValue, SerializerFeature.WriteNullStringAsEmpty);
+
+        fastJson.setFastJsonConfig(fastJsonConfig);
+
+        //3、中文乱码解决方案
+        List<MediaType> mediaTypeList = new ArrayList<>();
+        mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
+        mediaTypeList.add(MediaType.valueOf("text/html;charset=UTF-8"));
+
+        //4、将转换规则应用于转换对象
+        fastJson.setSupportedMediaTypes(mediaTypeList);
+
+        return new HttpMessageConverters(fastJson);
+    }
+}

+ 190 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/constant/Command.java

@@ -0,0 +1,190 @@
+package com.gis.common.constant;
+
+
+/**
+ * Created by Owen on 2019/11/1 0001 9:33
+ * Linxu 插件运行命令
+ */
+public class Command {
+
+//    public static String DOCKER_GDAL = "docker run --rm -v /root/gis/data:/root/gis/data osgeo/gdal:latest ";
+//    public static String DOCKER_CTB = "docker run --rm -v /root/gis/data:/root/gis/data tumgis/ctb-quantized-mesh:latest ";
+
+    public static String DOCKER_GDAL = "docker run --rm -v /mnt:/mnt osgeo/gdal:latest ";
+
+    public static String DOCKER_CTB = "docker run --rm -v /mnt:/mnt tumgis/ctb-quantized-mesh:latest ";
+
+    // docker 数据挂载目录
+    public static String DOCKER_BASE_DIR = "docker run --rm -v /mnt:/mnt ";
+
+    /**
+     * 输入目录:/root/gis/cesium/input/@fileName fileName:是目录名
+     * 输出目录:/root/gis/cesium/output/@fileName fileName:是目录名
+     */
+    public static String MODEL_SLICE_OSGB = DOCKER_BASE_DIR + "ubuntu:3dtile 3dtile -f osgb -i @inputFile -o @outputFile";
+
+    /**
+     * 矢量数据 坐标转换(普通转换,2000转wgs84)
+     * 输入文件:/root/gis/cesium/input/@fileName/@fileName.shp
+     * 输出文件:/root/gis/cesium/input/transform/@fileName/@fileName.shp
+     * 坐标参数:EPSG:4326
+     */
+    public static String VECTOR_TRANSFORM_GENERAL  = DOCKER_GDAL + "ogr2ogr -lco \"encoding=utf-8\" -t_srs EPSG:4326  @outputFile  @inputFile";
+
+
+
+    /**
+     * 矢量数据 严格坐标转换
+     * 有坐标参数,执行严格坐标转换(CGCS2000转wgs80)
+     * 坐标: @coord
+     * 输入文件:
+     * 输出文件:
+     */
+    public static String VECTOR_TRANSFORM_STRICT_WGS80  = DOCKER_GDAL + "ogr2ogr -lco \"encoding=utf-8\" -overwrite  -s_srs \"+proj=longlat +ellps=GRS80 +no_defs +towgs84=@coord\" -t_srs EPSG:4326 @outputFile @inputFile";
+
+    /**
+     * 矢量数据 严格坐标转换
+     * 有坐标参数,执行严格坐标转换(西安80转wgs84)
+     * 坐标: @coord
+     * 输入文件:
+     * 输出文件:
+     */
+    public static String VECTOR_TRANSFORM_STRICT_WGS84  = DOCKER_GDAL + "ogr2ogr -lco \"encoding=utf-8\" -overwrite  -s_srs \"+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=IAU76 +units=m +no_defs +towgs84=@coord\" -t_srs EPSG:4326 @outputFile @inputFile";
+
+    /**
+     * 矢量数据切片 step1
+     * shp转geojson
+     * 输入文件:@inputFile
+     * 输出文件:@outputFile
+     *
+     */
+    public static String VECTOR_TO_GEOJSON  = DOCKER_GDAL + "ogr2ogr -f GeoJSON @outputFile @inputFile";
+
+
+    /**
+     * 矢量数据切片 step2
+     * 输入文件:@inputFile
+     * 输出文件:@outputFile
+     *
+     */
+//    public static String VECTOR_SLICE_TIPPECANOE = "tippecanoe -e @outputFile --extend-zooms-if-still-dropping -pC --force -z@layerMax -Z@layerMin @inputFile";
+    public static String VECTOR_SLICE_TIPPECANOE = DOCKER_BASE_DIR + "tippecanoe:latest tippecanoe -e @outputFile --extend-zooms-if-still-dropping -pC --force -z@layerMax -Z@layerMin @inputFile";
+
+    /**
+     * 矢量数据判断坐标
+     * 输入文件:@inputFile
+     */
+    public static String VECTOR_JUDGE_COORD = DOCKER_GDAL + "ogrinfo -ro -al -so @inputFile";
+
+
+    /**
+     * 矢量数据要素查询
+     * 精准查询
+     */
+    public static String VECTOR_WFS_ACCURATE = DOCKER_GDAL + "ogr2ogr -overwrite -fieldTypeToString Date -f geojson -where \"@fileName = '@value'\" @outputFile @inputFile";
+
+    /**
+     * 矢量数据要素查询
+     * 模糊查询
+     */
+    public static String VECTOR_WFS_LIKE = DOCKER_GDAL + "ogr2ogr -overwrite -fieldTypeToString Date -f geojson -where \"@fileName like '%@value%'\" @outputFile @inputFile";
+
+    /**
+     * 矢量数据要素查询
+     * 范围查询
+     */
+    public static String VECTOR_WFS_SCOPE = DOCKER_GDAL + "ogr2ogr -overwrite -fieldTypeToString Date -f geojson -spat @xMin @yMin @xMax @yMax @outputFile @inputFile";
+
+    /**
+     * 矢量数据要素查询
+     * 获取字段名称
+     */
+    public static String VECTOR_WFS_FIELD = DOCKER_GDAL + "ogrinfo -al -so @inputFile";
+
+    /**
+     * 栅格数据切片命令
+     */
+
+    public static String RASTER_SLICE_OSGEO  = DOCKER_GDAL + "python3 /usr/bin/gdal2tiles.py -p geodetic -d --zoom=@layerMin-@layerMax --processes=6 @inputFile @outputFile";
+
+    /**
+     * 栅格数据判断坐标
+     * 输入文件:@inputFile
+     *
+     * gdalsrsinfo -o proj4 /root/gis/cesium/input/owen_2.tif
+     */
+//    public static String RASTER_JUDGE_COORD = "gdalsrsinfo -o proj4 @inputFile";
+    public static String RASTER_JUDGE_COORD = DOCKER_GDAL + "gdalsrsinfo -o proj4 @inputFile";
+
+
+
+    /**
+     * 严格坐标转换,step:1
+     */
+    public static String RASTER_TRANSFORM_GDALWARP_STRICT_1  = DOCKER_GDAL + "gdalwarp -overwrite -ct \"+proj=pipeline +step +proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000 +y_0=0 +ellps=IAU76 +units=m +no_defs +inv +step  +proj=cart +a=6378140 +b=6356755.288158 +step +proj=helmert +convention=coordinate_frame +x=@x +y=@y +z=@z +rx=@rx +ry=@ry +rz=@rz +s=1 +step +proj=cart +a=6378137 +b=6356752.314245 inv +step +proj=unitconvert +xy_in=rad +xy_out=deg\" @inputFile @outputFile";
+
+    /**
+     * 严格坐标转换,step:2
+     * 输入文件: /root/gis/cesium/input/transform/@fileName.tif
+     * 输出文件: /root/gis/cesium/input/transform_strict/@fileName.tif
+     */
+    public static String RASTER_TRANSFORM_GDALWARP_STRICT_2  = DOCKER_GDAL + "gdal_translate -a_srs EPSG:4326  @inputFile @outputFile";
+
+    // 解压到指定目录
+    public static String CMD_ZIP  = "cd @path && unzip -o @fileName.zip";
+
+    // 将生成的数据移动到服务器
+    public static String CMD_MV = "mv /root/gis/data/output/@fileName /root/gis/data/server";
+
+
+    /**
+     * 修改文件linux 写文件 0755 权限
+     */
+    public static String CMD_CHOMD_755 = "chmod 755 -R @path";
+
+
+    /**
+     * 地形数据打包
+     */
+    public static String DEM_BUILD = DOCKER_GDAL + "gdalbuildvrt @outputFile @inputFile";
+
+
+    /**
+     * 地形数据切片
+     */
+    public static String DEM_SLICE = DOCKER_CTB + "ctb-tile -f Mesh -C -N -o @outputFile @inputFile && " + DOCKER_CTB + "ctb-tile -f Mesh -C -N -l -o @outputFile @inputFile";
+
+
+    /**
+     * WGS84 转 CGCS2000坐标系
+     * 矢量数据 step1 step2
+     */
+    public static String convert_TRANSFORM_coord_vector_step1 = DOCKER_GDAL + "ogr2ogr -lco \"encoding=utf-8\" -s_srs epsg:4326 -t_srs \"+proj=longlat +ellps=GRS80 +towgs84=@coord +no_defs\" @outputFile @inputFile";
+
+    public static String convert_TRANSFORM_coord_vector_step2 = DOCKER_GDAL + "ogr2ogr -lco \"encoding=utf-8\"  -a_srs epsg:4490 @outputFile @inputFile";
+
+    /**
+     * WGS84 转 CGCS2000坐标系
+     * 栅格数据转换 step1 step2
+     */
+    public static String convert_TRANSFORM_coord_raster_step1 = DOCKER_GDAL + "gdalwarp -s_srs epsg:4326 -t_srs \"+proj=longlat +ellps=GRS80 +towgs84=@coord +no_defs\" @inputFile @outputFile ";
+
+    public static String convert_TRANSFORM_coord_raster_step2 = DOCKER_GDAL + "gdal_translate -a_srs epsg:4490 @inputFile @outputFile";
+
+    /**
+     * unzip -o /root/owen/unzip/owen1.zip -d /root/owen/unzip/
+     * -o:不必先询问用户,unzip执行后覆盖原有的文件
+     * -d<目录>:指定文件解压缩后所要存储的目录;
+     */
+    public final static String unzip = "unzip -o @inputFile -d @outputFile";
+
+    public final static String remove = "rm -rf @input";
+
+
+    // 执行脚本
+    public final static String demSlice = "bash /mnt/bash/demslice.sh @outputFile @inputFile";
+
+
+
+
+}

+ 65 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/constant/ConfigConstant.java

@@ -0,0 +1,65 @@
+package com.gis.common.constant;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by owen on 2020/12/31 0031 14:22
+ *
+ * 全局动态参数
+ */
+@Component
+public class ConfigConstant {
+
+
+    /** 服务器文件地址*/
+    @Value("${server.file.path}")
+    public  String serverBasePath;
+
+    /** 服务器域名*/
+    @Value("${server.domain}")
+    public  String serverDomain;
+
+
+
+    @Value("${project.name}")
+    public String projectName;
+
+    @Value("${oss.point}")
+    public  String ossPoint;
+
+    @Value("${oss.key}")
+    public  String ossKey;
+
+    @Value("${oss.secrecy}")
+    public  String ossSecrecy;
+
+    @Value("${oss.bucket}")
+    public  String ossBucket;
+
+    @Value("${oss.file.path}")
+    public  String ossBasePath;
+
+    @Value("${oss.domain}")
+    public  String ossDomain;
+
+
+    @Value("${swagger.package}")
+    public  String swaggerPackage;
+
+    @Value("${swagger.title}")
+    public  String swaggerTitle;
+
+    @Value("${swagger.description}")
+    public  String swaggerDescription;
+
+    @Value("${swagger.version}")
+    public  String swaggerVersion;
+
+
+
+
+
+
+
+}

+ 49 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/constant/TypeCode.java

@@ -0,0 +1,49 @@
+package com.gis.common.constant;
+
+/**
+ * Created by Owen on 2019/11/7 0007 11:10
+ *
+ * 文件类型
+ */
+public class TypeCode {
+
+    /**
+     * 栅格数据
+     */
+    public static final String FILE_TYPE_RASTER = "raster";
+
+
+    /**
+     * 矢量数据
+     */
+    public static final String FILE_TYPE_VECTOR = "vector";
+
+
+
+    /**
+     * 模型数据
+     */
+    public static final String FILE_TYPE_MODEL = "model";
+
+    /**
+     * 地形数据
+     */
+    public static final String FILE_TYPE_DEM = "dem";
+
+    /**
+     * WGS84到CGCS2000坐标系转换
+     */
+    public static final String FILE_TYPE_CONVERT = "convert";
+
+    /**
+     * 不需要转坐标,显示WGS84
+     */
+    public static final String COORD_WGS84 = "WGS84";
+
+    public static final String COORD_XIAN_1980 = "Xian 1980";
+
+    public static final String COORD_SYSTEM_2000 = "CGCS 2000";
+
+
+
+}

+ 35 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java

@@ -0,0 +1,35 @@
+package com.gis.common.exception;
+
+public class BaseRuntimeException extends RuntimeException{
+
+    private static final long serialVersionUID = -1518945670203783450L;
+    private Integer code;
+    private String msg;
+
+    public BaseRuntimeException(String msg){
+        super(msg);
+        this.msg = msg;
+    }
+
+    public BaseRuntimeException(Integer code, String msg){
+        super(msg);
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 34 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java

@@ -0,0 +1,34 @@
+package com.gis.common.exception;
+
+import org.apache.shiro.ShiroException;
+
+public class JwtAuthenticationException extends ShiroException {
+
+    private static final long serialVersionUID = 2899335020273674736L;
+
+    private int code;
+
+    private String msg;
+
+    public JwtAuthenticationException(int code, String msg){
+        super(msg);
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 239 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java

@@ -0,0 +1,239 @@
+package com.gis.common.util;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
+import com.aliyun.oss.model.OSSObjectSummary;
+import com.aliyun.oss.model.ObjectListing;
+import com.aliyun.oss.model.PutObjectResult;
+import com.gis.common.constant.ConfigConstant;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 阿里云oss工具类
+ */
+@Slf4j
+@Component
+public class AliyunOssUtil {
+
+    @Autowired
+    ConfigConstant configConstant;
+
+
+    private OSSClient init(){
+        return new OSSClient(configConstant.ossPoint, configConstant.ossKey, configConstant.ossSecrecy);
+    }
+
+
+
+    public  void delete(String key) throws IOException {
+        OSSClient ossClient = init();
+        try {
+
+            // 2019-2-28 启动aliyun oss 空间
+            ossClient.deleteObject(configConstant.ossBucket, key);
+            ossClient.deleteObject(configConstant.ossBucket, key);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    //上传的数据是byte[],key是上传后的文件名
+    public void upload(byte[] data, String key) throws IOException {
+        OSSClient ossClient = init();
+        try {
+            // 2019-2-28 启动aliyun oss 空间
+            ossClient.putObject(configConstant.ossBucket, key, new ByteArrayInputStream(data));
+        } catch (Exception e) {
+            log.error(e.toString() + key);
+        }
+    }
+
+
+    public void upload(String filePath, String key) {
+        OSSClient ossClient = init();
+        try {
+            File file = new File(filePath);
+            if (!file.exists()) {
+                log.error("要上传的文件不存在:" + filePath);
+            }
+            ossClient.putObject(configConstant.ossBucket, key, new File(filePath));
+
+        } catch (Exception e) {
+            log.error(e.toString() + filePath);
+        }
+    }
+
+    public  void upload2(String filePath, String key) {
+        OSSClient ossClient = init();
+        try {
+
+            // 2019-2-28 启动aliyun oss 空间
+            ossClient.putObject(configConstant.ossBucket, key, new File(filePath));
+        } catch (Exception e) {
+            log.error(e.toString() + filePath);
+        }
+    }
+
+
+    /**
+     * 上传的数据是文件夹,参数是文件夹路径,key是上传后的文件名
+     *
+     * @param filepaths key : 原文件路径
+     *                  value: oss路径, oss会自动创建目录
+     */
+    public  void uploadMulFiles(Map<String, String> filepaths) {
+        if (filepaths == null) {
+            return;
+        }
+        log.info("开始批量上传到阿里云:" + new Date().toString());
+        if (filepaths.size() > 50) {
+            for (String filePath : filepaths.keySet()) {
+                upload2(filePath, filepaths.get(filePath));
+            }
+        } else {
+            for (String filePath : filepaths.keySet()) {
+                log.info("文件:" + filePath + "到阿里云:" + filepaths.get(filePath));
+                upload(filePath, filepaths.get(filePath));
+            }
+        }
+        log.info("批量上传阿里云完毕:" + new Date().toString());
+    }
+
+
+    /**
+     * 可以删除目录
+     *
+     * @param prefix 图片路径
+     * @return
+     */
+    public  int deleteFile(String prefix) {
+        OSSClient ossClient = init();
+        ObjectListing objectListing = ossClient.listObjects(configConstant.ossBucket, prefix);
+        List<OSSObjectSummary> sums = objectListing.getObjectSummaries();
+        try {
+            for (OSSObjectSummary s : sums) {
+                delete(s.getKey());
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return sums.size();
+    }
+
+    public  void main(String[] args) throws IOException {
+
+        HashMap<String, String> map = new HashMap<>();
+//		map.put("F:\\test\\aa.jpg", "kanfang/test/aa.jpg");
+        map.put("F:\\test\\oss\\floor.json", "kanfang/test/faa.json");
+        uploadMulFiles(map);
+
+//		deleteFile("kanfang/test/aa.jpg");
+
+    }
+
+
+
+
+    public  String upload5(String filePath, String key) {
+        OSSClient ossClient = init();
+        PutObjectResult result = null;
+        try {
+            File file = new File(filePath);
+            if (!file.exists()) {
+                log.error("要上传的文件不存在:" + filePath);
+            }
+
+
+            result = ossClient.putObject(configConstant.ossBucket, key, new File(filePath));
+
+        } catch (Exception e) {
+            log.error(e.toString() + filePath);
+        }
+
+        log.info(" getETag : " + result.getETag());
+        log.info("1 : " + result.toString());
+        log.info("2 : " + result.getRequestId());
+        log.info("3 : " + result.getClientCRC());
+        log.info("4 : " + result.getResponse());
+        log.info("5 : " + result.getServerCRC());
+        return result.getETag();
+    }
+
+
+    /**
+     * 通过文件名判断并获取OSS服务文件上传时文件的contentType
+     *
+     * @param fileName 文件名
+     * @return 文件的contentType
+     */
+    private static String getContentType(String fileName) {
+        log.info("getContentType:" + fileName);
+        // 文件的后缀名
+        String fileExtension = fileName.substring(fileName.lastIndexOf("."));
+        if (".bmp".equalsIgnoreCase(fileExtension)) {
+            return "image/bmp";
+        }
+        if (".gif".equalsIgnoreCase(fileExtension)) {
+            return "image/gif";
+        }
+        if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension)
+                || ".png".equalsIgnoreCase(fileExtension)) {
+            return "image/jpeg";
+        }
+        if (".html".equalsIgnoreCase(fileExtension)) {
+            return "text/html";
+        }
+        if (".txt".equalsIgnoreCase(fileExtension)) {
+            return "text/plain";
+        }
+        if (".vsd".equalsIgnoreCase(fileExtension)) {
+            return "application/vnd.visio";
+        }
+        if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) {
+            return "application/vnd.ms-powerpoint";
+        }
+        if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) {
+            return "application/msword";
+        }
+        if (".xml".equalsIgnoreCase(fileExtension)) {
+            return "text/xml";
+        }
+        if (".pdf".equalsIgnoreCase(fileExtension)) {
+            return "application/pdf";
+        }
+        // 默认返回类型
+        return "image/jpeg";
+    }
+
+    /**
+     * 以流下载图片
+     *
+     * @param
+     * @return
+     * @Title: getInputStreamByFileUrl
+     * @Description: 根据文件路径获取InputStream流
+     * @return: InputStream
+     */
+    public  InputStream getInputStreamByFileUrl(String filePath) {
+        // ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
+        OSSClient ossClient = init();
+        OSSObject ossObject = ossClient.getObject(configConstant.ossBucket, filePath);
+        return ossObject.getObjectContent();
+    }
+
+
+
+
+
+}

+ 181 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/CmdUtils.java

@@ -0,0 +1,181 @@
+package com.gis.common.util;
+
+import cn.hutool.core.util.RuntimeUtil;
+import lombok.extern.log4j.Log4j2;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+/**
+ * Created by owen on 2021/1/4 0004 14:53
+ */
+@Log4j2
+public class CmdUtils {
+
+
+
+    /**
+     * 调用opencv 生成缩略图
+     * 100m的图java处理不了。目前使用算法部郭晨露的脚本
+     * @param cmd
+     * @return
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    public static int cmdThumb(String cmd) throws IOException, InterruptedException {
+        Process exec = RuntimeUtil.exec(cmd);
+        log.info("run cmdThumb");
+
+        BufferedReader br = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+        BufferedReader errorBuf = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
+
+        String errorLine;
+        while ((errorLine = errorBuf.readLine()) != null) {
+            log.error("errorLine: {}", errorLine);
+        }
+
+        // success ,没有获取到信息
+        String line;
+        int i = 1;
+        while ((line = br.readLine()) != null) {
+
+            // 查看执行日志
+            if (i % 100 == 0) {
+                log.info("line, i=" + i +", " +line);
+            }
+
+            if (line.contains("done.")) {
+                log.info("line: {}", line);
+                log.info("cmdThumb完成 ");
+            }
+            i++;
+        }
+        log.info("执行总行数:" +i);
+
+        // 结束命令行
+        int isCmd = exec.waitFor();
+
+        // 关闭流
+        br.close();
+        errorBuf.close();
+
+        return isCmd;
+
+    }
+
+    /**
+     * 命令运行结果 1:失败, 0:成功
+     * @param cmd
+     * @return
+     * @throws IOException
+     * @throws InterruptedException
+     */
+    public static int cmdPano(String cmd) throws IOException, InterruptedException {
+        Process exec = RuntimeUtil.exec(cmd);
+        log.info("run cmdPano");
+
+        BufferedReader br = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+        BufferedReader errorBuf = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
+
+        String errorLine;
+        while ((errorLine = errorBuf.readLine()) != null) {
+            log.error("errorLine: {}", errorLine);
+        }
+
+        // success ,没有获取到信息
+        String line;
+        while ((line = br.readLine()) != null) {
+            log.debug("line: {}", line);
+            if (line.contains("done.")) {
+                log.info("line: {}", line);
+                log.info("cmdPano完成 ");
+            }
+        }
+
+        // 结束命令行
+        int isCmd = exec.waitFor();
+
+        // 关闭流
+        br.close();
+        errorBuf.close();
+
+        return isCmd;
+
+    }
+
+
+    /**
+     * 调用算法 xx.sh 脚本
+     * @param command
+     */
+    public static void callShell(String command){
+        try {
+            Process process = Runtime.getRuntime().exec(command);
+            StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
+            errorGobbler.start();
+            StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");
+            outGobbler.start();
+            process.waitFor();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static void cmdShell(String command){
+        try {
+            String[] cmd = new String[]{"/bin/sh", "-c", command};
+            Process process = Runtime.getRuntime().exec(cmd);
+            StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
+            errorGobbler.start();
+            StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");
+            outGobbler.start();
+            process.waitFor();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public static int cmdOss(String cmd) throws IOException, InterruptedException {
+        Process exec = RuntimeUtil.exec(cmd);
+        log.info("run cmdOss");
+
+        BufferedReader br = new BufferedReader(new InputStreamReader(exec.getInputStream()));
+        BufferedReader errorBuf = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
+
+        String errorLine;
+        while ((errorLine = errorBuf.readLine()) != null) {
+            log.error("errorLine: {}", errorLine);
+        }
+
+        // success ,没有获取到信息
+        String line;
+        int i = 1;
+        while ((line = br.readLine()) != null) {
+            log.info("line: {}", line);
+
+            // 查看执行日志
+//            if (i % 100 == 0) {
+//                log.info("line, i=" + i +", " +line);
+//            }
+
+//            if (line.contains("done.")) {
+//                log.info("line: {}", line);
+//                log.info("cmdThumb完成 ");
+//            }
+            i++;
+        }
+        log.info("执行总行数:" +i);
+
+        // 结束命令行
+        int isCmd = exec.waitFor();
+
+        // 关闭流
+        br.close();
+        errorBuf.close();
+
+        return isCmd;
+
+    }
+}

+ 140 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -0,0 +1,140 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.URLUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Slf4j
+public class FileUtils {
+
+
+    /**
+     * 多文件上传
+     * savePath 路径(目录)
+     */
+    public static List<Map<String, String>> uploads(MultipartFile[] files, String savePath) throws IOException {
+        if (files == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        savePath = savePath + time + File.separator;
+//        FileUtil.mkdir(time);
+
+        ArrayList<Map<String, String>> list = new ArrayList<>();
+
+        String path;
+        int i = 0;
+        for (MultipartFile file : files) {
+            String fileName = file.getOriginalFilename();
+            String suffix = StringUtils.substringAfterLast(fileName, ".");
+            String newName = time + "_" + i + "."  +suffix;
+            path = savePath + newName;
+            FileUtil.writeFromStream(file.getInputStream(), path);
+
+            HashMap<String, String> fileInfo = new HashMap<>();
+            fileInfo.put("path", path);
+            fileInfo.put("name", fileName);
+            fileInfo.put("newName", newName);
+            fileInfo.put("dir", time);
+
+            list.add(fileInfo);
+            ++ i;
+        }
+
+        return list;
+
+    }
+
+
+    /**
+     * 重命名文件上传
+     * @param file
+     * @param savePath
+     * @return
+     * @throws IOException
+     */
+    public static String renameUpload(MultipartFile file, String savePath, String baseUrl)  {
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+
+        String fileName = file.getOriginalFilename();
+
+
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+        String newName = time  + "."  +suffix;
+        savePath = savePath  + newName;
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        String path = StringUtils.substringAfterLast(savePath, "cms_fdkanzhan_data"+ File.separator);
+
+        return baseUrl+"cms_fdkanzhan_data/" +path;
+
+    }
+
+
+    /**
+     * 根据路径写入文件,适合oss
+     * @param inPath 网络输入路径
+     * @param outPath 保存文件路径
+     * @throws IOException
+     */
+    public static void fielWrite(String inPath, String outPath) throws IOException {
+        InputStream in = URLUtil.getStream(new URL(inPath));
+        FileUtil.writeFromStream(in, outPath);
+    }
+
+
+    /**
+     * 获取文件资源路径
+     * 这方法,测试时是用当前类路径,当打包成jar包时时,会变成跟目录下。所以要把资源文件放入口类的资源文件夹
+     * @param filePath 文件路径
+     * @return
+     * @throws IOException
+     */
+    public static String getResourceUrl(String filePath) throws IOException {
+        String path = ResourceUtils.getURL("classpath:").getPath();
+        path = path + filePath;
+        return path;
+    }
+
+
+    @Test
+    public void test(){
+        String a = "F:\\test\\ngin\\cms_fdkanzhan_data\\img/20200903_181544452.jpg";
+        System.out.println(StringUtils.substringAfterLast(a, "cms_fdkanzhan_data"+ File.separator));
+    }
+
+    @Test
+    public void test2(){
+        String a = "F:\\test\\ngin\\cms_fdkanzhan_data\\img/20200903_181544452.jpg";
+        System.out.println(StringUtils.substringBeforeLast(a, "cms_fdkanzhan_data"+ File.separator));
+        System.out.println(StringUtils.substringBefore(a, "cms_fdkanzhan_data"+ File.separator));
+        System.out.println(StringUtils.substringBetween(a, "cms_fdkanzhan_data"+ File.separator));
+    }
+}

+ 194 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/PasswordUtils.java

@@ -0,0 +1,194 @@
+package com.gis.common.util;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.PBEKeySpec;
+import javax.crypto.spec.PBEParameterSpec;
+import java.security.Key;
+import java.security.SecureRandom;
+
+public class PasswordUtils {
+
+
+    /**
+     * JAVA6支持以下任意一种算法 PBEWITHMD5ANDDES PBEWITHMD5ANDTRIPLEDES
+     * PBEWITHSHAANDDESEDE PBEWITHSHA1ANDRC2_40 PBKDF2WITHHMACSHA1
+     * */
+
+    /**
+     * 定义使用的算法为:PBEWITHMD5andDES算法
+     */
+    public static final String ALGORITHM = "PBEWithMD5AndDES";//加密算法
+    public static final String Salt = "63293188";//密钥
+
+    /**
+     * 定义迭代次数为1000次
+     */
+    private static final int ITERATIONCOUNT = 1000;
+
+    /**
+     * 获取加密算法中使用的盐值,解密中使用的盐值必须与加密中使用的相同才能完成操作. 盐长度必须为8字节
+     *
+     * @return byte[] 盐值
+     */
+    public static byte[] getSalt() throws Exception {
+        // 实例化安全随机数
+        SecureRandom random = new SecureRandom();
+        // 产出盐
+        return random.generateSeed(8);
+    }
+
+    public static byte[] getStaticSalt() {
+        // 产出盐
+        return Salt.getBytes();
+    }
+
+    /**
+     * 根据PBE密码生成一把密钥
+     *
+     * @param password 生成密钥时所使用的密码
+     * @return Key PBE算法密钥
+     */
+    private static Key getPBEKey(String password) {
+        // 实例化使用的算法
+        SecretKeyFactory keyFactory;
+        SecretKey secretKey = null;
+        try {
+            keyFactory = SecretKeyFactory.getInstance(ALGORITHM);
+            // 设置PBE密钥参数
+            PBEKeySpec keySpec = new PBEKeySpec(password.toCharArray());
+            // 生成密钥
+            secretKey = keyFactory.generateSecret(keySpec);
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        return secretKey;
+    }
+
+    /**
+     * 加密明文字符串
+     *
+     * @param plaintext 待加密的明文字符串
+     * @param password  生成密钥时所使用的密码
+     * @param salt      盐值
+     * @return 加密后的密文字符串
+     * @throws Exception
+     */
+    public static String encrypt(String plaintext, String password, byte[] salt) {
+
+        Key key = getPBEKey(password);
+        byte[] encipheredData = null;
+        PBEParameterSpec parameterSpec = new PBEParameterSpec(salt, ITERATIONCOUNT);
+        try {
+            Cipher cipher = Cipher.getInstance(ALGORITHM);
+
+            cipher.init(Cipher.ENCRYPT_MODE, key, parameterSpec);
+
+            encipheredData = cipher.doFinal(plaintext.getBytes());
+        } catch (Exception e) {
+        }
+        return bytesToHexString(encipheredData);
+    }
+
+    /**
+     * 解密密文字符串
+     *
+     * @param ciphertext 待解密的密文字符串
+     * @param password   生成密钥时所使用的密码(如需解密,该参数需要与加密时使用的一致)
+     * @param salt       盐值(如需解密,该参数需要与加密时使用的一致)
+     * @return 解密后的明文字符串
+     * @throws Exception
+     */
+    public static Boolean decrypt(String ciphertext, String password, byte[] salt) {
+
+        Key key = getPBEKey(password);
+        byte[] passDec = null;
+        PBEParameterSpec parameterSpec = new PBEParameterSpec(getStaticSalt(), ITERATIONCOUNT);
+        try {
+            Cipher cipher = Cipher.getInstance(ALGORITHM);
+
+            cipher.init(Cipher.DECRYPT_MODE, key, parameterSpec);
+
+            passDec = cipher.doFinal(hexStringToBytes(ciphertext));
+            return true;
+        } catch (Exception e) {
+            // TODO: handle exception
+            return false;
+        }
+//        return new String(passDec);
+    }
+
+    /**
+     * 将字节数组转换为十六进制字符串
+     *
+     * @param src 字节数组
+     * @return
+     */
+    public static String bytesToHexString(byte[] src) {
+        StringBuilder stringBuilder = new StringBuilder("");
+        if (src == null || src.length <= 0) {
+            return null;
+        }
+        for (int i = 0; i < src.length; i++) {
+            int v = src[i] & 0xFF;
+            String hv = Integer.toHexString(v);
+            if (hv.length() < 2) {
+                stringBuilder.append(0);
+            }
+            stringBuilder.append(hv);
+        }
+        return stringBuilder.toString();
+    }
+
+    /**
+     * 将十六进制字符串转换为字节数组
+     *
+     * @param hexString 十六进制字符串
+     * @return
+     */
+    public static byte[] hexStringToBytes(String hexString) {
+        if (hexString == null || hexString.equals("")) {
+            return null;
+        }
+        hexString = hexString.toUpperCase();
+        int length = hexString.length() / 2;
+        char[] hexChars = hexString.toCharArray();
+        byte[] d = new byte[length];
+        for (int i = 0; i < length; i++) {
+            int pos = i * 2;
+            d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1]));
+        }
+        return d;
+    }
+
+    private static byte charToByte(char c) {
+        return (byte) "0123456789ABCDEF".indexOf(c);
+    }
+
+    public static void main(String[] args) {
+
+        String userName = "hao";
+        String password = "123456";
+
+        try {
+            byte[] salt = PasswordUtils.getStaticSalt();
+            String ciphertext = PasswordUtils.encrypt(userName, password, salt);
+            System.out.println("密文:" + ciphertext);
+            Boolean plaintext = PasswordUtils.decrypt(ciphertext, password, salt);
+            System.out.println("明文" + plaintext);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+
+
+
+
+    }
+
+
+}

+ 69 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/RegexUtils.java

@@ -0,0 +1,69 @@
+package com.gis.common.util;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by Owen on 2019/11/25 0025 14:30
+ *
+ * 正则表达式
+ */
+public class RegexUtils {
+
+    /** 非中文 */
+    public static final String CHINESE_NAME = "^[\\u4E00-\\u9FFF\\W]+$";
+
+    /** No. */
+    public static final String INTEGER_PATTERN = "^([+-]?)\\d*\\.?\\d+$" ;
+
+    public static final String INT_DECIMAL = "\\d*\\.?\\d+$" ;
+
+    /**  NAME: String (50.0)*/
+    public static final String INCLUDE_STR = ".*(\\(\\d*\\.\\d*\\)$)+" ;
+
+    /**  NAME: String (50.0) */
+    public static boolean regexInclude(String param){
+        if(StringUtils.isEmpty(param)){
+            return Boolean.FALSE ;
+        }
+        return param.matches(INCLUDE_STR) ;
+    }
+
+
+    /**  匹配中文 */
+    public static boolean regexChinese(String param){
+        if(StringUtils.isEmpty(param)){
+            return Boolean.FALSE ;
+        }
+        return param.matches(CHINESE_NAME) ;
+    }
+
+    /**  匹配数字 */
+    public static boolean regexInt(String param){
+        if(StringUtils.isEmpty(param)){
+            return Boolean.FALSE ;
+        }
+        return param.matches(INTEGER_PATTERN) ;
+    }
+
+    /**  匹配数字 */
+    public static boolean regexIntOrDecimal(String param){
+        if(StringUtils.isEmpty(param)){
+            return Boolean.FALSE ;
+        }
+        return param.matches(INTEGER_PATTERN) ;
+    }
+
+
+
+    public static void main(String[] args) {
+        String a = "我是中国人";
+        String a1 = "i m aaa";
+        String a2 = "1245454--";
+        String a3 = "1245454--中国人";
+        String a4 = "123";
+
+
+        System.out.println(regexIntOrDecimal(a4));
+
+    }
+}

+ 101 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/Result.java

@@ -0,0 +1,101 @@
+package com.gis.common.util;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 通用返回类
+ *
+ * @author
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Result<T> implements Serializable {
+    private static final long serialVersionUID = -1491499610244557029L;
+    public static final String SUCCESS_MSG = "操作成功";
+    public static int CODE_SUCCESS = 0;
+    public static int CODE_FAILURE = -1;
+    public static String[] NOOP = new String[]{};
+
+    /**
+     * 处理状态:0: 成功, 1: 失败
+     */
+    @ApiModelProperty(value = "处理状态:0: 成功, 1: 失败", name = "code")
+    private int code;
+    /**
+     * 消息
+     */
+    @ApiModelProperty(value = "消息", name = "msg")
+    private String msg;
+    /**
+     * 返回数据
+     */
+    @ApiModelProperty(value = "返回数据", name = "data")
+    private T data;
+    /**
+     * 处理成功,并返回数据
+     *
+     * @param data 数据对象
+     * @return data
+     */
+    public static Result success(Object data) {
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, data);
+    }
+    /**
+     * 处理成功
+     *
+     * @return data
+     */
+    public static Result success() {
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, NOOP);
+    }
+    /**
+     * 处理成功
+     *
+     * @param msg 消息
+     * @return data
+     */
+    public static Result success(String msg) {
+        return new Result(CODE_SUCCESS, msg, NOOP);
+    }
+    /**
+     * 处理成功
+     *
+     * @param msg  消息
+     * @param data 数据对象
+     * @return data
+     */
+    public static Result success(String msg, Object data) {
+        return new Result(CODE_SUCCESS, msg, data);
+    }
+    /**
+     * 处理失败,并返回数据(一般为错误信息)
+     *
+     * @param code 错误代码
+     * @param msg  消息
+     * @return data
+     */
+    public static Result failure(int code, String msg) {
+        return new Result(code, msg, NOOP);
+    }
+    /**
+     * 处理失败
+     *
+     * @param msg 消息
+     * @return data
+     */
+    public static Result failure(String msg) {
+        return failure(CODE_FAILURE, msg);
+    }
+
+    @Override
+    public String toString() {
+        return "JsonResult [code=" + code + ", msg=" + msg + ", data="
+                + data + "]";
+    }
+}

+ 66 - 0
cesium_manage/gis_common/src/main/java/com/gis/common/util/StreamGobbler.java

@@ -0,0 +1,66 @@
+package com.gis.common.util;
+
+import java.io.*;
+
+public class StreamGobbler extends Thread {
+
+	InputStream is;  
+    String type;  
+    OutputStream os;  
+
+    public StreamGobbler(InputStream is, String type) {  
+        this(is, type, null);  
+    }  
+
+    StreamGobbler(InputStream is, String type, OutputStream redirect) {  
+        this.is = is;  
+        this.type = type;  
+        this.os = redirect;  
+    }  
+
+    public void run() {  
+        InputStreamReader isr = null;  
+        BufferedReader br = null;  
+        PrintWriter pw = null;  
+        try {  
+            if (os != null)  
+                pw = new PrintWriter(os);  
+
+            isr = new InputStreamReader(is);  
+            br = new BufferedReader(isr);  
+            String line=null;
+            int i = 1;
+            while ( (line = br.readLine()) != null) {  
+                if (pw != null)  
+                    pw.println(line);
+//                if (i%200 == 0) {
+//                    System.out.println(type + "i: i" + i + ">" + line);
+//                }
+//                i++;
+                System.out.println(type + ">" + line);
+            }  
+
+            if (pw != null)  
+                pw.flush();  
+        } catch (IOException ioe) {  
+            ioe.printStackTrace();    
+        } finally{  
+            try {  
+            	if(pw!=null)
+            	{
+            		 pw.close();  
+            	}
+            	if(br!=null)
+            	{
+            		br.close();  
+            	}
+            	if(isr!=null)
+            	{
+            		isr.close();  
+            	}
+            } catch (IOException e) {  
+                e.printStackTrace();  
+            }  
+        }  
+    }  
+}

+ 22 - 0
cesium_manage/gis_domain/pom.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_domain</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_common</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 38 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java

@@ -0,0 +1,38 @@
+package com.gis.domain.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Data
+@MappedSuperclass
+public abstract class BaseEntity {
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id")
+    @ApiModelProperty(value = "对象ID")
+    private Long id;
+
+    @ApiModelProperty(value = "创建时间")
+    @Temporal(TemporalType.TIMESTAMP)
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "修改时间")
+    @Temporal(TemporalType.TIMESTAMP)
+    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 用来批量操作的
+     * A: 激活  I:禁用
+     */
+    @JsonIgnore
+    @JSONField(serialize = false)
+    private Integer isDelete;
+}

+ 33 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/DemEntity.java

@@ -0,0 +1,33 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2021/2/26 0026 12:13
+ * 地形数据实体
+ */
+@Data
+@Entity
+@Table(name = "tb_dem")
+public class DemEntity extends FileEntity implements Serializable {
+    private static final long serialVersionUID = 6525982455586117481L;
+
+
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "数据打包路径")
+    private String buildPath;
+
+    @ApiModelProperty(value = "切片数据路径")
+    private String slicePath;
+
+
+
+
+}

+ 35 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/FileEntity.java

@@ -0,0 +1,35 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 11:15
+ */
+@Data
+public class FileEntity extends BaseEntity {
+    private static final long serialVersionUID = 3663614649370191338L;
+
+//    @ApiModelProperty(value = "原文件名")
+//    private String originalName;
+
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件路径(上传文件)")
+    private String filePath;
+
+//    @ApiModelProperty(value = "进度")
+//    private Integer progress;
+
+    @ApiModelProperty(value = "目录码,唯一")
+    private String code;
+
+
+}

+ 42 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/ModelEntity.java

@@ -0,0 +1,42 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2021/2/26 0026 12:13
+ */
+@Data
+@Entity
+@Table(name = "tb_model")
+public class ModelEntity extends FileEntity implements Serializable {
+    private static final long serialVersionUID = 6525982455586117481L;
+
+
+    /**
+     * 状态
+     * 0: 切片失败
+     * 1:未解压
+     * 2:未判断坐标
+     * 3:未转geojson
+     * 4:未切片
+     * 5:切片完成
+     * 6:切片中
+     */
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "解压路径")
+    private String unzipPath;
+
+    @ApiModelProperty(value = "切片数据路径")
+    private String slicePath;
+
+
+
+
+}

+ 48 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/RasterEntity.java

@@ -0,0 +1,48 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2021/3/10 0026 12:13
+ * 删除数据实体
+ */
+@Data
+@Entity
+@Table(name = "tb_raster")
+public class RasterEntity extends FileEntity implements Serializable {
+
+
+    private static final long serialVersionUID = -8594309277683916572L;
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "坐标参数")
+    private String coord;
+
+//    @ApiModelProperty(value = "普通坐标文件路径")
+//    private String coordGeneralPath;
+
+    @ApiModelProperty(value = "严格坐标文件路径")
+    private String coordStrictPath;
+
+    @ApiModelProperty(value = "坐标类型")
+    private String coordType;
+
+    @ApiModelProperty(value = "最大图层")
+    private String layerMax;
+
+    @ApiModelProperty(value = "最小图层")
+    private String layerMin;
+
+    @ApiModelProperty(value = "切片数据路径")
+    private String slicePath;
+
+
+
+
+}

+ 31 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysDeptEntity.java

@@ -0,0 +1,31 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 部门表
+ */
+@Data
+@Entity
+@Table(name = "sys_dept")
+public class SysDeptEntity extends BaseEntity implements Serializable {
+
+
+//    @ApiModelProperty(value = "部门编号")
+//    private Integer num;
+
+
+    @ApiModelProperty(value = "部门名称")
+    private String name;
+
+    @ApiModelProperty(value = "上级部门id")
+    private Long parentId;
+
+
+
+}

+ 56 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysResourceEntity.java

@@ -0,0 +1,56 @@
+package com.gis.domain.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import java.io.Serializable;
+
+@Data
+@Entity
+@Table(name = "sys_resource")
+public class SysResourceEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -293343757324080501L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "资源key")
+    private String resourceKey;
+
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "路径")
+    private String url;
+
+
+//    private String icon;
+
+
+
+    // 前端需要传menu、button
+    @ApiModelProperty(value = "邮箱")
+    @Column(columnDefinition = "enum('menu','button')")
+    private String resourceType;
+
+    @ApiModelProperty(value = "邮箱")
+    private Integer sort;
+
+    @ApiModelProperty(value = "上级菜单id")
+    private Long parentId;
+
+    /** 封装权限字段,不需要映射到数据库*/
+    @Transient
+    private Boolean authority ;
+
+
+}

+ 30 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysRoleEntity.java

@@ -0,0 +1,30 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Entity
+@Table(name = "sys_role")
+public class SysRoleEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "角色key")
+    private String roleKey;
+
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    @ApiModelProperty(value = "角色描述")
+    private String roleDesc;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 58 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java

@@ -0,0 +1,58 @@
+package com.gis.domain.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 用户表
+ */
+@Data
+@Entity
+@Table(name = "sys_user")
+public class SysUserEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -853504493430501564L;
+
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    @JSONField(serialize = false)
+    private String password;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+//    @ApiModelProperty(value = "用户编号")
+//    private Integer userNum;
+
+    @ApiModelProperty(value = "性别 0:男  1:女")
+    private Integer sex;
+
+    @ApiModelProperty(value = "邮箱")
+    private String phone;
+
+    @ApiModelProperty(value = "状态 0:启用  1:停用 2:注销")
+    private Integer status;
+
+    @ApiModelProperty(value = "邮箱")
+    private String email;
+
+    @ApiModelProperty(value = "部门id")
+    private Long deptId;
+
+    @ApiModelProperty(value = "管理者,0:是, 1:否")
+    private Integer manager;
+
+//    @JSONField(serialize = false)
+//    @ApiModelProperty(value = "登录次数")
+//    private Integer viewCount;
+
+
+
+
+}

+ 51 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/entity/VectorEntity.java

@@ -0,0 +1,51 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2021/3/10 0026 12:13
+ * 删除数据实体
+ */
+@Data
+@Entity
+@Table(name = "tb_vector")
+public class VectorEntity extends FileEntity implements Serializable {
+
+
+    private static final long serialVersionUID = -8594309277683916572L;
+    @ApiModelProperty(value = "状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "坐标参数")
+    private String coord;
+
+    @ApiModelProperty(value = "严格坐标文件路径")
+    private String coordStrictPath;
+
+    @ApiModelProperty(value = "坐标类型")
+    private String coordType;
+
+    @ApiModelProperty(value = "最大图层")
+    private String layerMax;
+
+    @ApiModelProperty(value = "最小图层")
+    private String layerMin;
+
+    @ApiModelProperty(value = "切片数据路径")
+    private String slicePath;
+
+    @ApiModelProperty(value = "geojson路径")
+    private String geojsonPath;
+
+    @ApiModelProperty(value = "原文件名(所有文件)")
+    private String originalName;
+
+
+
+
+}

+ 23 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/DeptRequest.java

@@ -0,0 +1,23 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class DeptRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotNull(message = "部门名称")
+    @ApiModelProperty(value = "部门名称", required = true)
+    private String name;
+
+    @ApiModelProperty(value = "上级部门id")
+    private Long parentId;
+}

+ 21 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/LoginRequest.java

@@ -0,0 +1,21 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class LoginRequest {
+
+    @NotNull(message = "用户名不能为空")
+    @ApiModelProperty(value = "用户名", name = "userName", required = true)
+    private String userName;
+
+    @NotNull(message = "密码不能为空")
+    @ApiModelProperty(value = "密码", name = "password", required = true)
+    private String password;
+}

+ 27 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/PageDateRequest.java

@@ -0,0 +1,27 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 12:24
+ * 有时间
+ */
+@Data
+public class PageDateRequest extends PageDto {
+
+    /**
+     * 开始时间
+     * 需要用字符串接收
+     */
+    @ApiModelProperty(value = "开始时间", name = "startTime")
+    private String startTime;
+
+
+    @ApiModelProperty(value = "结束时间", name = "endTime")
+    private String endTime;
+
+
+
+}

+ 26 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/PageDto.java

@@ -0,0 +1,26 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 12:24
+ */
+@Data
+public class PageDto {
+
+
+    @ApiModelProperty(value = "起始页码,默认0为第一页", name = "pageNum")
+    private Integer pageNum;
+
+    @ApiModelProperty(value = "每页数量", name = "pageSize")
+    private Integer pageSize;
+
+    @ApiModelProperty(value = "搜索条件", name = "searchKey")
+    private String searchKey;
+
+
+
+
+}

+ 27 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/RoleAccreditRequest.java

@@ -0,0 +1,27 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Set;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ * 角色授权
+ */
+@Data
+public class RoleAccreditRequest {
+
+    @NotNull(message = "角色Id不能为空")
+    @ApiModelProperty(value = "roleId", required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "角色描述")
+    private String roleDesc;
+
+    @NotNull(message = "权限不能为空")
+    @ApiModelProperty(value = "资源id, 多个id用“,”隔开,例如:1,2,3", required = true)
+    private Set<Long> resources;
+}

+ 28 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/RoleRequest.java

@@ -0,0 +1,28 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class RoleRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+//    @NotBlank(message = "角色key不能为空")
+//    @ApiModelProperty(value = "角色key", required = true)
+//    private String roleKey;
+
+    @NotBlank(message = "角色key不能为空")
+    @ApiModelProperty(value = "角色名称", required = true)
+    private String roleName;
+
+    @ApiModelProperty(value = "角色描述")
+    private String roleDesc;
+}

+ 38 - 0
cesium_manage/gis_domain/src/main/java/com/gis/domain/request/UserRequest.java

@@ -0,0 +1,38 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ */
+@Data
+public class UserRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "用户名不能为空")
+    @ApiModelProperty(value = "用户名", required = true)
+    private String userName;
+
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+
+    @NotNull(message = "部门id不能为空")
+    @ApiModelProperty(value = "部门id", required = true)
+    private Long deptId;
+
+    @NotNull(message = "角色id不能为空")
+    @ApiModelProperty(value = "角色id", required = true)
+    private Long roleId;
+
+    @NotNull(message = "角色id不能为空")
+    @ApiModelProperty(value = "管理者,0:是, 1:否")
+    private Integer manager;
+}

+ 21 - 0
cesium_manage/gis_mapper/pom.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_mapper</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_domain</artifactId>
+        </dependency>
+    </dependencies>
+</project>

+ 19 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/DemMapper.java

@@ -0,0 +1,19 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.provider.DemProvider;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface DemMapper extends IBaseMapper<DemEntity, Long> {
+
+    @SelectProvider(type = DemProvider.class, method = "search")
+    List<DemEntity> search(PageDto param);
+}

+ 18 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java

@@ -0,0 +1,18 @@
+package com.gis.mapper;
+
+import com.gis.domain.entity.BaseEntity;
+import tk.mybatis.mapper.common.BaseMapper;
+import tk.mybatis.mapper.common.ConditionMapper;
+import tk.mybatis.mapper.common.IdsMapper;
+import tk.mybatis.mapper.common.special.InsertListMapper;
+
+
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2020/2/18 0018 11:27
+ */
+
+public interface IBaseMapper<T extends BaseEntity, ID extends Serializable> extends BaseMapper<T>,
+        ConditionMapper<T>, IdsMapper<T>, InsertListMapper<T> {
+}

+ 19 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/ModelMapper.java

@@ -0,0 +1,19 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.ModelEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.provider.ModelProvider;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface ModelMapper extends IBaseMapper<ModelEntity, Long> {
+
+    @SelectProvider(type = ModelProvider.class, method = "search")
+    List<ModelEntity> search(PageDto param);
+}

+ 14 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/RasterMapper.java

@@ -0,0 +1,14 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.RasterEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Mapper
+public interface RasterMapper extends IBaseMapper<RasterEntity, Long> {
+
+
+}

+ 12 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysDeptMapper.java

@@ -0,0 +1,12 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysDeptEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+@Component
+@Mapper
+public interface SysDeptMapper extends IBaseMapper<SysDeptEntity, Long> {
+
+}

+ 21 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysResourceMapper.java

@@ -0,0 +1,21 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysResourceEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface SysResourceMapper extends IBaseMapper<SysResourceEntity, Long> {
+
+    /** 根据角色id查询权限 */
+//    @Select(value = "select b.id, b.name, b.parent_id, b.resource_type, b.resource_key from " +
+//            " sys_role r join sys_role_resource a on r.id = a.role_id " +
+//            " join sys_resource b on b.id = a.resource_id WHERE r.id = #{roleId}")
+    @Select(value = "select * from sys_role_resource z left join sys_resource r ON z.resource_id = r.id where z.role_id= #{roleId}")
+    List<SysResourceEntity> findResourceByRoleId(Long roleId);
+}

+ 18 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysRoleMapper.java

@@ -0,0 +1,18 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysRoleEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+@Component
+@Mapper
+public interface SysRoleMapper extends IBaseMapper<SysRoleEntity, Long> {
+
+    @Select(value = "delete from sys_role_resource where role_id=#{roleId}")
+    void deleteRoleResource(Long roleId);
+
+    @Select(value = "insert into sys_role_resource (role_id, resource_id) values (#{roleId}, #{resourceId});")
+    void saveRoleResource(Long roleId, Long resourceId);
+}

+ 27 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java

@@ -0,0 +1,27 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysUserEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface SysUserMapper extends IBaseMapper<SysUserEntity, Long> {
+
+//    @SelectProvider(type = UserProvider.class, method = "findAllBySearchKey")
+//    List<UserResponse> findAllBySearchKey(String searchKey);
+
+    @Select(value = "select * from sys_user where rec_status = 'A' AND user_name= #{userName}")
+    SysUserEntity findByUserName(String userName);
+
+    @Select(value = "select * from sys_user where rec_status = 'A' AND phone = #{phone}")
+    SysUserEntity findByPhone(String phone);
+//
+//    @SelectProvider(type = UserProvider.class, method = "findBySearchKey")
+//    List<UserEntity> findBySearchKey(String searchKey);
+}

+ 14 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/VectorMapper.java

@@ -0,0 +1,14 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.VectorEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Mapper
+public interface VectorMapper extends IBaseMapper<VectorEntity, Long> {
+
+
+}

+ 36 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/provider/DemProvider.java

@@ -0,0 +1,36 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.request.PageDto;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2021/2/26 0026 16:33
+ */
+@Slf4j
+public class DemProvider {
+
+    public String search(PageDto param){
+        StringBuffer sql = new StringBuffer("select * from tb_dem where is_delete = 0");
+
+//        if(!StringUtils.isAllBlank(userId)){
+//            sql.append(" and ( user_id = '").append(userId).append("' )");
+//        }
+
+        String searchKey = param.getSearchKey();
+        if(!StringUtils.isAllBlank(searchKey)){
+            sql.append(" and ( name like '%").append(searchKey).append("%' )");
+        }
+
+//        String type = param.getType();
+//        if(!StringUtils.isAllBlank(type)){
+//            sql.append(" and ( type = '").append(type).append("' )");
+//        }
+
+        sql.append(" order by create_time desc");
+
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+}

+ 36 - 0
cesium_manage/gis_mapper/src/main/java/com/gis/mapper/provider/ModelProvider.java

@@ -0,0 +1,36 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.request.PageDto;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2021/2/26 0026 16:33
+ */
+@Slf4j
+public class ModelProvider {
+
+    public String search(PageDto param){
+        StringBuffer sql = new StringBuffer("select * from tb_moder where is_delete = 0");
+
+//        if(!StringUtils.isAllBlank(userId)){
+//            sql.append(" and ( user_id = '").append(userId).append("' )");
+//        }
+
+        String searchKey = param.getSearchKey();
+        if(!StringUtils.isAllBlank(searchKey)){
+            sql.append(" and ( name like '%").append(searchKey).append("%' )");
+        }
+
+//        String type = param.getType();
+//        if(!StringUtils.isAllBlank(type)){
+//            sql.append(" and ( type = '").append(type).append("' )");
+//        }
+
+        sql.append(" order by create_time desc");
+
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+}

+ 23 - 0
cesium_manage/gis_service/pom.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_service</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_mapper</artifactId>
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 23 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/DemService.java

@@ -0,0 +1,23 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.request.PageDto;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface DemService extends IBaseService<DemEntity, Long> {
+
+
+    Result upload(MultipartFile file);
+
+    Result<DemEntity> search(PageDto param);
+
+    Result remove(Long id);
+
+    Result slice(Long id);
+}

+ 47 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/IBaseService.java

@@ -0,0 +1,47 @@
+package com.gis.service;
+
+import com.github.pagehelper.PageInfo;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface IBaseService<T, ID extends Serializable> {
+
+    public abstract T findById(ID id);
+
+    public abstract T findOne(T entity);
+
+    public abstract List<T> findByIds(String ids);
+
+    public abstract long count();
+
+    public abstract boolean exists(ID id);
+
+    public abstract int save(T entity);
+
+    public abstract int update(T entity);
+
+    public abstract int updateAll(T entity);
+
+    public abstract int deleteById(ID id);
+
+    public abstract int deleteByIds(String ids);
+
+    public abstract int delete(T entity);
+
+    public abstract List<T> findAll(Condition condition, String orderBy);
+
+    public abstract List<T> findAll(Condition condition);
+
+    public abstract List<T> findAll();
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(int pageNum, int pageSize, String orderBy);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize);
+
+    public abstract PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy);
+
+}

+ 25 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/ModelService.java

@@ -0,0 +1,25 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.ModelEntity;
+import com.gis.domain.request.PageDto;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface ModelService extends IBaseService<ModelEntity, Long> {
+
+
+    Result upload(MultipartFile file);
+
+    Result unzip(Long id);
+
+    Result search(PageDto param);
+
+    Result remove(Long id);
+
+    Result slice(Long id);
+}

+ 26 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/RasterService.java

@@ -0,0 +1,26 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.entity.RasterEntity;
+import com.gis.domain.request.PageDto;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface RasterService extends IBaseService<RasterEntity, Long> {
+
+
+    Result upload(MultipartFile file, String[] coord);
+
+    Result<RasterEntity> search(PageDto param);
+
+    Result remove(Long id);
+
+    Result slice(Long id, String layerMin, String layerMax);
+
+    Result coordJudge(Long id);
+}

+ 13 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/SysDeptService.java

@@ -0,0 +1,13 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SysDeptEntity;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SysDeptService extends IBaseService<SysDeptEntity, Long> {
+
+
+}

+ 19 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/SysResourceService.java

@@ -0,0 +1,19 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SysResourceEntity;
+import com.gis.service.util.ResourceTree;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SysResourceService extends IBaseService<SysResourceEntity, Long> {
+
+
+    List<ResourceTree> getResourceByRoleId(Long roleId);
+
+    List<SysResourceEntity> findResourceByRoleId(Long roleId);
+}

+ 16 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/SysRoleService.java

@@ -0,0 +1,16 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SysRoleEntity;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SysRoleService extends IBaseService<SysRoleEntity, Long> {
+
+
+    void deleteRoleResource(Long roleId);
+
+    void saveRoleResource(Long roleId, long resourceId);
+}

+ 21 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/SysUserService.java

@@ -0,0 +1,21 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SysUserEntity;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SysUserService extends IBaseService<SysUserEntity, Long> {
+
+//    List<UserResponse> findAllBySearchKey(PageDto param);
+
+    SysUserEntity findByUserName(String userName);
+
+    SysUserEntity findByPhone(String phone);
+
+//    List<UserEntity> findBySearchKey(PageRequest param);
+}

+ 27 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/VectorService.java

@@ -0,0 +1,27 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.VectorEntity;
+import com.gis.domain.request.PageDto;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface VectorService extends IBaseService<VectorEntity, Long> {
+
+
+    Result upload(MultipartFile[] file, String[] coord);
+
+    Result<VectorEntity> search(PageDto param);
+
+    Result remove(Long id);
+
+    Result slice(Long id, String layerMin, String layerMax);
+
+    Result coordJudge(Long id);
+
+    Result toGeoJson(Long id);
+}

+ 165 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/DemServiceImpl.java

@@ -0,0 +1,165 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.gis.common.constant.Command;
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.util.CmdUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.DemMapper;
+import com.gis.service.DemService;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class DemServiceImpl extends IBaseServiceImpl<DemEntity, Long> implements DemService {
+
+    @Autowired
+    private DemMapper entityMapper;
+
+    @Override
+    public IBaseMapper<DemEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Override
+    public Result upload(MultipartFile file) {
+
+        String fileName = file.getOriginalFilename();
+        String s = StringUtils.substringAfterLast(fileName, ".");
+        if (!"tif".equals(s)) {
+            return Result.failure("只支持.tif文件上传");
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String savePath = configConstant.serverBasePath + time + "/" + fileName;
+
+        DemEntity entity = new DemEntity();
+        String vrtName = StringUtils.substringBeforeLast(fileName, ".");
+        String buildPath = configConstant.serverBasePath + time + "/" + vrtName + ".vrt" ;
+        // 写文件到服务器
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+            entity.setCode(time);
+            entity.setFileName(fileName);
+            entity.setFilePath(savePath);
+            entity.setBuildPath(buildPath);
+            // 地形数据打包
+            build(entity);
+            this.save(entity);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result<DemEntity> search(PageDto param) {
+        startPage(param);
+        List<DemEntity> list = entityMapper.search(param);
+        return Result.success(new PageInfo<>(list));
+    }
+
+    @Override
+    public Result remove(Long id) {
+        DemEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        String code = entity.getCode();
+        // 安全校验,rm -rf 删除需要严谨
+        if (StringUtils.isBlank(code)) {
+            log.error("目录编码不能为空");
+            return Result.failure("目录编码不能为空");
+        }
+        String fileDir = configConstant.serverBasePath + code;
+
+        String cmd = Command.remove;
+        cmd = cmd.replace("@input", fileDir);
+        log.info("cmd: " + cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("文件删除完成,耗时: {} s" , (end-stat)/1000);
+
+        entity.setIsDelete(1);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result slice(Long id) {
+        DemEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        String outputPath = configConstant.serverBasePath + entity.getCode() + "/slice";
+        // 命令不会主动创建目录
+        FileUtil.mkdir(outputPath);
+        // 传入的是目录
+        long stat = System.currentTimeMillis();
+        String cmd = Command.DEM_SLICE;
+        cmd = cmd.replace("@inputFile", entity.getBuildPath());
+        cmd = cmd.replace("@outputFile", outputPath);
+        log.info("cmd: {}", cmd);
+        CmdUtils.cmdShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("地型数据切片完成,耗时: {} s, id: {}" , (end-stat)/1000, id);
+
+        // todo 直接跑命令会失败,改跑脚本
+//        String cmd = Command.demSlice;
+//        cmd = cmd.replace("@inputFile", entity.getBuildPath());
+//        cmd = cmd.replace("@outputFile", outputPath);
+//        log.info("cmd: {}", cmd);
+//        long stat = System.currentTimeMillis();
+//        CmdUtils.callShell(cmd);
+//        long end = System.currentTimeMillis();
+//        log.info("地型数据切片完成,耗时: {} s, id: {}" , (end-stat)/1000, id);
+
+        // todo 数据切片完成,这里可能需要一个切片中的状态
+        entity.setStatus(3);
+        entity.setSlicePath(outputPath);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    // 数据打包
+    private void build(DemEntity entity){
+        long start = System.currentTimeMillis();
+        String cmd = Command.DEM_BUILD;
+        cmd = cmd.replace("@inputFile", entity.getFilePath());
+        cmd = cmd.replace("@outputFile", entity.getBuildPath());
+        // 这条命令需要需要手动创建生成路径目录
+        log.warn("cmd: {}", cmd);
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.warn("地形数据打包完成,耗时:{} s", (end-start)/1000);
+    }
+
+
+}

+ 186 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/IBaseServiceImpl.java

@@ -0,0 +1,186 @@
+package com.gis.service.impl;
+
+import com.gis.domain.request.PageDto;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.gis.mapper.IBaseMapper;
+import com.gis.domain.entity.BaseEntity;
+import com.gis.service.IBaseService;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.io.Serializable;
+import java.lang.reflect.ParameterizedType;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18 0018 11:22
+ */
+@Transactional
+public abstract class IBaseServiceImpl<T extends BaseEntity, ID extends Serializable> implements IBaseService<T, ID> {
+
+    public abstract IBaseMapper<T, ID> getBaseMapper();
+
+    private Class<T> entityClass;
+
+    public IBaseServiceImpl(){
+        ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
+        entityClass = (Class<T>) pt.getActualTypeArguments()[0];
+    }
+
+    @Override
+    public T findById(ID id){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("id", id);
+        condition.and().andEqualTo("isDelete", 0);
+        List<T> ts = getBaseMapper().selectByCondition(condition);
+        if (ts != null && ts.size() > 0){
+            return ts.get(0);
+        }else{
+            return null;
+        }
+    }
+
+    @Override
+    public T findOne(T entity){
+        entity.setIsDelete(0);
+        return getBaseMapper().selectOne(entity);
+    }
+
+    @Override
+    public List<T> findAll(){
+        Condition condition = new Condition(entityClass);
+        condition.createCriteria().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    /**
+     * 根据主键字符串进行查询,类中只有存在一个带有@Id注解的字段
+     *
+     * @param ids 如 "1,2,3,4"
+     * @return
+     */
+    @Override
+    public List<T> findByIds(String ids){
+        return getBaseMapper().selectByIds(ids);
+    }
+
+    @Override
+    public long count(){
+        List<T> all = this.findAll();
+        if (all != null && all.size() > 0){
+            return all.size();
+        }
+        return 0;
+    }
+
+    @Override
+    public boolean exists(ID id){
+        return getBaseMapper().existsWithPrimaryKey(id);
+    }
+
+    @Override
+    public int save(T entity) {
+        //migration之后要删掉判断
+        if (entity.getCreateTime() == null){
+            entity.setCreateTime(new Date());
+        }
+        if (entity.getUpdateTime() == null){
+            entity.setUpdateTime(new Date());
+        }
+        entity.setIsDelete(0);
+        return getBaseMapper().insertSelective(entity);
+    }
+
+    @Override
+    public int update(T entity) {
+        //migration之后要删掉判断
+        if (entity.getUpdateTime() == null){
+            entity.setUpdateTime(new Date());
+        }
+        return getBaseMapper().updateByPrimaryKeySelective(entity);
+    }
+
+    @Override
+    public int updateAll(T entity) {
+        //migration之后要删掉判断
+        if (entity.getUpdateTime() == null){
+            entity.setUpdateTime(new Date());
+        }
+        return getBaseMapper().updateByPrimaryKey(entity);
+    }
+
+    @Override
+    public int deleteById(ID id) {
+        return getBaseMapper().deleteByPrimaryKey(id);
+    }
+
+    @Override
+    public int deleteByIds(String ids){
+        return getBaseMapper().deleteByIds(ids);
+    }
+
+    @Override
+    public int delete(T entity){
+        return getBaseMapper().delete(entity);
+    }
+
+    public List<T> findAll(Condition condition){
+        condition.and().andEqualTo("isDelete", 0);
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public List<T> findAll(Condition condition, String orderBy){
+        condition.and().andEqualTo("isDelete", 0);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return getBaseMapper().selectByCondition(condition);
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll());
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize){
+        PageHelper.startPage(pageNum, pageSize);
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+    public PageInfo<T> findAll(Condition condition, int pageNum, int pageSize, String orderBy){
+        PageHelper.startPage(pageNum, pageSize);
+        if (!StringUtils.isEmpty(orderBy)){
+            PageHelper.orderBy(orderBy);
+        }
+        return new PageInfo<>(this.findAll(condition));
+    }
+
+    /**
+     * 设置请求分页数据
+     */
+    public void startPage(PageDto param){
+        Integer pageNum = param.getPageNum();
+        Integer pageSize = param.getPageSize();
+        if (pageNum == null || pageNum <= 0) {
+            pageNum = 0;
+        }
+
+        if (pageSize == null || pageSize <= 0) {
+            pageSize = 10;
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+
+    }
+}

+ 171 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/ModelServiceImpl.java

@@ -0,0 +1,171 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.gis.common.constant.Command;
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.util.CmdUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.ModelEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.ModelMapper;
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.ModelService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.jaxb.SpringDataJaxb;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class ModelServiceImpl extends IBaseServiceImpl<ModelEntity, Long> implements ModelService {
+
+    @Autowired
+    private ModelMapper entityMapper;
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Override
+    public IBaseMapper<ModelEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+
+
+    @Override
+    public Result upload(MultipartFile file) {
+
+        String fileName = file.getOriginalFilename();
+        String s = StringUtils.substringAfterLast(fileName, ".");
+        if (!"zip".equals(s)) {
+            return Result.failure("只支持.zip文件上传");
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String savePath = configConstant.serverBasePath + time + "/" + fileName;
+
+        ModelEntity entity = new ModelEntity();
+        // 写文件到服务器
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+            entity.setCode(time);
+            entity.setFileName(fileName);
+            entity.setFilePath(savePath);
+            this.save(entity);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result unzip(Long id) {
+        ModelEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        String filePath = entity.getFilePath();
+        String cmd = Command.unzip;
+        cmd = cmd.replace("@inputFile", filePath);
+        String unzipDir = configConstant.serverBasePath+entity.getCode() + "/";
+        cmd = cmd.replace("@outputFile", unzipDir);
+
+        log.info("cmd: " + cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("解压完成,耗时: {} s" + (end-stat)/1000);
+        String dirName = StringUtils.substringBeforeLast(entity.getFileName(), ".");
+        entity.setUnzipPath(unzipDir + dirName);
+        entity.setUpdateTime(new Date());
+        // 文件已解压
+        entity.setStatus(1);
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result<ModelEntity> search(PageDto param) {
+        startPage(param);
+        List<ModelEntity> list = entityMapper.search(param);
+        return Result.success(new PageInfo<>(list));
+    }
+
+    @Override
+    public Result remove(Long id) {
+        ModelEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        String code = entity.getCode();
+        // 安全校验,rm -rf 删除需要严谨
+        if (StringUtils.isBlank(code)) {
+            log.error("目录编码不能为空");
+            return Result.failure("目录编码不能为空");
+        }
+        String fileDir = configConstant.serverBasePath + code;
+
+        String cmd = Command.remove;
+        cmd = cmd.replace("@input", fileDir);
+        log.info("cmd: " + cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("文件删除完成,耗时: {} s" , (end-stat)/1000);
+
+        entity.setIsDelete(1);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result slice(Long id) {
+        ModelEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        String fileName = StringUtils.substringBeforeLast(entity.getFileName(), ".");
+        String outputPath = configConstant.serverBasePath + entity.getCode() + "/slice/" + fileName;
+        // 传入的是目录
+        String cmd = Command.MODEL_SLICE_OSGB;
+        cmd = cmd.replace("@inputFile", entity.getUnzipPath());
+        cmd = cmd.replace("@outputFile", outputPath);
+        log.info("cmd: {}", cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("模型数据切片完成,耗时: {} s, id: {}" + (end-stat)/1000, id);
+
+        // todo 数据切片完成,这里可能需要一个切片中的状态
+        entity.setStatus(3);
+        entity.setSlicePath(outputPath);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+}

+ 345 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/RasterServiceImpl.java

@@ -0,0 +1,345 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.gis.common.constant.Command;
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.constant.TypeCode;
+import com.gis.common.util.CmdUtils;
+import com.gis.common.util.RegexUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.RasterEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.RasterMapper;
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.RasterService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.Date;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class RasterServiceImpl extends IBaseServiceImpl<RasterEntity, Long> implements RasterService {
+
+    @Autowired
+    private RasterMapper entityMapper;
+
+    @Override
+    public IBaseMapper<RasterEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Override
+    public Result upload(MultipartFile file, String[] coord) {
+
+        String fileName = file.getOriginalFilename();
+        String s = StringUtils.substringAfterLast(fileName, ".");
+        if (!"tif".equals(s)) {
+            return Result.failure("只支持.tif文件上传");
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String savePath = configConstant.serverBasePath + time + "/" + fileName;
+
+        RasterEntity entity = new RasterEntity();
+        // 写文件到服务器
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+            entity.setCode(time);
+            entity.setFileName(fileName);
+            entity.setFilePath(savePath);
+            entity.setCoord(Arrays.toString(coord));
+            this.save(entity);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result search(PageDto param) {
+        startPage(param);
+//        List<RasterEntity> list = entityMapper.search(param);
+        return Result.success(null);
+    }
+
+    @Override
+    public Result remove(Long id) {
+        RasterEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        String code = entity.getCode();
+        // 安全校验,rm -rf 删除需要严谨
+        if (StringUtils.isBlank(code)) {
+            log.error("目录编码不能为空");
+            return Result.failure("目录编码不能为空");
+        }
+        String fileDir = configConstant.serverBasePath + code;
+
+        String cmd = Command.remove;
+        cmd = cmd.replace("@input", fileDir);
+        log.info("cmd: " + cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("文件删除完成,耗时: {} s" , (end-stat)/1000);
+
+        entity.setIsDelete(1);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result slice(Long id, String layerMin, String layerMax) {
+
+        if (!RegexUtils.regexInt(layerMin)) {
+            return Result.failure("非数字类型");
+        }
+        if (!RegexUtils.regexInt(layerMax)) {
+            return Result.failure("非数字类型");
+        }
+
+        RasterEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        String outputPath = configConstant.serverBasePath + entity.getCode() + "/slice";
+        // 命令不会主动创建目录
+        FileUtil.mkdir(outputPath);
+        // 传入的是目录
+        String cmd = Command.RASTER_SLICE_OSGEO;
+        cmd = cmd.replace("@inputFile", entity.getCoordStrictPath());
+        cmd = cmd.replace("@outputFile", outputPath);
+        cmd = cmd.replace("@layerMin", layerMin);
+        cmd = cmd.replace("@layerMax", layerMax);
+        log.info("cmd: {}", cmd);
+
+        long stat = System.currentTimeMillis();
+        CmdUtils.cmdShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("栅格数据切片完成,耗时: {} s, id: {}" , (end-stat)/1000, id);
+
+        // todo 数据切片完成,这里可能需要一个切片中的状态
+        entity.setStatus(3);
+        entity.setSlicePath(outputPath);
+        entity.setLayerMin(layerMin);
+        entity.setLayerMax(layerMax);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result coordJudge(Long id) {
+        RasterEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        // 获取坐标类型
+        String coordType = getCoordType(entity.getFilePath());
+        String coordStrictPath = "0";
+        log.info("coordType: {}", coordType);
+
+        if (TypeCode.COORD_XIAN_1980.equals(coordType)) {
+            log.info("执行严格坐标转换");
+            coordStrictPath = getStrict(entity);
+
+        } else if (TypeCode.COORD_WGS84.equals(coordType)) {
+            log.info("不需要坐标转换");
+            // 不需要转,就把上传文件路径复制到严格坐标路径上
+            coordStrictPath = entity.getFilePath();
+        }
+
+        entity.setCoordType(coordType);
+        entity.setUpdateTime(new Date());
+        entity.setCoordStrictPath(coordStrictPath);
+        this.update(entity);
+
+        return Result.success(entity);
+    }
+
+
+    /**
+     * 获取坐标类型
+     * @param filePath
+     * @return
+     */
+    private String getCoordType(String filePath){
+        String cmd = Command.RASTER_JUDGE_COORD;
+        cmd = cmd.replace("@inputFile", filePath);
+        log.info("cmd: {}", cmd);
+        Integer isJudge =  cmdJudgeCoord(cmd);
+        String type = "";
+        if (1000 == isJudge) {
+            log.info("need to transform");
+            // 严格坐标转换
+            type = TypeCode.COORD_XIAN_1980;
+
+        } else if (0 == isJudge) {
+            log.info("not to transform");
+            type = TypeCode.COORD_WGS84;
+
+        } else {
+            log.info("error exeCmd");
+        }
+
+        return type;
+    }
+
+
+    // 坐标判断
+    private Integer cmdJudgeCoord(String commandStr) {
+        // 命令运行结果 1:失败, 0:成功
+        Integer isCmd = null;
+
+        StringBuffer sb = new StringBuffer();
+        StringBuffer errorStr = new StringBuffer();
+        try {
+            String[] cmd = new String[]{"/bin/sh", "-c", commandStr};
+            Process ps = Runtime.getRuntime().exec(cmd);
+
+            BufferedReader br = new BufferedReader(new InputStreamReader(ps.getInputStream()));
+            BufferedReader errorBuf = new BufferedReader(new InputStreamReader(ps.getErrorStream()));
+
+            // error : 坑, 控制台信息是从errorBuf这里出来的
+            String errorLine;
+            while ((errorLine = errorBuf.readLine()) != null) {
+                errorStr.append(errorLine).append("\n");
+            }
+            if (StringUtils.isNotEmpty(errorStr)){
+                log.info("error result: {}", errorStr.toString());
+            }
+
+            // success ,没有获取到信息
+            String line;
+            while ((line = br.readLine()) != null) {
+//                log.info("=====  br.readLine: ======== {}", br.readLine());
+                //执行结果加上回车
+                sb.append(line).append("\n");
+            }
+            log.info("result: {}", sb.toString());
+
+            // 结束命令行
+            isCmd = ps.waitFor();
+
+            // 关闭流
+            br.close();
+            errorBuf.close();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+        if (isCmd == 0) {
+            log.info("end exeCmd : {}", isCmd);
+            // 判断坐标
+            if (sb.toString().contains("+proj=tmerc +lat_0=0 +lon_0=114 +k=1 +x_0=38500000")) {
+                // 需要坐标转换
+                // 1000: 需要转换
+                isCmd = 1000;
+            }
+            if (sb.toString().contains("+proj=longlat +datum=WGS84")) {
+                // 不需要坐标转换
+                isCmd = 0;
+            }
+        } else {
+            log.info("error cmd wsitFore: {}", isCmd);
+        }
+        return isCmd;
+    }
+
+
+    /**
+     * raster 严格坐标转换
+     * 获取严格坐标转换后的地址
+     */
+    private String getStrict(RasterEntity entity) {
+        log.info("run cmdTansformGdalwarpStrict");
+
+        String basePath = configConstant.serverBasePath + entity.getCode();
+        String outFileStep1 = basePath + "/general";
+        FileUtil.mkdir(outFileStep1);
+        outFileStep1 = outFileStep1 + File.separator + entity.getFileName();
+
+        // 坐标处理
+        String coord = entity.getCoord();
+        log.info("convert coord: {}", coord);
+        JSONArray array = JSON.parseArray(coord);
+
+        String step_1 = Command.RASTER_TRANSFORM_GDALWARP_STRICT_1;
+        step_1 = step_1.replace("@inputFile", entity.getFilePath());
+        step_1 = step_1.replace("@outputFile", outFileStep1);
+
+
+        // 3位数坐标
+        if (array.size() == 3) {
+            step_1 = step_1.replace("@x", array.getString(0));
+            step_1 = step_1.replace("@y", array.getString(1));
+            step_1 = step_1.replace("@z", array.getString(2));
+            step_1 = step_1.replace("@rx", "0");
+            step_1 = step_1.replace("@ry", "0");
+            step_1 = step_1.replace("@rz", "0");
+
+            // 坐标为空时
+        } else if (array.size() == 0) {
+            step_1 = step_1.replace("@x", "0");
+            step_1 = step_1.replace("@y", "0");
+            step_1 = step_1.replace("@z", "0");
+            step_1 = step_1.replace("@rx", "0");
+            step_1 = step_1.replace("@ry", "0");
+            step_1 = step_1.replace("@rz", "0");
+
+            // 6位数坐标
+        } else {
+            step_1 = step_1.replace("@x", array.getString(0));
+            step_1 = step_1.replace("@y", array.getString(1));
+            step_1 = step_1.replace("@z", array.getString(2));
+            step_1 = step_1.replace("@rx", array.getString(3));
+            step_1 = step_1.replace("@ry", array.getString(4));
+            step_1 = step_1.replace("@rz", array.getString(5));
+        }
+
+        String step_2 = Command.RASTER_TRANSFORM_GDALWARP_STRICT_2;
+
+        String outFileStep2 = basePath + "/strict";
+        FileUtil.mkdir(outFileStep2);
+        outFileStep2 = outFileStep2 + File.separator + entity.getFileName();
+
+        step_2 = step_2.replace("@inputFile", outFileStep1);
+        step_2 = step_2.replace("@outputFile", outFileStep2);
+        log.info("cmd1: {}", step_1);
+        CmdUtils.cmdShell(step_1);
+        log.info("普遍坐标转换完成");
+        log.info("cmd2: {}", step_2);
+        CmdUtils.cmdShell(step_2);
+        log.info("严格坐标转换完成");
+
+        return outFileStep2;
+    }
+
+}

+ 27 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysDeptServiceImpl.java

@@ -0,0 +1,27 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.SysDeptEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SysDeptMapper;
+import com.gis.service.SysDeptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class SysDeptServiceImpl extends IBaseServiceImpl<SysDeptEntity, Long> implements SysDeptService {
+
+    @Autowired
+    private SysDeptMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SysDeptEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+
+}

+ 38 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysResourceServiceImpl.java

@@ -0,0 +1,38 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.SysResourceEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SysResourceMapper;
+import com.gis.service.SysResourceService;
+import com.gis.service.util.ResourceTree;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class SysResourceServiceImpl extends IBaseServiceImpl<SysResourceEntity, Long> implements SysResourceService {
+
+    @Autowired
+    private SysResourceMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SysResourceEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public List<ResourceTree> getResourceByRoleId(Long roleId) {
+        return null;
+    }
+
+    @Override
+    public List<SysResourceEntity> findResourceByRoleId(Long roleId) {
+        return entityMapper.findResourceByRoleId(roleId);
+    }
+}

+ 35 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysRoleServiceImpl.java

@@ -0,0 +1,35 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.SysRoleEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SysRoleMapper;
+import com.gis.service.SysRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class SysRoleServiceImpl extends IBaseServiceImpl<SysRoleEntity, Long> implements SysRoleService {
+
+    @Autowired
+    private SysRoleMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SysRoleEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public void deleteRoleResource(Long roleId) {
+        entityMapper.deleteRoleResource(roleId);
+    }
+
+    @Override
+    public void saveRoleResource(Long roleId, long resourceId) {
+        entityMapper.saveRoleResource(roleId, resourceId);
+    }
+}

+ 49 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java

@@ -0,0 +1,49 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SysUserMapper;
+import com.gis.service.SysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> implements SysUserService {
+
+    @Autowired
+    private SysUserMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SysUserEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+//    @Override
+//    public List<UserResponse> findAllBySearchKey(PageDto param) {
+//        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+//        return entityMapper.findAllBySearchKey(param.getSearchKey());
+//    }
+
+    @Override
+    public SysUserEntity findByUserName(String userName) {
+        return entityMapper.findByUserName(userName);
+    }
+
+    @Override
+    public SysUserEntity findByPhone(String phone) {
+        return entityMapper.findByPhone(phone);
+    }
+//
+//    @Override
+//    public List<UserEntity> findBySearchKey(PageRequest param) {
+//        return entityMapper.findBySearchKey(param.getSearchKey());
+//    }
+
+
+}

+ 523 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/impl/VectorServiceImpl.java

@@ -0,0 +1,523 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.gis.common.constant.Command;
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.constant.TypeCode;
+import com.gis.common.util.CmdUtils;
+import com.gis.common.util.RegexUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.VectorEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.VectorMapper;
+import com.gis.service.VectorService;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.math.BigDecimal;
+import java.util.*;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class VectorServiceImpl extends IBaseServiceImpl<VectorEntity, Long> implements VectorService {
+
+    @Autowired
+    private VectorMapper entityMapper;
+
+    @Override
+    public IBaseMapper<VectorEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Autowired
+    ConfigConstant configConstant;
+
+
+    /**
+     * 需要坐标转换
+     * CGCS_2000
+     */
+    private static int COORD_CONVERT_CGCS_2000 = 1000;
+
+    /**
+     * 需要坐标转换
+     * _XIAN_1980
+     */
+    private static int COORD_CONVERT_XIAN_1980 = 1001;
+
+    /**
+     * 不需要坐标转换
+     * WGS84
+     */
+    private static int COORD_NOT_WGS84 = 0;
+
+    @Override
+    public Result upload(MultipartFile[] files, String[] coord) {
+
+        // 文件名前缀必须一致
+        // 必须包含以下四个后缀:"dbf","shp","shx","prj"
+        // 上传的文件名,字符拼接存到一个字段里
+        // 前端只显示shp的文件名
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String basePath = configConstant.serverBasePath + time + "/";
+        VectorEntity entity = new VectorEntity();
+        String shpName = "";
+        String savePath = "";
+        // 文件名拼接
+        StringBuffer allFileName = new StringBuffer();
+
+        // 文件名前缀
+        String prefixName = "";
+        // 检查文件名、格式
+        int suffixCheckInt = 0;
+
+
+        // 判断后缀名,需要包含这以下四个
+        String [] suffixCheck = {"dbf","shp","shx","prj"};
+
+            try {
+                int i = 1;
+                for (MultipartFile file: files) {
+
+                    String fileName = file.getOriginalFilename();
+                    // 上传的文件名,字符串拼接存到一个字段里
+                    allFileName.append(fileName).append(",");
+
+
+                    // 拿第一个文件名做为前缀
+                    if (i == 1) {
+                        prefixName = StringUtils.substringBeforeLast(fileName, ".");
+                    }
+
+                    // 文件名前缀必须一致
+                    if (!StringUtils.startsWith(fileName, prefixName)) {
+                        log.info("文件名前缀不一致");
+                        return Result.failure("文件名前缀不一致");
+                    }
+
+                    // 后缀名
+                    String suffix = StringUtils.substringAfterLast(fileName, ".");
+                    // 必须包含以下四个后缀:"dbf","shp","shx","prj"
+                    if (Arrays.asList(suffixCheck).contains(suffix)) {
+                        suffixCheckInt += 1;
+                    }
+
+
+                    // 保存shp信息
+                    if (StringUtils.endsWith(fileName, ".shp")) {
+                        shpName = fileName;
+                        savePath = basePath + fileName;
+                    }
+                    FileUtil.writeFromStream(file.getInputStream(), basePath+fileName);
+
+                    i ++;
+
+
+                }
+
+                // 上传文件格式有误
+                if (suffixCheckInt != 4) {
+                    log.info("文件后缀名有误");
+                    return Result.failure("文件后缀名有误,请检查清楚再上传");
+                }
+
+                entity.setFileName(shpName);
+                entity.setCode(time);
+                entity.setFilePath(savePath);
+                entity.setCoord(Arrays.toString(coord));
+                entity.setOriginalName(allFileName.toString());
+                this.save(entity);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+
+
+        return Result.success(entity);
+    }
+
+
+
+
+    @Override
+    public Result search(PageDto param) {
+        startPage(param);
+        List<VectorEntity> all = this.findAll();
+        return Result.success(new PageInfo<>(all));
+    }
+
+    @Override
+    public Result remove(Long id) {
+        VectorEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+        String code = entity.getCode();
+        // 安全校验,rm -rf 删除需要严谨
+        if (StringUtils.isBlank(code)) {
+            log.error("目录编码不能为空");
+            return Result.failure("目录编码不能为空");
+        }
+        String fileDir = configConstant.serverBasePath + code;
+
+        String cmd = Command.remove;
+        cmd = cmd.replace("@input", fileDir);
+        log.info("cmd: " + cmd);
+        long stat = System.currentTimeMillis();
+        CmdUtils.callShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("文件删除完成,耗时: {} s" , (end-stat)/1000);
+
+        entity.setIsDelete(1);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success();
+    }
+
+    @Override
+    public Result slice(Long id, String layerMin, String layerMax) {
+
+        if (!RegexUtils.regexInt(layerMin)) {
+            return Result.failure("非数字类型");
+        }
+        if (!RegexUtils.regexInt(layerMax)) {
+            return Result.failure("非数字类型");
+        }
+
+        VectorEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        String outputPath = configConstant.serverBasePath + entity.getCode() + "/slice";
+        // 命令不会主动创建目录
+        FileUtil.mkdir(outputPath);
+        // 传入的是目录
+        String cmd = Command.VECTOR_SLICE_TIPPECANOE;
+        cmd = cmd.replace("@inputFile", entity.getGeojsonPath());
+        cmd = cmd.replace("@outputFile", outputPath);
+        cmd = cmd.replace("@layerMin", layerMin);
+        cmd = cmd.replace("@layerMax", layerMax);
+        log.info("cmd: {}", cmd);
+
+        // todo 可能需要做进度条
+        long stat = System.currentTimeMillis();
+        CmdUtils.cmdShell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("栅格数据切片完成,耗时: {} s, id: {}" , (end-stat)/1000, id);
+
+        // todo 数据切片完成,这里可能需要一个切片中的状态
+        entity.setStatus(3);
+        entity.setSlicePath(outputPath);
+        entity.setLayerMin(layerMin);
+        entity.setLayerMax(layerMax);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success(entity);
+    }
+
+    /**
+     * 上传后判断坐标,显示原始坐标
+     *  20210312
+     *  需要把样式的经纬度显示出来(还没做)
+     *
+     */
+    @Override
+    public Result coordJudge(Long id) {
+        VectorEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        // 获取坐标类型
+        String coordType = getCoordType(entity.getFilePath());
+
+        entity.setCoordType(coordType);
+        entity.setUpdateTime(new Date());
+
+        Map<String, String> strictMap = getStrict(entity);
+        // 有错误日志
+        if (strictMap.get("log") != null) {
+            return Result.failure(strictMap.get("log"));
+        }
+        entity.setCoordStrictPath(strictMap.get("strictPath"));
+        this.update(entity);
+
+        return Result.success(entity);
+    }
+
+
+    private String getCoordType(String filePath){
+        // 判断是否需要坐标转换
+        String cmd = Command.VECTOR_JUDGE_COORD;
+        cmd = cmd.replace("@inputFile", filePath);
+        log.info("cmd: {}", cmd);
+        Map map = cmdJudgeCoord(cmd);
+        Integer code = (int) map.get("code");
+        log.info("judgeCoord code: {}", code);
+
+        String coordType = null;
+
+
+        // 转换坐标 普通坐标转换
+        if (code == COORD_CONVERT_CGCS_2000) {
+            // 普通坐标转换
+            log.info("need to general transform");
+            coordType = TypeCode.COORD_SYSTEM_2000;
+        } else if (code == COORD_CONVERT_XIAN_1980) {
+
+            // 严格坐标转换 (西安80转wgs84),需要参数
+            log.info("need to strict transform, code: {}", code);
+            coordType = TypeCode.COORD_XIAN_1980;
+
+        } else if (0 == COORD_NOT_WGS84) {
+            // 不转换坐标 把文件信息移动到CoordStrictPath 这路径下
+            log.info("not to transform");
+            coordType = TypeCode.COORD_WGS84;
+
+        }
+        return coordType;
+    }
+
+    @Override
+    public Result toGeoJson(Long id) {
+        VectorEntity entity = this.findById(id);
+        if (entity == null) {
+            log.info("对象不存在: " + id);
+            return Result.failure("对象不存在");
+        }
+
+        String fileName = StringUtils.substringBefore(entity.getFileName(), ".");
+        String geoJsonPath = configConstant.serverBasePath+entity.getCode() +"/" + fileName + ".json";
+
+        String cmd = Command.VECTOR_TO_GEOJSON;
+        cmd = cmd.replace("@inputFile", entity.getCoordStrictPath());
+        cmd = cmd.replace("@outputFile", geoJsonPath);
+        log.info("cmd: {}", cmd);
+        CmdUtils.cmdShell(cmd);
+        log.info("矢量数据转geoJson完成: {}", cmd);
+
+        entity.setGeojsonPath(geoJsonPath);
+        entity.setUpdateTime(new Date());
+        this.update(entity);
+        return Result.success(entity);
+    }
+
+    // 坐标判断
+    public Map cmdJudgeCoord(String commandStr) {
+        // 命令运行结果 1:失败, 0:成功
+        Integer isCmd = null;
+
+        StringBuffer sb = new StringBuffer();
+        StringBuffer errorStr = new StringBuffer();
+
+        Map map = null;
+        try {
+            String[] cmd = new String[]{"/bin/sh", "-c", commandStr};
+            Process ps = Runtime.getRuntime().exec(cmd);
+
+            BufferedReader br = new BufferedReader(new InputStreamReader(ps.getInputStream()));
+            BufferedReader errorBuf = new BufferedReader(new InputStreamReader(ps.getErrorStream()));
+
+            // error : 坑, 控制台信息是从errorBuf这里出来的
+            String errorLine;
+            while ((errorLine = errorBuf.readLine()) != null) {
+                errorStr.append(errorLine).append("\n");
+            }
+            if (StringUtils.isNotEmpty(errorStr)) {
+                log.info("error result: {}", errorStr.toString());
+            }
+
+
+            // success ,没有获取到信息
+            String line;
+            while ((line = br.readLine()) != null) {
+                //执行结果加上回车
+                sb.append(line).append("\n");
+                // 获取经纬度
+
+                if (line.contains("Extent: (")) {
+                    log.info("extent: {}", line);
+                    map = getExtent(line);
+                }
+            }
+            log.info("result: {}", sb.toString());
+
+            // 结束命令行
+            isCmd = ps.waitFor();
+
+
+            // 关闭流
+            br.close();
+            errorBuf.close();
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+
+        if (isCmd == 0) {
+            log.info("end exeCmd : {}", isCmd);
+            // 判断坐标
+            if (sb.toString().contains("GEOGCS[\"China Geodetic Coordinate System 2000\"")) {
+                // 需要普通坐标转换
+                isCmd = 1000;
+                map.put("code", isCmd);
+                log.info("需要坐标转换code:{}, GEOGCS[\"China Geodetic Coordinate System 2000\"", isCmd);
+            }
+
+            if (sb.toString().contains("GEOGCS[\"Xian 1980\"")) {
+                // 需要严格坐标转换
+                isCmd = 1001;
+                map.put("code", isCmd);
+                log.info("需要严格坐标转换code:{}, GEOGCS[\"Xian 1980\"", isCmd);
+            }
+
+            if (sb.toString().contains("GEOGCS[\"WGS 84\"")) {
+                // 不需要坐标转换
+                isCmd = 0;
+                map.put("code", isCmd);
+                log.info("不需要坐标转换code:{}, GEOGCS[\"WGS 84\"", isCmd);
+            }
+
+
+        } else {
+            map.put("code", isCmd);
+            log.info("error exeCmd wsitFore: {}", isCmd);
+        }
+
+        return map;
+
+    }
+
+
+    /**
+     * 获取经纬度平均值
+     *
+     * @param str 传入参数
+     * @return map
+     */
+    private Map getExtent(String str) {
+
+        str = str.replace("Extent: (", "");
+        str = str.replaceAll("\\(", "");
+        str = str.replaceAll("\\)", "");
+        str = str.replaceAll(" -", ",");
+
+        // 去除所有空白字符
+        str = StringUtils.deleteWhitespace(str);
+        String[] strArray = str.split(",");
+        List<String> list = Arrays.asList(strArray);
+        log.info("extent list: {}", Arrays.asList(strArray));
+
+        BigDecimal b0 = new BigDecimal(list.get(0));
+        BigDecimal b1 = new BigDecimal(list.get(1));
+        BigDecimal b2 = new BigDecimal(list.get(2));
+        BigDecimal b3 = new BigDecimal(list.get(3));
+
+        // 经度
+        BigDecimal longitude = b0.add(b2);
+        longitude = longitude.divide(new BigDecimal(2), 6, BigDecimal.ROUND_HALF_UP);
+        // 纬度
+        BigDecimal latitude = b1.add(b3);
+        latitude = latitude.divide(new BigDecimal(2), 6, BigDecimal.ROUND_HALF_UP);
+
+        HashMap<Object, Object> map = new HashMap<>();
+        map.put("longitude", longitude);
+        map.put("latitude", latitude);
+        return map;
+    }
+
+    /**
+     * vector 严格坐标转换
+     * 矢量数据转坐标只转一次就成功了
+     * 获取严格坐标转换后的地址
+     */
+    private Map<String, String> getStrict(VectorEntity entity) {
+
+        String basePath = configConstant.serverBasePath + entity.getCode();
+        String strictCoordPath = basePath + "/strict";
+        FileUtil.mkdir(strictCoordPath);
+        strictCoordPath = strictCoordPath + "/" + entity.getFileName();
+
+        // 坐标处理
+        String coord = entity.getCoord();
+        String filePath = entity.getFilePath();
+        log.info("convert coord: {}", coord);
+        JSONArray arrayCoord = JSON.parseArray(coord);
+
+        HashMap<String, String> map = new HashMap<>();
+        String errorLog = null;
+
+        // 转换坐标 普通坐标转换
+        if (TypeCode.COORD_SYSTEM_2000.equals(entity.getCoordType())) {
+            // 普通坐标转换
+            log.info("need to general transform");
+            if (arrayCoord.size() == 0) {
+                // 没有坐标参数,执行普通坐标转换(ogrinfo)
+                log.info("run generalCoordTransform");
+                coordTransform(Command.VECTOR_TRANSFORM_GENERAL, filePath, strictCoordPath);
+
+            } else {
+                // 有坐标参数,执行严格坐标转换(CGCS2000转wgs80)
+                log.info("run strictCoordTransform");
+                coordTransform(Command.VECTOR_TRANSFORM_STRICT_WGS80, filePath, strictCoordPath);
+            }
+
+        } else if (TypeCode.COORD_XIAN_1980.equals(entity.getCoordType())) {
+
+            // 严格坐标转换 (西安80转wgs84),需要参数
+            log.info("need to strict transform, CoordType: {}", entity.getCoordType());
+            if (arrayCoord.size() == 0) {
+                errorLog = "西安80转wgs84需要坐标参数,转换失败";
+                log.error("errorLog");
+            } else {
+                log.info("run strictCoordTransform");
+                coordTransform(Command.VECTOR_TRANSFORM_STRICT_WGS84, filePath, strictCoordPath);
+            }
+
+        } else if (TypeCode.COORD_WGS84.equals(entity.getCoordType())) {
+            // 不转换坐标 把文件信息移动到CoordStrictPath 这路径下
+            log.info("not to transform");
+            strictCoordPath = filePath;
+        }
+
+        map.put("strictPath", strictCoordPath);
+        map.put("log", errorLog);
+
+        return map;
+    }
+
+
+    /**
+     * 坐标转换
+     */
+    private void coordTransform(String cmd, String inputPath, String outPath) {
+
+        cmd = cmd.replace("@inputFile", inputPath);
+        cmd = cmd.replace("@outputFile", outPath);
+        log.info("cmd: {}", cmd);
+        CmdUtils.cmdShell(cmd);
+        log.info("坐标转换完成");
+    }
+
+}

+ 51 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/util/ResourceTree.java

@@ -0,0 +1,51 @@
+package com.gis.service.util;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ResourceTree {
+
+    private Long id;
+
+    private String name;
+
+    private Long parentId;
+
+    @JSONField(serialize = false)
+    private boolean checked = false;
+
+    @JSONField(serialize = false)
+    private boolean spread = false;
+
+    @JSONField(serialize = false)
+    private String isHeader = "0";
+
+    @JSONField(serialize = false)
+    private String url;
+
+    @JSONField(serialize = false)
+    private String icon;
+
+    @JSONField(serialize = false)
+    private String resourceKey;
+
+    @JSONField(serialize = false)
+    private String resourceType;
+
+    @JSONField(serialize = false)
+    private String order = "1";
+
+    // 子菜单/或按钮
+    private List<ResourceTree> children;
+
+    @JSONField(serialize = false)
+    private int level;
+
+    // 默认都没有权限
+    private boolean authority ;
+
+
+}

+ 106 - 0
cesium_manage/gis_service/src/main/java/com/gis/service/util/ResourceTreeUtil.java

@@ -0,0 +1,106 @@
+package com.gis.service.util;
+
+import com.gis.domain.entity.SysResourceEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ResourceTreeUtil {
+
+    private List<ResourceTree> resultNodes = new ArrayList<ResourceTree>();//树形结构排序之后list内容
+
+    private List<ResourceTree> nodes = new ArrayList<ResourceTree>();
+    //传入list参数
+
+    public ResourceTreeUtil(List<SysResourceEntity> nodesList) {//通过构造函数初始化
+        for (SysResourceEntity n : nodesList) {
+            ResourceTree treeGrid = new ResourceTree();
+            treeGrid.setId(n.getId());
+            treeGrid.setName(n.getName());
+//            treeGrid.setIcon(n.getIcon());
+            treeGrid.setUrl(n.getUrl());
+            treeGrid.setResourceKey(n.getResourceKey());
+            treeGrid.setResourceType(n.getResourceType());
+
+            if (n.getAuthority() != null){
+                treeGrid.setAuthority(n.getAuthority());
+            }
+
+            if (n.getParentId() != null) {
+                treeGrid.setParentId(n.getParentId());
+            }
+            nodes.add(treeGrid);
+        }
+    }
+
+    public ResourceTreeUtil() {
+    }
+
+    /**
+     * 构建树形结构list
+     *
+     * @return 返回树形结构List列表
+     */
+    public List<ResourceTree> buildTree() {
+        for (ResourceTree node : nodes) {
+            Long id = node.getParentId();
+            if (id == null) {//通过循环一级节点 就可以通过递归获取二级以下节点
+                resultNodes.add(node);//添加一级节点
+//                node.setLevel(1);
+                build(node, node.getLevel());//递归获取二级、三级、。。。节点
+            }
+        }
+        return resultNodes;
+    }
+
+    /**
+     * 递归循环子节点
+     *
+     * @param node 当前节点
+     */
+    private void build(ResourceTree node, int level) {
+        List<ResourceTree> children = getChildren(node);
+        if (!children.isEmpty()) {//如果存在子节点
+            node.setChildren(children);
+//        	level++;
+            for (ResourceTree child : children) {//将子节点遍历加入返回值中
+//        		child.setLevel(level);
+                build(child, child.getLevel());
+            }
+        }
+    }
+
+    /**
+     * @param node
+     * @return 返回
+     */
+    private List<ResourceTree> getChildren(ResourceTree node) {
+        List<ResourceTree> children = new ArrayList<ResourceTree>();
+        Long id = node.getId();
+        for (ResourceTree child : nodes) {
+            if (id.equals(child.getParentId())) {//如果id等于父id
+                children.add(child);//将该节点加入循环列表中
+            }
+        }
+        return children;
+    }
+
+    public List<ResourceTree> buildTree(List<SysResourceEntity> all, List<SysResourceEntity> in) {
+        for (SysResourceEntity n : all) {
+            ResourceTree treeGrid = new ResourceTree();
+            treeGrid.setId(n.getId());
+            treeGrid.setName(n.getName());
+            for (SysResourceEntity nin : in) {
+                if (nin.getId().equals(n.getId())) {
+                    treeGrid.setChecked(true);
+                }
+            }
+            if (n.getParentId() != null) {
+                treeGrid.setParentId(n.getParentId());
+            }
+            nodes.add(treeGrid);
+        }
+        return buildTree();
+    }
+
+}

+ 27 - 0
cesium_manage/gis_web/pom.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>cesium_manage</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_web</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_service</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 13 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/aop/WebControllerLog.java

@@ -0,0 +1,13 @@
+package com.gis.web.aop;
+
+import java.lang.annotation.*;
+
+/**
+ * Created by Hb_zzZ on 2020/2/27.
+ */
+@Target({ElementType.PARAMETER, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface WebControllerLog {
+    String description() default "";
+}

+ 122 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java

@@ -0,0 +1,122 @@
+package com.gis.web.aop;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/25 0025 9:24
+ *
+ * 日志aop
+ */
+@Slf4j
+@Aspect
+@Component
+public class WebLogAspect {
+
+    @Autowired
+    private HttpServletRequest request;
+
+//    @Autowired
+//    private LogService logService;
+
+    @Pointcut("execution(* com.gis.web.controller.*.*(..))")//切入点描述 这个是controller包的切入点
+    public void controllerLog(){}//签名,可以理解成这个切入点的一个名称
+
+    @Before("controllerLog()") //在切入点的方法run之前要干的
+    public void logBeforeController(JoinPoint joinPoint) throws Exception {
+
+        // 获取token
+        String token = request.getHeader("token");
+//        Long userId = null;
+//        if (token != null) {
+//            userId = JwtUtil.getUserId(token);
+//        }
+
+        // 记录下请求内容
+        log.warn("start : {}" , request.getRequestURI());
+        log.info("request Method : {}" , request.getMethod());
+        log.info("request IP : {}" , request.getRemoteAddr());
+        log.info("request Args : {}" , Arrays.toString(joinPoint.getArgs()));
+
+        // token为空,直接返回
+        if (StringUtils.isBlank(token)) {
+            return;
+        }
+
+//        Object[] args = joinPoint.getArgs();
+//        if (args.length > 0) {
+//            log.info("request Args : {}" , Arrays.toString(args));
+//        }
+
+        String description = getControllerLogDescription(joinPoint);
+
+//        if (!StringUtils.isAllBlank(description)) {
+//            log.info("request description : {}", description);
+//            // 保存数据库
+//            List<String> detail = getDetail(description);
+//            logService.save(new LogEntity(userId, detail.get(0), detail.get(1)));
+//        }
+
+        //下面这个getSignature().getDeclaringTypeName()是获取包+类名的   然后后面的joinPoint.getSignature.getName()获取了方法名
+        log.info("request Class_Method : {}" , joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
+
+
+
+    }
+
+
+    //使用@AfterReturning在切入点return内容之后切入内容(可以用来对处理返回值做一些加工处理)
+    @AfterReturning(returning = "ret", pointcut = "controllerLog()")
+    public void doAfterReturning(Object ret) throws Throwable {
+        // 处理完请求,返回内容
+//        log.info("响应RESPONSE : " + ret.toString());
+        log.warn("end : {}", request.getRequestURI());
+    }
+
+    /**
+     * 获取注解中对方法的描述信息 用于Controller层注解
+     *
+     * @param joinPoint
+     *            切点
+     * @return 方法描述
+     * @throws Exception
+     */
+    public static String getControllerLogDescription(JoinPoint joinPoint) throws Exception {
+        String targetName = joinPoint.getTarget().getClass().getName();
+        String methodName = joinPoint.getSignature().getName();
+        Object[] arguments = joinPoint.getArgs();
+        Class targetClass = Class.forName(targetName);
+        Method[] methods = targetClass.getMethods();
+        String description = "";
+        for (Method method : methods) {
+            if (method.getName().equals(methodName)) {
+                Class[] clazzs = method.getParameterTypes();
+                if (clazzs.length == arguments.length) {
+                    WebControllerLog annotation = method.getAnnotation(WebControllerLog.class);
+                    if (annotation != null) {
+                        description = annotation.description();
+                        break;
+                    }
+                }
+            }
+        }
+        return description;
+    }
+
+    private static List<String> getDetail(String str){
+        String[] split = str.split("-");
+        return Arrays.asList(split);
+    }
+}

+ 71 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/BaseController.java

@@ -0,0 +1,71 @@
+package com.gis.web.controller;
+
+import com.gis.web.shiro.JwtUtil;
+import com.github.pagehelper.PageHelper;
+
+import com.gis.domain.request.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Created by owen on 2020/2/20 0020 15:20
+ */
+public class BaseController {
+
+    @Autowired
+    protected HttpServletRequest request;
+
+
+
+
+
+    /** 获取用户名*/
+    String getTokenUserName(){
+        String token = getToken();
+        return JwtUtil.getUsername(token);
+    }
+
+    /** 获取用户id*/
+    Long getTokenUserId(){
+        return JwtUtil.getUserId(getToken());
+    }
+
+    /** 获取用户角色*/
+//    String getTokenUserRole(){
+//        return JwtUtil.getUserRole(getToken());
+//    }
+
+    /** 获取用户管理者*/
+    Boolean getTokenUserManager(){
+        return JwtUtil.getUserManager(getToken());
+    }
+
+
+    /** 获取header token */
+    String getToken(){
+        return request.getHeader("token");
+    }
+
+
+    /**
+     * 设置请求分页数据
+     */
+    void startPage(PageDto param){
+        Integer pageNum = param.getPageNum();
+        Integer pageSize = param.getPageSize();
+        if (pageNum == null) {
+            pageNum = 1;
+        }
+
+        if (pageSize == null) {
+            pageSize = 10;
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+
+    }
+
+
+
+}

+ 73 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/DemController.java

@@ -0,0 +1,73 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.service.DemService;
+import com.gis.service.ModelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2021/2/26 0026 11:57
+ *
+ * 流程:
+ * 1. 上传xxx.tif uploadPath: /root/gis/data/input/dem/20210301_144305810
+ * 2. 数据打包 build 目录会多一个 xxx.vrt root/gis/data/output/dem/bulid/20210301_144305810.vrt
+ * 3. 切片 没有进度条, 前端轮询 耗时3min左右  slicePath: /root/gis/data/output/dem/slice/20210301_144305810 (data , layer.json)
+ * 4. 发布 输入图层,身份
+ *
+ *
+ *
+ * slice: docker run --rm -v /mnt:/mnt ubuntu:3dtile 3dtile -f osgb -i /mnt/cesium_manage_jm_data/20210304_102342852/ASTGTM2_N22E112_dem.vrt -o /mnt/cesium_manage_jm_data/20210304_102342852/slice
+ * 这个进度条是一行过的,估计可以做进度条
+ */
+
+@Api(tags = "地型模块")
+@Slf4j
+@RequestMapping("api/dem")
+@RestController
+public class DemController {
+
+    @Autowired
+    DemService demService;
+
+
+    /**
+     * 队列时,设置一个变量到redis, 不直接更新数据库。尽量跟数据库解耦
+     * 可以的话,进度也放到redis里
+     * @param param
+     * @return
+     */
+    @ApiOperation("列表")
+    @PostMapping(value = "list")
+    public Result<DemEntity> list(@RequestBody PageDto param) {
+        return demService.search(param);
+    }
+
+    @ApiOperation(value = "上传地型数据", notes = "只能上传.tif文件")
+    @PostMapping(value = "upload")
+    public Result upload(MultipartFile file) {
+        return demService.upload(file);
+    }
+
+
+
+    @ApiOperation(value = "删除文件", notes = "真实删除物理数据,运行命令")
+    @GetMapping("remove/{id}")
+    public Result remove(@PathVariable("id") Long id) {
+        return demService.remove(id);
+    }
+
+
+    @ApiOperation(value = "数据切片", notes = "运行命令,需要用队列, 耗时需要4min, 可以做进度条")
+    @GetMapping("slice/{id}")
+    public Result slice(@PathVariable("id") Long id) {
+        return demService.slice(id);
+    }
+}

+ 144 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/ExceptionController.java

@@ -0,0 +1,144 @@
+package com.gis.web.controller;
+
+import com.gis.common.exception.BaseRuntimeException;
+import com.gis.common.util.Result;
+import lombok.extern.log4j.Log4j2;
+import org.apache.shiro.ShiroException;
+import org.apache.shiro.authz.UnauthorizedException;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.ConstraintViolationException;
+import javax.validation.ValidationException;
+
+/**
+ * 统一捕捉异常,自定义返回参数
+ * 这里只可以捕获controller层的异常。
+ */
+@Log4j2
+@RestControllerAdvice
+public class ExceptionController {
+
+    // 捕捉shiro的异常
+    @ResponseStatus(HttpStatus.UNAUTHORIZED)
+    @ExceptionHandler(ShiroException.class)
+    public Result handle401(ShiroException e) {
+//        return Result.failure(5001, e.getMessage());
+        log.error("没有授权1");
+        return Result.failure(5001, "没有授权");
+    }
+
+
+
+    /**
+     * 捕捉UnauthorizedException
+     *
+     * 权限不够,会抛这个异常
+     */
+    @ResponseStatus(HttpStatus.UNAUTHORIZED)
+    @ExceptionHandler(UnauthorizedException.class)
+    public Result handle401() {
+        log.error("没有授权2");
+        return Result.failure(5001, "没有授权");
+    }
+
+    // 捕捉其他所有异常
+    @ExceptionHandler(Exception.class)
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public Result globalException(HttpServletRequest request, Throwable ex) {
+        return Result.failure(getStatus(request).value(), ex.getMessage());
+    }
+
+
+    private HttpStatus getStatus(HttpServletRequest request) {
+        Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code");
+        if (statusCode == null) {
+            return HttpStatus.INTERNAL_SERVER_ERROR;
+        }
+        return HttpStatus.valueOf(statusCode);
+    }
+
+    @ResponseBody
+    @ExceptionHandler(BaseRuntimeException.class)
+    @ResponseStatus(HttpStatus.OK)
+    public Result runtimeExceptionHandler(HttpServletRequest request, BaseRuntimeException e) {
+        log.error(request.getRequestURI() + ":" + e.getMsg());
+//        return Result.failure(e.getCode() == null ? Result.CODE_FAILURE : e.getCode(), e.getMsg());
+        return Result.failure(e.getCode(), e.getMsg());
+    }
+
+    /**
+     * 方法参数校验
+     *
+     * 注解验证异常
+     */
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public Result handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+        return Result.failure(60001, e.getBindingResult().getFieldError().getDefaultMessage());
+    }
+
+    /**
+     * ValidationException
+     */
+    @ExceptionHandler(ValidationException.class)
+    public Result handleValidationException(ValidationException e) {
+        log.error(e.getMessage(), e);
+        return Result.failure(60002, e.getCause().getMessage());
+    }
+
+    /**
+     * ConstraintViolationException
+     */
+    @ExceptionHandler(ConstraintViolationException.class)
+    public Result handleConstraintViolationException(ConstraintViolationException e) {
+        log.error(e.getMessage(), e);
+        return Result.failure(60003, e.getMessage());
+    }
+
+    @ExceptionHandler(NoHandlerFoundException.class)
+    public Result handlerNoFoundException(Exception e) {
+        log.error(e.getMessage(), e);
+        return Result.failure(60004, "路径不存在,请检查路径是否正确");
+    }
+
+
+
+
+    @ExceptionHandler(NullPointerException.class)
+    public Result handlerNullPointerException(Exception e) {
+        log.error(e.getMessage(), e);
+        return Result.failure(60005, "空指针异常");
+    }
+
+//    @ExceptionHandler(BuilderException.class)
+//    public Result handlerBuilderException(Exception e) {
+//        log.error(e.getMessage(), e);
+//        return Result.failure(60006, "SQL mybatis 异常");
+//    }
+
+
+    /**
+     * 防止表单重复提交
+     * 需要结合数据库某个字段设置唯一字段使用
+     *
+     * 例如userName
+     *
+     * 也可以结合redis使用
+     */
+    @ExceptionHandler(DuplicateKeyException.class)
+    public Result handleDuplicateKeyException(DuplicateKeyException e) {
+        log.error(e.getMessage(), e);
+        return Result.failure(60005, "数据重复,请检查后提交");
+    }
+
+
+
+}
+

+ 46 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/FileController.java

@@ -0,0 +1,46 @@
+package com.gis.web.controller;
+
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.util.FileUtils;
+import com.gis.common.util.Result;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * Created by owen on 2020/9/3 0003 16:25
+ */
+@ApiIgnore
+@Log4j2
+@Api(tags = "文件服务")
+@RestController
+@RequestMapping("api/file")
+public class FileController extends BaseController {
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @ApiOperation(value = "文件上传", notes = "不记录db")
+    @PostMapping("upload")
+    public Result upload(MultipartFile file){
+
+        if (file == null) {
+            log.error("文件不能为空");
+            return Result.failure("文件不能为空");
+        }
+
+        // 写入本地服务器
+        String basePath = configConstant.serverBasePath + "img/";
+
+        String s = FileUtils.renameUpload(file, basePath, configConstant.serverDomain);
+        return Result.success(s);
+
+
+    }
+}

+ 105 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/IndexController.java

@@ -0,0 +1,105 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.PasswordUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.domain.request.LoginRequest;
+import com.gis.service.SysUserService;
+import com.gis.web.shiro.JwtUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.HashMap;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by owen on 2020/2/19 0019 15:53
+ */
+@ApiIgnore
+@Api(tags = "登录")
+@RestController
+@Log4j2
+public class IndexController {
+
+
+    // 目前是1h
+//    private static Integer TOKEN_EXPIRE = 1000 * 60 * 60 * 24;
+
+    // -1 不限时间
+    private static Integer TOKEN_EXPIRE = -1 ;
+
+
+    @Autowired
+    private SysUserService userService;
+
+//    @Autowired
+//    private RedisTemplate<String, String> redisTemplate;
+
+    @ApiOperation("登录")
+    @PostMapping(value = "admin/login")
+    public Result login(@Valid @RequestBody LoginRequest param) throws Exception {
+
+        // 1.获取用户
+        SysUserEntity entity = userService.findByUserName(param.getUserName());
+        if (entity == null){
+            log.error("用户不存在");
+            return Result.failure("用户不存在");
+        }
+        // 验证密码,解密出来是明文密码,在跟输入密码比较
+        boolean decryptName = PasswordUtils.decrypt(entity.getPassword(), param.getPassword(), PasswordUtils.getStaticSalt());
+        if (!decryptName) {
+            log.error("密码错误");
+            return Result.failure("密码错误");
+        }
+
+        // 检查账号是否启用
+        if (entity.getStatus() != 0) {
+            log.error("账号已停用: {}", entity.getUserName());
+            return Result.failure("账号已停用");
+        }
+
+        // 创建新token
+        HashMap<String, Object> tokenMap = new HashMap<>();
+        tokenMap.put("userName", entity.getUserName());
+        tokenMap.put("id", entity.getId());
+//        tokenMap.put("role", userEntity.getRole());
+        tokenMap.put("manager", entity.getManager());
+
+        // 创建新token
+        String token = JwtUtil.createJWT(TOKEN_EXPIRE, tokenMap);
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("user", entity);
+        result.put("token", token);
+
+
+
+        return Result.success(result);
+
+    }
+
+//    @ApiOperation("退出")
+//    @GetMapping("admin/logout")
+//    public Result logout() {
+//        String token = getToken();
+//        if (token == null) {
+//            log.info("token is null");
+//        }
+//        redisTemplate.delete(TypeCode.REDIS_TOKEN + token);
+//        return Result.success();
+//    }
+
+
+
+
+}

+ 67 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/ModelController.java

@@ -0,0 +1,67 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.ModelEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.service.ModelService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+
+
+
+/**
+ * Created by owen on 2021/2/26 0026 11:57
+ *
+ * 流程:
+ * 1. 上传xxx.zip uploadPath: /root/gis/data/input/model/owen_model.zip 注意压缩文件名称的一致性,文件包含(data目录,metadata.xml)
+ * 2. 解压   unZipPath: /root/gis/data/output/model/unzip/owen_model 注意压缩文件名称的一致性,文件包含(data目录,metadata.xml)
+ * 3. 切片 没有进度条, 前端轮询 耗时3min左右  slicePath: /root/gis/data/output/model/slice/owen_model 切片后数据(Data目录,tileset.json)
+ * 4. 发布 输入图层,身份
+ */
+
+@Api(tags = "模型模块")
+@Slf4j
+@RequestMapping("api/model")
+@RestController
+public class ModelController {
+
+    @Autowired
+    ModelService modelService;
+
+
+    @ApiOperation("列表")
+    @PostMapping(value = "list")
+    public Result<ModelEntity> list(@RequestBody PageDto param) {
+        return modelService.search(param);
+    }
+
+    @ApiOperation(value = "上传模型数据", notes = "只能上传zip文件")
+    @PostMapping(value = "upload")
+    public Result upload(MultipartFile file) {
+        return modelService.upload(file);
+    }
+
+    @ApiOperation(value = "解压zip文件", notes = "运行命令")
+    @GetMapping("unzip/{id}")
+    public Result unzip(@PathVariable("id") Long id) {
+        return modelService.unzip(id);
+    }
+
+    @ApiOperation(value = "删除文件", notes = "真实删除物理数据,运行命令")
+    @GetMapping("remove/{id}")
+    public Result remove(@PathVariable("id") Long id) {
+        return modelService.remove(id);
+    }
+
+
+    @ApiOperation(value = "数据切片", notes = "倾斜摄影数据切片(osgb), 运行命令,需要用队列")
+    @GetMapping("slice/{id}")
+    public Result slice(@PathVariable("id") Long id) {
+        return modelService.slice(id);
+    }
+}

+ 86 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/RasterController.java

@@ -0,0 +1,86 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.entity.RasterEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.service.DemService;
+import com.gis.service.RasterService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2021/3/10 0026 11:57
+ *
+ * 栅格数据
+ * 流程:
+ * 1. 上传xxx.tif  /root/gis/data/input/raster/20210309_181410623.tif (旧:上传时需要获取坐标类型, 新的在坐标判断时用)
+ * 2. 判断坐标
+ * 3. 切片 有进度条
+ */
+
+@Api(tags = "栅格模块")
+@Slf4j
+@RequestMapping("api/raster")
+@RestController
+public class RasterController {
+
+    @Autowired
+    RasterService rasterService;
+
+
+    /**
+     * 队列时,设置一个变量到redis, 不直接更新数据库。尽量跟数据库解耦
+     * 可以的话,进度也放到redis里
+     * @param param
+     * @return
+     */
+    @ApiOperation("列表")
+    @PostMapping(value = "list")
+    public Result<RasterEntity> list(@RequestBody PageDto param) {
+        return rasterService.search(param);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file", value = "只能上传tif文件", required = true),
+            @ApiImplicitParam(name = "coord", value = "坐标参数", dataType = "String"),
+    })
+    @ApiOperation(value = "上传栅格数据", notes = "只能上传.tif文件")
+    @PostMapping(value = "upload")
+    public Result upload(MultipartFile file, @RequestParam(value = "coord", required = false) String[] coord) {
+        return rasterService.upload(file, coord);
+    }
+
+    @ApiOperation(value = "判断坐标")
+    @GetMapping("coordJudge/{id}")
+    public Result coordJudge(@PathVariable("id") Long id) {
+        return rasterService.coordJudge(id);
+    }
+
+
+    @ApiOperation(value = "删除文件", notes = "真实删除物理数据,运行命令")
+    @GetMapping("remove/{id}")
+    public Result remove(@PathVariable("id") Long id) {
+        return rasterService.remove(id);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "文件id", required = true),
+            @ApiImplicitParam(name = "layerMin", value = "图片级别(最小值)9", required = true),
+            @ApiImplicitParam(name = "layerMax", value = "图片级别(最大值)17",  required = true)
+    })
+    @ApiOperation(value = "数据切片", notes = "运行命令,需要用队列")
+    @GetMapping("slice/{id}/{layerMin}/{layerMax}")
+    public Result slice(@PathVariable("id") Long id, @PathVariable("layerMin") String layerMin, @PathVariable("layerMax") String layerMax) {
+        return rasterService.slice(id, layerMin, layerMax);
+    }
+}

+ 92 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysDeptController.java

@@ -0,0 +1,92 @@
+package com.gis.web.controller;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SysDeptEntity;
+import com.gis.domain.request.DeptRequest;
+import com.gis.domain.request.PageDto;
+import com.gis.service.SysDeptService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Date;
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ */
+@ApiIgnore
+@Log4j2
+@Api(tags = "部门管理")
+@RestController
+@RequestMapping("manage/dept")
+public class SysDeptController extends BaseController {
+
+    @Autowired
+    private SysDeptService sysDeptService;
+
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+    @ApiOperation("部门列表")
+    @PostMapping("list")
+    public Result<SysDeptEntity> list(@RequestBody PageDto param) {
+        startPage(param);
+        PageInfo<SysDeptEntity> page = new PageInfo<>(sysDeptService.findAll());
+        return Result.success(page);
+    }
+
+    @ApiOperation("新增/修改部信息")
+    @PostMapping("save")
+    public Result save(@Valid @RequestBody DeptRequest param) {
+
+        SysDeptEntity entity = null;
+        if (param.getId() == null) {
+            entity = new SysDeptEntity();
+            BeanUtils.copyProperties(param, entity);
+            sysDeptService.save(entity);
+        } else {
+            entity = sysDeptService.findById(param.getId());
+            if (entity == null) {
+                return Result.failure("对象id不存在");
+            }
+
+            BeanUtils.copyProperties(param, entity);
+            entity.setUpdateTime(new Date());
+            sysDeptService.update(entity);
+
+        }
+
+        return Result.success();
+    }
+
+
+//    @ApiOperation("查询用户信息")
+//    @GetMapping("detail/{id}")
+//    public Result<UserEntity> detail(@PathVariable Long id) {
+//        UserEntity user = userService.findById(id);
+//
+//        if (user == null) {
+//            log.error("用户不存在: {}", id);
+//            return Result.failure("用户不存在");
+//        }
+//        return Result.success(user);
+//    }
+
+
+
+
+
+
+
+
+}

+ 144 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysRoleController.java

@@ -0,0 +1,144 @@
+package com.gis.web.controller;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SysResourceEntity;
+import com.gis.domain.entity.SysRoleEntity;
+import com.gis.domain.request.RoleAccreditRequest;
+import com.gis.domain.request.RoleRequest;
+import com.gis.domain.request.PageDto;
+import com.gis.service.SysResourceService;
+import com.gis.service.SysRoleService;
+import com.gis.service.util.ResourceTree;
+import com.gis.service.util.ResourceTreeUtil;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+import tk.mybatis.mapper.entity.Condition;
+
+import javax.validation.Valid;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ */
+@ApiIgnore
+@Log4j2
+@Api(tags = "角色管理")
+@RestController
+@RequestMapping("manage/role")
+public class SysRoleController extends BaseController {
+
+    @Autowired
+    private SysRoleService sysRoleService;
+
+    @Autowired
+    private SysResourceService sysResourceService;
+
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+    @ApiOperation("角色列表")
+    @PostMapping("list")
+    public Result<SysRoleEntity> list(@RequestBody PageDto param) {
+        startPage(param);
+        PageInfo<SysRoleEntity> page = new PageInfo<>(sysRoleService.findAll());
+        return Result.success(page);
+    }
+
+    @ApiOperation("新增/修改部信息")
+    @PostMapping("save")
+    public Result save(@Valid @RequestBody RoleRequest param) {
+
+        SysRoleEntity entity = null;
+        if (param.getId() == null) {
+            entity = new SysRoleEntity();
+            BeanUtils.copyProperties(param, entity);
+            sysRoleService.save(entity);
+        } else {
+            entity = sysRoleService.findById(param.getId());
+            if (entity == null) {
+                return Result.failure("对象id不存在");
+            }
+
+            BeanUtils.copyProperties(param, entity);
+            entity.setUpdateTime(new Date());
+            sysRoleService.update(entity);
+
+        }
+
+        return Result.success();
+    }
+
+
+    @ApiOperation("角色授权")
+    @PostMapping("accredit")
+    public Result accredit(@Valid @RequestBody RoleAccreditRequest param) {
+        Long roleId = param.getId();
+        SysRoleEntity entity  = sysRoleService.findById(roleId);
+        if (entity == null) {
+            log.error("对象id不存在");
+            Result.failure("对象id不存在");
+        }
+
+        // 每次新增/修改时,删除角色资源表信息,重新添加
+        sysRoleService.deleteRoleResource(roleId);
+
+        for (long i : param.getResources()) {
+            sysRoleService.saveRoleResource(roleId, i);
+        }
+
+        return Result.success();
+    }
+
+
+    @ApiOperation("角色详情")
+    @GetMapping("detail/{id}")
+    public Result detail(@PathVariable Long id) throws Exception {
+        SysRoleEntity entity = sysRoleService.findById(id);
+
+        HashMap<Object, Object> resultMap = new HashMap<>();
+
+        List<SysResourceEntity> resource = sysResourceService.findResourceByRoleId(id);
+
+        resultMap.put("role", entity);
+        resultMap.put("resource", resource);
+
+        return Result.success(resultMap);
+    }
+
+
+
+    /**
+     * 可能要改一下resourceKey 的值为sys
+     */
+    @ApiOperation("获取资源")
+    @GetMapping("get/resource")
+    public Result getResource() throws Exception {
+
+        Condition condition = new Condition(SysResourceEntity.class);
+        // 只查询普通角色
+        condition.and().andNotEqualTo("resourceKey","admin");
+        List<SysResourceEntity> result = sysResourceService.findAll(condition, "sort desc");
+        ResourceTreeUtil tree = new ResourceTreeUtil(result);
+        List<ResourceTree> resourceTrees = tree.buildTree();
+
+        return Result.success(resourceTrees);
+    }
+
+
+
+
+
+
+
+
+
+}

+ 156 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/SysUserController.java

@@ -0,0 +1,156 @@
+package com.gis.web.controller;
+
+
+import com.gis.common.util.PasswordUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.domain.request.UserRequest;
+import com.gis.service.SysUserService;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+import springfox.documentation.annotations.ApiIgnore;
+
+import javax.validation.Valid;
+import java.util.Date;
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ */
+@ApiIgnore
+@Log4j2
+@Api(tags = "用户管理")
+@RestController
+@RequestMapping("manage/user")
+@Transactional
+public class SysUserController extends BaseController {
+
+    @Autowired
+    public SysUserService userService;
+
+
+    @Autowired
+    public RedisTemplate<Object, Object> redisTemplate;
+
+
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+    @ApiOperation("用户列表")
+    @PostMapping("list")
+    public Result<SysUserEntity> list(@RequestBody PageDto param) {
+        startPage(param);
+        PageInfo<SysUserEntity> page = new PageInfo<>(userService.findAll());
+        return Result.success(page);
+    }
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+    @ApiOperation("新增/修改用户信息")
+    @PostMapping("save")
+    public Result save(@Valid @RequestBody UserRequest param) {
+
+        SysUserEntity entity = null;
+        if (param.getId() == null) {
+            entity = userService.findByUserName(param.getUserName());
+            if (entity != null) {
+                return Result.failure("用户名已存在");
+            }
+            entity = new SysUserEntity();
+            BeanUtils.copyProperties(param, entity);
+            entity.setPassword(PasswordUtils.encrypt(param.getUserName(), "123456", PasswordUtils.getStaticSalt()));
+            userService.save(entity);
+        } else {
+            entity = userService.findById(param.getId());
+            if (entity == null) {
+                log.error("用户不存在: {}", param.getId());
+                return Result.failure("用户不存在");
+            }
+            BeanUtils.copyProperties(param, entity);
+            entity.setUpdateTime(new Date());
+            userService.update(entity);
+        }
+
+        return Result.success();
+    }
+
+
+//    @ApiOperation("查询用户信息")
+//    @GetMapping("detail/{id}")
+//    public Result<UserEntity> detail(@PathVariable Long id) {
+//        UserEntity user = userService.findById(id);
+//
+//        if (user == null) {
+//            log.error("用户不存在: {}", id);
+//            return Result.failure("用户不存在");
+//        }
+//        return Result.success(user);
+//    }
+
+//    @ApiOperation("修改密码")
+//    @PostMapping("updatePwd")
+//    public Result updatePwd(@Valid @RequestBody PasswordRequest param) {
+//
+//        UserEntity user = userService.findByUserName(JwtUtil.getUsername(getToken()));
+//
+//        // 验证原密码
+//        Boolean isBoolean = PasswordUtils.decrypt(user.getPassword(), param.getOldPassword(), PasswordUtils.getStaticSalt());
+//        if (!isBoolean) {
+//            log.error("原始密码错误");
+//            return Result.failure("原始密码错误");
+//        }
+//
+//        user.setPassword(PasswordUtils.encrypt(user.getUserName(), param.getNewPassword(), PasswordUtils.getStaticSalt()));
+//        user.setUpdateTime(new Date());
+//        userService.update(user);
+//        return Result.success();
+//    }
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+//    @ApiOperation("重置密码")
+//    @GetMapping("resetPass/{id}")
+//    public Result resetPass(@PathVariable Long id) {
+//        UserEntity user = userService.findById(id);
+//
+//        if (user == null) {
+//            log.error("用户不存在: {}", id);
+//            return Result.failure("用户不存在");
+//        }
+//
+//        user.setPassword(PasswordUtils.encrypt(user.getUserName(), "123456", PasswordUtils.getStaticSalt()));
+//        user.setUpdateTime(new Date());
+//        userService.update(user);
+//        return Result.success();
+//    }
+
+//    @RequiresRoles(value = {"admin"}, logical = Logical.OR)
+//    @ApiOperation("启用、停用、注销账户")
+//    @GetMapping("setStatus/{id}/{status}")
+//    public Result setStatus(@PathVariable Long id, @PathVariable Integer status) {
+//
+//        UserEntity user = userService.findById(id);
+//        if (user == null) {
+//            log.error("用户不存在: {}", id);
+//            return Result.failure("用户不存在");
+//        }
+//
+//        // 管理员账号不能停用
+//        if ("admin".equals(user.getRole())) {
+//            log.error("管理员账户不能停用/注销: {}", id);
+//            return Result.failure("管理员账户不能停用/注销");
+//        }
+//
+//        user.setStatus(status);
+//        user.setUpdateTime(new Date());
+//        userService.update(user);
+//        return Result.success();
+//    }
+
+
+}

+ 22 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/TestController.java

@@ -0,0 +1,22 @@
+package com.gis.web.controller;
+
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
+
+/**
+ * Created by owen on 2020/5/8 0008 9:54
+ */
+@Api(tags = "测试")
+@RestController
+@RequestMapping
+public class TestController {
+
+    @GetMapping
+    public String test(){
+        return LocalDateTime.now().toString();
+    }
+}

+ 85 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/controller/VectorController.java

@@ -0,0 +1,85 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.DemEntity;
+import com.gis.domain.entity.VectorEntity;
+import com.gis.domain.request.PageDto;
+import com.gis.service.VectorService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * Created by owen on 2021/2/26 0026 11:55
+ * 1. 上传文件
+ * 2. 判断坐标
+ * 3. 转geojson
+ * 4. 切片
+ *
+ */
+
+@Api(tags = "矢量模块")
+@Slf4j
+@RequestMapping("api/vector")
+@RestController
+public class VectorController {
+
+    @Autowired
+    VectorService vectorService;
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "file", value = "矢量数据文件", required = true),
+            @ApiImplicitParam(name = "coord", value = "坐标参数", required = false),
+    })
+    @ApiOperation(value = "上传矢量数据(多文件)")
+    @PostMapping(value = "upload")
+    public Result upload(MultipartFile[] file, @RequestParam(value = "coord", required = false) String[] coord) {
+        return vectorService.upload(file, coord);
+
+
+    }
+
+    @ApiOperation(value = "判断坐标")
+    @GetMapping("coordJudge/{id}")
+    public Result coordJudge(@PathVariable("id") Long id) {
+        return vectorService.coordJudge(id);
+    }
+
+
+    @ApiOperation(value = "转geoJson")
+    @GetMapping("toGeoJson/{id}")
+    public Result toGeoJson(@PathVariable("id") Long id) {
+        return vectorService.toGeoJson(id);
+    }
+
+    @ApiOperation("列表")
+    @PostMapping(value = "list")
+    public Result<VectorEntity> list(@RequestBody PageDto param) {
+        return vectorService.search(param);
+    }
+
+
+    @ApiOperation(value = "删除文件", notes = "真实删除物理数据,运行命令")
+    @GetMapping("remove/{id}")
+    public Result remove(@PathVariable("id") Long id) {
+        return vectorService.remove(id);
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "文件id", required = true),
+            @ApiImplicitParam(name = "layerMin", value = "图片级别(最小值)9", required = true),
+            @ApiImplicitParam(name = "layerMax", value = "图片级别(最大值)17",  required = true)
+    })
+    @ApiOperation(value = "数据切片", notes = "运行命令,需要用队列")
+    @GetMapping("slice/{id}/{layerMin}/{layerMax}")
+    public Result slice(@PathVariable("id") Long id, @PathVariable("layerMin") String layerMin, @PathVariable("layerMax") String layerMax) {
+        return vectorService.slice(id, layerMin, layerMax);
+    }
+}

+ 159 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JWTFilter.java

@@ -0,0 +1,159 @@
+package com.gis.web.shiro;
+
+import com.alibaba.fastjson.JSONObject;
+import com.gis.common.exception.JwtAuthenticationException;
+import lombok.extern.log4j.Log4j2;
+import org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+
+/**
+ * 自定义拦截规则
+ */
+@Log4j2
+public class JWTFilter extends BasicHttpAuthenticationFilter {
+
+
+
+    /**
+     * 判断用户是否想要登入。
+     * 检测header里面是否包含Authorization字段即可
+     *
+     * return false:直接不校验就可以访问api
+     */
+//    @Override
+//    protected boolean isLoginAttempt(ServletRequest request, ServletResponse response) {
+//        HttpServletRequest req = (HttpServletRequest) request;
+////        String authorization = req.getHeader("Authorization");
+//        String authorization = req.getHeader("token");
+//
+//        if (StringUtils.isEmpty(authorization)) {
+//            log.error("Authorization is null");
+//        }
+//
+//        return true;
+//
+//    }
+
+
+
+    /**
+     * 执行登录验证
+     */
+    @Override
+    protected boolean executeLogin(ServletRequest request, ServletResponse response) {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        String authorization = httpServletRequest.getHeader("token");
+        JWTToken token = new JWTToken(authorization);
+
+        // 提交给realm进行登入,如果错误他会抛出异常并被捕获
+        getSubject(request, response).login(token);
+
+        // 如果没有抛出异常则代表登入成功,返回true
+        return true;
+    }
+
+    /**
+     * 这里我们详细说明下为什么最终返回的都是true,即允许访问
+     * 例如我们提供一个地址 GET /article
+     * 登入用户和游客看到的内容是不同的
+     * 如果在这里返回了false,请求会被直接拦截,用户看不到任何东西
+     * 所以我们在这里返回true,Controller中可以通过 subject.isAuthenticated() 来判断用户是否登入
+     * 如果有些资源只有登入用户才能访问,我们只需要在方法上面加上 @RequiresAuthentication 注解即可
+     * 但是这样做有一个缺点,就是不能够对GET,POST等请求进行分别过滤鉴权(因为我们重写了官方的方法),但实际上对应用影响不大
+     *
+     * owen:
+     *  return false ,表示全局拦截,必须登录才可以访问接口,除非配置了免拦截
+     *  "" @RequiresAuthentication 现在不需要配置这个注解来免登录
+     *
+     */
+    @Override
+    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
+        try {
+            executeLogin(request, response);
+        } catch (Exception e) {
+            /**
+             * 这个异常需要自己写,全局捕获不了
+             * 认证出现异常,传递错误信息msg
+             */
+            exceptionMsg(e, response);
+        }
+        // return false 前端没有响应,接收不到异常
+        return true;
+
+
+    }
+
+    /**
+     * 对跨域提供支持
+     * 只对需要token验证的有效,不需要验证的还是需要用注解处理一下
+     *
+     */
+    @Override
+    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+        httpServletResponse.setHeader("Access-control-Allow-Origin", httpServletRequest.getHeader("Origin"));
+        httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,PUT,DELETE");
+        httpServletResponse.setHeader("Access-Control-Allow-Headers", httpServletRequest.getHeader("Access-Control-Request-Headers"));
+        // 跨域时会首先发送一个option请求,这里我们给option请求直接返回正常状态
+        if (httpServletRequest.getMethod().equals(RequestMethod.OPTIONS.name())) {
+            httpServletResponse.setStatus(HttpStatus.OK.value());
+            return false;
+        }
+        return super.preHandle(request, response);
+    }
+
+
+    /**
+     * 无需转发,直接返回Response信息
+     *
+     */
+    private void writeResponse(ServletResponse response, JSONObject msg) {
+        response.setCharacterEncoding("UTF-8");
+        response.setContentType("application/json; charset=utf-8");
+        ServletOutputStream outputStream = null;
+        try {
+            outputStream = response.getOutputStream();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        assert outputStream != null;
+        PrintWriter printWriter = new PrintWriter(outputStream, true);
+        printWriter.write(msg.toString());//直接将json输出到页面
+        printWriter.flush();
+        printWriter.close();
+
+    }
+
+    /**
+     * 封装异常信息
+     */
+    private void exceptionMsg(Exception e, ServletResponse response) {
+        // 认证出现异常,传递错误信息msg
+        String msg = e.getMessage();
+        // 获取应用异常(该Cause是导致抛出此throwable(异常)的throwable(异常))
+        Throwable throwable = e.getCause();
+        JSONObject jsonObject = new JSONObject();
+        if (throwable instanceof JwtAuthenticationException) {
+            jsonObject.put("code", ((JwtAuthenticationException) throwable).getCode());
+            jsonObject.put("msg", ((JwtAuthenticationException) throwable).getMsg());
+        } else {
+            log.error(msg);
+            jsonObject.put("code", 5002);
+            jsonObject.put("msg", "token invalid");
+        }
+        // 直接返回Response信息
+        this.writeResponse(response, jsonObject);
+
+    }
+}

+ 23 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JWTToken.java

@@ -0,0 +1,23 @@
+package com.gis.web.shiro;
+
+import org.apache.shiro.authc.AuthenticationToken;
+
+public class JWTToken implements AuthenticationToken {
+
+    // 密钥
+    private String token;
+
+    public JWTToken(String token) {
+        this.token = token;
+    }
+
+    @Override
+    public Object getPrincipal() {
+        return token;
+    }
+
+    @Override
+    public Object getCredentials() {
+        return token;
+    }
+}

+ 253 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/shiro/JwtUtil.java

@@ -0,0 +1,253 @@
+package com.gis.web.shiro;
+
+import com.auth0.jwt.JWT;
+import com.auth0.jwt.interfaces.Claim;
+import com.auth0.jwt.interfaces.DecodedJWT;
+import com.gis.common.exception.BaseRuntimeException;
+import io.jsonwebtoken.Claims;
+import io.jsonwebtoken.JwtBuilder;
+import io.jsonwebtoken.Jwts;
+import io.jsonwebtoken.SignatureAlgorithm;
+import lombok.extern.log4j.Log4j2;
+import org.junit.Test;
+import org.springframework.util.Assert;
+
+import java.util.*;
+
+@Log4j2
+public class JwtUtil {
+
+    //生成签名的时候使用的秘钥secret
+    private static final String SECRET = "XX#$%()(#*!()!KL<><MQLMNQNQJQK&sdfkjsdrow32234545fdf>?N<:{LWPW";
+
+    /**
+     * 用户登录成功后生成Jwt
+     * 使用Hs256算法  私匙使用用户密码
+     *
+     * @param ttlMillis jwt过期时间
+     * @param userName  用户名
+     * @return
+     */
+    public static String createJWT(long ttlMillis, String userName) {
+        //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+        //生成JWT的时间
+        long nowMillis = System.currentTimeMillis();
+        Date now = new Date(nowMillis);
+
+        //创建payload的私有声明(根据特定的业务需要添加,如果要拿这个做验证,一般是需要和jwt的接收方提前沟通好验证方式的)
+        Map<String, Object> claims = new HashMap<String, Object>();
+        claims.put("userName", userName);
+
+        //下面就是在为payload添加各种标准声明和私有声明了
+        //这里其实就是new一个JwtBuilder,设置jwt的body
+        JwtBuilder builder = Jwts.builder()
+                //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
+                .setClaims(claims)
+                //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。
+                .setId(UUID.randomUUID().toString())
+                //iat: jwt的签发时间
+                .setIssuedAt(now)
+                //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串,可以存放什么userid,roldid之类的,作为什么用户的唯一标志。
+                .setSubject(userName)
+                //设置签名使用的签名算法和签名使用的秘钥
+                .signWith(signatureAlgorithm, SECRET);
+
+        if (ttlMillis >= 0) {
+            long expMillis = nowMillis + ttlMillis;
+            Date exp = new Date(expMillis);
+            //设置过期时间
+            builder.setExpiration(exp);
+        }/*else{
+            //设置过期时间半小时
+            DateTime expDate = new DateTime().plusMinutes(30);
+            builder.setExpiration(expDate.toDate());
+        }*/
+        return builder.compact();
+    }
+
+
+    /**
+     * Token的解密
+     *
+     * @param token 加密后的token
+     * @return
+     */
+    public static Claims parseJWT(String token) {
+        //得到DefaultJwtParser
+        Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+        return claims;
+    }
+
+    public static String getTokenStringValueByKey(String token, String key) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim value = jwt.getClaim(key);
+
+        if (value == null) {
+            log.error("token key is null");
+            throw new BaseRuntimeException(5001, "token invalid");
+        }
+        return value.asString();
+    }
+
+
+    /**
+     * 校验token
+     * 在这里可以使用官方的校验,我这里校验的是token中携带的密码于数据库一致的话就校验通过
+     *
+     * @param token
+     * @param userName
+     * @return
+     */
+    public static Boolean isVerify(String token, String userName) {
+
+        //得到DefaultJwtParser
+        Claims claims = Jwts.parser()
+                //设置签名的秘钥
+                .setSigningKey(SECRET)
+                //设置需要解析的jwt
+                .parseClaimsJws(token).getBody();
+
+        return claims.get("userName").equals(userName);
+    }
+
+    /**
+     * 获得token中的信息无需secret解密也能获得
+     *
+     * @return token中包含的用户名
+     */
+    public static String getUsername(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim userName = jwt.getClaim("userName");
+        Assert.notNull(userName, "token userName is null ");
+        return userName.asString();
+    }
+
+
+    public static List getUserRole(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim role = jwt.getClaim("role");
+        Assert.notNull(role, "token role is null ");
+        return role.as(List.class);
+    }
+
+
+    public static String createJWT(long ttlMillis, Map<String, Object> paramMap) {
+        //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
+        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
+
+        String userName = paramMap.get("userName").toString();
+
+        //生成JWT的时间
+        long nowMillis = System.currentTimeMillis();
+        Date now = new Date(nowMillis);
+
+        //创建payload的私有声明(根据特定的业务需要添加,如果要拿这个做验证,一般是需要和jwt的接收方提前沟通好验证方式的)
+        Map<String, Object> claims = new HashMap<String, Object>();
+        claims.put("userName", userName);
+        claims.put("id", paramMap.get("id"));
+        claims.put("role", paramMap.get("role"));
+        claims.put("manager", paramMap.get("manager"));
+
+        //下面就是在为payload添加各种标准声明和私有声明了
+        //这里其实就是new一个JwtBuilder,设置jwt的body
+        JwtBuilder builder = Jwts.builder()
+                //如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
+                .setClaims(claims)
+                //设置jti(JWT ID):是JWT的唯一标识,根据业务需要,这个可以设置为一个不重复的值,主要用来作为一次性token,从而回避重放攻击。
+                .setId(UUID.randomUUID().toString())
+                //iat: jwt的签发时间
+                .setIssuedAt(now)
+                //代表这个JWT的主体,即它的所有人,这个是一个json格式的字符串,可以存放什么userid,roldid之类的,作为什么用户的唯一标志。
+                .setSubject(userName)
+                //设置签名使用的签名算法和签名使用的秘钥
+                .signWith(signatureAlgorithm, SECRET);
+
+        if (ttlMillis >= 0) {
+            long expMillis = nowMillis + ttlMillis;
+            Date exp = new Date(expMillis);
+            //设置过期时间
+            builder.setExpiration(exp);
+        }/*else{
+            //设置过期时间半小时
+            DateTime expDate = new DateTime().plusMinutes(30);
+            builder.setExpiration(expDate.toDate());
+        }*/
+        return builder.compact();
+    }
+
+    /**
+     * 获取用户id
+     */
+    public static Long getUserId(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim id = jwt.getClaim("id");
+        Assert.notNull(id, "token id is null ");
+        return id.asLong();
+    }
+
+
+    /**
+     * 管理者 ,0:是, 1:否
+     */
+    public static Boolean getUserManager(String token) {
+        DecodedJWT jwt = JWT.decode(token);
+        Claim id = jwt.getClaim("manager");
+        Assert.notNull(id, "token manager is null ");
+        Integer integer = id.asInt();
+        return integer == 0;
+    }
+
+    public static void main(String[] args) {
+//        test3();
+//        test2();
+        long nowMillis = System.currentTimeMillis();
+        System.out.println(nowMillis);
+        Date exp = new Date(nowMillis);
+        System.out.println(exp);
+    }
+
+    public static void test2() {
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGUiOlsiYWRtaW4iLCJyb290Il0sImlkIjoxLCJ1c2VyTmFtZSI6ImFkbWluIiwiaWF0IjoxNTgzODA5MzkzLCJqdGkiOiJkNjZiZTFkYi00MTQ0LTQxMTYtYTNlNi01ZDBjNjhlNTI3ODAifQ.-4AdsVP2RwmPS2grtO4aC8ov9PwkilzaGdThGetBJok";
+        System.out.println(getUserRole(token));
+
+    }
+
+    public static void test3() {
+        HashMap<String, Object> map = new HashMap<>();
+
+        ArrayList<Object> list = new ArrayList<>();
+        list.add("admin");
+        list.add("root");
+
+        map.put("userName", "admin");
+        map.put("id", Long.valueOf("1"));
+        map.put("role", list);
+
+        String token = createJWT(-1, map);
+        System.out.println(token);
+
+        Boolean isVerify = isVerify(token, "admin");
+        System.out.println(isVerify);
+
+    }
+
+    private static void testList() {
+        ArrayList<Object> list = new ArrayList<>();
+        list.add("admin");
+        list.add("root");
+    }
+
+    @Test
+    public void test1(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGUiOm51bGwsIm1hbmFnZXIiOm51bGwsImlkIjoxLCJ1c2VyTmFtZSI6ImFkbWluIiwiaWF0IjoxNTkwNzIzMDg3LCJqdGkiOiJmMzk5ODg1NC0xYTU3LTQzNmYtYmEwMC04MmVkNDZlOWJlMWYifQ.G6Or9DmW32_Q3pKGB1WCrTZgpRWQhUnZ1043gggEj1M";
+        String username = getUsername(token);
+        System.out.println(username);
+    }
+
+}

+ 110 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/shiro/MyRealm.java

@@ -0,0 +1,110 @@
+package com.gis.web.shiro;
+
+import com.gis.common.exception.JwtAuthenticationException;
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.service.SysUserService;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.SimpleAuthenticationInfo;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Service;
+
+/**
+ * 配置不校验的话,是不会走这个方法的
+ */
+@Log4j2
+@Service
+public class MyRealm extends AuthorizingRealm {
+
+
+
+    @Autowired
+    private RedisTemplate<String, String> redisTemplate;
+
+    @Autowired
+    private SysUserService userService;
+
+
+
+    /**
+     * 大坑!,必须重写此方法,不然Shiro会报错
+     */
+    @Override
+    public boolean supports(AuthenticationToken token) {
+        return token instanceof JWTToken;
+    }
+
+
+
+
+    /**
+     * 只有当需要检测用户权限的时候才会调用此方法,例如checkRole,checkPermission之类的
+     *
+     * principals: 是token
+     */
+    @Override
+    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
+        String username = JwtUtil.getUsername(principals.toString());
+
+        SysUserEntity dbUserEntity = userService.findByUserName(username);
+
+        SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
+
+
+        // 设置角色、权限
+//        simpleAuthorizationInfo.addRole(dbUserEntity.getRole());
+        return simpleAuthorizationInfo;
+    }
+
+
+    /**
+     * 默认使用此方法进行用户名正确与否验证,错误抛出异常即可。
+     */
+    @Override
+    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken auth) throws AuthenticationException {
+        String token = (String) auth.getCredentials();
+
+        if (StringUtils.isBlank(token)) {
+            log.error("header token is null ");
+            throw new JwtAuthenticationException(5001, "header token is null");
+        }
+
+
+        // 解密获得username,用于和数据库进行对比
+        String username = JwtUtil.getUsername(token);
+        if (username == null) {
+            log.error("error token username");
+            throw new JwtAuthenticationException(5001, "token invalid");
+        }
+
+        SysUserEntity userEntity = userService.findByUserName(username);
+        if (userEntity == null) {
+            log.error("error token userEntity");
+            throw new JwtAuthenticationException(5001, "User didn't existed!");
+        }
+
+        // 校验请求token是否跟redis token一致
+//        String redisToken = redisTemplate.opsForValue().get(TypeCode.REDIS_TOKEN + token);
+//        if (!token.equals(redisToken)) {
+//            log.error("redis token is null");
+//            throw new JwtAuthenticationException(5001, "redis token is null");
+//
+//        }
+
+
+        if (! JwtUtil.isVerify(token, username)) {
+            log.error("error token username or password");
+            throw new JwtAuthenticationException(5001, "token invalid");
+        }
+
+        return new SimpleAuthenticationInfo(token, token, "my_realm");
+    }
+}

+ 114 - 0
cesium_manage/gis_web/src/main/java/com/gis/web/shiro/ShiroConfig.java

@@ -0,0 +1,114 @@
+package com.gis.web.shiro;
+
+import lombok.extern.log4j.Log4j2;
+import org.apache.shiro.mgt.DefaultSessionStorageEvaluator;
+import org.apache.shiro.mgt.DefaultSubjectDAO;
+import org.apache.shiro.spring.LifecycleBeanPostProcessor;
+import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
+import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
+import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
+import org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+
+import javax.servlet.Filter;
+import java.util.HashMap;
+import java.util.Map;
+
+@Log4j2
+@Configuration
+public class ShiroConfig {
+
+    @Bean("securityManager")
+    public DefaultWebSecurityManager getManager(MyRealm realm) {
+        DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
+        // 使用自己的realm
+        manager.setRealm(realm);
+
+        /*
+         * 关闭shiro自带的session,详情见文档
+         * http://shiro.apache.org/session-management.html#SessionManagement-StatelessApplications%28Sessionless%29
+         */
+        DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
+        DefaultSessionStorageEvaluator defaultSessionStorageEvaluator = new DefaultSessionStorageEvaluator();
+        defaultSessionStorageEvaluator.setSessionStorageEnabled(false);
+        subjectDAO.setSessionStorageEvaluator(defaultSessionStorageEvaluator);
+        manager.setSubjectDAO(subjectDAO);
+
+        return manager;
+    }
+
+    @Bean("shiroFilter")
+    public ShiroFilterFactoryBean factory(DefaultWebSecurityManager securityManager) {
+        ShiroFilterFactoryBean factoryBean = new ShiroFilterFactoryBean();
+
+        // 添加自己的过滤器并且取名为jwt
+        Map<String, Filter> filterMap = new HashMap<>();
+        filterMap.put("jwt", new JWTFilter());
+
+
+
+
+        factoryBean.setFilters(filterMap);
+
+        factoryBean.setSecurityManager(securityManager);
+        factoryBean.setUnauthorizedUrl("/401");
+
+        /*
+         * 自定义url规则
+         * http://shiro.apache.org/web.html#urls-
+         */
+        Map<String, String> filterRuleMap = new HashMap<>();
+
+        // 不拦截
+        filterRuleMap.put("/login", "anon");
+        filterRuleMap.put("/logout", "anon");
+        filterRuleMap.put("/admin", "anon");
+        filterRuleMap.put("/admin/login", "anon");
+        filterRuleMap.put("/test/**", "anon");
+
+
+        // swagger 不拦截
+        filterRuleMap.put("/swagger-resources/**", "anon");
+        filterRuleMap.put("/webjars/**", "anon");
+        filterRuleMap.put("/v2/**", "anon");
+        filterRuleMap.put("/swagger-ui.html/**", "anon");
+
+
+        // 所有请求通过我们自己的JWT Filter
+        filterRuleMap.put("/manage/**", "jwt");
+
+
+        // 访问401和404页面不通过我们的Filter
+        filterRuleMap.put("/401", "anon");
+        factoryBean.setFilterChainDefinitionMap(filterRuleMap);
+        return factoryBean;
+    }
+
+    /**
+     * 下面的代码是添加注解支持
+     */
+    @Bean
+    @DependsOn("lifecycleBeanPostProcessor")
+    public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() {
+        DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
+        // 强制使用cglib,防止重复代理和可能引起代理出错的问题
+        // https://zhuanlan.zhihu.com/p/29161098
+        defaultAdvisorAutoProxyCreator.setProxyTargetClass(true);
+        return defaultAdvisorAutoProxyCreator;
+    }
+
+    @Bean
+    public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() {
+        return new LifecycleBeanPostProcessor();
+    }
+
+    @Bean
+    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(DefaultWebSecurityManager securityManager) {
+        AuthorizationAttributeSourceAdvisor advisor = new AuthorizationAttributeSourceAdvisor();
+        advisor.setSecurityManager(securityManager);
+        return advisor;
+    }
+
+}

+ 255 - 0
cesium_manage/pom.xml

@@ -0,0 +1,255 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- museum parent-->
+    <groupId>com.gis</groupId>
+    <artifactId>cesium_manage</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0.0</version>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.0.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+
+    <modules>
+        <module>gis_common</module>
+        <module>gis_web</module>
+        <module>gis_domain</module>
+        <module>gis_service</module>
+        <module>gis_mapper</module>
+        <module>gis_application</module>
+    </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <spring.boot.version>2.1.0.RELEASE</spring.boot.version>
+        <gis.version>1.0.0</gis.version>
+        <fastjson.version>1.2.51</fastjson.version>
+        <druid.version>1.1.14</druid.version>
+        <hutool.version>5.3.3</hutool.version>
+        <lombok.version>1.18.2</lombok.version>
+        <lang3.version>3.7</lang3.version>
+        <mysql.version>8.0.15</mysql.version>
+        <shiro.version>1.4.0</shiro.version>
+        <jwt.version>3.2.0</jwt.version>
+        <jjwt.version>0.6.0</jjwt.version>
+        <aliyun.core.version>4.0.3</aliyun.core.version>
+        <aliyun.dysmsapi.version>1.1.0</aliyun.dysmsapi.version>
+        <aliyun.oss.version>2.5.0</aliyun.oss.version>
+        <tk.mybatis.version>2.0.2</tk.mybatis.version>
+        <tk.mapper.version>4.0.3</tk.mapper.version>
+        <pagehelper.version>1.2.5</pagehelper.version>
+        <knife4j.version>2.0.2</knife4j.version>
+        <junit.version>4.12</junit.version>
+
+    </properties>
+
+
+    <!--dependencyManagement用于管理依赖版本号, 必须写版本号,不然依赖不上-->
+    <dependencyManagement>
+        <dependencies>
+
+            <!--模块版本管理-->
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_application</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_common</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_domain</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_service</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_mapper</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_web</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+
+            <!-- springboot -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-data-jpa</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-web</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-test</artifactId>
+                <scope>test</scope>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <!--springboot中的redis依赖-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-data-redis</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <!--rabbit MQ-->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.boot</groupId>-->
+                <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+                <!--<version>${spring.boot.version}</version>-->
+            <!--</dependency>-->
+
+            <!-- lombok -->
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+            </dependency>
+
+            <!-- fastjson -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+
+            <!--阿里数据库连接池 -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+
+            <!-- mysql -->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+
+            <!-- 工具类 -->
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-all</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+
+            <!-- StringUtils -->
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${lang3.version}</version>
+            </dependency>
+
+            <!-- knife4j aip 包-->
+            <dependency>
+                <groupId>com.github.xiaoymin</groupId>
+                <artifactId>knife4j-spring-boot-starter</artifactId>
+                <version>${knife4j.version}</version>
+            </dependency>
+
+            <!-- shiro -->
+            <dependency>
+                <groupId>org.apache.shiro</groupId>
+                <artifactId>shiro-spring</artifactId>
+                <version>${shiro.version}</version>
+            </dependency>
+
+
+            <!-- jwt -->
+            <dependency>
+                <groupId>com.auth0</groupId>
+                <artifactId>java-jwt</artifactId>
+                <version>${jwt.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>io.jsonwebtoken</groupId>
+                <artifactId>jjwt</artifactId>
+                <version>${jjwt.version}</version>
+            </dependency>
+
+            <!--aliyun sdk-->
+            <dependency>
+                <groupId>com.aliyun</groupId>
+                <artifactId>aliyun-java-sdk-core</artifactId>
+                <version>${aliyun.core.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.aliyun</groupId>
+                <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+                <version>${aliyun.dysmsapi.version}</version>
+            </dependency>
+
+            <!--aliyun oss-->
+            <dependency>
+                <groupId>com.aliyun.oss</groupId>
+                <artifactId>aliyun-sdk-oss</artifactId>
+                <version>${aliyun.oss.version}</version>
+            </dependency>
+
+            <!--tk.mybatis 依赖-->
+            <dependency>
+                <groupId>tk.mybatis</groupId>
+                <artifactId>mapper-spring-boot-starter</artifactId>
+                <version>${tk.mybatis.version}</version>
+                <!-- tk.mybatis 跟springboot jap 包冲突-->
+                <exclusions>
+                    <exclusion>
+                        <groupId>javax.persistence</groupId>
+                        <artifactId>persistence-api</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+
+
+            <!--分页插件-->
+            <dependency>
+                <groupId>com.github.pagehelper</groupId>
+                <artifactId>pagehelper-spring-boot-starter</artifactId>
+                <version>${pagehelper.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>${junit.version}</version>
+            </dependency>
+
+
+        </dependencies>
+    </dependencyManagement>
+
+
+</project>

文件差异内容过多而无法显示
+ 26 - 0
cesium_manage/remark.md


+ 0 - 0
gmap/CHANGELOG.md


部分文件因为文件数量过多而无法显示