Sfoglia il codice sorgente

全景看看首次提交

wuweihao 4 anni fa
commit
69b44aae62
100 ha cambiato i file con 7602 aggiunte e 0 eliminazioni
  1. 275 0
      720yun_fd_consumer/pom.xml
  2. 3 0
      720yun_fd_consumer/remark.md
  3. 14 0
      720yun_fd_consumer/src/main/java/com/gis/ConsumerApplication.java
  4. 13 0
      720yun_fd_consumer/src/main/java/com/gis/ServletInitializer.java
  5. 31 0
      720yun_fd_consumer/src/main/java/com/gis/constant/CmdConstant.java
  6. 42 0
      720yun_fd_consumer/src/main/java/com/gis/constant/ConfigConstant.java
  7. 105 0
      720yun_fd_consumer/src/main/java/com/gis/constant/RabbitConfig.java
  8. 41 0
      720yun_fd_consumer/src/main/java/com/gis/controller/TestController.java
  9. 38 0
      720yun_fd_consumer/src/main/java/com/gis/entity/BaseEntity.java
  10. 52 0
      720yun_fd_consumer/src/main/java/com/gis/entity/FodderEntity.java
  11. 96 0
      720yun_fd_consumer/src/main/java/com/gis/listener/Fd720Listener.java
  12. 14 0
      720yun_fd_consumer/src/main/java/com/gis/mapper/FodderMapper.java
  13. 17 0
      720yun_fd_consumer/src/main/java/com/gis/mapper/IBaseMapper.java
  14. 238 0
      720yun_fd_consumer/src/main/java/com/gis/util/AliyunOssUtil.java
  15. 128 0
      720yun_fd_consumer/src/main/java/com/gis/util/CmdUtils.java
  16. 78 0
      720yun_fd_consumer/src/main/java/com/gis/util/FileUtils.java
  17. 34 0
      720yun_fd_consumer/src/main/java/com/gis/util/RandomUtils.java
  18. 101 0
      720yun_fd_consumer/src/main/java/com/gis/util/Result.java
  19. 61 0
      720yun_fd_consumer/src/main/java/com/gis/util/StreamGobbler.java
  20. 78 0
      720yun_fd_consumer/src/main/resources/application-dev.properties
  21. 76 0
      720yun_fd_consumer/src/main/resources/application-loc.properties
  22. 78 0
      720yun_fd_consumer/src/main/resources/application-sit.properties
  23. 35 0
      720yun_fd_consumer/src/main/resources/application.properties
  24. 156 0
      720yun_fd_consumer/src/main/resources/logback-spring.xml
  25. 4 0
      720yun_fd_consumer/src/main/resources/static/ossupload.sh
  26. 11 0
      720yun_fd_consumer/src/main/resources/static/shutdown.sh
  27. 29 0
      720yun_fd_consumer/src/main/resources/static/start.sh
  28. 19 0
      720yun_fd_consumer/src/test/java/com/gis/server/impl/SceneServiceImplTest.java
  29. 47 0
      720yun_fd_manage/gis_application/pom.xml
  30. 13 0
      720yun_fd_manage/gis_application/src/main/java/com/gis/GisApplication.java
  31. 13 0
      720yun_fd_manage/gis_application/src/main/java/com/gis/ServletInitializer.java
  32. 100 0
      720yun_fd_manage/gis_application/src/main/resources/application-dev.properties
  33. 105 0
      720yun_fd_manage/gis_application/src/main/resources/application-loc.properties
  34. 100 0
      720yun_fd_manage/gis_application/src/main/resources/application-sit.properties
  35. 39 0
      720yun_fd_manage/gis_application/src/main/resources/application.properties
  36. BIN
      720yun_fd_manage/gis_application/src/main/resources/img/kankan_icon.png
  37. 156 0
      720yun_fd_manage/gis_application/src/main/resources/logback-spring.xml
  38. 151 0
      720yun_fd_manage/gis_common/pom.xml
  39. 53 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  40. 140 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/RabbitConfig.java
  41. 95 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/Swagger2.java
  42. 78 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java
  43. 17 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/constant/CmdConstant.java
  44. 65 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/constant/ConfigConstant.java
  45. 10 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/constant/TypeCode.java
  46. 35 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java
  47. 34 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java
  48. 137 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JWTFilter.java
  49. 23 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JWTToken.java
  50. 275 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JwtUtil.java
  51. 112 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/MyRealm.java
  52. 114 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/ShiroConfig.java
  53. 29 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/task/AsyncTask.java
  54. 44 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/task/TaskExecutePool.java
  55. 97 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/test/ImageUtil.java
  56. 258 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java
  57. 168 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/CmdUtils.java
  58. 780 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/FileUtils.java
  59. 359 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/HttpUtils.java
  60. 43 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/ImageUtil.java
  61. 194 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/PasswordUtils.java
  62. 120 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/QrCodeUtils.java
  63. 48 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/RandomUtils.java
  64. 101 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/Result.java
  65. 215 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/SnowFlakeUUidUtils.java
  66. 61 0
      720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/StreamGobbler.java
  67. BIN
      720yun_fd_manage/gis_common/src/main/resources/img/kankan_icon.png
  68. 22 0
      720yun_fd_manage/gis_domain/pom.xml
  69. 32 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/CatalogDto.java
  70. 29 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/EditSomeDataDto.java
  71. 20 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java
  72. 15 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/FodderPageDto.java
  73. 27 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/PageDateDto.java
  74. 26 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/PageDto.java
  75. 40 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/SceneDto.java
  76. 23 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/UseHotsDto.java
  77. 60 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/VrModelDto.java
  78. 56 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/WorkDto.java
  79. 22 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/XmlDataDto.java
  80. 41 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java
  81. 40 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/CatalogEntity.java
  82. 59 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/FodderEntity.java
  83. 96 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/SceneEntity.java
  84. 58 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java
  85. 69 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/WorkEntity.java
  86. 97 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/vo/CatalogSceneTree.java
  87. 38 0
      720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/vo/ProSceneVo.java
  88. 22 0
      720yun_fd_manage/gis_mapper/pom.xml
  89. 33 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/CatalogMapper.java
  90. 30 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/FodderMapper.java
  91. 18 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java
  92. 89 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java
  93. 27 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  94. 22 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/WorkMapper.java
  95. 38 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/FodderProvider.java
  96. 76 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/SceneProvider.java
  97. 33 0
      720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/WorkProvider.java
  98. 23 0
      720yun_fd_manage/gis_service/pom.xml
  99. 25 0
      720yun_fd_manage/gis_service/src/main/java/com/gis/listener/TestConsumer.java
  100. 0 0
      720yun_fd_manage/gis_service/src/main/java/com/gis/service/CatalogService.java

+ 275 - 0
720yun_fd_consumer/pom.xml

@@ -0,0 +1,275 @@
+<?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>
+
+    <groupId>com.gis</groupId>
+    <artifactId>720yun_fd_consumer</artifactId>
+    <!--<packaging>war</packaging>-->
+    <packaging>jar</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>
+
+    <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>
+        <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>-->
+        <dependencies>
+            <!-- spring-cloud-->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.cloud</groupId>-->
+                <!--<artifactId>spring-cloud-dependencies</artifactId>-->
+                <!--<version>Greenwich.SR2</version>-->
+                <!--<type>pom</type>-->
+                <!--<scope>import</scope>-->
+            <!--</dependency>-->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.cloud</groupId>-->
+                <!--<artifactId>spring-cloud-alibaba-dependencies</artifactId>-->
+                <!--<version>0.9.0.RELEASE</version>-->
+                <!--<type>pom</type>-->
+                <!--<scope>import</scope>-->
+            <!--</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>
+
+            <!-- rocketmq -->
+            <!--<dependency>-->
+            <!--<groupId>org.apache.rocketmq</groupId>-->
+            <!--<artifactId>rocketmq-spring-boot-starter</artifactId>-->
+            <!--<version>2.1.1</version>-->
+            <!--</dependency>-->
+
+
+            <!--rabbit MQ-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-amqp</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <!-- nacos 注册中心依赖 -->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.cloud</groupId>-->
+                <!--<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
+                <!--<version>0.9.0.RELEASE</version>-->
+                <!--&lt;!&ndash;<version>2.1.0.RELEASE</version>&ndash;&gt;-->
+            <!--</dependency>-->
+
+
+
+            <!-- openfeign -->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.cloud</groupId>-->
+                <!--<artifactId>spring-cloud-starter-openfeign</artifactId>-->
+                <!--<version>2.1.0.RELEASE</version>-->
+            <!--</dependency>-->
+
+            <!-- openfeign 调用需要加这个依赖 -->
+            <!--<dependency>-->
+                <!--<groupId>com.netflix.archaius</groupId>-->
+                <!--<artifactId>archaius-core</artifactId>-->
+                <!--<version>0.7.6</version>-->
+                <!--<exclusions>-->
+                    <!--<exclusion>-->
+                        <!--<groupId>com.google.guava</groupId>-->
+                        <!--<artifactId>guava</artifactId>-->
+                    <!--</exclusion>-->
+                <!--</exclusions>-->
+            <!--</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>-->
+
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+        <finalName>720yun_fd_consumer</finalName>
+    </build>
+
+
+</project>

+ 3 - 0
720yun_fd_consumer/remark.md

@@ -0,0 +1,3 @@
+# 切图命令
+ 1. ./krpanotools makepano -config=templates/vtour-multires.config /root/user/owen_test/krpano/test.jpg
+ 2. krpanotools makepano -config=templates/vtour-multires.config /root/owen/720yun/test.jpg

+ 14 - 0
720yun_fd_consumer/src/main/java/com/gis/ConsumerApplication.java

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

+ 13 - 0
720yun_fd_consumer/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(ConsumerApplication.class);
+//    }
+//
+//}

+ 31 - 0
720yun_fd_consumer/src/main/java/com/gis/constant/CmdConstant.java

@@ -0,0 +1,31 @@
+package com.gis.constant;
+
+
+/**
+ * Created by owen on 2020/12/31 0031 14:22
+ *
+ */
+public class CmdConstant {
+
+
+    /** krpano 全景矢量切图 */
+    public final static String PANO_KRPANO = "krpanotools makepano -config=templates/vtour-multires.config ";
+
+    /**
+     * ossUtil上传目录
+     * ./ossutil cp -r localfolder/ oss://examplebucket/desfolder/
+     * opt/ossutil/ossutil64 cp -r /root/owen/720yun/vtour/ oss://oss-xiaoan/720yun_fd_manage/
+     *
+     */
+//    public final static String OSSUTIL_UPLOAD_DIR = "/opt/ossutil/ossutil64 cp -r /mnt/720yun_fd_manage_data/@sceneCode oss://oss-xiaoan/720yun_fd_manage/@sceneCode";
+
+    /**
+     * 用脚本的好处会自动结束线程, java直接跑命令容易出问题
+     * 调用oss上传目录脚本
+     * bash /opt/ossutil/ossupload.sh @dir @ossDir
+     *  bash /opt/ossutil/ossupload.sh /mnt/720yun_fd_manage_data/fd720_1A4Tba8mA 720yun_fd_manage/fd720_1A4Tba8mA
+     */
+//    public final static String OSSUTIL_UPLOAD_DIR = "bash /opt/ossutil/ossupload.sh /mnt/720yun_fd_manage_data/@sceneCode 720yun_fd_manage/@sceneCode";
+    public final static String OSSUTIL_UPLOAD_DIR = "bash /root/user/java/720yun_fd_consumer_8002/ossupload.sh /mnt/720yun_fd_manage_data/@sceneCode 720yun_fd_manage/@sceneCode";
+
+}

+ 42 - 0
720yun_fd_consumer/src/main/java/com/gis/constant/ConfigConstant.java

@@ -0,0 +1,42 @@
+package com.gis.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("${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;
+
+
+}

+ 105 - 0
720yun_fd_consumer/src/main/java/com/gis/constant/RabbitConfig.java

@@ -0,0 +1,105 @@
+package com.gis.constant;
+
+import org.springframework.amqp.core.*;
+import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
+import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+
+/**
+ * 即时队列
+ */
+
+@Configuration
+public class RabbitConfig {
+
+    @Value("${spring.rabbitmq.address}")
+    private String address;
+
+    @Value("${spring.rabbitmq.username}")
+    private String username;
+
+    @Value("${spring.rabbitmq.password}")
+    private String password;
+
+//    @Value("${rabbitmq.queue}")
+//    private String queue;
+
+
+
+    /** 全景图队列*/
+    public static final String PANO_QUEUE = "720FdQueue";
+
+    /** 全景图交换机*/
+    public static final String PANO_EXCHANGE = "720FdExchange";
+
+    /** 全景图交换机路由*/
+    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
+
+
+
+
+
+
+    /**
+     * 全景图模型队列
+     */
+    @Bean
+    public Queue panoQueue() {
+        return new Queue(PANO_QUEUE);
+    }
+
+    /**
+     * 全景图交换机
+     */
+    @Bean
+    public Exchange panoExchange(){
+        return new DirectExchange(PANO_EXCHANGE, true, false);
+    }
+
+
+    /**
+     * 全景图队列绑定交换机
+     */
+    @Bean
+    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
+        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
+    }
+
+
+    /**
+     * 以下三个方法是配置集群
+     * @return
+     */
+    @Bean
+    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
+        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+        factory.setConnectionFactory(connectionFactory());
+        factory.setPrefetchCount(1);
+        return factory;
+    }
+
+    @Bean
+    public ConnectionFactory connectionFactory() {
+        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+        connectionFactory.setAddresses(address);
+        connectionFactory.setUsername(username);
+        connectionFactory.setPassword(password);
+        connectionFactory.setVirtualHost("/");
+        connectionFactory.setPublisherConfirms(true);
+        return connectionFactory;
+    }
+
+    @Bean
+    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+    public RabbitTemplate rabbitTemplate() {
+        return new RabbitTemplate(connectionFactory());
+    }
+
+
+}

+ 41 - 0
720yun_fd_consumer/src/main/java/com/gis/controller/TestController.java

@@ -0,0 +1,41 @@
+package com.gis.controller;
+
+import com.gis.util.Result;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by owen on 2021/1/13 0013 14:45
+ */
+@Slf4j
+@RestController
+@RequestMapping("aa")
+public class TestController {
+
+
+    @GetMapping("bb")
+    private Result addHouse(){
+        log.info("run addHouse");
+        test();
+
+        return Result.success();
+
+    }
+
+    @Async("taskExecutor")
+    public void test(){
+
+        try {
+            log.info("start");
+            Thread.sleep(5000);
+            log.info("end");
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+}

+ 38 - 0
720yun_fd_consumer/src/main/java/com/gis/entity/BaseEntity.java

@@ -0,0 +1,38 @@
+package com.gis.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;
+
+    /**
+     * 用来批量操作的
+     * 0代表未删除 , 1代表已经删除,默认写0
+     */
+    @JsonIgnore
+    @JSONField(serialize = false)
+    private Integer isDelete;
+}

+ 52 - 0
720yun_fd_consumer/src/main/java/com/gis/entity/FodderEntity.java

@@ -0,0 +1,52 @@
+package com.gis.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 = "tb_fodder")
+public class FodderEntity extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = -1428200960867373738L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "存放地址")
+    private String filePath;
+
+    @ApiModelProperty(value = "oss存放地址")
+    private String ossPath;
+
+    @ApiModelProperty(value = "状态 1:切图中, 2:失败, 3:完成")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型, 全景图:pano, 图片:image, 音频:audio, 视频:video")
+    private String type;
+
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件大小,单位MB")
+    private String fileSize;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+
+
+
+
+
+
+}

+ 96 - 0
720yun_fd_consumer/src/main/java/com/gis/listener/Fd720Listener.java

@@ -0,0 +1,96 @@
+package com.gis.listener;
+
+import com.gis.constant.CmdConstant;
+import com.gis.constant.ConfigConstant;
+import com.gis.constant.RabbitConfig;
+import com.gis.entity.FodderEntity;
+import com.gis.mapper.FodderMapper;
+import com.gis.util.CmdUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+import org.springframework.amqp.rabbit.annotation.RabbitHandler;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+
+/**
+ * Created by owen on 2021/1/12 0012 10:05
+ */
+@Slf4j
+@Component
+@RabbitListener(queues = RabbitConfig.PANO_QUEUE) // 指定监听队列
+public class Fd720Listener {
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    @Autowired
+    FodderMapper fodderMapper;
+
+
+
+    @RabbitHandler
+    public void getMessage(Long param)  {
+        log.warn("run Fd720Listener: " + param);
+        cmdPano(param);
+        log.warn("end Fd720Listener: "+ param);
+    }
+
+
+    public void cmdPano(Long id) {
+        log.info("start task cmdPano");
+        FodderEntity entity = fodderMapper.selectByPrimaryKey(id);
+        if (entity == null) {
+            log.error("场景不存在: " + id);
+            // 直接结束,抛异常的话,会造成死循环,产生大量日志,而且队列也跑不下去
+            return;
+        }
+        try {
+
+            // 切图
+            long start = System.currentTimeMillis();
+            String panoPath = entity.getFilePath();
+            String sceneCode = entity.getSceneCode();
+            String cmd = CmdConstant.PANO_KRPANO + panoPath;
+            log.info("cmd: " + cmd);
+            CmdUtils.cmdPano(cmd);
+            long end = System.currentTimeMillis();
+            log.info("切图完成耗时: {} s" ,(end-start)/1000);
+            uploadOss(sceneCode);
+            entity.setStatus(3);
+        }  catch (Exception e) {
+            entity.setStatus(2);
+            e.printStackTrace();
+        } finally {
+            fodderMapper.updateByPrimaryKey(entity);
+        }
+
+    }
+
+    /**
+     * 上传切图目录
+     */
+    public void uploadOss(String sceneCode){
+        String cmd = CmdConstant.OSSUTIL_UPLOAD_DIR;
+        cmd = cmd.replaceAll("@sceneCode", sceneCode);
+        log.info("ossCmd: " + cmd);
+        long start = System.currentTimeMillis();
+        CmdUtils.callshell(cmd);
+        long end = System.currentTimeMillis();
+        log.info("切图上传完成, 耗时:{} s" , (end-start)/1000 );
+    }
+
+    @Test
+    public void test(){
+        CmdUtils.callshell("ipconfig");
+    }
+
+
+
+
+
+
+
+}

+ 14 - 0
720yun_fd_consumer/src/main/java/com/gis/mapper/FodderMapper.java

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

+ 17 - 0
720yun_fd_consumer/src/main/java/com/gis/mapper/IBaseMapper.java

@@ -0,0 +1,17 @@
+package com.gis.mapper;
+
+import com.gis.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> {
+}

+ 238 - 0
720yun_fd_consumer/src/main/java/com/gis/util/AliyunOssUtil.java

@@ -0,0 +1,238 @@
+package com.gis.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.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;
+
+    @Autowired
+    FileUtils fileUtils;
+
+
+//    private static final String END_POINT = "http://oss-cn-shenzhen.aliyuncs.com";
+//    private static final String ACCESS_KEY_ID = "LTAIUrvuHqj8pvry";
+//    private static final String ACCESS_KEY_SECREY = "JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4";
+//    private static final String BUCKET_NAME = "oss-xiaoan";
+
+    // 加载对象
+//    private static OSSClient ossClient = new OSSClient(END_POINT, ACCESS_KEY_ID, ACCESS_KEY_SECREY);
+//    private static OSSClient ossClient = new OSSClient(END_POINT, ACCESS_KEY_ID, ACCESS_KEY_SECREY);
+
+    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);
+        } 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) {
+            int i = 1;
+            for (String filePath : filepaths.keySet()) {
+                if (i%100 == 0) {
+
+                    log.info("i= " +i + ", 文件:" + filePath + "到阿里云:" + filepaths.get(filePath));
+                }
+                upload2(filePath, filepaths.get(filePath));
+                i ++ ;
+            }
+            log.info("上传文件数量:"+ i);
+        } else {
+            for (String filePath : filepaths.keySet()) {
+                log.debug("文件:" + 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();
+    }
+
+
+
+    /**
+     * 上传目录到oss
+     * @param dirPath 目录地址
+     * @param sceneCode 场景码
+     * @param ossBasePath oss基础地址
+     * @throws IOException
+     */
+    public void uploadDir(String dirPath, String sceneCode, String ossBasePath, String houseId) throws IOException {
+//        Map map = FileUtils.eachFile(dirPath, sceneCode, ossBasePath, houseId);
+        Map map = fileUtils.eachFile(dirPath, sceneCode, ossBasePath, houseId);
+
+        uploadMulFiles(map);
+        log.info("oss上传完成");
+    }
+
+
+
+
+
+    /**
+     * 通过文件名判断并获取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();
+    }
+
+
+
+
+
+}

+ 128 - 0
720yun_fd_consumer/src/main/java/com/gis/util/CmdUtils.java

@@ -0,0 +1,128 @@
+package com.gis.util;
+
+import cn.hutool.core.util.RuntimeUtil;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+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 {
+
+
+    /**
+     * 调用算法 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 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;
+
+    }
+
+
+    /**
+     * 命令运行结果 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;
+        int i = 1;
+        while ((line = br.readLine()) != null) {
+
+            // 查看执行日志
+            if (i % 200 == 0) {
+                log.info("line, i=" + i +", " +line);
+            }
+
+            if (line.contains("done.")) {
+                log.info("line: {}", line);
+            }
+            i++;
+        }
+        log.info("执行总行数:" +i);
+
+        // 结束命令行
+        int isCmd = exec.waitFor();
+
+        // 关闭流
+        br.close();
+        errorBuf.close();
+
+        return isCmd;
+
+    }
+
+
+
+
+}

+ 78 - 0
720yun_fd_consumer/src/main/java/com/gis/util/FileUtils.java

@@ -0,0 +1,78 @@
+package com.gis.util;
+
+import cn.hutool.core.io.FileUtil;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Log4j2
+@Component
+public class FileUtils {
+
+
+
+    /***
+     * 遍历每一个文件路径
+     * dirPath :目录路径
+     * eachFile
+     * 作用上传oss
+     */
+    public  Map eachFile(String dirPath, String sceneCode, String ossBasePath, String houseId)  {
+        if (!FileUtil.isDirectory(dirPath)) {
+            log.error("目录不存在, dirPath: " + dirPath);
+//            new BaseRuntimeException("文件不存在");
+
+        }
+        File file = new File(dirPath);
+
+        HashMap<String, String> result = new HashMap<>();
+        dfs(file, sceneCode, ossBasePath, result, houseId);
+        return result;
+    }
+
+    /**
+     * 递归解析
+     * @param file
+     * @param sceneCode
+     * @param ossBasePath
+     * @return
+     * @throws IOException
+     */
+    public void dfs(File file, String sceneCode, String ossBasePath, HashMap<String, String> result, String houseId) {
+
+        File[] files = file.listFiles();
+        for (File every : files) {
+            // 是文件
+            if (every.isFile()) {
+                String filePath = every.getAbsolutePath();
+
+//                String ossPath = StringUtils.substringAfterLast(filePath, sceneCode);
+                String ossPath = StringUtils.substringAfter(filePath, sceneCode);
+                ossPath = ossBasePath + houseId + "/" + sceneCode + ossPath;
+                result.put(filePath, ossPath);
+
+                // 是目录
+            } else {
+                dfs(every, sceneCode, ossBasePath, result, houseId);
+            }
+        }
+    }
+
+    @Test
+    public void test1(){
+        String dirPath = "F:\\test\\bigScene\\";
+        if (!FileUtil.isDirectory(dirPath)) {
+            log.warn("文件不存在, dirPath: " + dirPath);
+        }
+    }
+
+
+}

+ 34 - 0
720yun_fd_consumer/src/main/java/com/gis/util/RandomUtils.java

@@ -0,0 +1,34 @@
+package com.gis.util;
+
+import cn.hutool.core.util.RandomUtil;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by owen on 2020/4/26 0026 10:07
+ *
+ *
+ */
+@Component
+public class RandomUtils {
+
+    public static String randowString(int length){
+        String baseString = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+        return RandomUtil.randomString(baseString, length);
+    }
+
+    public static void main(String[] args) {
+        System.out.println(randowString(9));
+    }
+
+    /**
+     * 分布式id
+     * preStr: 8位id前缀
+     * @return
+     */
+
+
+    private static String randowInt(int length){
+        String baseString = "0123456789";
+        return RandomUtil.randomString(baseString, length);
+    }
+}

+ 101 - 0
720yun_fd_consumer/src/main/java/com/gis/util/Result.java

@@ -0,0 +1,101 @@
+package com.gis.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 + "]";
+    }
+}

+ 61 - 0
720yun_fd_consumer/src/main/java/com/gis/util/StreamGobbler.java

@@ -0,0 +1,61 @@
+package com.gis.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;  
+            while ( (line = br.readLine()) != null) {  
+                if (pw != null)  
+                    pw.println(line);  
+                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();  
+            }  
+        }  
+    }  
+}

+ 78 - 0
720yun_fd_consumer/src/main/resources/application-dev.properties

@@ -0,0 +1,78 @@
+
+#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://127.0.0.1:3306/720yun_fd_manage?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkk2021testproject%
+
+
+# \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
+
+
+
+#rabbit MQ
+#spring.rabbitmq.host=10.1.30.120
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=root
+#spring.rabbitmq.password=root
+
+#rabbit MQ\uFFFD\uFFFD\u023A
+spring.rabbitmq.address=127.0.0.1:5672
+spring.rabbitmq.username=admin
+spring.rabbitmq.password=admin123
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+
+# oss info
+#oss.point=http://oss-cn-shenzhen.aliyuncs.com
+# \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=720yun_fd_manage/
+oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+
+
+#log
+logging.path=/root/data/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=info
+
+
+# \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=/mnt/720yun_fd_manage_data/
+
+
+
+

+ 76 - 0
720yun_fd_consumer/src/main/resources/application-loc.properties

@@ -0,0 +1,76 @@
+
+
+#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/cms_pano_manage_fd?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
+
+#rabbit MQ
+#spring.rabbitmq.host=localhost
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=guest
+#spring.rabbitmq.password=guest
+
+# rabbitmq \uFFFD\uFFFD\u023A\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.address=127.0.0.1:5672
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+# oss info
+oss.point=http://oss-cn-shenzhen.aliyuncs.com
+oss.key=LTAIUrvuHqj8pvry
+oss.secrecy=JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4
+oss.bucket=oss-xiaoan
+oss.type=oss
+oss.file.path=cms_pano_fcb//
+oss.domain=http://ossxiaoan.4dage.com/
+
+
+
+#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=192
+
+
+
+

+ 78 - 0
720yun_fd_consumer/src/main/resources/application-sit.properties

@@ -0,0 +1,78 @@
+
+#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://127.0.0.1:3306/720yun_fd_manage?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkk2020test%
+
+
+# \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
+
+
+
+#rabbit MQ
+#spring.rabbitmq.host=10.1.30.120
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=root
+#spring.rabbitmq.password=root
+
+#rabbit MQ\uFFFD\uFFFD\u023A
+spring.rabbitmq.address=127.0.0.1:5672
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+
+# oss info
+#oss.point=http://oss-cn-shenzhen.aliyuncs.com
+# \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=720yun_fd_manage/
+oss.domain=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+
+
+#log
+logging.path=/root/data/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=info
+
+
+# \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=/mnt/720yun_fd_manage_data/
+
+
+
+

+ 35 - 0
720yun_fd_consumer/src/main/resources/application.properties

@@ -0,0 +1,35 @@
+server.port=8002
+spring.profiles.active=dev
+
+
+# \uFFFD\uFFFD\u013F\uFFFD\uFFFD\uFFFD\uFFFD
+project.name=720yun_fd_consumer
+
+# \uFFFD\uFFFD\u032C\uFFFD\uFFFD\u0534\uFFFD\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/
+
+# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u013C\uFFFD\uFFFD\u03F4\uFFFD\uFFFD\uFFFD\u0421
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=256MB
+spring.servlet.multipart.max-request-size=256MB
+
+
+
+#\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
720yun_fd_consumer/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>

+ 4 - 0
720yun_fd_consumer/src/main/resources/static/ossupload.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+directory=$1
+fileurl=$2
+/opt/ossutil/ossutil64 cp \-rf $directory oss://oss-xiaoan/$fileurl  

+ 11 - 0
720yun_fd_consumer/src/main/resources/static/shutdown.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+RESOURCE_NAME=720yun_fd_consumer.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
720yun_fd_consumer/src/main/resources/static/start.sh

@@ -0,0 +1,29 @@
+#!/bin/sh
+RESOURCE_NAME=720yun_fd_consumer.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!

+ 19 - 0
720yun_fd_consumer/src/test/java/com/gis/server/impl/SceneServiceImplTest.java

@@ -0,0 +1,19 @@
+package com.gis.server.impl;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Created by owen on 2021/1/12 0012 11:53
+ */
+public class SceneServiceImplTest {
+
+    @Test
+    public void getBaseMapper() {
+    }
+
+    @Test
+    public void cmdPano() {
+    }
+}

+ 47 - 0
720yun_fd_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>
+
+
+
+
+    <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>
+
+    <parent>
+        <groupId>com.gis</groupId>
+        <artifactId>720yun_fd_manage</artifactId>
+        <version>1.0.0</version>
+    </parent>
+
+    <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>720yun_fd_manage</finalName>
+    </build>
+
+
+
+</project>

+ 13 - 0
720yun_fd_manage/gis_application/src/main/java/com/gis/GisApplication.java

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

+ 13 - 0
720yun_fd_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(GisApplication.class);
+//    }
+//
+//}

+ 100 - 0
720yun_fd_manage/gis_application/src/main/resources/application-dev.properties

@@ -0,0 +1,100 @@
+spring.application.name=pano-service
+spring.cloud.nacos.discovery.server-addr=8.135.98.231:8848
+
+#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://127.0.0.1:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkk2021testproject%
+
+
+# \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 \uFFFD\u05B2\uFFFD\u02BD\uFFFD\uFFFD
+spring.redis.cluster.nodes=127.0.0.1:6379
+spring.redis.database=0
+spring.redis.password=
+spring.redis.timeout=3000ms
+spring.redis.jedis.pool.max-idle=8
+spring.redis.jedis.pool.min-idle=0
+spring.redis.jedis.pool.max-active=8
+spring.redis.jedis.pool.max-wait=-1ms
+
+#rabbit MQ
+#spring.rabbitmq.host=10.1.30.120
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=root
+#spring.rabbitmq.password=root
+
+spring.rabbitmq.address=127.0.0.1:5672
+spring.rabbitmq.username=admin
+spring.rabbitmq.password=admin123
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+
+# oss info
+#oss.point=http://oss-cn-shenzhen.aliyuncs.com
+# \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=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+
+
+# swagger2 \u8BBE\u7F6E\u5168\u5C40\u5B57\u4F53\u683C\u5F0F\u4E3Autf-8
+swagger.package=com.gis.web.controller
+swagger.title=VR720 dev \u5168\u666F\u770B\u770B
+swagger.description=VR720 \u5168\u666F\u770B\u770B API\u6587\u6863
+swagger.version=1.0
+
+#log
+logging.path=/root/data/${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 nas\u013F\u00BC
+server.file.path=/mnt/${project.name}_data/
+server.domain=
+
+domain.4dkk=https://test.4dkankan.com
+
+# \u6307\u5B9Atomcat\u6587\u4EF6\u4E0A\u4F20\u7684\u4E34\u65F6\u76EE\u5F55,\u4E0A\u4F20\u5B8C\u4F1A\u628A\u6587\u4EF6\u5220\u9664\uFF0C\u4F46\u8FD9\u4E2A\u65B9\u6CD5\u4E0D\u4F1A\u4E3B\u52A8\u521B\u5EFA\u76EE\u5F55, \u9ED8\u8BA4\u5728/tmp/tomcat.XXX, \u8FD9\u4E2A\u76EE\u5F55\u4F1A\u5728\u6E05\u695Atmp\u6587\u4EF6\u65F6\u5220\u9664\uFF0C\u5BFC\u81F4\u51FA\u9519
+spring.servlet.multipart.location=/mnt
+
+
+
+

+ 105 - 0
720yun_fd_manage/gis_application/src/main/resources/application-loc.properties

@@ -0,0 +1,105 @@
+
+#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=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
+
+
+
+#rabbit MQ
+#spring.rabbitmq.host=localhost
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=guest
+#spring.rabbitmq.password=guest
+
+# rabbitmq \u96C6\u7FA4\u6A21\u5F0F
+spring.rabbitmq.address=localhost:5672
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+
+# oss info
+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 \u8BBE\u7F6E\u5168\u5C40\u5B57\u4F53\u683C\u5F0F\u4E3Autf-8
+swagger.package=com.gis.web.controller
+swagger.title=VR720 dev \u56DB\u7EF4\u5168\u666F
+swagger.description=VR720 \u56DB\u7EF4\u5168\u666F API\u6587\u6863
+swagger.version=1.0
+
+
+#log
+logging.path=E:/javaProject/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+# file info
+server.file.path=F:\\test\\ngin\\${project.name}_data\\
+server.domain=
+
+
+domain.4dkk=https://test.4dkankan.com
+
+# \u6307\u5B9Atomcat\u6587\u4EF6\u4E0A\u4F20\u7684\u4E34\u65F6\u76EE\u5F55,\u4E0A\u4F20\u5B8C\u4F1A\u628A\u6587\u4EF6\u5220\u9664\uFF0C\u4F46\u8FD9\u4E2A\u65B9\u6CD5\u4E0D\u4F1A\u4E3B\u52A8\u521B\u5EFA\u76EE\u5F55, \u9ED8\u8BA4\u5728/tmp/tomcat.XXX, \u8FD9\u4E2A\u76EE\u5F55\u4F1A\u5728\u6E05\u695Atmp\u6587\u4EF6\u65F6\u5220\u9664\uFF0C\u5BFC\u81F4\u51FA\u9519
+spring.servlet.multipart.location=F:\\test
+
+
+
+

+ 100 - 0
720yun_fd_manage/gis_application/src/main/resources/application-sit.properties

@@ -0,0 +1,100 @@
+spring.application.name=pano-service
+spring.cloud.nacos.discovery.server-addr=8.135.98.231:8848
+
+#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://127.0.0.1:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkk2020test%
+
+
+# \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 \uFFFD\u05B2\uFFFD\u02BD\uFFFD\uFFFD
+spring.redis.cluster.nodes=127.0.0.1:6379
+spring.redis.database=0
+spring.redis.password=
+spring.redis.timeout=3000ms
+spring.redis.jedis.pool.max-idle=8
+spring.redis.jedis.pool.min-idle=0
+spring.redis.jedis.pool.max-active=8
+spring.redis.jedis.pool.max-wait=-1ms
+
+#rabbit MQ
+#spring.rabbitmq.host=10.1.30.120
+#spring.rabbitmq.port=5672
+#spring.rabbitmq.username=root
+#spring.rabbitmq.password=root
+
+spring.rabbitmq.address=127.0.0.1:5672
+spring.rabbitmq.username=guest
+spring.rabbitmq.password=guest
+spring.rabbitmq.virtual-host=/
+spring.rabbitmq.connection-timeout=15000
+# confirm\u0123\u02BD
+spring.rabbitmq.publisher-confirms=true
+# return\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.publisher-returns=true
+# \uFFFD\uFFFDreturn\uFFFD\uFFFD\uFFFD\u01BD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
+spring.rabbitmq.template.mandatory=true
+
+
+# oss info
+#oss.point=http://oss-cn-shenzhen.aliyuncs.com
+# \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=https://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/
+
+
+# swagger2 \u8BBE\u7F6E\u5168\u5C40\u5B57\u4F53\u683C\u5F0F\u4E3Autf-8
+swagger.package=com.gis.web.controller
+swagger.title=VR720 sit \u5168\u666F\u770B\u770B
+swagger.description=VR720 \u5168\u666F\u770B\u770B API\u6587\u6863
+swagger.version=1.0
+
+#log
+logging.path=/root/data/${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 nas\u013F\u00BC
+server.file.path=/mnt/${project.name}_data/
+server.domain=
+
+domain.4dkk=https://test.4dkankan.com
+
+# \u6307\u5B9Atomcat\u6587\u4EF6\u4E0A\u4F20\u7684\u4E34\u65F6\u76EE\u5F55,\u4E0A\u4F20\u5B8C\u4F1A\u628A\u6587\u4EF6\u5220\u9664\uFF0C\u4F46\u8FD9\u4E2A\u65B9\u6CD5\u4E0D\u4F1A\u4E3B\u52A8\u521B\u5EFA\u76EE\u5F55, \u9ED8\u8BA4\u5728/tmp/tomcat.XXX, \u8FD9\u4E2A\u76EE\u5F55\u4F1A\u5728\u6E05\u695Atmp\u6587\u4EF6\u65F6\u5220\u9664\uFF0C\u5BFC\u81F4\u51FA\u9519
+spring.servlet.multipart.location=/mnt
+
+
+
+

+ 39 - 0
720yun_fd_manage/gis_application/src/main/resources/application.properties

@@ -0,0 +1,39 @@
+server.port=8001
+spring.profiles.active=loc
+
+# \uFFFD\uFFFD\u013F\uFFFD\uFFFD\uFFFD\uFFFD
+project.name=720yun_fd_manage
+
+# \uFFFD\uFFFD\u032C\uFFFD\uFFFD\u0534\uFFFD\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/
+
+# \uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u013C\uFFFD\uFFFD\u03F4\uFFFD\uFFFD\uFFFD\u0421
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=256MB
+spring.servlet.multipart.max-request-size=256MB
+
+
+# tk.mybatis
+#\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
+
+
+# \u7EBF\u7A0B\u6C60\u914D\u7F6E
+spring.task.pool.corePoolSize=10
+spring.task.pool.maxPoolSize=100
+spring.task.pool.keepAliveSeconds=100
+spring.task.pool.queueCapacity=100
+
+
+
+
+
+
+

BIN
720yun_fd_manage/gis_application/src/main/resources/img/kankan_icon.png


+ 156 - 0
720yun_fd_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>

+ 151 - 0
720yun_fd_manage/gis_common/pom.xml

@@ -0,0 +1,151 @@
+<?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>720yun_fd_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>
+
+        <!-- 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>
+
+
+        <!--rabbit MQ-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <!-- 二维码 -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+
+
+    </dependencies>
+
+
+</project>

+ 53 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java

@@ -0,0 +1,53 @@
+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 {
+
+
+    @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());
+//        log.info("request Method : {}" , request.getMethod());
+//        log.info("request IP : {}" , request.getRemoteAddr());
+
+
+        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());
+    }
+
+
+
+
+}

+ 140 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/RabbitConfig.java

@@ -0,0 +1,140 @@
+package com.gis.common.config;
+
+import org.springframework.amqp.core.*;
+import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
+import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+
+/**
+ * 即时队列
+ */
+
+@Configuration
+public class RabbitConfig {
+
+
+    @Value("${spring.rabbitmq.address}")
+    private String address;
+
+    @Value("${spring.rabbitmq.username}")
+    private String username;
+
+    @Value("${spring.rabbitmq.password}")
+    private String password;
+
+
+
+    /** 全景图队列*/
+    public static final String PANO_QUEUE = "720FdQueue";
+
+    /** 全景图交换机*/
+    public static final String PANO_EXCHANGE = "720FdExchange";
+
+    /** 全景图交换机路由*/
+    public static final String PANO_QUEUE_ROUTING = "720FdQueueRouting";
+
+
+    /** 全景图队列*/
+    public static final String TEST_QUEUE = "testOwenQueue";
+
+    /** 全景图交换机*/
+    public static final String TEST_EXCHANGE = "testOwenExchange";
+
+    /** 全景图交换机路由*/
+    public static final String TEST_QUEUE_ROUTING = "testOwenQueueRouting";
+
+
+
+
+
+
+    /**
+     * 全景图模型队列
+     */
+    @Bean
+    public Queue panoQueue() {
+        return new Queue(PANO_QUEUE);
+    }
+
+    /**
+     * 全景图交换机
+     */
+    @Bean
+    public Exchange panoExchange(){
+        return new DirectExchange(PANO_EXCHANGE, true, false);
+    }
+
+
+    /**
+     * 全景图队列绑定交换机
+     */
+    @Bean
+    public Binding panoQueueExchange(Queue panoQueue, Exchange panoExchange){
+        return BindingBuilder.bind(panoQueue).to(panoExchange).with(PANO_QUEUE_ROUTING).noargs();
+    }
+
+
+    /**
+     * 全景图模型队列
+     */
+    @Bean
+    public Queue testQueue() {
+        return new Queue(TEST_QUEUE);
+    }
+
+    /**
+     * 全景图交换机
+     */
+    @Bean
+    public Exchange testExchange(){
+        return new DirectExchange(TEST_EXCHANGE, true, false);
+    }
+
+
+    /**
+     * 全景图队列绑定交换机
+     */
+    @Bean
+    public Binding testQueueExchange(Queue testQueue, Exchange testExchange){
+        return BindingBuilder.bind(testQueue).to(testExchange).with(TEST_QUEUE_ROUTING).noargs();
+    }
+
+
+    /**
+     * 以下三个方法是配置集群
+     * @return
+     */
+    @Bean
+    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
+        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+        factory.setConnectionFactory(connectionFactory());
+        factory.setPrefetchCount(1);
+        return factory;
+    }
+
+    @Bean
+    public ConnectionFactory connectionFactory() {
+        CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
+        connectionFactory.setAddresses(address);
+        connectionFactory.setUsername(username);
+        connectionFactory.setPassword(password);
+        connectionFactory.setVirtualHost("/");
+        connectionFactory.setPublisherConfirms(true);
+        return connectionFactory;
+    }
+
+    @Bean
+    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+    public RabbitTemplate rabbitTemplate() {
+        return new RabbitTemplate(connectionFactory());
+    }
+
+
+
+}

+ 95 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/config/Swagger2.java

@@ -0,0 +1,95 @@
+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 lombok.extern.slf4j.Slf4j;
+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 不需要字启动类配置注解
+ */
+@Slf4j
+@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
720yun_fd_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);
+    }
+}

+ 17 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/constant/CmdConstant.java

@@ -0,0 +1,17 @@
+package com.gis.common.constant;
+
+
+/**
+ * Created by owen on 2020/12/31 0031 14:22
+ *
+ */
+public class CmdConstant {
+
+
+    /** krpano 全景矢量切图 */
+    public final static String PANO_KRPANO = "krpanotools makepano -config=templates/vtour-multires.config ";
+
+//    public final static String OSSUTIL_UPLOAD_DIR = "/opt/ossutil/ossutil64 cp -r /mnt/720yun_fd_manage_data/@sceneCode oss://oss-xiaoan/720yun_fd_manage/@sceneCode";
+
+
+}

+ 65 - 0
720yun_fd_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;
+
+
+    /*********************** 其他参数 ***********************/
+
+    @Value("${domain.4dkk}")
+    public  String domain4dKK;
+
+
+
+
+}

+ 10 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/constant/TypeCode.java

@@ -0,0 +1,10 @@
+package com.gis.common.constant;
+
+/**
+ * Created by owen on 2020/11/19 0019 9:13
+ */
+public class TypeCode {
+
+    /** redis token key*/
+    public final static String REDIS_TOKEN = "pano_720yun_fd_token_";
+}

+ 35 - 0
720yun_fd_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
720yun_fd_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;
+    }
+}

+ 137 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JWTFilter.java

@@ -0,0 +1,137 @@
+package com.gis.common.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 {
+
+    /**
+     * 执行登录验证
+     */
+    @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);
+            return true;
+        } catch (Exception e) {
+            /**
+             * 这个异常需要自己写,全局捕获不了
+             * 认证出现异常,传递错误信息msg
+             */
+            exceptionMsg(e, response);
+        }
+        // return false 前端没有响应,接收不到异常
+        // 验证出错时,返回false
+        return false;
+
+
+    }
+
+    /**
+     * 对跨域提供支持
+     * 只对需要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
720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JWTToken.java

@@ -0,0 +1,23 @@
+package com.gis.common.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;
+    }
+}

+ 275 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/JwtUtil.java

@@ -0,0 +1,275 @@
+package com.gis.common.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) {
+        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");
+    }
+
+    /**
+     * 检查token是否有效
+     */
+    @Test
+    public void testCheckToken(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzExMjMxMTE3OCIsInVzZXJOYW1lIjoiMTMxMTIzMTExNzgiLCJpYXQiOjE2MTM2MjAzNjcsImp0aSI6IjMyYTAwZDNiLTE2ODctNDUzNi04NmIwLWY4OTMzODQzNzNjMiJ9.5sV47Yf0HU4m6u77jmCziR3KhAGfiL5aUKxo57MImTI";
+        String username = getUsername(token);
+        Long userId = getUserId(token);
+        System.out.println(username);
+        System.out.println("id: " + userId );
+    }
+
+
+    @Test
+    public void testIsVerify(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzExMjMxMTE3OCIsInVzZXJOYW1lIjoiMTMxMTIzMTExNzgiLCJpYXQiOjE2MTM2MjAzNjcsImp0aSI6IjMyYTAwZDNiLTE2ODctNDUzNi04NmIwLWY4OTMzODQzNzNjMiJ9.5sV47Yf0HU4m6u77jmCziR3KhAGfiL5aUKxo57MImTI";
+       String userName = "13112311178";
+        Boolean verify = isVerify(token, userName);
+        System.out.println(verify);
+    }
+
+
+    /**
+     * 解析出来是一个对象
+     */
+    @Test
+    public void testParseJWT(){
+        String token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsInJvbGUiOlsiYWRtaW4iLCJyb290Il0sImlkIjoxLCJ1c2VyTmFtZSI6ImFkbWluIiwiaWF0IjoxNTgzODA5MzkzLCJqdGkiOiJkNjZiZTFkYi00MTQ0LTQxMTYtYTNlNi01ZDBjNjhlNTI3ODAifQ.-4AdsVP2RwmPS2grtO4aC8ov9PwkilzaGdThGetBJok";
+        System.out.println(parseJWT(token));
+    }
+
+}

+ 112 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/MyRealm.java

@@ -0,0 +1,112 @@
+package com.gis.common.shiro;
+
+import com.gis.common.exception.JwtAuthenticationException;
+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;
+
+//import com.gis.domain.entity.SysUserEntity;
+//import com.gis.service.SysUserService;
+
+/**
+ * 配置不校验的话,是不会走这个方法的
+ */
+@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!");
+//        }
+
+        // 这里redis的key是token, value是用户信息,所以只要有返回结果,就算是验证通过
+//        String redisToken = redisTemplate.opsForValue().get(token);
+//        if (redisToken == null) {
+//            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
720yun_fd_manage/gis_common/src/main/java/com/gis/common/shiro/ShiroConfig.java

@@ -0,0 +1,114 @@
+package com.gis.common.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;
+    }
+
+}

+ 29 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/task/AsyncTask.java

@@ -0,0 +1,29 @@
+package com.gis.common.task;
+
+import cn.hutool.core.io.FileUtil;
+import com.gis.common.util.AliyunOssUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * Created by owen on 2021/1/20 0020 20:38
+ */
+@Slf4j
+@Component
+public class AsyncTask {
+
+    @Autowired
+    AliyunOssUtil aliyunOssUtil;
+
+    @Async("taskExecutor")
+    public void uploadOss(String savePath, String ossPath) {
+        log.info("run task uploadOss");
+        aliyunOssUtil.upload(savePath, ossPath);
+        // 删除服务器临时文件
+        FileUtil.del(savePath);
+        log.info("end task uploadOss");
+    }
+}

+ 44 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/task/TaskExecutePool.java

@@ -0,0 +1,44 @@
+package com.gis.common.task;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.stereotype.Component;
+
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * Created by owen on 2017/8/29.
+ */
+//@Configuration
+@Component
+@EnableAsync
+public class TaskExecutePool {
+
+    @Value("${spring.task.pool.corePoolSize}")
+    private int corePoolSize;
+    @Value("${spring.task.pool.corePoolSize}")
+    private int maxPoolSize;
+    @Value("${spring.task.pool.keepAliveSeconds}")
+    private int keepAliveSeconds;
+    @Value("${spring.task.pool.queueCapacity}")
+    private int queueCapacity;
+
+    @Bean
+    public Executor taskExecutor() {
+        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
+        executor.setCorePoolSize(corePoolSize);
+        executor.setMaxPoolSize(maxPoolSize);
+        executor.setQueueCapacity(queueCapacity);
+        executor.setKeepAliveSeconds(keepAliveSeconds);
+        executor.setThreadNamePrefix("MyExecutor-");
+        // rejection-policy:当pool已经达到max size的时候,如何处理新任务
+        // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行
+        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+        executor.initialize();
+        return executor;
+    }
+}

+ 97 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/test/ImageUtil.java

@@ -0,0 +1,97 @@
+package com.gis.common.test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+
+/**
+ * Created by owen on 2021/2/24 0024 12:23
+ */
+public class ImageUtil {
+
+    private Logger log = LoggerFactory.getLogger(getClass());
+
+    private static String DEFAULT_PREVFIX = "thumb_";
+    private static Boolean DEFAULT_FORCE = false;
+
+    /**
+     * <p>Title: thumbnailImage</p>
+     * <p>Description: 根据图片路径生成缩略图 </p>
+     * @param
+     * @param w            缩略图宽
+     * @param h            缩略图高
+     * @param prevfix    生成缩略图的前缀
+     * @param force        是否强制按照宽高生成缩略图(如果为false,则生成最佳比例缩略图)
+     */
+    public void thumbnailImage(File imgFile, int w, int h, String prevfix, boolean force){
+        if(imgFile.exists()){
+            try {
+                // ImageIO 支持的图片类型 : [BMP, bmp, jpg, JPG, wbmp, jpeg, png, PNG, JPEG, WBMP, GIF, gif]
+                String types = Arrays.toString(ImageIO.getReaderFormatNames());
+                String suffix = null;
+                // 获取图片后缀
+                if(imgFile.getName().indexOf(".") > -1) {
+                    suffix = imgFile.getName().substring(imgFile.getName().lastIndexOf(".") + 1);
+                }// 类型和图片后缀全部小写,然后判断后缀是否合法
+                if(suffix == null || types.toLowerCase().indexOf(suffix.toLowerCase()) < 0){
+                    log.error("Sorry, the image suffix is illegal. the standard image suffix is {}." + types);
+                    return ;
+                }
+                log.debug("target image's size, width:{}, height:{}.",w,h);
+                Image img = ImageIO.read(imgFile);
+                if(!force){
+                    // 根据原图与要求的缩略图比例,找到最合适的缩略图比例
+                    int width = img.getWidth(null);
+                    int height = img.getHeight(null);
+                    if((width*1.0)/w < (height*1.0)/h){
+                        if(width > w){
+                            h = Integer.parseInt(new java.text.DecimalFormat("0").format(height * w/(width*1.0)));
+                            log.debug("change image's height, width:{}, height:{}.",w,h);
+                        }
+                    } else {
+                        if(height > h){
+                            w = Integer.parseInt(new java.text.DecimalFormat("0").format(width * h/(height*1.0)));
+                            log.debug("change image's width, width:{}, height:{}.",w,h);
+                        }
+                    }
+                }
+                BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+                Graphics g = bi.getGraphics();
+                g.drawImage(img, 0, 0, w, h, Color.LIGHT_GRAY, null);
+                g.dispose();
+                String p = imgFile.getPath();
+                // 将图片保存在原目录并加上前缀
+                ImageIO.write(bi, suffix, new File(p.substring(0,p.lastIndexOf(File.separator)) + File.separator + prevfix +imgFile.getName()));
+            } catch (IOException e) {
+                log.error("generate thumbnail image failed.",e);
+            }
+        }else{
+            log.warn("the image is not exist.");
+        }
+    }
+
+    public void thumbnailImage(String imagePath, int w, int h, String prevfix, boolean force){
+        File imgFile = new File(imagePath);
+        thumbnailImage(imgFile, w, h, prevfix, force);
+    }
+
+    public void thumbnailImage(String imagePath, int w, int h, boolean force){
+        thumbnailImage(imagePath, w, h, DEFAULT_PREVFIX, force);
+    }
+
+    public void thumbnailImage(String imagePath, int w, int h){
+        thumbnailImage(imagePath, w, h, DEFAULT_FORCE);
+    }
+
+    public static void main(String[] args) {
+        String path = "C:\\Users\\Administrator\\Desktop\\33\\aa.jpg";
+        new ImageUtil().thumbnailImage(path, 100, 150);
+    }
+
+}

+ 258 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java

@@ -0,0 +1,258 @@
+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.*;
+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");
+
+    }
+
+    /**
+     * 上传目录到oss
+     * @param dirPath 目录地址
+     * @param sceneCode 场景码
+     * @param ossBasePath oss基础地址
+     * @throws IOException
+     */
+    public  void uploadDir(String dirPath, String sceneCode, String ossBasePath) throws IOException {
+        Map map = FileUtils.eachFile(dirPath, sceneCode, ossBasePath);
+        uploadMulFiles(map);
+        log.info("oss上传完成");
+    }
+
+
+    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();
+    }
+
+
+
+    /**
+     * 生成图片
+     * @param inputFilePath
+     * @param savePath
+     */
+//	public static void writeFile(String inputFilePath, String savePath){
+//		try {
+//			FileUtils.bigFileWrite(getInputStreamByFileUrl(inputFilePath), savePath);
+//		} catch (IOException e) {
+//			e.printStackTrace();
+//		}
+//	}
+
+}

+ 168 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/CmdUtils.java

@@ -0,0 +1,168 @@
+package com.gis.common.util;
+
+import cn.hutool.core.util.RuntimeUtil;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+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 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;
+
+    }
+}

+ 780 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/FileUtils.java

@@ -0,0 +1,780 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.img.Img;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.util.URLUtil;
+import com.gis.common.task.AsyncTask;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.*;
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Log4j2
+@Component
+public class FileUtils {
+
+    /** 临时文件存放目录*/
+    private final static String PROJECT_NAME = "cms_pano_fcb_dev_data/";
+
+    @Autowired
+    AliyunOssUtil aliyunOssUtil;
+
+    @Autowired
+    AsyncTask asyncTask;
+
+
+    /**
+     * 多文件上传
+     * 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;
+
+    }
+
+
+    /**
+     * 从网络Url中下载文件
+     *
+     * @param urlStr
+     * @param fileName
+     * @param savePath
+     * @return
+     * @throws IOException
+     */
+    public static boolean downLoadFromUrl(String urlStr, String fileName, String savePath){
+        FileOutputStream fos = null;
+        InputStream inputStream = null;
+        try {
+            URL url = new URL(urlStr);
+            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+            // 设置超时间为3秒
+            conn.setConnectTimeout(3 * 1000);
+            // 防止屏蔽程序抓取而返回403错误
+            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+
+            // 得到输入流
+            inputStream = conn.getInputStream();
+            // 获取自己数组
+            byte[] getData = readInputStream(inputStream);
+
+            // 文件保存位置
+            File saveDir = new File(savePath);
+            if (!saveDir.exists()) {
+                saveDir.mkdirs();
+            }
+            String filePath = saveDir + File.separator + fileName;
+            String filePathFolder = filePath.substring(0, filePath.lastIndexOf("/") + 1);
+            FileUtil.mkdir(filePathFolder);
+
+            File file = new File(filePath);
+            fos = new FileOutputStream(file);
+            fos.write(getData);
+            if (fos != null) {
+                fos.close();
+            }
+            if (inputStream != null) {
+                inputStream.close();
+            }
+            System.out.println("info:" + url + " download success");
+        } catch(FileNotFoundException e){
+            return false;
+        } catch (IOException e) {
+            return false;
+        }finally {
+            if (fos != null) {
+                try {
+                    fos.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 从输入流中获取字节数组
+     *
+     * @param inputStream
+     * @return
+     * @throws IOException
+     */
+    private static byte[] readInputStream(InputStream inputStream) throws IOException {
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        while ((len = inputStream.read(buffer)) != -1) {
+            bos.write(buffer, 0, len);
+        }
+        bos.close();
+        return bos.toByteArray();
+    }
+
+
+    /**
+     * 重命名文件上传
+     * @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, PROJECT_NAME);
+
+        return baseUrl+ PROJECT_NAME +path;
+
+    }
+
+    /***
+     * 文件上传oss
+     * @param file
+     * @param savePath 服务器保存地址
+     * @param ossBasePath oss目录地址
+     * @param ossDomain oss域名
+     * @return
+     */
+    public Object renameUploadOss(MultipartFile file, String savePath, String ossBasePath, String ossDomain)  {
+
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        long size = file.getSize();
+        log.info("文件大小:" + size );
+        log.info("文件大小:" + (size/1000) + "kb");
+
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+
+        String fileName = file.getOriginalFilename();
+        log.info("上传的文件名:" + fileName);
+
+        String fileType = getFileType(fileName);
+        String dirType = "image/";
+        if (fileType.equals("doc")) {
+            dirType = "doc/";
+        }
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+        String newName = time  + "."  +suffix;
+        savePath = savePath + dirType + newName;
+
+        log.info("savePath: {}", savePath);
+
+
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        // 上传oss
+        String ossPath = ossBasePath + dirType + newName;
+        aliyunOssUtil.upload(savePath, ossPath);
+
+        String ossUrl = ossDomain + ossPath + "?d=" + System.currentTimeMillis();
+        log.info("ossUrl: {}", ossUrl);
+
+
+
+        return ossUrl;
+
+    }
+
+    /**
+     * 文件流上传,不存本地服务器,直接上传oss
+     * @param file
+     * @param ossBasePath
+     * @param ossDomain
+     * @return
+     */
+    public Object renameUploadOssBye(MultipartFile file, String ossBasePath, String ossDomain)  {
+
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        long size = file.getSize();
+        log.info("文件大小:" + size );
+        log.info("文件大小:" + (size/1000) + "kb");
+
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+
+        String fileName = file.getOriginalFilename();
+        log.info("上传的文件名:" + fileName);
+
+        String fileType = getFileType(fileName);
+        String dirType = "image/";
+        if (fileType.equals("doc")) {
+            dirType = "doc/";
+        }
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+        String newName = time  + "."  +suffix;
+
+        // 上传oss
+        String ossPath = ossBasePath + dirType + newName;
+        try {
+            aliyunOssUtil.upload(file.getBytes(), ossPath);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        String ossUrl = ossDomain + ossPath;
+        log.info("ossUrl: {}", ossUrl);
+
+        return ossUrl;
+
+    }
+
+
+
+
+
+    /***
+     * 文件上传oss, 返回文件名跟地址
+     * @param file
+     * @param saveBasePath 服务器保存地址
+     * @param ossBasePath oss目录地址
+     * @param ossDomain oss域名
+     * @return 文件名,跟地址
+     */
+    public Map renameUploadOssMap(MultipartFile file, String saveBasePath, String ossBasePath, String ossDomain)  {
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+
+        String fileName = file.getOriginalFilename();
+
+        HashMap<String, String> result = new HashMap<>();
+        result.put("fileName", fileName);
+
+        String fileType = getFileType(fileName);
+        String dirType = "image/";
+        if (fileType.equals("doc")) {
+            dirType = "doc/";
+        }
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+        String newName = time  + "."  +suffix;
+        String savePath = saveBasePath + dirType + newName;
+
+        log.info("savePath: {}", savePath);
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        // 上传oss
+        String ossPath = ossBasePath + dirType + newName;
+//        AliyunOssUtil.upload(savePath, ossPath);
+        aliyunOssUtil.upload(savePath, ossPath);
+        String ossUrl = ossDomain + ossPath;
+        log.info("ossUrl: {}", ossUrl);
+        result.put("ossUrl", ossUrl);
+
+        // 删除服务器临时文件
+        FileUtil.del(savePath);
+
+        return result;
+
+    }
+
+
+    /**
+     * 文件上传,用来上传指定文档,应用程序需要不同的文件,特意针对他们设计
+     * @param file
+     * @param savePath
+     * @param ossBasePath
+     * @param ossDomain
+     * @param type sample:样本文档, empty:空白文档
+     * @param code 用来做目录的,如果code为空,创建code; 不为空,就把文件放到code目录里
+     * @return
+     */
+    public  Map renameUploadOssMap(MultipartFile file, String savePath, String ossBasePath, String ossDomain, String type, String code)  {
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        // 创建目录码
+        if (StringUtils.isBlank(code)) {
+            code = RandomUtils.getSceneCode("");
+        }
+
+        String fileName = file.getOriginalFilename();
+
+        HashMap<String, String> result = new HashMap<>();
+        result.put("fileName", fileName);
+
+        String dirType = "doc/" + code + "/";
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+        String newName = type  + "."  +suffix;
+        savePath = savePath + dirType + newName;
+
+        log.info("savePath: {}", savePath);
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        // 上传oss
+        String ossPath = ossBasePath + dirType + newName;
+//        AliyunOssUtil.upload(savePath, ossPath);
+        aliyunOssUtil.upload(savePath, ossPath);
+        // code 是用来区分表格是否放在同一目录
+        String ossUrl = ossDomain + ossPath + "?code=" +code;
+        log.info("ossUrl: {}", ossUrl);
+        result.put("ossUrl", ossUrl);
+
+        // 删除服务器临时文件
+        FileUtil.del(savePath);
+
+        return result;
+
+    }
+
+
+
+    /**
+     * 使用opencv 生成缩略图
+     * 压缩图片
+     * 需要图片比例是2:1,否则图片压出来会变形
+     */
+    public  String compressImgAndUploadOss(String inputFilePath, String ossBasePath, String ossDomain) throws IOException, InterruptedException {
+        String serverBasePath = StringUtils.substringBeforeLast(inputFilePath, "/");
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String suffix = StringUtils.substringAfterLast(inputFilePath, ".");
+        String fileName ="/thumb_"+ time  + "."  +suffix;
+
+        // 保存图片位置
+        String saveCompressImgPath = serverBasePath + fileName;
+
+//        Img.from(new File(inputFilePath)).scale(300, 150).write(new File(saveCompressImgPath));
+        // ./DAGE_Downsample 100m.jpg out.jpg 300 150
+        String cmd = "/home/720yun/100m/DAGE_Downsample " + inputFilePath + " " +  saveCompressImgPath + " 300 150";
+        log.info("cmd: " + cmd);
+        long start = System.currentTimeMillis();
+        CmdUtils.cmdThumb(cmd);
+        long end = System.currentTimeMillis();
+        log.info("openCV耗时: " + (end-start)/1000 + " s");
+        log.info("图片压缩成功: " + saveCompressImgPath);
+
+        // 上传oss
+        String ossPath = ossBasePath + "image/" + fileName;
+        log.info("ossPath: " + ossPath);
+        asyncTask.uploadOss(saveCompressImgPath, ossPath);
+        String ossUrl = ossDomain + ossPath;
+        log.info("图片上传成功: " + ossUrl);
+        return ossUrl;
+    }
+
+
+    /**
+     * 使用java 生成缩略图
+     * @param inputFilePath
+     * @param ossBasePath
+     * @param ossDomain
+     * @return
+     */
+    public  String compressImgAndUploadOss2(String inputFilePath, String ossBasePath, String ossDomain){
+        String serverBasePath = StringUtils.substringBeforeLast(inputFilePath, "/");
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String suffix = StringUtils.substringAfterLast(inputFilePath, ".");
+        String fileName ="/thumb_"+ time  + "."  +suffix;
+
+        // 保存图片位置
+        String saveCompressImgPath = serverBasePath + fileName;
+        String ossUrl = null;
+        try {
+            Img.from(new File(inputFilePath)).scale(600, 300).write(new File(saveCompressImgPath));
+            log.info("图片压缩成功: " + saveCompressImgPath);
+
+            if (FileUtil.isFile(saveCompressImgPath)) {
+                // 上传oss
+                String ossPath = ossBasePath + fileName;
+                log.info("ossPath: " + ossPath);
+//                asyncTask.uploadOss(saveCompressImgPath, ossPath);
+                aliyunOssUtil.upload(saveCompressImgPath, ossPath);
+                ossUrl = ossDomain + ossPath;
+                log.info("图片上传成功: " + ossUrl);
+            } else {
+                log.error("缩略图不存在: " + saveCompressImgPath);
+            }
+
+        } catch (Exception e) {
+            log.error("图片格式有误,不支持此图片");
+            e.printStackTrace();
+        }
+        return ossUrl;
+    }
+
+
+    /**
+     * 按比例缩放
+     * @param inputFilePath
+     * @param ossBasePath
+     * @param ossDomain
+     * @return
+     */
+    public  String scaleImgAndUploadOss(String inputFilePath, String ossBasePath, String ossDomain){
+        String serverBasePath = StringUtils.substringBeforeLast(inputFilePath, "/");
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        String suffix = StringUtils.substringAfterLast(inputFilePath, ".");
+        String fileName ="thumb_"+ time  + "."  +suffix;
+
+        // 保存图片位置
+        String saveCompressImgPath = serverBasePath + fileName;
+        String ossUrl = null;
+        try {
+            ImageUtil.scale(inputFilePath, saveCompressImgPath, 0.1f);
+            log.info("图片压缩成功: " + saveCompressImgPath);
+
+            if (FileUtil.isFile(saveCompressImgPath)) {
+                // 上传oss
+                String ossPath = ossBasePath + fileName;
+                log.info("ossPath: " + ossPath);
+                aliyunOssUtil.upload(saveCompressImgPath, ossPath);
+                ossUrl = ossDomain + ossPath;
+                log.info("图片上传成功: " + ossUrl);
+            } else {
+                log.error("缩略图不存在: " + saveCompressImgPath);
+            }
+
+        } catch (Exception e) {
+            log.error("图片格式有误,不支持此图片");
+            e.printStackTrace();
+        }
+        return ossUrl;
+    }
+
+    @Test
+    public void compressImg(){
+        String inputFilePath = "C:\\Users\\Administrator\\Desktop\\33\\100m\\100m.jpg";
+        String saveCompressImgPath = "C:\\Users\\Administrator\\Desktop\\33\\100m\\thump.jpg";
+
+        Img.from(new File(inputFilePath)).scale(300, 150).write(new File(saveCompressImgPath));
+    }
+
+
+    public static boolean checkFile(MultipartFile file) {
+        //设置允许上传文件类型
+        String suffixList = ".jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.avi,.mov";
+        // 获取文件后缀
+        if(file == null){
+            log.info("文件流为空不可上传");
+            return false;
+        }
+        String fileName = file.getOriginalFilename();
+        String suffix = fileName.substring(fileName.lastIndexOf(".")
+                + 1, fileName.length());
+        if (suffixList.contains(suffix.trim().toLowerCase())) {
+            log.info("无非法参数可以放行!!!");
+            return true;
+        }
+        log.info("存在非法参数不能放行!请核对上传文件格式,重新刷新页面再次上传!");
+        return false;
+    }
+
+    /**
+     * 根据路径写入文件,适合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;
+    }
+
+
+
+
+
+    /**
+     * @param fileName 文件名
+     * @return 文件的type
+     */
+    private static String getFileType(String fileName) {
+        log.info("getContentType:" + fileName);
+        // 文件的后缀名
+        String fileExtension = fileName.substring(fileName.lastIndexOf("."));
+        if (".bmp".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".gif".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension)
+                || ".png".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".txt".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+
+        if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        if (".xls".equalsIgnoreCase(fileExtension) || "xlsx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        // 默认返回类型
+        return "image";
+    }
+
+
+    public static String getType(String type) {
+        log.info("getContentType:" + type);
+        // 文件的后缀名
+        if ("jpg".equalsIgnoreCase(type)) {
+            return "image";
+        }
+        if ("png".equalsIgnoreCase(type)) {
+            return "image";
+        }
+        if (".jpeg".equalsIgnoreCase(type)) {
+            return "image";
+        }
+
+        // 默认返回类型
+        return "";
+    }
+
+
+    /***
+     * 遍历每一个文件路径
+     * dirPath :目录路径
+     * eachFile
+     * 作用上传oss
+     */
+    public static Map eachFile(String dirPath, String sceneCode, String ossBasePath) throws IOException {
+        File file = new File(dirPath);
+        HashMap<String, String> result = new HashMap<>();
+        dfs(file, sceneCode, ossBasePath, result);
+        return result;
+    }
+
+    /**
+     * 递归解析
+     * @param file
+     * @param sceneCode
+     * @param ossBasePath
+     * @return
+     * @throws IOException
+     */
+    public static void dfs(File file, String sceneCode, String ossBasePath, HashMap<String, String> result) throws IOException {
+
+        File[] files = file.listFiles();
+
+        for (File every : files) {
+            // 是文件
+            if (every.isFile()) {
+                String filePath = every.getAbsolutePath();
+                String ossPath = StringUtils.substringAfterLast(filePath, sceneCode);
+                ossPath = ossBasePath + sceneCode + ossPath;
+
+                result.put(filePath, ossPath);
+//                log.info("filePath, {}", every.getAbsolutePath());
+//                log.info("ossPath, {}", ossPath);
+
+                // 是目录
+            } else {
+                dfs(every, sceneCode, ossBasePath, result);
+            }
+        }
+    }
+
+
+    /**
+     * 检查出图比较是否2:1
+     * @return
+     * @throws IOException
+     */
+    public Boolean checkScale(String path) throws IOException {
+        BufferedImage image = ImageIO.read(new File(path));
+        int srcWidth = image .getWidth();      // 源图宽度
+        int srcHeight = image .getHeight();    // 源图高度
+
+        boolean flag = false;
+        if (srcWidth % srcHeight == 0 ) {
+            flag = true;
+        }
+        log.info("srcWidth = " + srcWidth);
+        log.info("srcHeight = " + srcHeight);
+        return flag;
+
+    }
+
+    /**
+     * 检查出图比较是否2:1
+     * @return
+     * @throws IOException
+     */
+    public static Boolean checkScale(InputStream input) throws IOException {
+        BufferedImage image = ImageIO.read(input);
+        int srcWidth = image .getWidth();      // 源图宽度
+        int srcHeight = image .getHeight();    // 源图高度
+
+        boolean flag = false;
+        if (srcWidth % srcHeight == 0 ) {
+            flag = true;
+        }
+        log.info("srcWidth = " + srcWidth);
+        log.info("srcHeight = " + srcHeight);
+        return flag;
+
+    }
+
+
+    @Test
+    public void testScale() throws IOException {
+        String path = "C:\\Users\\Administrator\\Desktop\\33\\28\\2.jpg";
+        BufferedImage image = ImageIO.read(new File(path));
+        int srcWidth = image .getWidth();      // 源图宽度
+        int srcHeight = image .getHeight();    // 源图高度
+
+        if (srcWidth % srcHeight == 0 ) {
+            System.out.println("图片比例正确");
+        } else {
+            System.out.println("图片比例有误");
+
+        }
+
+        System.out.println("srcWidth = " + srcWidth);
+        System.out.println("srcHeight = " + srcHeight);
+}
+
+    public static String getResource(){
+        String path = "";
+        try {
+            path = ResourceUtils.getURL("classpath:").getPath();
+            path = URLDecoder.decode(path,"utf-8");
+        } catch (Exception e) {
+        }
+        return path;
+    }
+
+
+    // jar包运行,只能用文件流的形式获取文件
+    public static InputStream getResource(String path){
+        ClassPathResource classPathResource = new ClassPathResource(path);
+        InputStream inputStream = null;
+        try {
+            inputStream = classPathResource.getInputStream();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return inputStream;
+    }
+
+
+
+}

+ 359 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/HttpUtils.java

@@ -0,0 +1,359 @@
+package com.gis.common.util;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.scheme.SchemeRegistry;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.message.BasicNameValuePair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class HttpUtils {
+
+    protected static final Logger LOGGER = LoggerFactory.getLogger(HttpUtils.class);
+
+    /**
+     * get
+     *
+     * @param host
+     * @param path
+     * @param headers
+     * @param querys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doGet(String host, String path,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpGet request = new HttpGet(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * post form
+     *
+     * @param host
+     * @param path
+     * @param headers
+     * @param querys
+     * @param bodys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path, Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      Map<String, String> bodys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (bodys != null) {
+            List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
+
+            for (String key : bodys.keySet()) {
+                nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
+            }
+            UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
+            formEntity.setContentType("application/x-www-form-urlencoded;charset=UTF-8");
+            request.setEntity(formEntity);
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * 2021-02-23
+     * post 有请求头,有headers
+     *
+     * @param host
+     * @param path
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path, Map<String, String> headers, Map<String, String> querys, JSONObject body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        // 请求体
+        if (body != null) {
+            StringEntity stringEntity = new StringEntity(body.toJSONString(), "utf-8");
+            stringEntity.setContentType("application/json;charset=UTF-8");
+            request.setEntity(stringEntity);
+        }
+        return httpClient.execute(request);
+    }
+
+
+    /**
+     * 2021-02-23
+     * post 有请求头,有headers
+     *
+     * @param headers
+     * @param body
+     * @param api
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String api, Map<String, String> headers, JSONObject body)
+            throws Exception {
+        HttpClient httpClient = new DefaultHttpClient();
+        LOGGER.info("url : " + api);
+        HttpPost request = new HttpPost(api);
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        // 请求体
+        if (body != null) {
+            StringEntity stringEntity = new StringEntity(body.toJSONString(), "utf-8");
+            stringEntity.setContentType("application/json;charset=UTF-8");
+            request.setEntity(stringEntity);
+        }
+        return httpClient.execute(request);
+    }
+
+
+    public static HttpResponse doPost(String host, String path, Map<String, String> headers, Map<String, String> querys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Post stream
+     *
+     * @param host
+     * @param path
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPost(String host, String path,
+                                      Map<String, String> headers,
+                                      Map<String, String> querys,
+                                      byte[] body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPost request = new HttpPost(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (body != null) {
+            request.setEntity(new ByteArrayEntity(body));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Put String
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     String body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPut request = new HttpPut(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (StringUtils.isNotBlank(body)) {
+            request.setEntity(new StringEntity(body, "utf-8"));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Put stream
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @param body
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doPut(String host, String path, String method,
+                                     Map<String, String> headers,
+                                     Map<String, String> querys,
+                                     byte[] body)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpPut request = new HttpPut(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        if (body != null) {
+            request.setEntity(new ByteArrayEntity(body));
+        }
+
+        return httpClient.execute(request);
+    }
+
+    /**
+     * Delete
+     *
+     * @param host
+     * @param path
+     * @param method
+     * @param headers
+     * @param querys
+     * @return
+     * @throws Exception
+     */
+    public static HttpResponse doDelete(String host, String path, String method,
+                                        Map<String, String> headers,
+                                        Map<String, String> querys)
+            throws Exception {
+        HttpClient httpClient = wrapClient(host);
+
+        HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
+        for (Map.Entry<String, String> e : headers.entrySet()) {
+            request.addHeader(e.getKey(), e.getValue());
+        }
+
+        return httpClient.execute(request);
+    }
+
+    public static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
+        StringBuilder sbUrl = new StringBuilder();
+        sbUrl.append(host);
+        if (!StringUtils.isBlank(path)) {
+            sbUrl.append(path);
+        }
+        LOGGER.info("request api: " + sbUrl.toString());
+        if (null != querys) {
+            StringBuilder sbQuery = new StringBuilder();
+            for (Map.Entry<String, String> query : querys.entrySet()) {
+                if (0 < sbQuery.length()) {
+                    sbQuery.append("&");
+                }
+                if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
+                    sbQuery.append(query.getValue());
+                }
+                if (!StringUtils.isBlank(query.getKey())) {
+                    sbQuery.append(query.getKey());
+                    if (!StringUtils.isBlank(query.getValue())) {
+                        sbQuery.append("=");
+                        sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
+                    }
+                }
+            }
+            if (0 < sbQuery.length()) {
+                sbUrl.append("?").append(sbQuery);
+            }
+        }
+
+        return sbUrl.toString();
+    }
+
+    private static HttpClient wrapClient(String host) {
+        HttpClient httpClient = new DefaultHttpClient();
+        if (host.startsWith("https://")) {
+            sslClient(httpClient);
+        }
+        return httpClient;
+    }
+
+    private static void sslClient(HttpClient httpClient) {
+        try {
+            SSLContext ctx = SSLContext.getInstance("TLS");
+            X509TrustManager tm = new X509TrustManager() {
+                public X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+
+                public void checkClientTrusted(X509Certificate[] xcs, String str) {
+
+                }
+
+                public void checkServerTrusted(X509Certificate[] xcs, String str) {
+
+                }
+            };
+            ctx.init(null, new TrustManager[]{tm}, null);
+            SSLSocketFactory ssf = new SSLSocketFactory(ctx);
+            ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+            ClientConnectionManager ccm = httpClient.getConnectionManager();
+            SchemeRegistry registry = ccm.getSchemeRegistry();
+            registry.register(new Scheme("https", 443, ssf));
+        } catch (KeyManagementException ex) {
+            throw new RuntimeException(ex);
+        } catch (NoSuchAlgorithmException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+
+
+}

+ 43 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/ImageUtil.java

@@ -0,0 +1,43 @@
+package com.gis.common.util;
+
+import cn.hutool.core.img.ImgUtil;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Created by owen on 2021/2/24 0024 14:27
+ */
+public class ImageUtil {
+
+    /**
+     * 按比例缩放图片
+     * @return
+     */
+    public static void scale(String inPath, String outPath, float size){
+        ImgUtil.scale(new File(inPath), new File(outPath), size);
+    }
+
+    /**
+     * 获取图片分辨率
+     * 要传文件流,传地址会出错
+     */
+    public static String dpi(MultipartFile file){
+
+        String dpi = "0";
+        BufferedImage read = null;
+        try {
+            // 直接传路径会出错
+            read = ImageIO.read(file.getInputStream());
+            int width = read.getWidth();
+            int height = read.getHeight();
+            dpi = width + "*" + height + "px";
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return dpi;
+    }
+}

+ 194 - 0
720yun_fd_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();
+        }
+
+
+
+
+
+
+    }
+
+
+}

+ 120 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/QrCodeUtils.java

@@ -0,0 +1,120 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.extra.qrcode.QrCodeUtil;
+import cn.hutool.extra.qrcode.QrConfig;
+import lombok.extern.log4j.Log4j2;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.io.InputStream;
+import java.util.Date;
+
+/**
+ * Created by owen on 2020/12/17 0017 16:49
+ *
+ * 二维码
+ */
+@Component
+@Log4j2
+public class QrCodeUtils {
+
+    @Autowired
+    AliyunOssUtil aliyunOssUtil;
+
+    @Test
+    public void test(){
+        QrCodeUtil.generate("http://ossxiaoan.4dage.com/cms_zhen/image/20201218_142627638.png?123", 300,300, FileUtil.file("F:\\test\\ngin\\cms_wuhu_gov_data\\qrCode\\3.jpg"));
+    }
+
+    /**
+     * 创建普通二维码
+     */
+    @Test
+    public  void generateQrCode(){
+        String url = "www.baidu.com";
+        String savePath = "E:\\cache\\";
+        // 保存地址
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS") + ".jpg";
+        String dirType = "qrCode/";
+        savePath = savePath + dirType;
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + time;
+        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        QrCodeUtil.generate(url, 300,300, FileUtil.file(savePath));
+    }
+
+
+    /**
+     * 附带logo小图标二维码
+     */
+    public String generateLogoQrCode(String url, String serverBasePath, String ossBasePath, String ossDomain){
+        // 保存地址
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS") + ".jpg";
+        String dirType = "qrCode/";
+        String savePath = serverBasePath + dirType;
+
+        String logoPath = serverBasePath + "img/kankan_icon.png";
+        if (!FileUtil.isFile(logoPath)) {
+            InputStream resource = FileUtils.getResource("img/kankan_icon.png");
+            FileUtil.writeFromStream(resource, logoPath);
+            log.info("logo写入完成");
+        }
+        log.info("logoPath: {}", logoPath);
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + time;
+        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        QrCodeUtil.generate(url, QrConfig.create().setImg(logoPath).setWidth(300), FileUtil.file(savePath));
+
+        // 二维码上传oss
+        String ossPath = ossBasePath + dirType + time;
+        aliyunOssUtil.upload(savePath, ossPath);
+        String ossUrl = ossDomain + ossPath;
+        log.info("ossUrl: {}", ossUrl);
+
+        // 删除服务器临时文件
+        FileUtil.del(savePath);
+
+        return ossUrl;
+    }
+
+
+    /**
+     * 附带logo小图标二维码
+     */
+    @Test
+    public  void testGenerateLogoQrCode(){
+        String url = "https://www.baidu.com";
+        String savePath = "E:\\cache\\";
+        // 保存地址
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS") + ".jpg";
+        String dirType = "qrCode/";
+        savePath = savePath + dirType;
+
+        String logoPath = FileUtils.getResource() + "img/kankan_icon.png";
+        log.info("logoPath: {}", logoPath);
+
+        // 创建目录
+        if (!FileUtil.isDirectory(savePath)) {
+            FileUtil.mkdir(savePath);
+        }
+        savePath = savePath + time;
+        log.info("savePath: {}", savePath);
+        // 创建二维码tpt
+        QrCodeUtil.generate(url, QrConfig.create().setImg(logoPath).setWidth(300), FileUtil.file(savePath));
+    }
+
+
+}

+ 48 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/RandomUtils.java

@@ -0,0 +1,48 @@
+package com.gis.common.util;
+
+import cn.hutool.core.util.RandomUtil;
+//import fdage.back.sdk.base.uuid.SnowFlakeUUidUtils;
+import org.junit.Test;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by owen on 2020/4/26 0026 10:07
+ *
+ *
+ */
+@Component
+public class RandomUtils {
+
+    public static String randomString(int length){
+        String baseString = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+        return RandomUtil.randomString(baseString, length);
+    }
+
+    public static void main(String[] args) {
+        System.out.println(randomString(9));
+    }
+
+    /**
+     * 分布式id
+     * preStr: 8位id前缀
+     * @return
+     */
+    public static String getUuid(){
+        return SnowFlakeUUidUtils.generaUUid(null, null, "pano");
+
+    }
+
+    /**
+     * 场景码
+     * @return
+     */
+    public static String getSceneCode(String prefix){
+        String sceneCode = RandomUtils.randomString(9);
+        return  prefix +sceneCode;
+    }
+
+    private static String randowInt(int length){
+        String baseString = "0123456789";
+        return RandomUtil.randomString(baseString, length);
+    }
+}

+ 101 - 0
720yun_fd_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 + "]";
+    }
+}

+ 215 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/SnowFlakeUUidUtils.java

@@ -0,0 +1,215 @@
+package com.gis.common.util;
+
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+import java.lang.management.ManagementFactory;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2020/12/9 16:07
+ * 4
+ */
+@Log4j2
+public class SnowFlakeUUidUtils {
+
+    // 时间起始标记点,作为基准,一般取系统的最近时间(一旦确定不能变动)
+    //起始标记点
+    private final static long twepoch = 1288834974657L;
+    // 机器标识位数
+    private final static long workerIdBits = 5L;
+    // 数据中心标识位数
+    private final static long datacenterIdBits = 5L;
+    // 机器ID最大值
+    private final static long maxWorkerId = -1L ^ (-1L << workerIdBits);
+    // 数据中心ID最大值
+    private final static long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
+    // 毫秒内自增位
+    private final static long sequenceBits = 12L;
+    // 机器ID偏左移12位
+    private final static long workerIdShift = sequenceBits;
+    // 数据中心ID左移17位
+    private final static long datacenterIdShift = sequenceBits + workerIdBits;
+    // 时间毫秒左移22位
+    private final static long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
+
+    private final static long sequenceMask = -1L ^ (-1L << sequenceBits);
+
+    private final static Lock myLock = new ReentrantLock();
+    /* 上次生产id时间戳 */
+    private static long lastTimestamp = -1L;
+    // 0,并发控制
+    private long sequence = 0L;
+
+    private final long workerId;
+    // 数据标识id部分
+    private final long datacenterId;
+
+    private static volatile SnowFlakeUUidUtils snowFlakeUUidUtils;
+
+
+    private static SnowFlakeUUidUtils getSingleInstance(Long workerId, Long datacenterId){
+        if(null == snowFlakeUUidUtils){
+            synchronized (SnowFlakeUUidUtils.class){
+                if(null == snowFlakeUUidUtils){
+                    if(null != workerId && null != datacenterId){
+                        snowFlakeUUidUtils = new SnowFlakeUUidUtils(workerId , datacenterId);
+                    }else{
+                        snowFlakeUUidUtils = new SnowFlakeUUidUtils();
+                    }
+                }
+            }
+        }
+        return snowFlakeUUidUtils;
+    }
+
+    /**
+     * @param workerId 自定义的应用所在的服务器的机器ID,使用默认读取本机则无需传,传个NULL即可
+     * @param datacenterId 自定义的应用所在的服务器的数据中心ID,使用默认读取本机则无需传,传个NULL即可
+     * @param preStr 自定义的ID前缀
+     * **/
+    public static String generaUUid(Long workerId, Long datacenterId , String preStr){
+        StringBuilder resultId = new StringBuilder();
+        SnowFlakeUUidUtils snowFlakeUUidUtils = getSingleInstance(workerId , datacenterId);
+        if(StringUtils.isNotBlank(preStr)){
+            return resultId.append(preStr).append(snowFlakeUUidUtils.nextId()).toString();
+        }else{
+            return resultId.append(snowFlakeUUidUtils.nextId()).toString();
+        }
+    }
+
+    public SnowFlakeUUidUtils(){
+        this.datacenterId = getDatacenterId(maxDatacenterId);
+        this.workerId = getMaxWorkerId(datacenterId, maxWorkerId);
+    }
+    /**
+     * @param workerId
+     *            工作机器ID
+     * @param datacenterId
+     *            序列号
+     */
+    public SnowFlakeUUidUtils(long workerId, long datacenterId) {
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
+        }
+        if (datacenterId > maxDatacenterId || datacenterId < 0) {
+            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
+        }
+        this.workerId = workerId;
+        this.datacenterId = datacenterId;
+    }
+    /**
+     * 获取下一个ID
+     * 线程安全
+     * @return NULL 抢锁失败,需要重新调用
+     *         数字串 抢锁成功,则生成20位的数字串
+     */
+    public  Long nextId() {
+        try {
+
+            if(myLock.tryLock(700 , TimeUnit.MILLISECONDS)){
+                try {
+                    long timestamp = timeGen();
+                    if (timestamp < lastTimestamp) {
+                        throw new RuntimeException(String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
+                    }
+
+                    if (lastTimestamp == timestamp) {
+                        // 当前毫秒内,则+1
+                        sequence = (sequence + 1) & sequenceMask;
+                        if (sequence == 0) {
+                            // 当前毫秒内计数满了,则等待下一秒
+                            timestamp = tilNextMillis(lastTimestamp);
+                        }
+                    } else {
+                        sequence = 0L;
+                    }
+                    lastTimestamp = timestamp;
+                    // ID偏移组合生成最终的ID,并返回ID
+                    Long nextId = ((timestamp - twepoch) << timestampLeftShift)
+                            | (datacenterId << datacenterIdShift)
+                            | (workerId << workerIdShift) | sequence;
+
+                    return nextId;
+                }catch (Exception e){
+                    log.info("生成UUID抢锁失败:{}" , e);
+                }finally {
+                    myLock.unlock();
+                }
+            }else{
+                return null;
+            }
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        return null;
+
+    }
+
+    private long tilNextMillis(final long lastTimestamp) {
+        long timestamp = this.timeGen();
+        while (timestamp <= lastTimestamp) {
+            timestamp = this.timeGen();
+        }
+        return timestamp;
+    }
+
+    private long timeGen() {
+        return System.currentTimeMillis();
+    }
+
+    /**
+     * <p>
+     * 获取 maxWorkerId
+     * </p>
+     */
+    protected static long getMaxWorkerId(long datacenterId, long maxWorkerId) {
+        StringBuffer mpid = new StringBuffer();
+        mpid.append(datacenterId);
+        String name = ManagementFactory.getRuntimeMXBean().getName();
+        if (!name.isEmpty()) {
+            /*
+             * GET jvmPid
+             */
+            mpid.append(name.split("@")[0]);
+        }
+        /*
+         * MAC + PID 的 hashcode 获取16个低位
+         */
+        return (mpid.toString().hashCode() & 0xffff) % (maxWorkerId + 1);
+    }
+
+    /**
+     * <p>
+     * 数据标识id部分
+     * </p>
+     */
+    protected static long getDatacenterId(long maxDatacenterId) {
+        long id = 0L;
+        try {
+            InetAddress ip = InetAddress.getLocalHost();
+            NetworkInterface network = NetworkInterface.getByInetAddress(ip);
+            if (network == null) {
+                id = 1L;
+            } else {
+                byte[] mac = network.getHardwareAddress();
+                id = ((0x000000FF & (long) mac[mac.length - 1])
+                        | (0x0000FF00 & (((long) mac[mac.length - 2]) << 8))) >> 6;
+                id = id % (maxDatacenterId + 1);
+            }
+        } catch (Exception e) {
+            System.out.println(" getDatacenterId: " + e.getMessage());
+        }
+        return id;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(SnowFlakeUUidUtils.generaUUid(null, null, null));
+    }
+
+}

+ 61 - 0
720yun_fd_manage/gis_common/src/main/java/com/gis/common/util/StreamGobbler.java

@@ -0,0 +1,61 @@
+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;  
+            while ( (line = br.readLine()) != null) {  
+                if (pw != null)  
+                    pw.println(line);  
+                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();  
+            }  
+        }  
+    }  
+}

BIN
720yun_fd_manage/gis_common/src/main/resources/img/kankan_icon.png


+ 22 - 0
720yun_fd_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>720yun_fd_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>

+ 32 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/CatalogDto.java

@@ -0,0 +1,32 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2021/2/22 0022 10:24
+ */
+@Data
+public class CatalogDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    @ApiModelProperty(value = "父目录Id")
+    private Long parentId;
+
+    @NotNull(message = "作品id不能为空")
+    @ApiModelProperty(value = "作品id")
+    private Long workId;
+
+
+
+
+}

+ 29 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/EditSomeDataDto.java

@@ -0,0 +1,29 @@
+package com.gis.domain.dto;
+
+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 EditSomeDataDto {
+
+    @NotNull(message = "场景id不能为空")
+    @ApiModelProperty(value = "场景id", required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "场景-someData")
+    private String someData;
+
+    @NotBlank(message = "场景名称不能为空")
+    @ApiModelProperty(value = "(场景名称)文件名")
+    private String sceneTitle;
+
+
+
+
+}

+ 20 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java

@@ -0,0 +1,20 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2021/2/23 0023 16:39
+ */
+@Data
+public class FodderDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+}

+ 15 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/FodderPageDto.java

@@ -0,0 +1,15 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2021/1/8 0008 16:31
+ */
+@Data
+public class FodderPageDto extends PageDto {
+
+    @ApiModelProperty(value = "类型, 全景图:pano, 图片:image, 音频:audio, 视频:video")
+    private String type;
+
+}

+ 27 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/PageDateDto.java

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

+ 26 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/PageDto.java

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

+ 40 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/SceneDto.java

@@ -0,0 +1,40 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2021/2/22 0028 16:36
+ */
+@Data
+public class SceneDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+//    @NotBlank(message = "标题不能为空")
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+//    @NotBlank(message = "封面图不能为空")
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "分组Id")
+    private Long catalogId;
+
+    @ApiModelProperty(value = "作品Id")
+    private Long workId;
+
+    @ApiModelProperty(value = "类型:pano/4dkk")
+    private String type;
+
+//    @ApiModelProperty(value = "场景密码")
+//    private String password;
+
+}

+ 23 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/UseHotsDto.java

@@ -0,0 +1,23 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * Created by owen on 2021/2/25 0025 18:32
+ */
+
+@Data
+public class UseHotsDto {
+
+    @NotNull(message = "全景id能为空")
+    @ApiModelProperty(value = "id", required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "场景关联的场景码, 多个以逗号隔开")
+    private List sceneCodes;
+}

+ 60 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/VrModelDto.java

@@ -0,0 +1,60 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ * 保存VR模型实体
+ */
+@Data
+public class VrModelDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private String id;
+
+    @NotBlank(message = "楼盘id不能为空")
+    @ApiModelProperty(value = "楼盘id", required = true)
+    private String houseId;
+
+    @NotBlank(message = "恒大样本间id不能为空")
+    @ApiModelProperty(value = "恒大样本间id", required = true)
+    private String roomId;
+
+    @NotBlank(message = "样版间名称不能为空")
+    @ApiModelProperty(value = "样版间名称", required = true)
+    private String roomName;
+
+    @NotBlank(message = "vrModelId不能为空")
+    @ApiModelProperty(value = "vrModelId(四维看看场景id)" ,required = true)
+    private String vrModelId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+//    @NotBlank(message = "场景链接不能为空")
+//    @ApiModelProperty(value = "场景链接", required = true)
+//    private String webSite;
+
+    @NotBlank(message = "场景码不能为空")
+    @ApiModelProperty(value = "场景码(四维看看)", required = true)
+    private String sceneCode;
+
+    @NotBlank(message = "恒大id不能为空")
+    @ApiModelProperty(value = "恒大id", required = true)
+    private String hengdaId;
+
+
+
+
+
+
+}

+ 56 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/WorkDto.java

@@ -0,0 +1,56 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2021/2/22 0028 16:36
+ */
+@Data
+public class WorkDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+//    @ApiModelProperty(value = "状态")
+//    private Integer status;
+
+//    @ApiModelProperty(value = "创建人")
+//    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "场景密码")
+    private String password;
+
+    @ApiModelProperty(value = "PC端提示语")
+    private String pcIcon;
+
+    @ApiModelProperty(value = "移动端提示语")
+    private String appIcon;
+
+    @ApiModelProperty(value = "提醒开关:0:不提醒, 1:提醒")
+    private Integer isRemind;
+
+    @ApiModelProperty(value = "提醒时间,单位秒")
+    private Integer remindTime;
+
+    @ApiModelProperty(value = "自定义logo")
+    private String logo;
+
+    @ApiModelProperty(value = "显示logo, 0:关,1:开")
+    private Integer isLogo;
+
+    @ApiModelProperty(value = "自动巡游, 0:关,1:开")
+    private Integer isAuto;
+
+}

+ 22 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/dto/XmlDataDto.java

@@ -0,0 +1,22 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2021/1/14 0014 19:11
+ */
+@Data
+public class XmlDataDto {
+
+    @ApiModelProperty(value = "hlookat", required = true)
+    private String hlookat;
+
+    @ApiModelProperty(value = "vlookat" ,required = true)
+    private String vlookat;
+
+    @ApiModelProperty(value = "id" ,required = true)
+    private Long id;
+}

+ 41 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java

@@ -0,0 +1,41 @@
+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;
+
+    /**
+     * 用来批量操作的
+     * 0代表未删除 , 1代表已经删除,默认写0
+     * 需要使用对象类型
+     */
+    @JsonIgnore
+    @JSONField(serialize = false)
+    private Integer isDelete;
+
+
+}

+ 40 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/CatalogEntity.java

@@ -0,0 +1,40 @@
+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 = "tb_catalog")
+public class CatalogEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 4942917362578018318L;
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+//    @ApiModelProperty(value = "创建人")
+//    private String userId;
+
+    @ApiModelProperty(value = "作品Id")
+        private Long workId;
+
+    @ApiModelProperty(value = "排序(序号小排前面)")
+    private Integer sort;
+
+    @ApiModelProperty(value = "目录层级,最大二级")
+    private Integer level;
+
+    @ApiModelProperty(value = "父目录Id")
+    private Long parentId;
+
+
+
+
+}

+ 59 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/FodderEntity.java

@@ -0,0 +1,59 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import java.io.Serializable;
+
+@Data
+@Entity
+@Table(name = "tb_fodder")
+public class FodderEntity extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = -1428200960867373738L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "存放地址")
+    private String filePath;
+
+    @ApiModelProperty(value = "oss存放地址")
+    private String ossPath;
+
+    @ApiModelProperty(value = "状态 1:切图中, 2:失败, 3:完成")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型, 全景图:pano, 图片:image, 音频:audio, 视频:video")
+    private String type;
+
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件大小,单位KB")
+    private String fileSize;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @ApiModelProperty(value = "分辨率")
+    private String dpi;
+
+
+    @Transient
+    @ApiModelProperty(value = "该作品下的场景是否已使用")
+    private Integer isUse = 0;
+
+
+
+
+
+}

+ 96 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/SceneEntity.java

@@ -0,0 +1,96 @@
+package com.gis.domain.entity;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Entity
+@Table(name = "tb_scene")
+public class SceneEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+//    @ApiModelProperty(value = "存放地址")
+//    private String path;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+//    @ApiModelProperty(value = "oss存放地址")
+//    private String ossPath;
+
+//    @ApiModelProperty(value = "状态 1:切图中, 2:失败, 3:完成(未审核), 4:审核通过")
+//    private Integer status;
+
+//    @ApiModelProperty(value = "类型, 全景图:pano, 图片:image, 音频:audio, 视频:video")
+//    private String type;
+
+//    @ApiModelProperty(value = "目录, 1:目录, 0:文件")
+//    private Integer isDir;
+
+//    @ApiModelProperty(value = "创建人")
+//    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+//    @ApiModelProperty(value = "文件名")
+//    private String fileName;
+
+    @ApiModelProperty(value = "someData")
+    private String someData;
+
+    @ApiModelProperty(value = "初始场景,0:否, 1:是(排第一)")
+    private Integer isIndex;
+
+
+    @ApiModelProperty(value = "排序(序号小排前面)")
+    private Integer sort;
+
+    @ApiModelProperty(value =  "初始视觉")
+    private String initVisual;
+
+//    @ApiModelProperty(value = "访问量")
+//    private Integer visit;
+
+//    @ApiModelProperty(value = "是否添加到720, 0:否, 1:是")
+//    private Integer isShow;
+
+//    @ApiModelProperty(value = "目录层级,最大三级")
+//    private Integer dirLevel;
+//
+    @ApiModelProperty(value = "类型:pano/4dkk")
+    private String type;
+
+    @ApiModelProperty(value = "目录分组Id")
+    private Long catalogId;
+
+//    @JsonIgnore
+//    @ApiModelProperty(value = "场景密码, 默认0:不需要密码")
+//    private String password;
+
+
+    @ApiModelProperty(value = "作品Id")
+    private Long workId;
+
+    @ApiModelProperty(value =  "热点关联场景, 场景码,允许多个以逗号隔开")
+    private String useHots;
+
+
+
+}

+ 58 - 0
720yun_fd_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;
+
+
+
+
+}

+ 69 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/entity/WorkEntity.java

@@ -0,0 +1,69 @@
+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 = "tb_work")
+public class WorkEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 5547099647255957890L;
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "状态, 0:默认不显示, 1:显示")
+    private Integer status;
+
+    @ApiModelProperty(value = "创建人")
+    private String userId;
+
+    @ApiModelProperty(value = "封面图")
+    private String icon;
+
+    @ApiModelProperty(value = "访问量")
+    private Integer visit;
+
+//    @JSONField(serialize = false)
+    @ApiModelProperty(value = "作品密码, 默认0:不需要密码")
+    private String password;
+
+    @ApiModelProperty(value = "PC端提示语")
+    private String pcIcon;
+
+    @ApiModelProperty(value = "移动端提示语")
+    private String appIcon;
+
+    @ApiModelProperty(value = "提醒开关:0:不提醒, 1:提醒")
+    private Integer isRemind;
+
+    @ApiModelProperty(value = "提醒时间,单位秒")
+    private Integer remindTime;
+
+    @ApiModelProperty(value = "自定义logo")
+    private String logo;
+
+    @ApiModelProperty(value = "显示logo, 0:关,1:开")
+    private Integer isLogo;
+
+    @ApiModelProperty(value = "自动巡游, 0:关,1:开")
+    private Integer isAuto;
+
+    @ApiModelProperty(value = "二维码")
+    private String qrCode;
+
+    @ApiModelProperty(value = "初始场景id(场景id)")
+    private Long sceneIndex;
+
+}

+ 97 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/vo/CatalogSceneTree.java

@@ -0,0 +1,97 @@
+package com.gis.domain.vo;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class CatalogSceneTree implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "分组id")
+    private Long id;
+
+    @ApiModelProperty(value = "分组名称")
+    private String name;
+
+    @ApiModelProperty(value = "删除")
+    private Integer isDelete;
+
+    @ApiModelProperty(value = "作品id")
+    private Long workId;
+
+    @ApiModelProperty(value = "父分组id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "场景id")
+    private Long sceneId;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+//    @ApiModelProperty(value = "存放地址")
+//    private String path;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+        @ApiModelProperty(value = "分组Id")
+    private String catalogId;
+
+
+//
+//    @ApiModelProperty(value = "场景url")
+//    private String webSite;
+
+//    @ApiModelProperty(value = "简介")
+//    private String description;
+
+//    @ApiModelProperty(value = "oss存放地址")
+//    private String ossPath;
+
+//    @ApiModelProperty(value = "封面图")
+//    private String icon;
+
+//    @ApiModelProperty(value = "文件名")
+//    private String fileName;
+//
+//    @ApiModelProperty(value = "someData")
+//    private String someData;
+//
+//    @ApiModelProperty(value = "初始场景,0:否, 1:是(排第一)")
+//    private Integer isIndex;
+//
+//    @ApiModelProperty(value = "排序(序号小排前面)")
+//    private Integer sort;
+//
+//    @ApiModelProperty(value =  "初始视觉")
+//    private String initVisual;
+//
+//    @ApiModelProperty(value = "访问量")
+//    private Integer visit;
+//
+//    @ApiModelProperty(value = "是否添加到720, 0:否, 1:是")
+//    private Integer isShow;
+
+
+
+
+//
+//    @ApiModelProperty(value = "类型")
+//    private String type;
+
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "目录层级,最大二级")
+    private Integer level;
+
+
+    /** 默认给空数组*/
+    private List<CatalogSceneTree> children = new ArrayList<>();
+
+}

+ 38 - 0
720yun_fd_manage/gis_domain/src/main/java/com/gis/domain/vo/ProSceneVo.java

@@ -0,0 +1,38 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 四维看看 实体
+ */
+
+@Data
+public class ProSceneVo extends BaseEntity implements Serializable {
+
+
+    private static final long serialVersionUID = 7905086816704543888L;
+    @ApiModelProperty(value = "场景码")
+    private String num;
+
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneName;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "缩略图")
+    private String thumb;
+
+    @ApiModelProperty(value = "状态 ")
+    private Integer status;
+
+    @ApiModelProperty(value = "该作品下的场景是否已使用")
+    private Integer isUse = 0;
+
+
+}

+ 22 - 0
720yun_fd_manage/gis_mapper/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>720yun_fd_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>

+ 33 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/CatalogMapper.java

@@ -0,0 +1,33 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.CatalogEntity;
+import com.gis.domain.vo.CatalogSceneTree;
+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 CatalogMapper extends IBaseMapper<CatalogEntity, Long> {
+
+//    @Select("select * from tb_catalog where is_delete = 0 and user_id = #{userId}")
+//    List<CatalogEntity> findByUserId(String userId);
+
+    @Select("select * from tb_catalog where is_delete = 0 and work_id = #{workId}")
+    List<CatalogEntity> findByWorkId(Long workId);
+
+
+//    @Select("select a.id,a.parent_id,a.is_delete,b.id as scene_id ,b.scene_code, b.scene_title,b.catalog_id" +
+//            "from tb_catalog a LEFT JOIN tb_scene b on a.id = b.catalog_id and b.is_delete='0' WHERE a.is_delete = '0' and a.work_id = '5'")
+
+    @Select("select a.id,a.parent_id,a.name,a.work_id,a.is_delete,b.id as scene_id ,b.scene_code, b.scene_title,b.catalog_id" +
+            " from tb_catalog a LEFT JOIN tb_scene b on a.id = b.catalog_id and b.is_delete='0' WHERE a.is_delete = '0' and a.work_id = #{workId}")
+
+//    @Select("select a.*,b.*" +
+//            "from tb_catalog a LEFT JOIN tb_scene b on a.id = b.catalog_id and b.is_delete='0' WHERE a.is_delete = '0' and a.work_id = '5'")
+    List<CatalogSceneTree> afindByWorkId(Long workId);
+}

+ 30 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/FodderMapper.java

@@ -0,0 +1,30 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.FodderPageDto;
+import com.gis.domain.entity.FodderEntity;
+import com.gis.mapper.provider.FodderProvider;
+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 FodderMapper extends IBaseMapper<FodderEntity, Long> {
+
+    @Select("select * from tb_fodder where is_delete = 0 and user_id = #{userId} AND status = #{status} AND type = #{type}")
+    List<FodderEntity> findByStatusAndTypeAndUserId(int status, String type, String userId);
+
+    @Select("select * from tb_fodder where is_delete = 0 and user_id = #{userId} AND type = #{type}")
+    List<FodderEntity> findByType(String userId, String type);
+
+    @SelectProvider(type = FodderProvider.class, method = "search")
+    List<FodderEntity> search(FodderPageDto param, String userId);
+
+    @Select("select * from tb_fodder where is_delete = 0 and scene_code = #{sceneCode} ")
+    FodderEntity findBySceneCode(String sceneCode);
+}

+ 18 - 0
720yun_fd_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> {
+}

+ 89 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java

@@ -0,0 +1,89 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SceneEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Component
+@Mapper
+public interface SceneMapper extends IBaseMapper<SceneEntity, Long> {
+
+//    @SelectProvider(type = SceneProvider.class, method = "search")
+//    List<SceneEntity> search(ScenePageDto param);
+//
+//    @SelectProvider(type = SceneProvider.class, method = "searchByUserName")
+//    List<SceneEntity> searchByUserName(ScenePageDto param, String userName, String isShow);
+
+    @Update("UPDATE tb_scene SET is_index=#{index}")
+    void setIndex(Integer index);
+
+//    @Update("UPDATE tb_scene SET is_index=#{index} where user_id = #{userId}")
+//    void setIndexByUserId(Integer index, String userId);
+
+//    @Update("UPDATE tb_scene SET is_index=#{index} where work_id = #{workId}")
+//    void setIndexByWorkId(int index, Long workId);
+
+    @Update("UPDATE tb_scene SET is_index=#{index} where id = #{id}")
+    void setIndexById(Long id, Integer index);
+
+    @Select("select * from tb_scene where is_delete = 0 and scene_code = #{sceneCode}")
+    SceneEntity findBySceneCode(String sceneCode);
+
+    @Select("select * from tb_scene where is_delete = 0 and vr_model_id = #{vrModelId}")
+    SceneEntity findByVrModelId(String vrModelId);
+
+    @Select("select * from tb_scene where is_delete = 0 and vr_model_id = #{vrModelId}")
+    List<SceneEntity> findByVrModelId2(String vrModelId);
+
+    @Select("select * from tb_scene where is_delete = 0 and vr_model_id = #{vrModelId} and house_id = #{houseId}")
+    SceneEntity findByVrModelIdAndHouseId(String vrModelId, String houseId);
+
+    @Select("select * from tb_scene where is_delete = 0 and is_index = 1 and create_user_id = #{userName} ")
+    List<SceneEntity> getIndex(String userName);
+
+    @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId}")
+    List<SceneEntity> findByHouseId(String houseId);
+
+    @Select("select * from tb_scene where is_delete = 0 and house_id = #{houseId} and type = #{type} order by sort asc, create_time asc ")
+    List<SceneEntity> findByHouseIdAndType(String houseId, String type);
+
+    @Update("UPDATE tb_scene SET sort=#{sort} where id = #{id}")
+    void setSortById(String id, String sort);
+
+    @Select("select scene_code from tb_scene where is_delete = 0 and status >= #{status} and type = #{type} and house_id = #{houseId}")
+    List<String> getVrSceneCode(String houseId, String status, String type);
+
+    @Update("UPDATE tb_scene SET is_delete = 1 where is_delete = 0 AND house_id = #{houseId}")
+    void houseRemove(String houseId);
+
+    @Update("UPDATE tb_scene SET status = #{status} where is_delete = 0 AND house_id = #{houseId}")
+    void houseAudit(String houseId, String status);
+
+    @Select("select * from tb_scene where is_delete = 0 and status = #{status} and house_id = #{houseId}")
+    List<SceneEntity> findByHouseIdAndStatus(String houseId, String status);
+
+    /**
+     * for update 锁表更新完,才能进行更新,需要开启事务
+     * 并发量大作会出现脏数据
+     *
+     * @param id
+     * @return
+     */
+    @Select("select * from tb_scene where is_delete = 0 and id = #{id} for update")
+    SceneEntity findByIdForUpdate(Long id);
+
+    @Select("select * from tb_scene where is_delete = 0 and catalog_id = #{catalogId}")
+    List<SceneEntity> findByCatalogId(Long catalogId);
+
+    @Select("select * from tb_scene where is_delete = 0 and work_id = #{workId}")
+    List<SceneEntity> findByWorkId(Long workId);
+
+    @Select("select scene_code from tb_scene where is_delete = 0 and work_id = #{workId} AND type = #{type}")
+    List<String> strFindByWorkId(Long workId, String type);
+}

+ 27 - 0
720yun_fd_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);
+}

+ 22 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/WorkMapper.java

@@ -0,0 +1,22 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDto;
+import com.gis.domain.entity.WorkEntity;
+import com.gis.mapper.provider.WorkProvider;
+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 WorkMapper extends IBaseMapper<WorkEntity, Long> {
+
+
+
+    @SelectProvider(type = WorkProvider.class, method = "search")
+    List<WorkEntity> search(PageDto param, String userId);
+}

+ 38 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/FodderProvider.java

@@ -0,0 +1,38 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.dto.FodderPageDto;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2021/1/8 0008 16:50
+ */
+@Log4j2
+public class FodderProvider {
+
+    public String search(FodderPageDto param, String userId){
+        StringBuffer sql = new StringBuffer("select * from tb_fodder 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 asc");
+
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+
+
+}

+ 76 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/SceneProvider.java

@@ -0,0 +1,76 @@
+//package com.gis.mapper.provider;
+//
+//import com.gis.domain.dto.ScenePageDto;
+//import lombok.extern.log4j.Log4j2;
+//import org.apache.commons.lang3.StringUtils;
+//
+///**
+// * Created by owen on 2021/1/8 0008 16:50
+// */
+//@Log4j2
+//public class SceneProvider {
+//
+//    public String search(ScenePageDto param){
+//        StringBuffer sql = new StringBuffer("select * from tb_scene where is_delete = 0");
+//
+//        String houseId = param.getHouseId();
+//        if(!StringUtils.isAllBlank(houseId)){
+//            sql.append(" and ( house_id = '").append(houseId).append("' )");
+//        }
+//
+//        String searchKey = param.getSearchKey();
+//        if(!StringUtils.isAllBlank(searchKey)){
+//            sql.append(" and ( scene_title like '%").append(searchKey).append("%' )");
+//        }
+//
+//        String type = param.getType();
+//        if(!StringUtils.isAllBlank(type)){
+//            sql.append(" and ( type = '").append(type).append("' )");
+//        }
+//
+//        String status = param.getStatus();
+//        // 传3 过来,会把审核:4、未审核:3的都传给前端
+//        if(StringUtils.isNotBlank(status)){
+//            sql.append(" and ( status >= '").append(status).append("' )");
+//        }
+//
+//        sql.append(" order by sort asc, create_time asc");
+//
+//        log.info("sql: {}", sql.toString());
+//        return sql.toString();
+//    }
+//
+//
+//    public String searchByUserName(ScenePageDto param, String userName, String isShow){
+//        StringBuffer sql = new StringBuffer("select * from tb_scene where is_delete = 0");
+//
+//        sql.append(" and ( create_user_id = '").append(userName).append("' )");
+//
+//
+//        String searchKey = param.getSearchKey();
+//        if(!StringUtils.isAllBlank(searchKey)){
+//            sql.append(" and ( scene_title like '%").append(searchKey).append("%' )");
+//        }
+//
+//        String type = param.getType();
+//        if(!StringUtils.isAllBlank(type)){
+//            sql.append(" and ( type = '").append(type).append("' )");
+//        }
+//
+//        String status = param.getStatus();
+//        // 传3 过来,会把审核:4、未审核:3的都传给前端
+//        if(StringUtils.isNotBlank(status)){
+//            sql.append(" and ( status >= '").append(status).append("' )");
+//        }
+//
+//
+//        if(StringUtils.isNotBlank(isShow)){
+//            sql.append(" and ( is_show = '").append(isShow).append("' )");
+//        }
+//
+//        sql.append(" order by sort asc, create_time asc");
+//
+//        log.info("sql: {}", sql.toString());
+//        return sql.toString();
+//    }
+//}

+ 33 - 0
720yun_fd_manage/gis_mapper/src/main/java/com/gis/mapper/provider/WorkProvider.java

@@ -0,0 +1,33 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.dto.PageDto;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2021/1/8 0008 16:50
+ */
+@Log4j2
+public class WorkProvider {
+
+    public String search(PageDto param, String userId){
+        StringBuffer sql = new StringBuffer("select * from tb_work where is_delete = 0 and status > 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("%' )");
+        }
+
+        sql.append(" order by create_time asc");
+
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+
+
+}

+ 23 - 0
720yun_fd_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>720yun_fd_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>

+ 25 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/listener/TestConsumer.java

@@ -0,0 +1,25 @@
+package com.gis.listener;
+
+
+/**
+ * Created by owen on 2021/1/12 0012 10:05
+ */
+//@Slf4j
+//@Component
+//@RabbitListener(queues = RabbitConfig.TEST_QUEUE) // 指定监听队列
+//public class TestConsumer {
+//
+//
+//
+//
+//    @RabbitHandler
+//    public void getMessage(String param)  {
+//        log.warn("run Listener TestConsumer: " + param);
+//
+//        log.warn("end Listener TestConsumer");
+//    }
+//
+//
+//
+//
+//}

+ 0 - 0
720yun_fd_manage/gis_service/src/main/java/com/gis/service/CatalogService.java


Some files were not shown because too many files changed in this diff