wuweihao 3 лет назад
Родитель
Сommit
aab71c152e
83 измененных файлов с 5893 добавлено и 2 удалено
  1. 9 2
      README.md
  2. 47 0
      gis_application/pom.xml
  3. 15 0
      gis_application/src/main/java/com/gis/GisApplication.java
  4. 13 0
      gis_application/src/main/java/com/gis/ServletInitializer.java
  5. 86 0
      gis_application/src/main/resources/application-dev.properties
  6. 83 0
      gis_application/src/main/resources/application-pro.properties
  7. 36 0
      gis_application/src/main/resources/application.properties
  8. 156 0
      gis_application/src/main/resources/logback-spring.xml
  9. 11 0
      gis_application/src/main/resources/static/shutdown.sh
  10. 29 0
      gis_application/src/main/resources/static/start.sh
  11. 151 0
      gis_common/pom.xml
  12. 49 0
      gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  13. 88 0
      gis_common/src/main/java/com/gis/common/config/Swagger2.java
  14. 78 0
      gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java
  15. 20 0
      gis_common/src/main/java/com/gis/common/constant/Account.java
  16. 81 0
      gis_common/src/main/java/com/gis/common/constant/ConfigConstant.java
  17. 55 0
      gis_common/src/main/java/com/gis/common/constant/ErrorEnum.java
  18. 10 0
      gis_common/src/main/java/com/gis/common/constant/TypeCode.java
  19. 134 0
      gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java
  20. 34 0
      gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java
  21. 235 0
      gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java
  22. 404 0
      gis_common/src/main/java/com/gis/common/util/DateUtil.java
  23. 69 0
      gis_common/src/main/java/com/gis/common/util/DateUtils.java
  24. 114 0
      gis_common/src/main/java/com/gis/common/util/FileUtils.java
  25. 80 0
      gis_common/src/main/java/com/gis/common/util/HttpRequestorUtil.java
  26. 194 0
      gis_common/src/main/java/com/gis/common/util/PasswordUtils.java
  27. 22 0
      gis_common/src/main/java/com/gis/common/util/RandomUtils.java
  28. 97 0
      gis_common/src/main/java/com/gis/common/util/RegexUtil.java
  29. 101 0
      gis_common/src/main/java/com/gis/common/util/Result.java
  30. 177 0
      gis_common/src/main/java/com/gis/common/util/StatisticsUtil.java
  31. 22 0
      gis_domain/pom.xml
  32. 41 0
      gis_domain/src/main/java/com/gis/domain/dto/AgeAlipayDto.java
  33. 53 0
      gis_domain/src/main/java/com/gis/domain/dto/ExhibitsDto.java
  34. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/LoginDto.java
  35. 27 0
      gis_domain/src/main/java/com/gis/domain/dto/PageDateDto.java
  36. 26 0
      gis_domain/src/main/java/com/gis/domain/dto/PageDto.java
  37. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/PasswordDto.java
  38. 38 0
      gis_domain/src/main/java/com/gis/domain/dto/UserDto.java
  39. 40 0
      gis_domain/src/main/java/com/gis/domain/entity/AgeAlipayEntity.java
  40. 52 0
      gis_domain/src/main/java/com/gis/domain/entity/AgeBooksEntity.java
  41. 38 0
      gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java
  42. 32 0
      gis_domain/src/main/java/com/gis/domain/entity/SceneCountEntity.java
  43. 90 0
      gis_domain/src/main/java/com/gis/domain/entity/SceneStatisticsEntity.java
  44. 58 0
      gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java
  45. 22 0
      gis_mapper/pom.xml
  46. 15 0
      gis_mapper/src/main/java/com/gis/mapper/AgeAlipayMapper.java
  47. 25 0
      gis_mapper/src/main/java/com/gis/mapper/AgeBooksMapper.java
  48. 18 0
      gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java
  49. 27 0
      gis_mapper/src/main/java/com/gis/mapper/SceneCountMapper.java
  50. 23 0
      gis_mapper/src/main/java/com/gis/mapper/SceneStatisticsMapper.java
  51. 27 0
      gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  52. 23 0
      gis_service/pom.xml
  53. 20 0
      gis_service/src/main/java/com/gis/service/AgeAlipayService.java
  54. 17 0
      gis_service/src/main/java/com/gis/service/AgeBooksService.java
  55. 47 0
      gis_service/src/main/java/com/gis/service/IBaseService.java
  56. 24 0
      gis_service/src/main/java/com/gis/service/SceneCountService.java
  57. 21 0
      gis_service/src/main/java/com/gis/service/SceneStatisticsService.java
  58. 21 0
      gis_service/src/main/java/com/gis/service/SysUserService.java
  59. 60 0
      gis_service/src/main/java/com/gis/service/impl/AgeAlipayServiceImpl.java
  60. 60 0
      gis_service/src/main/java/com/gis/service/impl/AgeBooksServiceImpl.java
  61. 179 0
      gis_service/src/main/java/com/gis/service/impl/IBaseServiceImpl.java
  62. 58 0
      gis_service/src/main/java/com/gis/service/impl/SceneCountServiceImpl.java
  63. 82 0
      gis_service/src/main/java/com/gis/service/impl/SceneStatisticsServiceImpl.java
  64. 51 0
      gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java
  65. 27 0
      gis_web/pom.xml
  66. 13 0
      gis_web/src/main/java/com/gis/web/aop/WebControllerLog.java
  67. 102 0
      gis_web/src/main/java/com/gis/web/aop/WebLogAspect.java
  68. 42 0
      gis_web/src/main/java/com/gis/web/controller/AgeAlipayController.java
  69. 33 0
      gis_web/src/main/java/com/gis/web/controller/AgeBooksController.java
  70. 85 0
      gis_web/src/main/java/com/gis/web/controller/BaseController.java
  71. 142 0
      gis_web/src/main/java/com/gis/web/controller/ExceptionController.java
  72. 102 0
      gis_web/src/main/java/com/gis/web/controller/IndexController.java
  73. 65 0
      gis_web/src/main/java/com/gis/web/controller/SceneCountController.java
  74. 93 0
      gis_web/src/main/java/com/gis/web/controller/SceneStatisticsController.java
  75. 118 0
      gis_web/src/main/java/com/gis/web/controller/SysUserController.java
  76. 45 0
      gis_web/src/main/java/com/gis/web/job/ScheduleJob.java
  77. 136 0
      gis_web/src/main/java/com/gis/web/shiro/JWTFilter.java
  78. 23 0
      gis_web/src/main/java/com/gis/web/shiro/JWTToken.java
  79. 253 0
      gis_web/src/main/java/com/gis/web/shiro/JwtUtil.java
  80. 111 0
      gis_web/src/main/java/com/gis/web/shiro/MyRealm.java
  81. 121 0
      gis_web/src/main/java/com/gis/web/shiro/ShiroConfig.java
  82. 265 0
      pom.xml
  83. 60 0
      run.sh

+ 9 - 2
README.md

@@ -3,11 +3,18 @@
 小项目:百度统计、场景统计、收集用户信息等
 
 # 已部署项目
-1.百度统计接口 
+ ##1.百度统计接口 
     1.1 每天定时去查数据
 
-2. 场景统计(点赞、访问量)
+
+ ##2. 场景统计(点赞、访问量)
     2.1 大理洱海 2022-3-25 
+ 
+ ##3. 珠海市唐家半岛—无界AR书店
+    3.1 2021-12-1   
+    
+ ##4. 支付宝-用户信息记录
+    4.1 2022-5-5   
     
 # pro
   server: 47.112.166.173

+ 47 - 0
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>cms_statistics_baidu</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>cms_statistics_baidu</finalName>
+    </build>
+
+
+
+</project>

+ 15 - 0
gis_application/src/main/java/com/gis/GisApplication.java

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

+ 13 - 0
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);
+    }
+
+}

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

@@ -0,0 +1,86 @@
+
+
+#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
+
+# pro-db
+spring.datasource.druid.url=jdbc:mysql://47.112.166.173:3306/${project.en}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkankan4dage
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.password=
+# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4 \u5355\u4F4D ms\uFF08\u6BEB\u79D2\uFF09
+spring.redis.timeout=3000ms
+# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F8\u3002
+spring.redis.jedis.pool.max-idle=8
+#\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F0\u3002
+spring.redis.jedis.pool.min-idle=0
+# \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
+spring.redis.jedis.pool.max-active=8
+# \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
+spring.redis.jedis.pool.max-wait=-1ms
+
+
+
+#log
+logging.file.path=E:/log/${project.en}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+# swagger2
+swagger.package=com.gis
+swagger.title=${project.sc}-sit
+swagger.description=${swagger.title}
+swagger.version=1.0
+
+server.file.path=E:\\data\\${project.en}_data
+server.domain=192.168.0.135
+
+
+
+#
+spring.mvc.static-path-pattern=/**
+### \u01A5\uFFFD\uFFFD\u00B7\uFFFD\uFFFD\uFFFD\uFFFD \u05E2\uFFFD\uFFFDfile\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD/ \uFFFD\uFFFDwindows:\\  , linxu:\u022B\u00B7\uFFFD\uFFFD, \uFFFD\uFFFD\uFFFD\uFFFD\u04AA\uFFFD\u0631\uFFFD\uFFFD\u0431\uFFFD\uFFFD
+spring.resources.static-locations=file:\\${server.file.path}
+
+
+# \uFFFD\u03F4\uFFFD\uFFFD\u013C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+# \uFFFD\uFFFD\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+#file.path=E:\\data\\${project.en}_data\\
+
+# oss info
+oss.file.path=${project.en}/
+oss.domain=http://ossxiaoan.4dage.com/
+

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

@@ -0,0 +1,83 @@
+
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/${project.en}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkankan4dage
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.password=
+# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4 \u5355\u4F4D ms\uFF08\u6BEB\u79D2\uFF09
+spring.redis.timeout=3000ms
+# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F8\u3002
+spring.redis.jedis.pool.max-idle=8
+#\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F0\u3002
+spring.redis.jedis.pool.min-idle=0
+# \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
+spring.redis.jedis.pool.max-active=8
+# \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
+spring.redis.jedis.pool.max-wait=-1ms
+
+
+
+#log
+logging.file.path=/root/log/${project.en}_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
+# \uFFFD\uFFFD\uFFFD\u0631\uFFFD\uFFFD\uFFFD\u00B7\uFFFD\uFFFD
+#file.path=/root/user/${project.name}_data/
+
+# oss info
+oss.file.path=${project.en}/
+oss.domain=http://ossxiaoan.4dage.com/
+
+# \u65B0\u5730\u5740
+server.file.path=/root/data/${project.en}_data
+server.domain=192.168.0.135
+
+
+
+#
+spring.mvc.static-path-pattern=/**
+### \u01A5\uFFFD\uFFFD\u00B7\uFFFD\uFFFD\uFFFD\uFFFD \u05E2\uFFFD\uFFFDfile\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD/ \uFFFD\uFFFDwindows:\\  , linxu:\u022B\u00B7\uFFFD\uFFFD, \uFFFD\uFFFD\uFFFD\uFFFD\u04AA\uFFFD\u0631\uFFFD\uFFFD\u0431\uFFFD\uFFFD
+spring.resources.static-locations=file:${server.file.path}
+
+#swagger login
+knife4j.basic.enable=true
+knife4j.basic.username=owen
+knife4j.basic.password=owen
+

+ 36 - 0
gis_application/src/main/resources/application.properties

@@ -0,0 +1,36 @@
+server.port=8109
+
+spring.profiles.active=dev
+
+# \u9879\u76EE\u540D\u79F0
+project.en=cms_statistics_baidu
+project.sc=\u767E\u5EA6\u7EDF\u8BA1
+
+# \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
+
+# \u5141\u8BB8\u4E0A\u4F20\u7684\u6587\u4EF6\u540E\u7F00
+server.file.allow=.jpg,.gif,.png,.ico,.bmp,.jpeg
+
+
+
+
+
+

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

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

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

@@ -0,0 +1,29 @@
+#!/bin/sh
+RESOURCE_NAME=cms_statistics_baidu.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=pro  &
+echo $! > tpid
+echo Start Success!

+ 151 - 0
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>cms_statistics_baidu</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_common</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+
+        <!--springboot-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- JPA -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!--springboot中的redis依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- rabbit MQ-->
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.boot</groupId>-->
+            <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+        <!--</dependency>-->
+
+        <!-- lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+
+        <!-- mysql -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!--阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!-- knife4j aip 包-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- 工具类 -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+        </dependency>
+
+        <!-- 中文转拼音 -->
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</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>
+
+        <!-- 二维码 -->
+        <dependency>
+            <groupId>com.google.zxing</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+
+
+
+    </dependencies>
+
+
+</project>

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

@@ -0,0 +1,49 @@
+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")){
+        }
+
+
+        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")){
+        }
+    }
+
+
+
+
+}

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

@@ -0,0 +1,88 @@
+package com.gis.common.config;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import com.google.common.collect.Lists;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18
+ *
+ * 集成Swagger有3步:
+ * 1.pom.xml添加依赖
+ * 2.添加Swagger2.class
+ * 3.Application.class 加上注解@EnableSwagger2 表示开启Swagger
+ * 4.http://localhost:8080/doc.html#/
+ *
+ * 2.9.2 不需要字启动类配置注解
+ */
+@Configuration
+@EnableSwagger2
+@EnableKnife4j
+public class Swagger2 {
+    @Bean
+    public Docket createRestApi() {
+        return new Docket(DocumentationType.SWAGGER_2)
+                .apiInfo(apiInfo())
+                .select()
+                .apis(RequestHandlerSelectors.basePackage("com.gis.web.controller"))
+                .paths(PathSelectors.any())
+                .build()
+                //添加登录认证,可以使用token
+                .securityContexts(securityContexts())
+                .securitySchemes(securitySchemes())
+                ;
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+                .title("百度统计接口)")
+                .description("百度统计接口 Api接口文档")
+                .version("1.0")
+                .build();
+    }
+
+    private List<ApiKey> securitySchemes() {
+        //设置请求头信息
+        List<ApiKey> result = new ArrayList<>();
+//        ApiKey apiKey = new ApiKey("Authorization", "Authorization", "header");
+        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
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);
+    }
+}

+ 20 - 0
gis_common/src/main/java/com/gis/common/constant/Account.java

@@ -0,0 +1,20 @@
+package com.gis.common.constant;
+
+/**
+ * Created by owen on 2020/6/10 0010 16:39
+ */
+public class Account {
+
+    /** 百度商业账号 */
+    public final static String USER_NAME = "四维时代";
+
+    public final static String PASSWORD = "4DAge2018";
+
+    /**
+     * 1. 请您妥善保管此token值,不要外泄,否则会影响您调用相关接口。
+     * 2. 为了合理分配资源,我们为访问API的用户限定了使用配额。每一次调用API操作,都会消耗一定量的配额。
+     * 3. 百度统计API每人每周的配额是50000,每周六会统一清零,请您合理规划配额的使用。
+     * 4. 在每次访问API服务返回的响应头信息中均包含配额的相关数据,您可以从API响应的信息中查看配额情况
+     * */
+    public final static String ACCESS_TOKEN = "17a1e010f1be38abead0066b2b02cb4c";
+}

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

@@ -0,0 +1,81 @@
+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.file.allow}")
+    public String serverFileFallow;
+
+    @Value("${server.domain}")
+    public String serverDomain;
+
+    /**redis token前缀*/
+//    @Value("${redis.prefix}")
+//    public  String redisPrefix;
+
+    /**环境配置*/
+    @Value("${spring.profiles.active}")
+    public String active;
+
+
+//    /**允许上传的文件后缀*/
+//    @Value("${file.allow}")
+//    public String fileAllow;
+
+//    @Value("${project.en}")
+//    public String projectEn;
+
+
+
+//    @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("${swagger.package}")
+    public  String swaggerPackage;
+
+    @Value("${swagger.title}")
+    public  String swaggerTitle;
+
+    @Value("${swagger.description}")
+    public  String swaggerDescription;
+
+    @Value("${swagger.version}")
+    public  String swaggerVersion;
+
+
+
+
+
+
+
+
+
+
+}

+ 55 - 0
gis_common/src/main/java/com/gis/common/constant/ErrorEnum.java

@@ -0,0 +1,55 @@
+package com.gis.common.constant;
+
+/**
+ * Created by owen on 2022/3/10 0010 14:47
+ *
+ *
+ * #1000~1999 区间表示参数错误
+ * #2000~2999 区间表示用户错误
+ * #3000~3999 区间表示接口异常
+ */
+public enum ErrorEnum {
+
+    FAILURE_SYS_2001(2001, "对象不存在"),
+
+    FAILURE_CODE_3001(3001, "缺少必要参数"),
+    FAILURE_CODE_3002(3002, "访问异常!"),
+    FAILURE_CODE_3003(3003, "非法访问!"),
+    FAILURE_CODE_3004(3004, "用户未登录"),
+    FAILURE_CODE_3005(3005, "验证码已过期"),
+    FAILURE_CODE_3006(3006, "验证码错误"),
+    FAILURE_CODE_3007(3007, "昵称已存在"),
+    FAILURE_CODE_3008(3008, "该手机已被注册"),
+    FAILURE_CODE_3009(3009, "两次输入的密码不一致"),
+    FAILURE_CODE_3010(3010, "昵称长度错误"),
+    FAILURE_CODE_3011(3011, "密码需要包含英文大小写、数字,长度8-16字符"),
+    FAILURE_CODE_3012(3012, "昵称包含敏感词"),
+    FAILURE_CODE_3013(3013, "手机号码格式错误"),
+    FAILURE_CODE_3014(3014, "账号或密码不正确"),
+    FAILURE_CODE_3015(3015, "用户不存在"),
+    FAILURE_CODE_3016(3016, "登录失败,账号无权访问"),
+    FAILURE_CODE_3017(3017, "空文件"),
+    FAILURE_CODE_3018(3018, "需要上传或使用的文件不存在"),
+
+    ;
+
+    private Integer code;
+    private String message;
+
+    private ErrorEnum(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Integer code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+
+    public String formatMessage(Object... args){
+        return String.format(message, args);
+    }
+}

+ 10 - 0
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 = "zhen_token_";
+}

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

@@ -0,0 +1,134 @@
+package com.gis.common.exception;
+
+import cn.hutool.core.util.StrUtil;
+import com.gis.common.constant.ErrorEnum;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+public class BaseRuntimeException extends RuntimeException{
+
+    private static final long serialVersionUID = -1518945670203783450L;
+    private Integer code;
+    private String msg;
+
+    public BaseRuntimeException(String msg){
+        super(msg);
+        this.code = -1;
+        this.msg = msg;
+    }
+
+    /**
+     *
+     * @param code 允许为null
+     * @param msg
+     */
+    public BaseRuntimeException(Integer code, String msg){
+        super(msg);
+        this.code = code == null? -1 : code;
+        this.msg = msg;
+    }
+
+    public BaseRuntimeException(ErrorEnum errorEnum){
+        this.code = errorEnum.code();
+        this.msg = errorEnum.message();
+    }
+
+    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;
+    }
+
+
+    public static void isNull(Object obj, Integer code, String msg){
+        if (obj == null){
+            getExc(code, msg);
+        }
+    }
+
+    public static void isBlank(Object obj, Integer code, String msg){
+        if (obj == null){
+            getExc(code, msg);
+        }
+
+        if (obj instanceof String && StrUtil.isBlank(obj.toString())){
+            getExc(code, msg);
+        }
+
+    }
+
+    public static void isNull(Object obj, ErrorEnum errorEnum){
+        if (obj == null){
+            getExc(errorEnum.code(), errorEnum.message());
+        }
+    }
+
+    public static void isBlank(Object obj, ErrorEnum errorEnum){
+        Integer code = errorEnum.code();
+        String msg = errorEnum.message();
+        if (obj == null){
+            getExc(code, msg);
+        }
+
+        if (obj instanceof String && StrUtil.isBlank(obj.toString())){
+            getExc(code, msg);
+        }
+
+    }
+
+    /**
+     *
+     * @param obj true 存在抛异常
+     * @param errorEnum
+     */
+    public static void isTrue(boolean obj, ErrorEnum errorEnum){
+        if (obj){
+            getExc(errorEnum.code(), errorEnum.message());
+        }
+    }
+
+    /**
+     *
+     * @param obj 存在抛异常
+     * @param code 允许为null
+     * @param msg
+     */
+    public static void isTrue(boolean obj, Integer code, String msg){
+        if (obj){
+            getExc(code, msg);
+        }
+    }
+
+    public static void  getExc(Integer code, String msg){
+        throw new BaseRuntimeException(code, msg);
+    }
+
+    /**
+     *
+     * @param obj 集合
+     * @param errorEnum
+     */
+    public static void isEmpty(List obj, ErrorEnum errorEnum){
+        if (CollectionUtils.isEmpty(obj)){
+            getExc(errorEnum.code(), errorEnum.message());
+        }
+    }
+
+    public static void isEmpty(List obj, Integer code, String msg){
+        if (CollectionUtils.isEmpty(obj)){
+            getExc(code, msg);
+        }
+    }
+
+}

+ 34 - 0
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;
+//    }
+//}

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

@@ -0,0 +1,235 @@
+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 lombok.extern.slf4j.Slf4j;
+
+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
+public class AliyunOssUtil {
+
+
+    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);
+    
+
+    
+    public static void delete(String key) throws IOException{
+    	  try {
+    		  
+            // 2019-2-28 启动aliyun oss 空间
+          	ossClient.deleteObject(BUCKET_NAME, key);
+          } catch (Exception e) {
+              e.printStackTrace();
+          }
+    }
+    
+    //上传的数据是byte[],key是上传后的文件名
+    public void upload(byte[] data,String key) throws IOException{  
+    	try 
+    	{  
+    		// 2019-2-28 启动aliyun oss 空间
+        	ossClient.putObject(BUCKET_NAME, key, new ByteArrayInputStream(data));
+        } catch (Exception e) {
+        	log.error(e.toString()+key); 
+        }
+    }  
+    
+   
+	public static void upload(String filePath, String key) {
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+			}
+			ossClient.putObject(BUCKET_NAME, key, new File(filePath));
+
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		}
+	}
+    
+	public static void upload2(String filePath, String key) {
+		try {
+			
+			// 2019-2-28 启动aliyun oss 空间
+			ossClient.putObject(BUCKET_NAME , key, new File(filePath));
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		}
+	}
+    
+
+	/**
+	 * 上传的数据是文件夹,参数是文件夹路径,key是上传后的文件名
+	 * @param filepaths
+	 * key : 原文件路径
+	 * value: oss路径, oss会自动创建目录
+	 */
+	public static 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 static int deleteFile(String prefix){
+
+		ObjectListing objectListing = ossClient.listObjects(BUCKET_NAME, prefix);
+		List<OSSObjectSummary> sums = objectListing.getObjectSummaries();
+		try {
+			for (OSSObjectSummary s : sums) {
+				delete(s.getKey());
+			}
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	    return sums.size();  
+	}
+	
+	public static void main(String[] args) throws IOException {
+
+		HashMap<String, String> map = new HashMap<>();
+//		map.put("F:\\test\\aa.jpg", "kanfang/test/aa.jpg");
+		map.put("F:\\test\\oss\\floor.json", "kanfang/test/faa.json");
+		uploadMulFiles(map);
+
+//		deleteFile("kanfang/test/aa.jpg");
+
+    }
+
+
+	public static String upload5(String filePath, String key) {
+		PutObjectResult result = null;
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+			}
+
+
+			 result = ossClient.putObject(BUCKET_NAME, 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";
+    }
+
+    /**
+     * 以流下载图片
+	 * @Title: getInputStreamByFileUrl
+     * @Description: 根据文件路径获取InputStream流
+     * @param
+     * @return
+     * @return: InputStream
+     */
+    public static InputStream getInputStreamByFileUrl(String filePath) {
+        // ossObject包含文件所在的存储空间名称、文件名称、文件元信息以及一个输入流。
+        OSSObject ossObject = ossClient.getObject(BUCKET_NAME, 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();
+//		}
+//	}
+
+}

+ 404 - 0
gis_common/src/main/java/com/gis/common/util/DateUtil.java

@@ -0,0 +1,404 @@
+/*
+ * PROJECT NAME: openplatform
+ * CREATED TIME: 15-4-30 下午4:16
+ *       AUTHOR: lizhiming
+ *    COPYRIGHT: Copyright(c) 2015~2020 All Rights Reserved.
+ *
+ */
+package com.gis.common.util;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * 日期工具类
+ *
+ * @author lizhiming
+ */
+@Slf4j
+public final class DateUtil {
+
+	/**
+     * 时间格式
+     */
+    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+    public static final String YYYY_MM_DD_DATE_FORMAT = "yyyy-MM-dd";
+
+    public static final String YYYYMMDD_DATA_FORMAT = "yyyyMMdd";
+
+    public static final String HHMMSS_DATA_FORMAT = "HHmmss";
+
+    public static final String YYYYMMDDHHMMSSSSS_DATA_FORMAT = "yyyyMMddHHmmssSSS";
+
+    public static final String YYYYMMDDHHMMSS_DATA_FORMAT = "yyyyMMddHHmmss";
+    
+    public static final String YYMMDDHHMMSS_DATA_FORMAT = "yyMMddHHmmss";
+    
+    public static final String YYMMDDHHMM_DATA_FORMAT = "yyyyMMddHHmm";
+    
+	
+	/**
+	 * 过去的Date对象,TIMESTAMP值可以从1970的某时的开始一直到2037年
+	 */
+	public static final Date PASSED_DATE = DateUtil.string2Date("2000-01-01 00:00:00",
+			DEFAULT_DATE_FORMAT);;
+	/**
+	 * 永久的Date对象,TIMESTAMP值可以从1970的某时的开始一直到2037年
+	 */
+	public static final Date FOREVER_DATE = DateUtil.string2Date("9999-12-31 23:59:59",
+			DEFAULT_DATE_FORMAT);
+
+	private DateUtil() {
+	}
+
+	/**
+	 * 把时间转成北京时间的时间戳
+	 *
+	 * @param input
+	 * @return
+	 */
+	public static long convert2CST(String input) {
+		SimpleDateFormat dff = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		dff.setTimeZone(TimeZone.getTimeZone("GMT+08"));
+
+		long result = -1;
+		try {
+			Date cstDate = dff.parse(input);
+			result = cstDate.getTime();
+		} catch (Exception e) {
+			log.error("convert2CST meet exception.", e);
+		}
+
+		return result;
+	}
+
+	/**
+	 * 把时间戳转成北京时间的字符串表示
+	 *
+	 * @param input
+	 * @return
+	 */
+	public static String convert2CST(long input) {
+		SimpleDateFormat dff = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		dff.setTimeZone(TimeZone.getTimeZone("GMT+08"));
+
+		try {
+			return dff.format(new Date(input));
+		} catch (Exception e) {
+			log.error("convert2CST meet exception.", e);
+		}
+
+		return "";
+	}
+
+
+	/**
+	 * 判断两个日期是否是同一天
+	 *
+	 * @param dateA
+	 *            日期1
+	 * @param dateB
+	 *            日期2
+	 * @return true:false
+	 */
+	public static boolean isSameDay(Date dateA, Date dateB) {
+		Calendar calDateA = Calendar.getInstance();
+		calDateA.setTime(dateA);
+
+		Calendar calDateB = Calendar.getInstance();
+		calDateB.setTime(dateB);
+
+		return calDateA.get(Calendar.YEAR) == calDateB.get(Calendar.YEAR)
+				&& calDateA.get(Calendar.MONTH) == calDateB.get(Calendar.MONTH)
+				&& calDateA.get(Calendar.DAY_OF_MONTH) == calDateB.get(Calendar.DAY_OF_MONTH);
+	}
+
+	/**
+	 * 将Java日期转成以秒为单位,去除毫秒信息
+	 * java中Date类中的getTime()是获取时间戳的,java中生成的时间戳精确到毫秒级别,而unix中精确到秒级别,
+	 * 所以通过java生成的时间戳需要除以1000
+	 *
+	 * @param date
+	 * @return
+	 */
+	public static Date truncMesc(Date date) {
+		String strDate = DateUtil.date2String(date, DEFAULT_DATE_FORMAT);
+
+		Date result = null;
+		try {
+			SimpleDateFormat dateFmt = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
+			result = dateFmt.parse(strDate);
+		} catch (Exception e) {
+			log.error("truncMesc meet exception", e);
+		}
+
+		return result;
+	}
+
+	/**
+	 * 判断当前时间是否在指定的有效期内
+	 *
+	 * @param beginDate
+	 *            开始时间
+	 * @param endDate
+	 *            结束时间
+	 * @return true : false
+	 */
+	public static boolean isInPeriod(Date beginDate, Date endDate) {
+		Date now = new Date();
+
+		if (beginDate == null || endDate == null) {
+			log.error("isInPeriod meet null argument.");
+			throw new IllegalArgumentException("isInPeriod meet null argument.");
+		}
+
+		if (beginDate.before(endDate) == false) {
+			log.error("isInPeriod meet invalid date argument.");
+			throw new IllegalArgumentException("isInPeriod meet invalid date argument.");
+		}
+
+		if (now.after(beginDate) && now.before(endDate)) {
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	/**
+	 * 判断目标时间是否比当前时间早
+	 *
+	 * @param targetDate
+	 *            需比较的时间
+	 * @return
+	 */
+	public static boolean isBeforeNow(Date targetDate) {
+		if (targetDate == null) {
+			log.error("isBeforeNow meet null argument.");
+			throw new IllegalArgumentException("isBeforeNow meet null argument.");
+		}
+
+		Date now = new Date();
+
+		return (now.after(targetDate)) ? true : false;
+	}
+
+	/**
+	 * @param beginDate
+	 *            开始时期
+	 * @param days
+	 *            偏离天数,> 0 往后推算; < 0 往前推算
+	 * @return
+	 */
+	public static Date daysCalculate(Date beginDate, int days) {
+		return timesCalculate(beginDate, days, GregorianCalendar.DATE);
+	}
+
+	/**
+	 * @param beginDate
+	 *            开始时期
+	 * @return
+	 */
+	public static Date hoursCalculate(Date beginDate, int hours) {
+		return timesCalculate(beginDate, hours, GregorianCalendar.HOUR);
+	}
+
+	public static Date timesCalculate(Date beginDate, int times, int type) {
+		/*
+		 * GregorianCalendar类的add(int field,int amount)方法表示年月日加减.
+		 * field参数表示年,月,周,日等. amount参数表示要加减的数量.
+		 */
+		GregorianCalendar gc = new GregorianCalendar();
+		gc.setTime(beginDate);
+		gc.add(type, times);
+		return gc.getTime();
+	}
+
+	/**
+	 * 将日期对象按照格式转成字符串
+	 *
+	 * @param date
+	 *            日期对象
+	 * @param format
+	 *            日期格式
+	 * @return 字符串
+	 */
+	public static String date2String(Date date, String format) {
+		if (date == null) {
+			log.error("date2String meet null argument.");
+			throw new IllegalArgumentException("argument is null.");
+		}
+
+		if (format == null) {
+			format = DEFAULT_DATE_FORMAT;
+		}
+
+		String result = null;
+		try {
+			DateFormat fmt = new SimpleDateFormat(format);
+			result = fmt.format(date);
+		} catch (Exception e) {
+			log.error("date2String meet exception. " + e.getLocalizedMessage());
+		}
+		return result;
+	}
+
+	/**
+	 * 将字符串转成日期对象
+	 *
+	 * @param date
+	 *            日期字符串
+	 * @param format
+	 *            日期格式
+	 * @return 日期对象
+	 */
+	public static Date string2Date(String date, String format) {
+		if (date == null) {
+			log.error("string2Date meet null argument.");
+			throw new IllegalArgumentException("argument is null.");
+		}
+
+		if (format == null) {
+			format = DEFAULT_DATE_FORMAT;
+		}
+
+		Date result = null;
+		try {
+			DateFormat fmt = new SimpleDateFormat(format);
+			result = fmt.parse(date);
+		} catch (Exception e) {
+			log.error("string2Date meet exception. " + e.getLocalizedMessage());
+		}
+
+		return result;
+	}
+
+	/**
+	 * java时间戳转换到php时间戳
+	 *
+	 * @param time
+	 * @return
+	 */
+	public static long javaTimestamp(long time) {
+		if (time <= 0) {
+			log.error("javaTimestamp meet null argument.");
+			throw new IllegalArgumentException("argument is null.");
+		}
+		// mysql 时间戳只有10位,只精确到秒,而Java时间戳精确到毫秒,故要做处理
+		String dateline = String.valueOf(time);
+		dateline = dateline.substring(0, 10);
+		return Long.parseLong(dateline);
+	}
+
+	public static long javaTimestamp(Date now) {
+		return javaTimestamp(now.getTime());
+	}
+
+	/**
+	 * 计算两个日期之间相差的天数
+	 *
+	 * @param smdate
+	 *            较小的时间
+	 * @param bdate
+	 *            较大的时间
+	 * @return 相差天数
+	 * @throws ParseException
+	 */
+	public static int daysBetween(Date smdate, Date bdate) {
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		try {
+			smdate = sdf.parse(sdf.format(smdate));
+			bdate = sdf.parse(sdf.format(bdate));
+		} catch (ParseException e) {
+			log.error("ParseException:", e);
+		}
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(smdate);
+		long time1 = cal.getTimeInMillis();
+		cal.setTime(bdate);
+		long time2 = cal.getTimeInMillis();
+		long between_days = (time2 - time1) / (1000 * 3600 * 24);
+
+		return Integer.parseInt(String.valueOf(between_days));
+	}
+
+	/**
+	 * 把日期推后一天
+	 * @return 相差天数
+	 * @throws ParseException
+	 */
+	public static Date dayDelay(String dateTime) {
+		Date date = string2Date(dateTime, "yyyy-MM-dd");
+		Calendar calendar = new GregorianCalendar();
+		calendar.setTime(date);
+		calendar.add(calendar.DATE, 1);// 把日期往后增加一天.整数往后推,负数往前移动
+		date = calendar.getTime(); // 这个时间就是日期往后推一天的结果
+
+		return date;
+	}
+
+	/**
+	 * 获取某年某月的最后一天日期
+	 */
+	public static Date getLastDayOfMonth(int year, int month) {
+		Calendar cal = Calendar.getInstance();
+		cal.set(Calendar.YEAR, year);
+		cal.set(Calendar.MONTH, month - 1);
+		int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
+		cal.set(Calendar.DAY_OF_MONTH, lastDay);
+		return cal.getTime();
+	}
+
+	/**
+	 * 获取某年某月的第一天 日期
+	 */
+	public static Date getFisrtDayOfMonth(int year, int month) {
+		Calendar cal = Calendar.getInstance();
+		cal.set(Calendar.YEAR, year);
+		cal.set(Calendar.MONTH, month - 1);
+		int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH);
+		cal.set(Calendar.DAY_OF_MONTH, firstDay);
+		return cal.getTime();
+	}
+
+	/**
+	 * 根据开始时间和结束时间返回时间段内的时间集合
+	 *
+	 * @param beginDate
+	 * @param endDate
+	 * int calendarType 差距的时间 如获取间隔为一天 输入Calendar.DAY_OF_MONTH
+	 * @return List
+	 */
+	public static List<Date> getDatesBetweenTwoDate(Date beginDate, Date endDate,int calendarType) {
+		List<Date> lDate = new ArrayList<Date>();
+		lDate.add(beginDate);// 把开始时间加入集合
+		Calendar cal = Calendar.getInstance();
+		// 使用给定的 Date 设置此 Calendar 的时间
+		cal.setTime(beginDate);
+		boolean bContinue = true;
+		while (bContinue) {
+			// 根据日历的规则,为给定的日历字段添加或减去指定的时间量
+			cal.add(calendarType, 1);
+			// 测试此日期是否在指定日期之后
+			if (endDate.after(cal.getTime())) {
+				lDate.add(cal.getTime());
+			} else {
+				break;
+			}
+		}
+		lDate.add(endDate);// 把结束时间加入集合
+		return lDate;
+	}
+
+	public static boolean after(Date date1,Date date2){
+		Calendar c1 = Calendar.getInstance();
+		c1.setTime(date1);
+		Calendar c2 = Calendar.getInstance();
+		c2.setTime(date2);
+		return c2.after(c1);
+	}
+}

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

@@ -0,0 +1,69 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import org.junit.Test;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+/**
+ * Created by owen on 2022/4/8 0008 14:32
+ */
+public class DateUtils extends DateUtil {
+
+    private static String YYYY_MM = "yyyy-MM";
+
+    private static String YYYYMM = "yyyyMM";
+
+    private static String YYYY_MM_DD = "yyyy-MM-dd";
+
+    private static String YYYY_MM_DD_HH_MM = "yyyy-MM-dd HH:mm";
+
+
+    private static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
+
+    private static String YYYYMMDD_HHMMSSSSS = "yyyyMMdd_HHmmssSSS";
+
+    private static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
+
+
+    /**
+     * 获取当前月
+     * @return
+     */
+    public static String getMonth(){
+        return format(LocalDateTime.now(), YYYYMM);
+    }
+
+    /**
+     * 获取当前月份的前几个月
+     * @param month
+     * @return
+     */
+    public static String minusMonths(int month){
+        return format(LocalDateTime.now().minusMonths(month), YYYYMM);
+    }
+
+    /**
+     * 获取当前时间戳
+     * @return
+     */
+    public static String getDateTime(){
+        return format(LocalDateTime.now(), YYYYMMDD_HHMMSSSSS);
+    }
+
+
+    /**
+     * 字符串转LocalDateTime
+     * @param time 字符串
+     * @return LocalDateTime
+     */
+    public static LocalDateTime srtToLocalDateTime(String time){
+        return LocalDateTime.parse(time, DateTimeFormatter.ofPattern(YYYY_MM_DD_HH_MM));
+    }
+
+    @Test
+    public void test(){
+        System.out.println(srtToLocalDateTime("2022-02-16 12:26"));
+    }
+}

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

@@ -0,0 +1,114 @@
+package com.gis.common.util;
+
+import cn.hutool.core.io.FileUtil;
+import com.gis.common.constant.ConfigConstant;
+import com.gis.common.exception.BaseRuntimeException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Slf4j
+@Component
+public class FileUtils {
+
+    @Autowired
+    ConfigConstant configConstant;
+
+    // 确保同一时间上传文件的唯一性
+    private static final AtomicInteger ATOMIC_INTEGER = new AtomicInteger();
+
+    public boolean checkFile(MultipartFile file) {
+        //设置允许上传文件类型
+        String suffixList = configConstant.serverFileFallow;
+        // 获取文件后缀
+        if(file == null){
+            log.error("文件流为空不可上传");
+            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.error("存在非法参数不能放行!请核对上传文件格式,重新刷新页面再次上传!输入文件后缀: {}", suffix);
+        return false;
+    }
+
+
+    /**
+     *
+     * @param file
+     * @param isPinYinRename false:时间戳重命名, true:用拼音重名文件
+     * @param savePath 保存地址(前面有斜杠, 后面没有),没有文件名
+     * @return 文件名
+     */
+    public String upload(MultipartFile file, String savePath, boolean isPinYinRename) {
+
+        // 检查非法文件上传
+        boolean checkFile = this.checkFile(file);
+        if (!checkFile) {
+            throw new BaseRuntimeException("上传文件格式有误, 请重新上传");
+        }
+
+        // 文件目录
+        String fileName = file.getOriginalFilename();
+        String newName;
+        if (isPinYinRename){
+             newName = RegexUtil.getPinyinName(fileName);
+        } else {
+            String suffix = StringUtils.substringAfterLast(fileName, ".");
+            newName =  DateUtils.getDateTime() + ATOMIC_INTEGER.incrementAndGet() + "." + suffix;
+        }
+
+        savePath = configConstant.serverBasePath + savePath + "/" + newName;
+        log.info("保存文件地址:{}", savePath);
+
+        try {
+            FileUtil.writeFromStream(file.getInputStream(), savePath);
+
+            return newName;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     *
+     * @param file
+     * @param isPinYinRename false:时间戳重命名, true:用拼音重名文件
+     * @param savePath 保存地址(前面有斜杠, 后面没有),没有文件名
+     * @return map
+     */
+    public Map<String, Object> uploadMap(MultipartFile file, String savePath, boolean isPinYinRename) {
+        String newName = this.upload(file, savePath, isPinYinRename);
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("fileName", file.getOriginalFilename());
+        result.put("filePath", savePath + "/" + newName);
+        return result;
+
+    }
+
+    /**
+     * 真删除文件
+     * @param path 参数是相对地址
+     */
+    public void del(String path){
+        String delPath = configConstant.serverBasePath + path;
+        FileUtil.del(delPath);
+        log.info("真删除文件: {}", delPath);
+    }
+
+}

+ 80 - 0
gis_common/src/main/java/com/gis/common/util/HttpRequestorUtil.java

@@ -0,0 +1,80 @@
+package com.gis.common.util;
+
+import lombok.extern.log4j.Log4j2;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+/**
+ * Created by owen on 2020/12/22 0022 9:35
+ */
+@Log4j2
+public class HttpRequestorUtil {
+
+    /**
+     * 发送HttpPost请求
+     *
+     * @param strURL
+     *            服务地址
+     * @param params
+     *            json字符串,例如: "{ \"id\":\"12345\" }" ;其中属性名必须带双引号<br/>
+     * @return 成功:返回json字符串<br/>
+     */
+    public static String postJson(String strURL, String params, String type) {
+        log.info(strURL);
+        log.info(params);
+        BufferedReader reader = null;
+        try {
+            URL url = new URL(strURL);// 创建连接
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setUseCaches(false);
+            connection.setInstanceFollowRedirects(true);
+            connection.setRequestMethod(type); // 设置请求方式
+            // connection.setRequestProperty("Accept", "application/json"); // 设置接收数据的格式
+            connection.setRequestProperty("Content-Type", "application/json"); // 设置发送数据的格式
+            connection.setRequestProperty("Authorizations", "Y9z$w*WA%z!uz0O$dcCQ@i1KHKs5rhQW");
+            connection.connect();
+            //一定要用BufferedReader 来接收响应, 使用字节来接收响应的方法是接收不到内容的
+            OutputStreamWriter out = new OutputStreamWriter(connection.getOutputStream(), "UTF-8"); // utf-8编码
+            out.append(params);
+            out.flush();
+            out.close();
+            // 读取响应
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
+            String line;
+            String res = "";
+            while ((line = reader.readLine()) != null) {
+                res += line;
+            }
+            reader.close();
+
+            //如果一定要使用如下方式接收响应数据, 则响应必须为: response.getWriter().print(StringUtils.join("{\"errCode\":\"1\",\"errMsg\":\"", message, "\"}")); 来返回
+//            int length = (int) connection.getContentLength();// 获取长度
+//            if (length != -1) {
+//                byte[] data = new byte[length];
+//                byte[] temp = new byte[512];
+//                int readLen = 0;
+//                int destPos = 0;
+//                while ((readLen = is.read(temp)) > 0) {
+//                    System.arraycopy(temp, 0, data, destPos, readLen);
+//                    destPos += readLen;
+//                }
+//                String result = new String(data, "UTF-8"); // utf-8编码
+//                log.info(result);
+//                return result;
+//            }
+
+            return res;
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        return "error"; // 自定义错误信息
+    }
+}

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

+ 22 - 0
gis_common/src/main/java/com/gis/common/util/RandomUtils.java

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

+ 97 - 0
gis_common/src/main/java/com/gis/common/util/RegexUtil.java

@@ -0,0 +1,97 @@
+package com.gis.common.util;
+
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.pinyin.PinyinUtil;
+import com.gis.common.exception.BaseRuntimeException;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Created by owen on 2021/11/18 0011 16:16
+ * 字符串过滤
+ */
+@Slf4j
+public class RegexUtil {
+
+    // 需要过滤的特殊字符
+    static String [] specialSql = {"%","or","=","and","truncate","delete","update","exec"};
+
+
+    /** 处理特殊符号,变空值*/
+    public static String specificSymbol(String str){
+
+        String regEx = "[\\s`~!@#$%^&*()+=|{}':;\\[\\]<>/?·~!@#¥%……&*()——+|{}【】‘;:“”。,、?]";
+        return str.replaceAll(regEx, "");
+    }
+
+
+    /** 中文转拼音*/
+    public static String getPinyinName(String str){
+        // 去除特殊符号
+        String pinyinName = RegexUtil.specificSymbol(str);
+        pinyinName = PinyinUtil.getPinyin(pinyinName, "");
+        // 转小写
+        pinyinName =  pinyinName.toLowerCase();
+        return pinyinName;
+
+    }
+
+
+    /**防止sql注入*/
+    public static void regSql(String str){
+        String key = "and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|;|or|-|+";
+        String[] split = StrUtil.split(key, "|");
+        List<String> list = Arrays.asList(split);
+        for (String s : list) {
+            if (str.toLowerCase().contains(s)){
+                String msg = "存在sql注入字符";
+                log.error(msg);
+                throw new BaseRuntimeException(msg);
+            }
+        }
+
+    }
+
+    /**
+     * sql 过滤特殊字符
+     * @param str
+     * @return
+     */
+    public static String sqlReplaceSpecialStr(String str){
+        str = StrUtil.trim(str);
+        str = str.toLowerCase();
+        for (String s : specialSql) {
+            if (str.contains(s)) {
+                str = str.replaceAll(s, "");
+            }
+        }
+        return str;
+    }
+
+
+
+
+
+
+
+    public static void main(String[] args) {
+        String str = "我·是 中—国(人), 你-在{干嘛}--哈—哈。 ddd.jpg";
+        System.out.println(specificSymbol(str));
+    }
+
+
+    @Test
+    public void test(){
+        String regEx = "12,15,+ delete";
+        regSql(regEx);
+
+
+}
+
+
+}
+
+

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

+ 177 - 0
gis_common/src/main/java/com/gis/common/util/StatisticsUtil.java

@@ -0,0 +1,177 @@
+package com.gis.common.util;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 百度统计
+ * Created by Hb_zzZ on 2020/8/24.
+ */
+@Slf4j
+public class StatisticsUtil {
+
+    // 账号
+    private static final String BAIDU_USERNAME = "四维时代";
+
+    // 密码
+    private static final String BAIDU_PASSWORD = "4DAge2018";
+
+    private static final String BAIDU_TOKEN = "17a1e010f1be38abead0066b2b02cb4c";
+
+//    private static final String SITE_ID = "12325722";
+
+    // 站点id, 通过获取站点列表接口可以获取到
+    // www.4dmodel.com/SuperTwo/*
+//    private static final String SITE_ID = "13484448";
+
+    // www.4dmodel.com
+    private static final String SITE_ID = "13484132";
+
+
+    //指标, 数据单位
+    private static final String METRICS = "pv_count,visitor_count,ip_count,visit1_count,outward_count,exit_count,average_stay_time,exit_ratio";
+
+    // 受访页面接口
+    private static final String METHOD = "visit/toppage/a";
+
+    // 接口
+    private static final String BAIDU_URL = "https://api.baidu.com/json/tongji/v1/ReportService/getData";
+
+    private static final String FILE_PATH = "/root/user/cms_statistics_baidu/";
+
+    public static Map<String, Map<String, Double>> findStatisticsData(String dateStr) throws Exception{
+
+        JSONObject param = new JSONObject();
+        JSONObject header = new JSONObject();
+        JSONObject body = new JSONObject();
+        header.put("username", BAIDU_USERNAME);
+        header.put("password", BAIDU_PASSWORD);
+        header.put("token", BAIDU_TOKEN);
+        header.put("account_type", 1);
+        body.put("site_id", SITE_ID);
+        body.put("start_date", dateStr);
+        body.put("end_date", dateStr);
+        body.put("metrics", METRICS);
+        body.put("method", METHOD);
+        param.put("header", header);
+        param.put("body", body);
+        String baiduData = HttpRequestorUtil.postJson(BAIDU_URL, param.toString(), "POST");
+
+
+
+        JSONObject data = JSONObject.parseObject(baiduData);
+
+
+        Map<String, Map<String, Double>> map = new HashMap<>();
+        Map<String, Double> numMap = null;
+        String url = "";
+        String sceneNum = "";
+        if(data.getJSONObject("header").getIntValue("status") == 0){
+            log.info("请求百度api成功");
+
+            JSONArray items = data.getJSONObject("body").getJSONArray("data").getJSONObject(0)
+                    .getJSONObject("result").getJSONArray("items");
+
+            JSONArray urlArray = items.getJSONArray(0);
+            JSONArray numArray = items.getJSONArray(1);
+//
+            for(int i = 0, len = urlArray.size(); i < len; i++){
+                url = urlArray.getJSONArray(i).getJSONObject(0).getString("name");
+//                if((url.contains("www.4dmodel.com/SuperTwo/index.html") && url.contains("?m="))){
+                if((url.contains("4dmodel.com/") && url.contains("?m="))){
+
+                    // 获取场景码
+                    sceneNum = StringUtils.substringAfterLast(url, "?m=");
+                    if (sceneNum.contains("&")) {
+                        sceneNum = StringUtils.substringBefore(sceneNum, "&");
+                    }
+                    numMap = map.get(sceneNum);
+                    numMap = getNumMap(numMap, numArray, i);
+                    map.put(sceneNum, numMap);
+                }
+
+            }
+        }
+        // 写入文件
+        String filePath = FILE_PATH + dateStr + ".json" ;
+        log.info("数据存放地址:" + filePath);
+        FileUtil.writeUtf8String(baiduData, filePath);
+        return map;
+    }
+
+    public static void main(String[] args) {
+        try{
+//            StatisticsUtil.findStatisticsData("20200822");
+            Map<String, Map<String, Double>> statisticsData = StatisticsUtil.findStatisticsData("20201223");
+//            System.out.println(JSONObject.parse(statisticsData.toString()));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+
+    }
+
+    /**
+     * metrics(指标, 数据单位) :
+     * pv_count (浏览量(PV))
+     * visitor_count (访客数(UV))
+     * ip_count (IP 数)
+     * visit1_count (入口页次数)
+     * outward_count (贡献下游浏览量)
+     * exit_count (退出页次数)
+     * average_stay_time (平均停留时长, 秒)
+     * exit_ratio (退出率,%)
+     *
+     * 其他参数:
+     * source(来源类型)
+     * visitor(访客类型)
+     *
+     * @param numMap
+     * @param numArray
+     * @param index
+     * @return
+     */
+    private static Map<String, Double> getNumMap(Map<String, Double> numMap, JSONArray numArray, int index){
+        if(numMap == null){
+            numMap = new HashMap<>();
+
+            numMap.put("pv_count", numArray.getJSONArray(index).getDouble(0));
+            numMap.put("visitor_count", numArray.getJSONArray(index).getDouble(1));
+            numMap.put("ip_count", numArray.getJSONArray(index).getDouble(2));
+            numMap.put("visit1_count", numArray.getJSONArray(index).getDouble(3));
+            numMap.put("outward_count", numArray.getJSONArray(index).getDouble(4));
+            numMap.put("exit_count", numArray.getJSONArray(index).getDouble(5));
+            numMap.put("average_stay_time", numArray.getJSONArray(index).getDouble(6));
+            numMap.put("exit_ratio", numArray.getJSONArray(index).getDouble(7));
+        }else {
+            numMap.put("pv_count", numMap.get("pv_count") + numArray.getJSONArray(index).getDouble(0));
+            numMap.put("visitor_count", numMap.get("visitor_count") + numArray.getJSONArray(index).getDouble(1));
+            numMap.put("ip_count", numMap.get("ip_count") + numArray.getJSONArray(index).getDouble(2));
+            numMap.put("visit1_count", numMap.get("visit1_count") + numArray.getJSONArray(index).getDouble(3));
+            numMap.put("outward_count", numMap.get("outward_count") + numArray.getJSONArray(index).getDouble(4));
+            numMap.put("exit_count", numMap.get("exit_count") + numArray.getJSONArray(index).getDouble(5));
+            numMap.put("average_stay_time", numMap.get("average_stay_time") + numArray.getJSONArray(index).getDouble(6));
+            numMap.put("exit_ratio", numMap.get("exit_ratio") + numArray.getJSONArray(index).getDouble(7));
+        }
+        return numMap;
+    }
+
+
+    @Test
+    public void teswt1(){
+        String url  = "http://www.4dmodel.com/SuperTwo/index.html?m=118&version=one";
+        String sceneNum = StringUtils.substringAfterLast(url, "?m=");
+        System.out.println("1: " + sceneNum);
+        if (sceneNum.contains("&")) {
+            sceneNum = StringUtils.substringBefore(sceneNum, "&");
+            System.out.println("2: " + sceneNum);
+        }
+    }
+}

+ 22 - 0
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>cms_statistics_baidu</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>

+ 41 - 0
gis_domain/src/main/java/com/gis/domain/dto/AgeAlipayDto.java

@@ -0,0 +1,41 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+@Data
+public class AgeAlipayDto implements Serializable {
+
+
+    private static final long serialVersionUID = 4318169549610501688L;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    @NotBlank(message = "电话不能为空")
+    @ApiModelProperty(value = "电话", required = true)
+    private String phone;
+
+    @ApiModelProperty(value = "城市")
+    private String city;
+
+    @ApiModelProperty(value = "单位名称")
+    private String unit;
+
+    @ApiModelProperty(value = "图片")
+    private String img;
+
+    @NotBlank(message = "类别不能为空")
+    @ApiModelProperty(value = "类别:edu:孵化培育(元宇宙) | model:三维", required = true)
+    private String type;
+
+
+
+
+
+}

+ 53 - 0
gis_domain/src/main/java/com/gis/domain/dto/ExhibitsDto.java

@@ -0,0 +1,53 @@
+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.io.Serializable;
+import java.util.List;
+
+
+@Data
+public class ExhibitsDto implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493944L;
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "展品名称不能为空")
+    @ApiModelProperty(value = "展品名称", required = true)
+    private String name;
+
+    @NotBlank(message = "封面图不能为空")
+    @ApiModelProperty(value = "封面图", required = true)
+    private String icon;
+
+//    @NotBlank(message = "海报图不能为空")
+//    @ApiModelProperty(value = "海报图",required = true)
+//    private String imgUrl;
+
+    @NotBlank(message = "模型url不能为空")
+    @ApiModelProperty(value = "模型url", required = true)
+    private String modelUrl;
+
+    @NotBlank(message = "购买url不能为空")
+    @ApiModelProperty(value = "购买url", required = true)
+    private String buyUrl;
+
+    @ApiModelProperty(value = "是否展示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "排序,数字小排前面")
+    private Integer sort;
+
+    @NotNull(message = "海报图不能为空")
+    @ApiModelProperty(value = "海报图",required = true)
+    private List<String> images;
+
+
+
+
+}

+ 21 - 0
gis_domain/src/main/java/com/gis/domain/dto/LoginDto.java

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

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

+ 21 - 0
gis_domain/src/main/java/com/gis/domain/dto/PasswordDto.java

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/11/18 0018 18:28
+ */
+@Data
+public class PasswordDto {
+
+    @NotBlank(message = "旧密码不能为空")
+    @ApiModelProperty(value = "旧密码", name = "oldPassword", required = true)
+    private String oldPassword;
+
+    @NotBlank(message = "新密码不能为空")
+    @ApiModelProperty(value = "新密码", name = "newPassword", required = true)
+    private String newPassword;
+}

+ 38 - 0
gis_domain/src/main/java/com/gis/domain/dto/UserDto.java

@@ -0,0 +1,38 @@
+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 UserDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "用户名不能为空")
+    @ApiModelProperty(value = "用户名", required = true)
+    private String userName;
+
+
+//    @ApiModelProperty(value = "真实姓名")
+//    private String realName;
+//
+//
+//    @NotNull(message = "部门id不能为空")
+//    @ApiModelProperty(value = "部门id", required = true)
+//    private Long deptId;
+//
+//    @NotNull(message = "角色id不能为空")
+//    @ApiModelProperty(value = "角色id", required = true)
+//    private Long roleId;
+//
+//    @NotNull(message = "角色id不能为空")
+//    @ApiModelProperty(value = "管理者,0:是, 1:否")
+//    private Integer manager;
+}

+ 40 - 0
gis_domain/src/main/java/com/gis/domain/entity/AgeAlipayEntity.java

@@ -0,0 +1,40 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2022/5/05 0022 11:53
+ *
+ * 支付宝-用户信息记录
+ */
+@Data
+@Table(name = "age_alipay")
+public class AgeAlipayEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -481250843590270172L;
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+    @ApiModelProperty(value = "城市")
+    private String city;
+
+    @ApiModelProperty(value = "单位名称")
+    private String unit;
+
+    @ApiModelProperty(value = "图片")
+    private String img;
+
+    @ApiModelProperty(value = "类别:edu:孵化培育(元宇宙) | model:三维")
+    private String type;
+
+
+
+
+}

+ 52 - 0
gis_domain/src/main/java/com/gis/domain/entity/AgeBooksEntity.java

@@ -0,0 +1,52 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2021/9/22 0022 11:53
+ *
+ * 内部应用
+ * 珠海市唐家半岛—无界AR书店  数据实体
+ *
+ */
+@Data
+@Table(name = "age_books")
+public class AgeBooksEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 9165735859546832908L;
+    @ApiModelProperty(value = "书名")
+    private String name;
+
+    @ApiModelProperty(value = "书号")
+    private String num;
+
+    @ApiModelProperty(value = "定价")
+    private String price;
+
+    @ApiModelProperty(value = "库存")
+    private Integer stock;
+
+    @ApiModelProperty(value = "出版社")
+    private String publish;
+
+    @ApiModelProperty(value = "著译者")
+    private String translator;
+
+    @ApiModelProperty(value = "架位号")
+    private String shelfNum;
+
+    @ApiModelProperty(value = "定位(x,y,z)")
+    private String location;
+
+    @ApiModelProperty(value = "类别")
+    private String type;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+
+}

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

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

+ 32 - 0
gis_domain/src/main/java/com/gis/domain/entity/SceneCountEntity.java

@@ -0,0 +1,32 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+
+/**
+ * Created by owen on 2021/8/10 0010 10:40
+ *
+ * 用于场景分享、访问量统计
+ */
+@Data
+@Table(name = "t_scene_count")
+public class SceneCountEntity extends BaseEntity {
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @ApiModelProperty(value = "访问量")
+    private Integer visitSum;
+
+    @ApiModelProperty(value = "分享量")
+    private Integer shareSum;
+
+    @ApiModelProperty(value = "类型:bigScene:大场景")
+    private String type;
+
+    @ApiModelProperty(value = "点赞量")
+    private Integer starSum;
+
+}

+ 90 - 0
gis_domain/src/main/java/com/gis/domain/entity/SceneStatisticsEntity.java

@@ -0,0 +1,90 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.util.Date;
+
+/**
+ * 百度统计场景流量数
+ */
+@Data
+@Entity
+@Table(name = "t_scene_statistics")
+public class SceneStatisticsEntity extends BaseEntity{
+
+    /**
+     * 场景码
+     */
+    @ApiModelProperty(value = "场景码")
+    private String sceneNum;
+
+    /**
+     * 浏览量(PV)
+     */
+    @ApiModelProperty(value = "浏览量(PV)")
+    private Integer pvCount;
+
+    /**
+     * 访客数(UV)
+     */
+    @ApiModelProperty(value = "访客数(UV)")
+    private Integer visitorCount;
+
+    /**
+     * IP 数
+     */
+    @ApiModelProperty(value = "IP 数")
+    private Integer ipCount;
+
+    /**
+     * 入口页次数
+     */
+    @ApiModelProperty(value = "入口页次数")
+    private Integer visit1Count;
+
+    /**
+     * 贡献下游浏览量
+     */
+    @ApiModelProperty(value = "贡献下游浏览量")
+    private Integer outwardCount;
+
+    /**
+     * 退出页次数
+     */
+    @ApiModelProperty(value = "退出页次数")
+    private Integer exitCount;
+
+    /**
+     * 平均停留时长, 秒
+     */
+    @ApiModelProperty(value = "平均停留时长, 秒")
+    private Integer averageStayTime;
+
+    /**
+     * 退出率,%
+     */
+    @ApiModelProperty(value = "退出率,%")
+    private Double exitRatio;
+
+    /**
+     * 1:场景,2:热点,3:视频
+     */
+    @ApiModelProperty(value = "")
+    private Integer type;
+
+    /**
+     * 日期(年月日)
+     */
+    @ApiModelProperty(value = "日期(年月日)")
+    private Date dateStr;
+
+    @ApiModelProperty(value = "站点类型, bigScene: 大场景, 4Dkankan:四维看看")
+    private String sideType;
+
+
+
+}

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

+ 22 - 0
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>cms_statistics_baidu</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>

+ 15 - 0
gis_mapper/src/main/java/com/gis/mapper/AgeAlipayMapper.java

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

+ 25 - 0
gis_mapper/src/main/java/com/gis/mapper/AgeBooksMapper.java

@@ -0,0 +1,25 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.AgeBooksEntity;
+import com.gis.domain.entity.SceneCountEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Mapper
+public interface AgeBooksMapper extends IBaseMapper<AgeBooksEntity, Long> {
+
+
+//    @Select("select * from t_scene_count where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+//    SceneCountEntity findBySceneCode(String sceneCode, String type);
+//
+//    @Update("update t_scene_count set visit_sum  = visit_sum +1 , update_time = NOW() where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+//    void saveVisit(String sceneCode, String type);
+//
+//    @Update("update t_scene_count set share_sum = share_sum +1 , update_time = NOW() where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+//    void saveShare(String sceneCode, String type);
+}

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

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

@@ -0,0 +1,27 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SceneCountEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+
+@Component
+@Mapper
+public interface SceneCountMapper extends IBaseMapper<SceneCountEntity, Long> {
+
+
+    @Select("select * from t_scene_count where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+    SceneCountEntity findBySceneCode(String sceneCode, String type);
+
+    @Update("update t_scene_count set visit_sum  = visit_sum +1 , update_time = NOW() where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+    void saveVisit(String sceneCode, String type);
+
+    @Update("update t_scene_count set share_sum = share_sum +1 , update_time = NOW() where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+    void saveShare(String sceneCode, String type);
+
+    @Update("update t_scene_count set star_sum  = star_sum +1 , update_time = NOW() where rec_status = 'A' and scene_code = #{sceneCode} and type = #{type} ")
+    void saveStar(String sceneCode, String type);
+}

+ 23 - 0
gis_mapper/src/main/java/com/gis/mapper/SceneStatisticsMapper.java

@@ -0,0 +1,23 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDto;
+import com.gis.domain.entity.SceneStatisticsEntity;
+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 SceneStatisticsMapper extends IBaseMapper<SceneStatisticsEntity, Long> {
+
+    List<SceneStatisticsEntity> search(PageDto param);
+
+    @Select("select * from t_scene_statistics where date_str = #{date}")
+    List<SceneStatisticsEntity> findByDate(String date);
+
+    @Select("select * from t_scene_statistics where scene_num = #{sceneNum} order by create_time desc limit 0, 400")
+    List<SceneStatisticsEntity> findBySceneNum(String sceneNum);
+}

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

+ 23 - 0
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>cms_statistics_baidu</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>

+ 20 - 0
gis_service/src/main/java/com/gis/service/AgeAlipayService.java

@@ -0,0 +1,20 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.dto.AgeAlipayDto;
+import com.gis.domain.entity.AgeAlipayEntity;
+import com.gis.domain.entity.AgeBooksEntity;
+import org.springframework.web.multipart.MultipartFile;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface AgeAlipayService extends IBaseService<AgeAlipayEntity, Long> {
+
+
+    Result saveEntity(AgeAlipayDto param);
+
+    Result upload(MultipartFile file);
+}

+ 17 - 0
gis_service/src/main/java/com/gis/service/AgeBooksService.java

@@ -0,0 +1,17 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.AgeBooksEntity;
+import com.gis.domain.entity.SceneCountEntity;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface AgeBooksService extends IBaseService<AgeBooksEntity, Long> {
+
+    Result search(String name);
+
+    Result search1();
+}

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

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

+ 24 - 0
gis_service/src/main/java/com/gis/service/SceneCountService.java

@@ -0,0 +1,24 @@
+package com.gis.service;
+
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SceneCountEntity;
+import com.gis.domain.entity.SceneStatisticsEntity;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SceneCountService extends IBaseService<SceneCountEntity, Long> {
+
+
+    Result saveVisit(String sceneCode);
+
+    Result saveShare(String sceneCode);
+
+    Result detail(String sceneCode);
+
+    Result saveStar(String sceneCode);
+}

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

@@ -0,0 +1,21 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SceneStatisticsEntity;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface SceneStatisticsService extends IBaseService<SceneStatisticsEntity, Long> {
+
+
+
+    List<SceneStatisticsEntity> getAdd(String data) throws Exception;
+
+    List<SceneStatisticsEntity> getDate(String date);
+
+    List<SceneStatisticsEntity> findBySceneNum(String sceneNum);
+}

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

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

+ 60 - 0
gis_service/src/main/java/com/gis/service/impl/AgeAlipayServiceImpl.java

@@ -0,0 +1,60 @@
+package com.gis.service.impl;
+
+import com.gis.common.exception.BaseRuntimeException;
+import com.gis.common.util.FileUtils;
+import com.gis.common.util.Result;
+import com.gis.domain.dto.AgeAlipayDto;
+import com.gis.domain.entity.AgeAlipayEntity;
+import com.gis.mapper.AgeAlipayMapper;
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.AgeAlipayService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class AgeAlipayServiceImpl extends IBaseServiceImpl<AgeAlipayEntity, Long> implements AgeAlipayService {
+
+    @Autowired
+    private AgeAlipayMapper entityMapper;
+
+    @Autowired
+    FileUtils fileUtils;
+
+    @Override
+    public IBaseMapper<AgeAlipayEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Override
+    public Result saveEntity(AgeAlipayDto param) {
+        String type = param.getType();
+        List<String> asList = Arrays.asList("edu", "model");
+        if (!asList.contains(type)){
+            log.error("type:{}", type );
+            BaseRuntimeException.getExc(null, "非法类型");
+        }
+        AgeAlipayEntity entity = new AgeAlipayEntity();
+        BeanUtils.copyProperties(param, entity);
+        this.save(entity);
+
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result upload(MultipartFile file) {
+        Map<String, Object> map = fileUtils.uploadMap(file, "/alipay", false);
+        return Result.success(map);
+    }
+}

+ 60 - 0
gis_service/src/main/java/com/gis/service/impl/AgeBooksServiceImpl.java

@@ -0,0 +1,60 @@
+package com.gis.service.impl;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.AgeBooksEntity;
+import com.gis.domain.entity.SceneCountEntity;
+import com.gis.mapper.AgeBooksMapper;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SceneCountMapper;
+import com.gis.service.AgeBooksService;
+import com.gis.service.SceneCountService;
+import com.github.pagehelper.PageInfo;
+import lombok.extern.log4j.Log4j2;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import tk.mybatis.mapper.entity.Condition;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class AgeBooksServiceImpl extends IBaseServiceImpl<AgeBooksEntity, Long> implements AgeBooksService {
+
+    @Autowired
+    private AgeBooksMapper entityMapper;
+
+    @Override
+    public IBaseMapper<AgeBooksEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Override
+    public Result search(String searchKey) {
+        List<AgeBooksEntity> list;
+        searchKey = StringUtils.trim(searchKey);
+        if (StringUtils.isNotBlank(searchKey) && !"null".equals(searchKey)){
+            Condition condition = new Condition(AgeBooksEntity.class);
+            searchKey = StringUtils.trim(searchKey);
+            condition.and().orLike("name", "%" + searchKey + "%")
+                    .orLike("publish", "%" + searchKey + "%");
+            condition.orderBy("sort").asc();
+
+            list = this.findAll(condition);
+        } else {
+            list = this.findAll("sort", "asc");
+        }
+
+        return Result.success(list);
+    }
+
+    @Override
+    public Result search1() {
+        return Result.success(findAll());
+    }
+}

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

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

+ 58 - 0
gis_service/src/main/java/com/gis/service/impl/SceneCountServiceImpl.java

@@ -0,0 +1,58 @@
+package com.gis.service.impl;
+
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SceneCountEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SceneCountMapper;
+import com.gis.service.SceneCountService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class SceneCountServiceImpl extends IBaseServiceImpl<SceneCountEntity, Long> implements SceneCountService {
+
+    @Autowired
+    private SceneCountMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SceneCountEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    private final static String TYPE = "bigScene";
+
+
+    @Override
+    public Result saveVisit(String sceneCode) {
+        entityMapper.saveVisit(sceneCode, TYPE);
+        SceneCountEntity entity = entityMapper.findBySceneCode(sceneCode, TYPE);
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result saveShare(String sceneCode) {
+        entityMapper.saveShare(sceneCode, TYPE);
+        SceneCountEntity entity = entityMapper.findBySceneCode(sceneCode, TYPE);
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result detail(String sceneCode) {
+        SceneCountEntity entity = entityMapper.findBySceneCode(sceneCode, TYPE);
+        return Result.success(entity);
+    }
+
+    @Override
+    public Result saveStar(String sceneCode) {
+        entityMapper.saveStar(sceneCode, TYPE);
+        SceneCountEntity entity = entityMapper.findBySceneCode(sceneCode, TYPE);
+        return Result.success(entity);
+    }
+}

+ 82 - 0
gis_service/src/main/java/com/gis/service/impl/SceneStatisticsServiceImpl.java

@@ -0,0 +1,82 @@
+package com.gis.service.impl;
+
+import cn.hutool.core.date.DateUtil;
+import com.gis.common.util.StatisticsUtil;
+import com.gis.domain.entity.SceneStatisticsEntity;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.SceneStatisticsMapper;
+import com.gis.service.SceneStatisticsService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Slf4j
+@Service
+public class SceneStatisticsServiceImpl extends IBaseServiceImpl<SceneStatisticsEntity, Long> implements SceneStatisticsService {
+
+    @Autowired
+    private SceneStatisticsMapper entityMapper;
+
+    @Override
+    public IBaseMapper<SceneStatisticsEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+
+    @Override
+    public List<SceneStatisticsEntity> getAdd(String data) throws Exception {
+        Map<String, Map<String, Double>> map = StatisticsUtil.findStatisticsData(data);
+
+        ArrayList<SceneStatisticsEntity> list = new ArrayList<>();
+        String sceneNum = "";
+        Map<String, Double> numMap = null;
+        SceneStatisticsEntity entity = null;
+
+        int i = 0;
+        for (Map.Entry<String, Map<String, Double>> entry : map.entrySet()) {
+            sceneNum = entry.getKey();
+            numMap = entry.getValue();
+            entity = new SceneStatisticsEntity();
+            entity.setSceneNum(sceneNum);
+            entity.setPvCount(numMap.get("pv_count").intValue());
+            entity.setVisitorCount(numMap.get("visitor_count").intValue());
+            entity.setVisit1Count(numMap.get("visit1_count").intValue());
+            entity.setOutwardCount(numMap.get("outward_count").intValue());
+            entity.setExitCount(numMap.get("exit_count").intValue());
+            entity.setAverageStayTime(numMap.get("average_stay_time").intValue());
+            entity.setExitRatio(numMap.get("exit_ratio"));
+            entity.setDateStr(DateUtil.parse(data));
+            entity.setRecStatus("A");
+            entity.setCreateTime(new Date());
+            entity.setUpdateTime(new Date());
+            entity.setSideType("bigScene");
+
+            entityMapper.insert(entity);
+            list.add(entity);
+
+            i ++;
+        }
+        log.info("数量: {}", i);
+        return list;
+    }
+
+    @Override
+    public List<SceneStatisticsEntity> getDate(String date) {
+        return entityMapper.findByDate(date);
+    }
+
+    @Override
+    public List<SceneStatisticsEntity> findBySceneNum(String sceneNum) {
+        return entityMapper.findBySceneNum(sceneNum);
+    }
+}

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

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

+ 27 - 0
gis_web/pom.xml

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

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

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

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

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

+ 42 - 0
gis_web/src/main/java/com/gis/web/controller/AgeAlipayController.java

@@ -0,0 +1,42 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.domain.dto.AgeAlipayDto;
+import com.gis.service.AgeAlipayService;
+import com.gis.service.AgeBooksService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+
+/**
+ * Created by owen on 2022/5/5 0010 10:50
+ *
+ * 内部应用
+ * 支付宝-收集用户信息
+ */
+@Api(tags = "age-支付宝-收集用户信息")
+@RestController
+@RequestMapping("/api/alipay")
+public class AgeAlipayController {
+
+    @Autowired
+    AgeAlipayService entityService;
+
+    @ApiOperation(value = "保存信息")
+    @PostMapping("/save")
+    public Result saveEntity(@Valid @RequestBody AgeAlipayDto param){
+        return entityService.saveEntity(param);
+    }
+
+    @ApiOperation(value = "上传图片")
+    @PostMapping("/upload")
+    public Result upload(MultipartFile file){
+        return entityService.upload(file);
+    }
+}
+
+

+ 33 - 0
gis_web/src/main/java/com/gis/web/controller/AgeBooksController.java

@@ -0,0 +1,33 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.service.AgeBooksService;
+import com.gis.service.SceneCountService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by owen on 2021/9/22 0010 10:50
+ *
+ * 内部应用
+ * 珠海市唐家半岛—无界AR书店  数据实体
+ */
+@Api(tags = "无界AR书店-唐家半岛")
+@RestController
+@RequestMapping("api/books")
+public class AgeBooksController {
+
+    @Autowired
+    AgeBooksService entityService;
+
+    @ApiOperation(value = "条件搜索", notes = "搜索条件:name 书名、出版社")
+    @GetMapping("search")
+    public Result search(String name){
+        return entityService.search(name);
+    }
+}

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

@@ -0,0 +1,85 @@
+package com.gis.web.controller;
+
+import com.gis.domain.dto.PageDto;
+import com.gis.web.shiro.JwtUtil;
+import com.github.pagehelper.PageHelper;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * Created by owen on 2020/2/20 0020 15:20
+ */
+public class BaseController {
+
+    @Autowired
+    protected HttpServletRequest request;
+
+    /**
+     * 服务器保存文件路径前缀
+     */
+//    @Value("${file.path}")
+//    public String FILE_PATH;
+//
+//    @Value("${server.domain}")
+//    public String SERVER_DOMAIN;
+
+//    @Value("${oss.file.path}")
+//    public String OSS_PATH;
+//
+//    @Value("${oss.domain}")
+//    public String OSS_DOMAIN;
+
+
+
+    /** 获取用户名*/
+    String getTokenUserName(){
+        String token = getToken();
+        return JwtUtil.getUsername(token);
+    }
+
+    /** 获取用户id*/
+    Long getTokenUserId(){
+        return JwtUtil.getUserId(getToken());
+    }
+
+    /** 获取用户角色*/
+//    String getTokenUserRole(){
+//        return JwtUtil.getUserRole(getToken());
+//    }
+
+    /** 获取用户管理者*/
+    Boolean getTokenUserManager(){
+        return JwtUtil.getUserManager(getToken());
+    }
+
+
+    /** 获取header token */
+    String getToken(){
+        return request.getHeader("token");
+    }
+
+
+    /**
+     * 设置请求分页数据
+     */
+    void startPage(PageDto param){
+        Integer pageNum = param.getPageNum();
+        Integer pageSize = param.getPageSize();
+        if (pageNum == null || pageNum <= 0) {
+            pageNum = 0;
+        }
+
+        if (pageSize == null || pageSize <= 0) {
+            pageSize = 10;
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+
+    }
+
+
+
+}

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

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

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

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

+ 65 - 0
gis_web/src/main/java/com/gis/web/controller/SceneCountController.java

@@ -0,0 +1,65 @@
+package com.gis.web.controller;
+
+import com.gis.common.util.Result;
+import com.gis.service.SceneCountService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Created by owen on 2021/8/10 0010 10:50
+ *
+ * 初始化第一条数据, 需要手动加上
+ * 主要是场景的访问量统计
+ */
+@Api(tags = "场景数据统计-大场景")
+@RestController
+@RequestMapping("api/count")
+public class SceneCountController {
+
+    @Autowired
+    SceneCountService entityService;
+
+    @ApiOperation("访问量")
+    @GetMapping("saveVisit/{sceneCode}")
+    public Result saveVisit(@PathVariable String sceneCode){
+        return entityService.saveVisit(sceneCode);
+    }
+
+
+    /**
+     * 2022-3-25
+     * @param sceneCode
+     * @return
+     */
+    @ApiOperation("点赞")
+    @GetMapping("saveStar/{sceneCode}")
+    public Result saveStar(@PathVariable String sceneCode){
+        return entityService.saveStar(sceneCode);
+    }
+
+
+    @ApiOperation("分享")
+    @GetMapping("saveShare/{sceneCode}")
+    public Result saveShare(@PathVariable String sceneCode){
+        return entityService.saveShare(sceneCode);
+
+    }
+
+    /**
+     * 2021-09-19
+     * @param sceneCode
+     * @return
+     */
+    @ApiOperation("详情")
+    @GetMapping("detail/{sceneCode}")
+    public Result detail(@PathVariable String sceneCode){
+        return entityService.detail(sceneCode);
+
+    }
+
+}

+ 93 - 0
gis_web/src/main/java/com/gis/web/controller/SceneStatisticsController.java

@@ -0,0 +1,93 @@
+package com.gis.web.controller;
+
+
+import cn.hutool.http.HttpUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.gis.common.constant.Account;
+import com.gis.common.util.HttpRequestorUtil;
+import com.gis.common.util.Result;
+import com.gis.domain.entity.SceneStatisticsEntity;
+import com.gis.service.SceneStatisticsService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+
+/**
+ * Created by owen on 2020/2/18 0018 12:17
+ *
+ *  *  百度参考文档
+ *  * https://tongji.baidu.com/api/manual/Chapter1/trend_time_a.html
+ */
+@Log4j2
+@Api(tags = "百度统计")
+@RestController
+@RequestMapping("api/baidu")
+public class SceneStatisticsController extends BaseController {
+
+    @Autowired
+    private SceneStatisticsService sceneStatisticsService;
+
+
+    @ApiOperation("根据场景取前一天数据:日期参数如:20201223")
+    @GetMapping("bigScene/getData/{date}")
+    public Result<SceneStatisticsEntity> get(@PathVariable String date) throws Exception {
+        return Result.success(sceneStatisticsService.getDate(date));
+    }
+
+
+    @ApiOperation(value = "根据场景码查询", notes = "返回最近四百条")
+    @GetMapping("bigScene/getSceneData/{sceneNum}")
+    public Result<SceneStatisticsEntity> getSceneData(@PathVariable String sceneNum) throws Exception {
+        return Result.success(sceneStatisticsService.findBySceneNum(sceneNum));
+    }
+
+
+
+
+    @ApiOperation(value = "大场景, 日期参数如:20201223", notes = "手动添加指定日期到数据库,谨慎使用")
+    @GetMapping("bigScene/{data}")
+    public Result<SceneStatisticsEntity> add(@PathVariable String data) throws Exception {
+        return Result.success(sceneStatisticsService.getAdd(data));
+    }
+
+
+    @ApiOperation("获取站点列表")
+    @GetMapping("getSiteList")
+    public Result getSiteList(){
+
+        String url = "https://api.baidu.com/json/tongji/v1/ReportService/getSiteList";
+
+        JSONObject subJson = new JSONObject();
+        subJson.put("username", Account.USER_NAME);
+        subJson.put("password", Account.PASSWORD);
+        subJson.put("token", Account.ACCESS_TOKEN);
+        subJson.put("account_type", 1);
+
+        JSONObject reqJson = new JSONObject();
+        reqJson.put("header", subJson);
+
+        HttpUtil.get("https://api.baidu.com/json/tongji/v1/ReportService/getSiteList");
+        HttpUtil.post(url, reqJson);
+        String post =  HttpRequestorUtil.postJson(url, reqJson.toString(),"POST");
+
+
+        return Result.success(JSONObject.parseObject(post));
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+}

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

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

+ 45 - 0
gis_web/src/main/java/com/gis/web/job/ScheduleJob.java

@@ -0,0 +1,45 @@
+package com.gis.web.job;
+
+import com.gis.common.util.DateUtil;
+import com.gis.service.SceneStatisticsService;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * Created by owen on 2020/12/24 0024 16:11
+ *
+ * 自动运行
+ */
+@Log4j2
+@Component
+public class ScheduleJob {
+
+    @Autowired
+    private SceneStatisticsService sceneStatisticsService;
+
+    /**
+     * 需要在启动类加入注解
+     * 每天24点检查未开始的活动
+     * 每天24点执行一次  @Scheduled(cron=" 0 0 0 * * ? ") @Scheduled(cron=" * 1  * * ? ")
+     *
+     * Scheduled(cron=" 10 0/5 * * * ? ")   //每五分钟执行一次
+     */
+//    @Scheduled(cron=" 10 0/5 * * * ? ")
+    @Scheduled(cron = "0 0 4 * * ?")
+    public void baiduStatistics() {
+
+        log.warn("每天03:00开始执行定时任务:获取百度统计的数据入库");
+        try {
+            String dateStr = DateUtil.date2String(DateUtil.daysCalculate(new Date(), -1), DateUtil.YYYYMMDD_DATA_FORMAT);
+            sceneStatisticsService.getAdd(dateStr);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error(e.getMessage());
+        }
+    }
+
+}

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

@@ -0,0 +1,136 @@
+//package com.gis.web.shiro;
+//
+//import com.alibaba.fastjson.JSONObject;
+//import com.gis.common.exception.JwtAuthenticationException;
+//import lombok.extern.log4j.Log4j2;
+//import org.apache.commons.lang3.StringUtils;
+//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);
+//        } catch (Exception e) {
+//            /**
+//             * 这个异常需要自己写,全局捕获不了
+//             * 认证出现异常,传递错误信息msg
+//             */
+//            exceptionMsg(e, response);
+//        }
+//        // return false 前端没有响应,接收不到异常
+//        return true;
+//
+//
+//    }
+//
+//    /**
+//     * 对跨域提供支持
+//     * 只对需要token验证的有效,不需要验证的还是需要用注解处理一下
+//     *
+//     */
+//    @Override
+//    protected boolean preHandle(ServletRequest request, ServletResponse response) throws Exception {
+//        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+//        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+//        httpServletResponse.setHeader("Access-control-Allow-Origin", httpServletRequest.getHeader("Origin"));
+//        httpServletResponse.setHeader("Access-Control-Allow-Methods", "GET,POST,OPTIONS,PUT,DELETE");
+//        httpServletResponse.setHeader("Access-Control-Allow-Headers", httpServletRequest.getHeader("Access-Control-Request-Headers"));
+//        // 跨域时会首先发送一个option请求,这里我们给option请求直接返回正常状态
+//        if (httpServletRequest.getMethod().equals(RequestMethod.OPTIONS.name())) {
+//            httpServletResponse.setStatus(HttpStatus.OK.value());
+//            return false;
+//        }
+//        return super.preHandle(request, response);
+//    }
+//
+//
+//    /**
+//     * 无需转发,直接返回Response信息
+//     *
+//     */
+//    private void writeResponse(ServletResponse response, JSONObject msg) {
+//        response.setCharacterEncoding("UTF-8");
+//        response.setContentType("application/json; charset=utf-8");
+//        ServletOutputStream outputStream = null;
+//        try {
+//            outputStream = response.getOutputStream();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//        assert outputStream != null;
+//        PrintWriter printWriter = new PrintWriter(outputStream, true);
+//        printWriter.write(msg.toString());//直接将json输出到页面
+//        printWriter.flush();
+//        printWriter.close();
+//
+//    }
+//
+//    /**
+//     * 封装异常信息
+//     */
+//    private void exceptionMsg(Exception e, ServletResponse response) {
+//        // 认证出现异常,传递错误信息msg
+//        String msg = e.getMessage();
+//        // 获取应用异常(该Cause是导致抛出此throwable(异常)的throwable(异常))
+//        Throwable throwable = e.getCause();
+//        JSONObject jsonObject = new JSONObject();
+//        if (throwable instanceof JwtAuthenticationException) {
+//            jsonObject.put("code", ((JwtAuthenticationException) throwable).getCode());
+//            jsonObject.put("msg", ((JwtAuthenticationException) throwable).getMsg());
+//        } else {
+//            log.error(msg);
+//            jsonObject.put("code", 5002);
+//            jsonObject.put("msg", "token invalid");
+//        }
+//        // 直接返回Response信息
+//        this.writeResponse(response, jsonObject);
+//
+//    }
+//}

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

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

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

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

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

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

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

@@ -0,0 +1,121 @@
+//package com.gis.web.shiro;
+//
+//import com.alibaba.fastjson.serializer.SerializerFeature;
+//import com.alibaba.fastjson.support.config.FastJsonConfig;
+//import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
+//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.boot.autoconfigure.http.HttpMessageConverters;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.context.annotation.DependsOn;
+//import org.springframework.http.MediaType;
+//
+//import javax.servlet.Filter;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//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;
+//    }
+//
+//}

+ 265 - 0
pom.xml

@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!-- museum parent-->
+    <groupId>com.gis</groupId>
+    <artifactId>cms_statistics_baidu</artifactId>
+    <packaging>pom</packaging>
+
+    <version>1.0.0</version>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.4.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+
+    <modules>
+        <module>gis_common</module>
+        <module>gis_web</module>
+        <module>gis_domain</module>
+        <module>gis_service</module>
+        <module>gis_mapper</module>
+        <module>gis_application</module>
+    </modules>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <java.version>1.8</java.version>
+        <spring.boot.version>2.1.0.RELEASE</spring.boot.version>
+        <gis.version>1.0.0</gis.version>
+        <fastjson.version>1.2.75</fastjson.version>
+        <druid.version>1.1.14</druid.version>
+        <hutool.version>5.3.3</hutool.version>
+        <pinyin4j.version>2.5.1</pinyin4j.version>
+        <lombok.version>1.18.2</lombok.version>
+        <lang3.version>3.7</lang3.version>
+        <mysql.version>8.0.15</mysql.version>
+        <shiro.version>1.3.2</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>
+        <zxing.version>3.3.3</zxing.version>
+
+    </properties>
+
+
+    <!--dependencyManagement用于管理依赖版本号, 必须写版本号,不然依赖不上-->
+    <dependencyManagement>
+        <dependencies>
+            <!--模块版本管理-->
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_application</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_common</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_domain</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_service</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_mapper</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.gis</groupId>
+                <artifactId>gis_web</artifactId>
+                <version>${gis.version}</version>
+            </dependency>
+
+
+            <!-- springboot -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-data-jpa</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-web</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-test</artifactId>
+                <scope>test</scope>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <!--springboot中的redis依赖-->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-starter-data-redis</artifactId>
+                <version>${spring.boot.version}</version>
+            </dependency>
+
+            <!--rabbit MQ-->
+            <!--<dependency>-->
+                <!--<groupId>org.springframework.boot</groupId>-->
+                <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+                <!--<version>${spring.boot.version}</version>-->
+            <!--</dependency>-->
+
+            <!-- lombok -->
+            <dependency>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+            </dependency>
+
+            <!-- fastjson -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>${fastjson.version}</version>
+            </dependency>
+
+            <!--阿里数据库连接池 -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid-spring-boot-starter</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+
+            <!-- mysql -->
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+
+            <!-- 工具类 -->
+            <dependency>
+                <groupId>cn.hutool</groupId>
+                <artifactId>hutool-all</artifactId>
+                <version>${hutool.version}</version>
+            </dependency>
+
+            <!-- 中文转拼音 -->
+            <dependency>
+                <groupId>com.belerweb</groupId>
+                <artifactId>pinyin4j</artifactId>
+                <version>${pinyin4j.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>
+
+
+            <!-- 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>
+
+            <!-- 二维码 -->
+            <dependency>
+                <groupId>com.google.zxing</groupId>
+                <artifactId>core</artifactId>
+                <version>${zxing.version}</version>
+            </dependency>
+
+
+        </dependencies>
+    </dependencyManagement>
+
+
+</project>

+ 60 - 0
run.sh

@@ -0,0 +1,60 @@
+#!/bin/sh
+APP_NAME=cms_statistics_baidu.jar
+APP_PORT=8109
+APP_EVN=$2   #执行环境 sit|pro
+APP_ORDER=$1   #执行方法  start|stop|restart
+# 获取进程号
+APP_PID=`netstat -ntpl | grep $APP_PORT | grep LISTEN | awk '{print $7}' | awk -F "/" '{print $1}'`
+
+
+# 启动命令
+startApp(){
+    if [ ${APP_PID} ];
+    then
+    	echo "程序已经在运行了"
+    else
+    	echo "执行 start 方法"
+    	nohup java -jar -Xmx3072M -Xms512M ./$APP_NAME --spring.profiles.active=$APP_EVN --server.port=$APP_PORT > logs.log 2>error.log &  # 说明pid为空
+	echo Start Success!
+fi
+}
+
+# 停止命令
+stopApp(){
+    echo "执行 stop 方法"
+    if [ ${APP_PID} ];
+	then
+		echo $APP_NAME "存在,执行 stop 方法"
+			kill -9 ${APP_PID} && echo 'Kill Process!'
+	else
+		echo $APP_NAME 没有运行
+    fi
+}
+
+# 重启命令
+restartApp(){
+    echo " 1 执行 restart 方法"
+	stopApp
+	APP_PID=''  #将进程号置空
+	sleep 2
+	echo "进程号:" ${APP_PID}
+	echo " 2 执行 restart 方法"
+	startApp
+}
+
+# 判断执行命令 取第一个参数
+case $APP_ORDER in
+    "start")
+        startApp
+        ;;
+    "stop")
+        stopApp
+        ;;
+	"restart")
+		restartApp
+        ;;
+        *)
+     ;;
+esac
+
+