wuweihao 5 år sedan
förälder
incheckning
a9fe96923b
100 ändrade filer med 4120 tillägg och 1 borttagningar
  1. 50 1
      README.md
  2. 45 0
      gis_application/pom.xml
  3. 13 0
      gis_application/src/main/java/com/gis/GisApplication.java
  4. 13 0
      gis_application/src/main/java/com/gis/ServletInitializer.java
  5. 63 0
      gis_application/src/main/resources/application-dev.properties
  6. 61 0
      gis_application/src/main/resources/application-sit.properties
  7. 61 0
      gis_application/src/main/resources/application-uat.properties
  8. 41 0
      gis_application/src/main/resources/application.properties
  9. 1 0
      gis_application/src/main/resources/data/T1m25l6oJl.txt
  10. 156 0
      gis_application/src/main/resources/logback-spring.xml
  11. 153 0
      gis_common/pom.xml
  12. 59 0
      gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  13. 86 0
      gis_common/src/main/java/com/gis/common/config/Swagger2.java
  14. 79 0
      gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java
  15. 14 0
      gis_common/src/main/java/com/gis/common/constant/TypeCode.java
  16. 35 0
      gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java
  17. 34 0
      gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java
  18. 236 0
      gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java
  19. 82 0
      gis_common/src/main/java/com/gis/common/util/FileUtils.java
  20. 194 0
      gis_common/src/main/java/com/gis/common/util/PasswordUtils.java
  21. 20 0
      gis_common/src/main/java/com/gis/common/util/RandomUtils.java
  22. 101 0
      gis_common/src/main/java/com/gis/common/util/Result.java
  23. 22 0
      gis_domain/pom.xml
  24. 38 0
      gis_domain/src/main/java/com/gis/domain/entity/BaseEntity.java
  25. 24 0
      gis_domain/src/main/java/com/gis/domain/entity/FileEntity.java
  26. 55 0
      gis_domain/src/main/java/com/gis/domain/entity/GoodsEntity.java
  27. 37 0
      gis_domain/src/main/java/com/gis/domain/entity/LogEntity.java
  28. 30 0
      gis_domain/src/main/java/com/gis/domain/entity/SysDeptEntity.java
  29. 55 0
      gis_domain/src/main/java/com/gis/domain/entity/SysResourceEntity.java
  30. 32 0
      gis_domain/src/main/java/com/gis/domain/entity/SysRoleEntity.java
  31. 53 0
      gis_domain/src/main/java/com/gis/domain/entity/SysUserEntity.java
  32. 27 0
      gis_domain/src/main/java/com/gis/domain/entity/WxCollectEntity.java
  33. 47 0
      gis_domain/src/main/java/com/gis/domain/entity/WxCommentEntity.java
  34. 27 0
      gis_domain/src/main/java/com/gis/domain/entity/WxStarEntity.java
  35. 25 0
      gis_domain/src/main/java/com/gis/domain/entity/WxTrackEntity.java
  36. 20 0
      gis_domain/src/main/java/com/gis/domain/request/CommentPageRequest.java
  37. 23 0
      gis_domain/src/main/java/com/gis/domain/request/DeptRequest.java
  38. 27 0
      gis_domain/src/main/java/com/gis/domain/request/GoodsPageRequest.java
  39. 52 0
      gis_domain/src/main/java/com/gis/domain/request/GoodsRequest.java
  40. 22 0
      gis_domain/src/main/java/com/gis/domain/request/LoginRequest.java
  41. 27 0
      gis_domain/src/main/java/com/gis/domain/request/PageDateRequest.java
  42. 23 0
      gis_domain/src/main/java/com/gis/domain/request/PageRequest.java
  43. 22 0
      gis_domain/src/main/java/com/gis/domain/request/PasswordRequest.java
  44. 43 0
      gis_domain/src/main/java/com/gis/domain/request/QuestionRequest.java
  45. 27 0
      gis_domain/src/main/java/com/gis/domain/request/RoleAccreditRequest.java
  46. 31 0
      gis_domain/src/main/java/com/gis/domain/request/RoleRequest.java
  47. 15 0
      gis_domain/src/main/java/com/gis/domain/request/UserPageRequest.java
  48. 41 0
      gis_domain/src/main/java/com/gis/domain/request/UserRequest.java
  49. 28 0
      gis_domain/src/main/java/com/gis/domain/request/WxCollectStarRequest.java
  50. 33 0
      gis_domain/src/main/java/com/gis/domain/request/WxCommentRequest.java
  51. 24 0
      gis_domain/src/main/java/com/gis/domain/request/WxGoodsRequest.java
  52. 29 0
      gis_domain/src/main/java/com/gis/domain/request/WxTrackCommentPageRequest.java
  53. 33 0
      gis_domain/src/main/java/com/gis/domain/request/WxTrackCommentRequest.java
  54. 60 0
      gis_domain/src/main/java/com/gis/domain/response/GoodsResponse.java
  55. 24 0
      gis_domain/src/main/java/com/gis/domain/response/LogResponse.java
  56. 41 0
      gis_domain/src/main/java/com/gis/domain/response/WxCollectStarResponse.java
  57. 66 0
      gis_domain/src/main/java/com/gis/domain/response/WxTrackCommentResponse.java
  58. 22 0
      gis_mapper/pom.xml
  59. 33 0
      gis_mapper/src/main/java/com/gis/mapper/CommonMapper.java
  60. 16 0
      gis_mapper/src/main/java/com/gis/mapper/FileMapper.java
  61. 30 0
      gis_mapper/src/main/java/com/gis/mapper/GoodsMapper.java
  62. 18 0
      gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java
  63. 23 0
      gis_mapper/src/main/java/com/gis/mapper/LogMapper.java
  64. 15 0
      gis_mapper/src/main/java/com/gis/mapper/SysDeptMapper.java
  65. 21 0
      gis_mapper/src/main/java/com/gis/mapper/SysResourceMapper.java
  66. 21 0
      gis_mapper/src/main/java/com/gis/mapper/SysRoleMapper.java
  67. 30 0
      gis_mapper/src/main/java/com/gis/mapper/SysUserMapper.java
  68. 24 0
      gis_mapper/src/main/java/com/gis/mapper/WxCollectMapper.java
  69. 36 0
      gis_mapper/src/main/java/com/gis/mapper/WxCommentMapper.java
  70. 25 0
      gis_mapper/src/main/java/com/gis/mapper/WxStarMapper.java
  71. 25 0
      gis_mapper/src/main/java/com/gis/mapper/WxTrackMapper.java
  72. 63 0
      gis_mapper/src/main/java/com/gis/mapper/provider/GoodsProvider.java
  73. 39 0
      gis_mapper/src/main/java/com/gis/mapper/provider/LogProvider.java
  74. 34 0
      gis_mapper/src/main/java/com/gis/mapper/provider/UserProvider.java
  75. 23 0
      gis_service/pom.xml
  76. 13 0
      gis_service/src/main/java/com/gis/service/FileService.java
  77. 23 0
      gis_service/src/main/java/com/gis/service/GoodsService.java
  78. 47 0
      gis_service/src/main/java/com/gis/service/IBaseService.java
  79. 18 0
      gis_service/src/main/java/com/gis/service/LogService.java
  80. 14 0
      gis_service/src/main/java/com/gis/service/SysDeptService.java
  81. 19 0
      gis_service/src/main/java/com/gis/service/SysResourceService.java
  82. 18 0
      gis_service/src/main/java/com/gis/service/SysRoleService.java
  83. 22 0
      gis_service/src/main/java/com/gis/service/SysUserService.java
  84. 19 0
      gis_service/src/main/java/com/gis/service/WxCollectService.java
  85. 22 0
      gis_service/src/main/java/com/gis/service/WxCommentService.java
  86. 19 0
      gis_service/src/main/java/com/gis/service/WxStarService.java
  87. 19 0
      gis_service/src/main/java/com/gis/service/WxTrackService.java
  88. 28 0
      gis_service/src/main/java/com/gis/service/impl/FileServiceImpl.java
  89. 42 0
      gis_service/src/main/java/com/gis/service/impl/GoodsServiceImpl.java
  90. 167 0
      gis_service/src/main/java/com/gis/service/impl/IBaseServiceImpl.java
  91. 34 0
      gis_service/src/main/java/com/gis/service/impl/LogServiceImpl.java
  92. 30 0
      gis_service/src/main/java/com/gis/service/impl/SysDeptServiceImpl.java
  93. 38 0
      gis_service/src/main/java/com/gis/service/impl/SysResourceServiceImpl.java
  94. 40 0
      gis_service/src/main/java/com/gis/service/impl/SysRoleServiceImpl.java
  95. 50 0
      gis_service/src/main/java/com/gis/service/impl/SysUserServiceImpl.java
  96. 38 0
      gis_service/src/main/java/com/gis/service/impl/WxCollectServiceImpl.java
  97. 45 0
      gis_service/src/main/java/com/gis/service/impl/WxCommentServiceImpl.java
  98. 39 0
      gis_service/src/main/java/com/gis/service/impl/WxStarServiceImpl.java
  99. 38 0
      gis_service/src/main/java/com/gis/service/impl/WxTrackServiceImpl.java
  100. 0 0
      gis_service/src/main/java/com/gis/service/util/ResourceTree.java

+ 50 - 1
README.md

@@ -1,3 +1,52 @@
 # cms_museum_yw
 
-义乌博物馆小程序后台
+义乌博物馆java后端代码
+
+
+##sit
+    服务器:
+    192.168.0.44
+        root
+        hehe0618
+        port:2222
+        
+         mysql:
+             root
+             4dkk2020test%
+             
+         tomcat:
+         /root/user/java/tomcat_museum_yw_8104/webapps
+         
+         api:
+         http://192.168.0.44:8104/doc.html
+         
+         公网访问:
+         http://face3d.4dage.com:8104/doc.html
+         
+    
+    <Context path="" docBase="/root/user/java/tomcat_museum_yw_8104/webapps/cmsMuseumYw" debug="0" reloadable="true" crossContext="true"/>
+    /root/user/java/tomcat_museum_yw_8104/webapps
+    
+    
+    
+    
+    
+    
+   
+## uat
+    四维看展服务器,正式环境
+    
+    tomcat
+    <Context path="" docBase="/usr/local/tomcat_museum_yw_8104/webapps/cmsMuseumYw" debug="0" reloadable="true" crossContext="true"/>
+    /usr/local/tomcat_museum_yw_8104/webapps/
+    
+    
+    
+    api
+    http://tywmseum.4dage.com/doc.html
+    
+
+
+        
+# data文件夹
+    - 

+ 45 - 0
gis_application/pom.xml

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

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

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

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

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

@@ -0,0 +1,63 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/cms_museum_yw?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=root
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\u6570\u636E\u5E93\u7D22\u5F15\uFF08\u9ED8\u8BA4\u4E3A0\uFF09
+spring.redis.database=0
+spring.redis.host=127.0.0.1
+spring.redis.port=6379
+spring.redis.password=
+# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4 \u5355\u4F4D ms\uFF08\u6BEB\u79D2\uFF09
+spring.redis.timeout=3000ms
+# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F8\u3002
+spring.redis.jedis.pool.max-idle=8
+#\u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u9ED8\u8BA4\u503C\u4E5F\u662F0\u3002
+spring.redis.jedis.pool.min-idle=0
+# \u5982\u679C\u8D4B\u503C\u4E3A-1\uFF0C\u5219\u8868\u793A\u4E0D\u9650\u5236\uFF1B\u5982\u679Cpool\u5DF2\u7ECF\u5206\u914D\u4E86maxActive\u4E2Ajedis\u5B9E\u4F8B\uFF0C\u5219\u6B64\u65F6pool\u7684\u72B6\u6001\u4E3Aexhausted(\u8017\u5C3D)\u3002
+spring.redis.jedis.pool.max-active=8
+# \u7B49\u5F85\u53EF\u7528\u8FDE\u63A5\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF0C\u9ED8\u8BA4\u503C\u4E3A-1\uFF0C\u8868\u793A\u6C38\u4E0D\u8D85\u65F6\u3002\u5982\u679C\u8D85\u8FC7\u7B49\u5F85\u65F6\u95F4\uFF0C\u5219\u76F4\u63A5\u629B\u51FAJedisConnectionException
+spring.redis.jedis.pool.max-wait=-1ms
+
+
+#log
+logging.path=E:/javaProject/army_cms_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+## \u672C\u5730\u4FDD\u5B58\u8DEF\u5F84
+#file.path=F:\\test\\army\\images
+
+# \u4E0A\u4F20\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84
+output.file.path=F:\\test\\cms_museum_yw\\
+# oss info
+oss.file.path=museum_yw/
+oss.domain=http://ossxiaoan.4dage.com/
+

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

@@ -0,0 +1,61 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/cms_museum_yw?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=4dkk2020test%
+
+
+# \u521D\u59CB\u8FDE\u63A5\u6570
+spring.datasource.druid.initial-size=5
+# \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.min-idle=10
+# \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF
+spring.datasource.druid.max-active=20
+# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
+spring.datasource.druid.max-wait=60000
+# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.time-between-eviction-runs-millis=60000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.min-evictable-idle-time-millis=30000
+# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
+spring.datasource.druid.max-evictable-idle-time-millis=90000
+# \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548
+spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
+spring.datasource.druid.test-while-idle=true
+spring.datasource.druid.test-on-borrow=false
+spring.datasource.druid.test-on-return=false
+spring.datasource.druid.web-stat-filter.enabled=true
+spring.datasource.druid.stat-view-servlet.enabled=true
+
+
+# Redis\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.path=/root/user/cms_museum_yw_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+# \u4E0A\u4F20\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84
+output.file.path=/root/user/cms_museum_yw_data/
+# oss info
+oss.file.path=museum_yw_/
+oss.domain=http://ossxiaoan.4dage.com/
+

+ 61 - 0
gis_application/src/main/resources/application-uat.properties

@@ -0,0 +1,61 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/cms_museum_yw?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=123456
+
+
+# \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.path=/root/user/cms_museum_yw_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+
+# \u4E0A\u4F20\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84
+output.file.path=/root/user/cms_museum_yw_data/
+# oss info
+oss.file.path=museum_yw_/
+oss.domain=http://ossxiaoan.4dage.com/
+

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

@@ -0,0 +1,41 @@
+#server.port=8104
+server.port=2000
+
+spring.profiles.active=dev
+
+# \u8BBF\u95EE\u9759\u6001\u8D44\u6E90\u8BBE\u7F6E
+spring.resources.static-locations=classpath:templates/,classpath:static/,classpath:web/
+
+#\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F
+spring.servlet.multipart.enabled=true
+spring.servlet.multipart.max-file-size=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
+
+
+#\u5FAE\u4FE1\u8D26\u53F7\uFF0C\u8FD9\u4E2A\u662F\u56DB\u7EF4\u7684
+#app_id=wxd55ee54235e90359
+#app_secret=84af840254f5db6bba478bab71897177
+
+# \u4E49\u4E4C\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F\u4FE1\u606F
+app_id=wxbd0f9ff2a5621bf3
+app_secret=94f6cf81ce63fbbf19a155070bb29b60
+
+
+
+
+
+
+
+

+ 1 - 0
gis_application/src/main/resources/data/T1m25l6oJl.txt

@@ -0,0 +1 @@
+9b2792990acae0fdf2789f24e670418d

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

+ 153 - 0
gis_common/pom.xml

@@ -0,0 +1,153 @@
+<?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_gis</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_common</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+
+        <!--springboot-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <!-- JPA -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-jpa</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!--springboot中的redis依赖-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+
+        <!-- rabbit MQ-->
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.boot</groupId>-->
+            <!--<artifactId>spring-boot-starter-amqp</artifactId>-->
+        <!--</dependency>-->
+
+        <!-- lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+        <!-- fastjson -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+        </dependency>
+
+        <!-- mysql -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!--阿里数据库连接池 -->
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!-- knife4j aip 包-->
+        <dependency>
+            <groupId>com.github.xiaoymin</groupId>
+            <artifactId>knife4j-spring-boot-starter</artifactId>
+        </dependency>
+
+        <!-- 工具类 -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+
+        <!-- shiro -->
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+        </dependency>
+
+
+        <!-- jwt -->
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+        </dependency>
+
+        <!--aliyun sdk-->
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>aliyun-java-sdk-dysmsapi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+        </dependency>
+
+
+        <!--tk.mybatis 依赖-->
+        <dependency>
+            <groupId>tk.mybatis</groupId>
+            <artifactId>mapper-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!--分页插件-->
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+        </dependency>
+
+
+        <!-- 钉钉sdk -->
+        <!--<dependency>-->
+            <!--<groupId>com.dingtalk.open</groupId>-->
+            <!--<artifactId>taobao-sdk-java-auto</artifactId>-->
+        <!--</dependency>-->
+
+
+        <!--excel 依赖工具包, hutool需要用的-->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.poi</groupId>-->
+            <!--<artifactId>poi-ooxml</artifactId>-->
+        <!--</dependency>-->
+
+
+    </dependencies>
+
+
+</project>

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

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

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

@@ -0,0 +1,86 @@
+package com.gis.common.config;
+
+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
+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("义乌博物馆 APIs")
+                .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;
+    }
+}

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

@@ -0,0 +1,79 @@
+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);
+    }
+
+}

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

@@ -0,0 +1,14 @@
+package com.gis.common.constant;
+
+/**
+ * Created by owen on 2020/5/14 0014 8:56
+ */
+public class TypeCode {
+
+    /**redis token 前缀*/
+    public static final String REDIS_LOGIN_TOKEN = "museum_yw_token_";
+
+    /**redis wxToken 前缀*/
+    public static final String REDIS_LOGIN_WXTOKEN = "museum_yw_wxToken_";
+
+}

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

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

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

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

@@ -0,0 +1,236 @@
+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 = "4dkankan";
+	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();
+//		}
+//	}
+
+}

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

@@ -0,0 +1,82 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Slf4j
+public class FileUtils {
+
+
+    /**
+     * 多文件上传
+     * savePath 路径(目录)
+     */
+    public static List<Map<String, String>> uploads(MultipartFile[] files, String savePath) throws IOException {
+        if (files == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        savePath = savePath + time + File.separator;
+        log.info("savePath: {}", savePath);
+
+        ArrayList<Map<String, String>> list = new ArrayList<>();
+
+        String path;
+        int i = 0;
+        for (MultipartFile file : files) {
+            String fileName = file.getOriginalFilename();
+            String suffix = StringUtils.substringAfterLast(fileName, ".");
+            String newName = time + "_" + i + "."  +suffix;
+            path = savePath + newName;
+            FileUtil.writeFromStream(file.getInputStream(), path);
+
+            HashMap<String, String> fileInfo = new HashMap<>();
+            fileInfo.put("path", path);
+            fileInfo.put("name", fileName);
+            fileInfo.put("newName", newName);
+            fileInfo.put("dir", time);
+
+            list.add(fileInfo);
+            ++ i;
+        }
+
+        return list;
+
+    }
+
+
+    /**
+     * 但文件上传
+     * @param file
+     * @param savePath
+     * @return
+     * @throws IOException
+     */
+    public static boolean upload(MultipartFile file, String savePath) throws IOException {
+        if (file == null) {
+            log.error("文件不能为空");
+            return false;
+        }
+        FileUtil.writeFromStream(file.getInputStream(), savePath);
+        return true;
+
+    }
+
+
+    public void test(){
+        String a = "aaaa.jpg";
+        System.out.println(StringUtils.substringAfterLast(a, "."));
+    }
+}

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

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

@@ -0,0 +1,20 @@
+package com.gis.common.util;
+
+import cn.hutool.core.util.RandomUtil;
+
+/**
+ * Created by owen on 2020/4/26 0026 10:07
+ *
+ *
+ */
+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));
+    }
+}

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

+ 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_gis</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_domain</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_common</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

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

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

@@ -0,0 +1,24 @@
+package com.gis.domain.entity;
+
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 文件表
+ */
+@Data
+@Table(name = "tb_file")
+public class FileEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+    /** 文件名 */
+    private String fileName;
+
+    /** 文件保存路径 */
+    private String filePath;
+
+
+}

+ 55 - 0
gis_domain/src/main/java/com/gis/domain/entity/GoodsEntity.java

@@ -0,0 +1,55 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 藏品信息表
+ */
+@Data
+@Table(name = "tb_goods")
+public class GoodsEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "朝代Id")
+    private Long dynastyId;
+
+
+    @ApiModelProperty(value = "文物类别Id")
+    private Long categoryId;
+
+
+    @ApiModelProperty(value = "文件级别,0:未定级,1:一级, 2:二级, 3:三级")
+    private Integer level;
+
+    @ApiModelProperty(value = "文物介绍")
+    private String description;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "模型url")
+    private String webSite;
+
+    @ApiModelProperty(value = "浏览量")
+    private Integer countTrack;
+
+    @ApiModelProperty(value = "评论量")
+    private Integer countComment;
+
+    @ApiModelProperty(value = "点赞量")
+    private Integer countStar;
+
+
+}

+ 37 - 0
gis_domain/src/main/java/com/gis/domain/entity/LogEntity.java

@@ -0,0 +1,37 @@
+package com.gis.domain.entity;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 收集日志实体类
+ */
+@NoArgsConstructor                 //无参构造
+@AllArgsConstructor                //有参构造
+@Data
+//@Table(name = "tb_log")
+public class LogEntity extends BaseEntity implements Serializable {
+
+
+    private static final long serialVersionUID = -3394791736156714542L;
+
+    /**
+     * 操作者用户id
+     */
+    private Long userId;
+
+    /**
+     * 操作类型
+     */
+    private String type;
+
+    /**
+     * 操作记录
+     */
+    private String description;
+
+}

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

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

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

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

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

@@ -0,0 +1,32 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+//@Table(name = "sys_role")
+public class SysRoleEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "角色key")
+    private String roleKey;
+
+    @ApiModelProperty(value = "角色名称")
+    private String roleName;
+
+    @ApiModelProperty(value = "角色描述")
+    private String roleDesc;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @ApiModelProperty(value = "数据范围,1:所有数据,2:部门数据,3:个人数据")
+    private Integer dataScope ;
+
+}

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

@@ -0,0 +1,53 @@
+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 = -5191918184688236778L;
+
+    /** 用户名 */
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+
+    /** 真实姓名 */
+//    private String realName;
+
+    @JSONField(serialize = false)
+    private String password;
+
+    /** 性别 0:男  1:女 */
+//    private Integer sex;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+//    private String email;
+
+    @ApiModelProperty(value = "状态 0:启用  1:停用 2:注销")
+    private Integer status;
+
+//    @ApiModelProperty(value = "角色:只有两种 admin:超级管理员, normal:普通管理员")
+//    private String role;
+
+    @ApiModelProperty(value = "头像url")
+    private String icon;
+
+    @ApiModelProperty(value = "超级管理员,1:是, 0:否")
+    private Integer sysManager;
+
+
+
+}

+ 27 - 0
gis_domain/src/main/java/com/gis/domain/entity/WxCollectEntity.java

@@ -0,0 +1,27 @@
+package com.gis.domain.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 微信收藏表
+ * wxId、goodsId够成联合主键,确定唯一值
+ */
+@Data
+@Table(name = "tb_wx_collect")
+public class WxCollectEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "微信id")
+    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private Long goodsId;
+
+}

+ 47 - 0
gis_domain/src/main/java/com/gis/domain/entity/WxCommentEntity.java

@@ -0,0 +1,47 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * 微信评论表
+ */
+@Data
+@Table(name = "tb_wx_comment")
+public class WxCommentEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+    @ApiModelProperty(value = "微信id")
+    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private Long goodsId;
+
+    @ApiModelProperty(value = "评论")
+    private String comment;
+
+    @ApiModelProperty(value = "点赞数量")
+    private Integer star;
+
+    @ApiModelProperty(value = "wx用户昵称")
+    private String nickName ;
+
+    @ApiModelProperty(value = "wx头像")
+    private String avatarUrl ;
+
+    @Transient
+    @ApiModelProperty(value = "自己是否点赞")
+    private Boolean isStar = false;
+
+
+
+
+
+
+}

+ 27 - 0
gis_domain/src/main/java/com/gis/domain/entity/WxStarEntity.java

@@ -0,0 +1,27 @@
+package com.gis.domain.entity;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 微信点赞表
+ *
+ */
+@Data
+@Table(name = "tb_wx_star")
+public class WxStarEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+    @JSONField(serialize = false)
+    @ApiModelProperty(value = "微信id")
+    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private Long goodsId;
+
+}

+ 25 - 0
gis_domain/src/main/java/com/gis/domain/entity/WxTrackEntity.java

@@ -0,0 +1,25 @@
+package com.gis.domain.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 微信足迹表
+ */
+@Data
+@Table(name = "tb_wx_track")
+public class WxTrackEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+    @ApiModelProperty(value = "微信id")
+    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private Long goodsId;
+
+
+}

+ 20 - 0
gis_domain/src/main/java/com/gis/domain/request/CommentPageRequest.java

@@ -0,0 +1,20 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ */
+@Data
+public class CommentPageRequest extends PageRequest {
+
+    @NotBlank(message = "藏品Id不能为空")
+    @ApiModelProperty(value = "藏品Id", required = true)
+    private String goodsId;
+
+
+}

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

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

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

@@ -0,0 +1,27 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class GoodsPageRequest extends PageRequest{
+
+
+
+    @ApiModelProperty(value = "朝代")
+    private Long dynastyId;
+
+    @ApiModelProperty(value = "等级")
+    private Integer level;
+
+    @ApiModelProperty(value = "文物类别Id")
+    private Integer categoryId;
+
+    @ApiModelProperty(value = "排序:热度:track、点赞:star、评论:comment")
+    private String orderBy;
+
+}

+ 52 - 0
gis_domain/src/main/java/com/gis/domain/request/GoodsRequest.java

@@ -0,0 +1,52 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class GoodsRequest implements Serializable {
+
+    private static final long serialVersionUID = -8093426577843493946L;
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略")
+    private Long id;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    @NotNull(message = "朝代不能为空")
+    @ApiModelProperty(value = "朝代", required = true)
+    private Long dynastyId;
+
+    @NotNull(message = "文物类别不能为空")
+    @ApiModelProperty(value = "文物类别Id")
+    private Long categoryId;
+
+    @NotNull(message = "文件级别不能为空")
+    @ApiModelProperty(value = "文件级别,1,2")
+    private Integer level;
+
+
+    @NotBlank(message = "文物介绍不能为空")
+    @ApiModelProperty(value = "文物介绍")
+    private String description;
+
+    @NotBlank(message = "缩略图url不能为空")
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @NotBlank(message = "高清图url不能为空")
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @NotBlank(message = "模型url不能为空")
+    @ApiModelProperty(value = "模型url")
+    private String webSite;
+
+
+}

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

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

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

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

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

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

+ 22 - 0
gis_domain/src/main/java/com/gis/domain/request/PasswordRequest.java

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

+ 43 - 0
gis_domain/src/main/java/com/gis/domain/request/QuestionRequest.java

@@ -0,0 +1,43 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ */
+@Data
+public class QuestionRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略")
+    private Long id;
+
+    @NotBlank(message = "题目不能为空")
+    @ApiModelProperty(value = "题目", required = true)
+    private String title;
+
+    @NotBlank(message = "诗人不能为空")
+    @ApiModelProperty(value = "诗人", required = true)
+    private String poet;
+
+    @NotNull(message = "题目类型不能为空")
+    @ApiModelProperty(value = "题目类型,1:单选,2:多选", required = true)
+    private Integer type;
+
+    @NotNull(message = "题目难度不能为空")
+    @ApiModelProperty(value = "题目难度,1:简单,2:困难", required = true)
+    private Integer level;
+
+    @NotBlank(message = "答案不能为空")
+    @ApiModelProperty(value = "答案id", required = true)
+    private String answerId;
+
+    @ApiModelProperty(value = "相关知识点")
+    private String related;
+
+
+
+}

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

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

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

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

+ 15 - 0
gis_domain/src/main/java/com/gis/domain/request/UserPageRequest.java

@@ -0,0 +1,15 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/6/19 0019 14:15
+ */
+@Data
+public class UserPageRequest extends PageRequest {
+
+
+    @ApiModelProperty(value = "状态 0:启用  1:停用 2:注销")
+    private Integer status;
+}

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

@@ -0,0 +1,41 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ */
+@Data
+public class UserRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotNull(message = "用户名不能为空")
+    @ApiModelProperty(value = "用户名", name = "userName", required = true)
+    private String userName;
+
+    @NotNull(message = "手机号不能为空")
+    @ApiModelProperty(value = "手机号", name = "phone", required = true)
+    private String phone;
+
+    @NotNull(message = "状态不能为空")
+    @ApiModelProperty(value = "状态, 0:启用  1:停用 2:注销", name = "status", required = true)
+    private Integer status;
+
+//    @NotNull(message = "角色不能为空")
+//    @ApiModelProperty(value = "角色:只有两种 admin normal", name = "role", required = true)
+//    private String role;
+
+    @NotNull(message = "头像不能为空")
+    @ApiModelProperty(value = "头像url", required = true)
+    private String icon;
+
+    @NotNull(message = "角色不能为空")
+    @ApiModelProperty(value = "超级管理员,1:是, 0:否")
+    private Integer sysManager;
+}

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

@@ -0,0 +1,28 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class WxCollectStarRequest implements Serializable {
+
+    private static final long serialVersionUID = -8093426577843493946L;
+
+
+    @NotBlank(message = "微信id不能为空")
+    @ApiModelProperty(value = "微信id", required = true)
+    private String wxId;
+
+    @NotNull(message = "藏品id不能为空")
+    @ApiModelProperty(value = "藏品id", required = true)
+    private Long goodsId;
+
+    @NotNull(message = "类型不能为空")
+    @ApiModelProperty(value = "类型, 1:点赞,2:收藏", required = true)
+    private Integer type;
+
+}

+ 33 - 0
gis_domain/src/main/java/com/gis/domain/request/WxCommentRequest.java

@@ -0,0 +1,33 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class WxCommentRequest implements Serializable {
+
+    private static final long serialVersionUID = -8093426577843493946L;
+
+
+    @NotNull(message = "藏品id不能为空")
+    @ApiModelProperty(value = "藏品id", required = true)
+    private Long goodsId;
+
+    @ApiModelProperty(value = "评论")
+    private String comment;
+
+    @NotNull(message = "wx用户昵称不能为空")
+    @ApiModelProperty(value = "wx用户昵称", required = true)
+    private String nickName ;
+
+    @NotNull(message = "wx头像不能为空")
+    @ApiModelProperty(value = "wx头像", required = true)
+    private String avatarUrl ;
+
+
+
+}

+ 24 - 0
gis_domain/src/main/java/com/gis/domain/request/WxGoodsRequest.java

@@ -0,0 +1,24 @@
+package com.gis.domain.request;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+@Data
+public class WxGoodsRequest implements Serializable {
+
+    private static final long serialVersionUID = -8093426577843493946L;
+
+
+    @NotBlank(message = "微信id不能为空")
+    @ApiModelProperty(value = "微信id", required = true)
+    private String wxId;
+
+    @NotNull(message = "藏品id不能为空")
+    @ApiModelProperty(value = "藏品id", required = true)
+    private Long goodsId;
+
+}

+ 29 - 0
gis_domain/src/main/java/com/gis/domain/request/WxTrackCommentPageRequest.java

@@ -0,0 +1,29 @@
+//package com.gis.domain.request;
+//
+//import io.swagger.annotations.ApiModelProperty;
+//import lombok.Data;
+//
+//import javax.validation.constraints.NotBlank;
+//import javax.validation.constraints.NotNull;
+//
+///**
+// * Created by owen on 2020/6/10 0010 17:39
+// */
+//@Data
+//public class WxTrackCommentPageRequest extends PageRequest {
+//
+//    @NotBlank(message = "微信id不能为空")
+//    @ApiModelProperty(value = "微信id", required = true)
+//    private String wxId;
+//
+//    @NotNull(message = "类型不能为空")
+//    @ApiModelProperty(value = "类型, 1:足迹,2:评论", required = true)
+//    private Integer type;
+//
+//
+//
+//
+//
+//
+//
+//}

+ 33 - 0
gis_domain/src/main/java/com/gis/domain/request/WxTrackCommentRequest.java

@@ -0,0 +1,33 @@
+//package com.gis.domain.request;
+//
+//import io.swagger.annotations.ApiModelProperty;
+//import lombok.Data;
+//
+//import javax.validation.constraints.NotBlank;
+//import javax.validation.constraints.NotNull;
+//import java.io.Serializable;
+//
+//@Data
+//public class WxTrackCommentRequest implements Serializable {
+//
+//    private static final long serialVersionUID = -8093426577843493946L;
+//
+//    @NotBlank(message = "微信id不能为空")
+//    @ApiModelProperty(value = "微信id", required = true)
+//    private String wxId;
+//
+//    @NotNull(message = "藏品id不能为空")
+//    @ApiModelProperty(value = "藏品id", required = true)
+//    private Long goodsId;
+//
+//    @NotNull(message = "类型不能为空")
+//    @ApiModelProperty(value = "类型, 1:足迹,2:评论", required = true)
+//    private Integer type;
+//
+//    @ApiModelProperty(value = "评论")
+//    private String comment;
+//
+//
+//
+//
+//}

+ 60 - 0
gis_domain/src/main/java/com/gis/domain/response/GoodsResponse.java

@@ -0,0 +1,60 @@
+package com.gis.domain.response;
+
+import com.gis.domain.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+public class GoodsResponse extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446577843493946L;
+
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    @ApiModelProperty(value = "朝代id")
+    private Long dynastyId;
+
+    @ApiModelProperty(value = "朝代名称")
+    private String dynastyName;
+
+
+    @ApiModelProperty(value = "文物类别Id")
+    private Long categoryId;
+
+    @ApiModelProperty(value = "文物类别")
+    private String categoryName;
+
+
+    @ApiModelProperty(value = "文物介绍")
+    private String description;
+
+    @ApiModelProperty(value = "文件级别,0:未定级,1:一级, 2:二级, 3:三级")
+    private Integer level;
+
+    @ApiModelProperty(value = "浏览量")
+    private Integer countTrack;
+
+    @ApiModelProperty(value = "评论量")
+    private Integer countComment;
+
+    @ApiModelProperty(value = "点赞量")
+    private Integer countStar;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "模型url")
+    private String webSite;
+
+    @ApiModelProperty(value = "微信登录用户是否点赞, 默认false")
+    private Boolean isStart = false;
+
+
+}

+ 24 - 0
gis_domain/src/main/java/com/gis/domain/response/LogResponse.java

@@ -0,0 +1,24 @@
+package com.gis.domain.response;
+
+import com.gis.domain.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/12.
+ */
+@Data
+public class LogResponse extends BaseEntity {
+
+
+    @ApiModelProperty(value = "操作者账号")
+    private String userName;
+
+    @ApiModelProperty(value = "操作类型")
+    private String type;
+
+    @ApiModelProperty(value = "操作记录")
+    private String description;
+
+
+}

+ 41 - 0
gis_domain/src/main/java/com/gis/domain/response/WxCollectStarResponse.java

@@ -0,0 +1,41 @@
+package com.gis.domain.response;
+
+import com.gis.domain.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 微信用户藏品表,记录点赞、评论、收藏、流量量表
+ */
+@Data
+public class WxCollectStarResponse extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+//    @ApiModelProperty(value = "微信id")
+//    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private String goodsId;
+
+    @ApiModelProperty(value = "藏品名称")
+    private String goodsName;
+
+    @ApiModelProperty(value = "文物介绍")
+    private String description;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "模型url")
+    private String webSite;
+
+
+
+
+
+
+}

+ 66 - 0
gis_domain/src/main/java/com/gis/domain/response/WxTrackCommentResponse.java

@@ -0,0 +1,66 @@
+package com.gis.domain.response;
+
+import com.gis.domain.entity.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+
+@Data
+public class WxTrackCommentResponse extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+//    @ApiModelProperty(value = "微信id")
+//    private String wxId;
+
+    @ApiModelProperty(value = "藏品id")
+    private String goodsId;
+
+    @ApiModelProperty(value = "类型, 1:足迹,2:评论")
+    private Integer type;
+
+    @ApiModelProperty(value = "评论")
+    private String comment;
+
+    @ApiModelProperty(value = "点赞数量")
+    private Integer star;
+
+
+    @ApiModelProperty(value = "藏品名称")
+    private String goodsName;
+
+    @ApiModelProperty(value = "朝代Id")
+    private Long dynastyId;
+
+    @ApiModelProperty(value = "朝代名称")
+    private String dynastyName;
+
+
+    @ApiModelProperty(value = "文物介绍")
+    private String description;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "模型url")
+    private String webSite;
+
+    @ApiModelProperty(value = "wx用户昵称")
+    private String nickName ;
+
+    @ApiModelProperty(value = "wx头像")
+    private String avatarUrl ;
+
+    @ApiModelProperty(value = "wx用户点赞")
+    private Boolean isStar = false ;
+
+
+
+
+
+
+}

+ 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_gis</artifactId>
+        <groupId>com.gis</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>gis_mapper</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.gis</groupId>
+            <artifactId>gis_domain</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 33 - 0
gis_mapper/src/main/java/com/gis/mapper/CommonMapper.java

@@ -0,0 +1,33 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.BaseEntity;
+import com.gis.domain.entity.FileEntity;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+
+@Component
+@Mapper
+public interface CommonMapper extends IBaseMapper<BaseEntity, Long> {
+
+    // 不写实体类,用Map接收
+    @Select("SELECT id, name FROM tb_dynasty WHERE rec_status = 'A' order by sort asc ")
+    List<Map> getDynasty();
+
+    @Select("SELECT id, name FROM tb_category WHERE rec_status = 'A' order by sort asc ")
+    List<Map> getCategory();
+
+    @Insert("insert into tb_wx_comment_star (wx_id, comment_id) values (#{wxId}, #{commentId})")
+    void addCommentStar(String wxId, Long commentId);
+
+    @Select("select * from tb_wx_comment_star where wx_id = #{wxId} and comment_id = #{commentId}")
+    Map findCommentStarByWxIdAndCommentId(String wxId, Long commentId);
+
+
+}

+ 16 - 0
gis_mapper/src/main/java/com/gis/mapper/FileMapper.java

@@ -0,0 +1,16 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.FileEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Component
+@Mapper
+public interface FileMapper extends IBaseMapper<FileEntity, Long> {
+
+
+}

+ 30 - 0
gis_mapper/src/main/java/com/gis/mapper/GoodsMapper.java

@@ -0,0 +1,30 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.GoodsEntity;
+import com.gis.domain.request.GoodsPageRequest;
+import com.gis.domain.response.GoodsResponse;
+import com.gis.mapper.provider.GoodsProvider;
+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;
+import java.util.Map;
+
+@Component
+@Mapper
+public interface GoodsMapper extends IBaseMapper<GoodsEntity, Long> {
+
+    @SelectProvider(type = GoodsProvider.class, method = "findBySearchKey")
+    List<GoodsResponse> search(GoodsPageRequest param);
+
+
+    @Select("select a.id, a.name, a.dynasty_id, a.description, a.category_id, a.level, a.img, a.thumb, a.web_site," +
+            "b.name as dynasty_name, c.name as category_name, a.count_star, a.count_track, a.count_comment " +
+            "from tb_goods a left join tb_dynasty b on b.id = a.dynasty_id left join tb_category c on c.id = a.category_id " +
+            "where a.rec_status = 'A' AND a.id = #{id}  ")
+    GoodsResponse rFindById(Long id);
+
+}

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

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

@@ -0,0 +1,23 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.LogEntity;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.LogResponse;
+import com.gis.mapper.provider.LogProvider;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface LogMapper extends IBaseMapper<LogEntity, Long> {
+
+    /**
+     * 注意日期,需要传字符串类型
+     */
+    @SelectProvider(type = LogProvider.class, method = "findBySearchKey")
+    List<LogResponse> search(PageRequest param);
+}

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

@@ -0,0 +1,15 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysDeptEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+@Component
+@Mapper
+public interface SysDeptMapper extends IBaseMapper<SysDeptEntity, Long> {
+
+    @Select(value = "select * from sys_dept where rec_status = 'A' AND dept_no = #{deptNo}")
+    SysDeptEntity findByDeptNo(String deptNo);
+}

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

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

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

@@ -0,0 +1,21 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysRoleEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Component;
+
+@Component
+@Mapper
+public interface SysRoleMapper extends IBaseMapper<SysRoleEntity, Long> {
+
+    @Select(value = "delete from sys_role_resource where role_id=#{roleId}")
+    void deleteRoleResource(Long roleId);
+
+    @Select(value = "insert into sys_role_resource (role_id, resource_id) values (#{roleId}, #{resourceId});")
+    void saveRoleResource(Long roleId, Long resourceId);
+
+    @Select(value = "select z.id, z.role_key, z.role_name from sys_user_role u left join sys_role z on z.id = u.role_id where z.rec_status = 'A' and u.user_id = #{userId}")
+    SysRoleEntity findUserRoleByUserId(Long userId);
+}

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

@@ -0,0 +1,30 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.domain.request.UserPageRequest;
+import com.gis.mapper.provider.UserProvider;
+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<SysUserEntity> findBySearchKey(UserPageRequest param);
+}

+ 24 - 0
gis_mapper/src/main/java/com/gis/mapper/WxCollectMapper.java

@@ -0,0 +1,24 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.WxCollectEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+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 WxCollectMapper extends IBaseMapper<WxCollectEntity, Long> {
+
+    @Select(value = "select a.id, a.wx_id, a.create_time, a.update_time, " +
+            "b.id as goods_id, b.name as goods_name, b.thumb as thumb, b.description as description, b.web_site as web_site " +
+            "from tb_wx_collect a left join tb_goods b on b.id = a.goods_id " +
+            "where a.rec_status = 'A' and a.wx_id = #{wxId} ORDER BY a.create_time desc ")
+    List<WxCollectStarResponse> findPageAll(String wxId);
+
+    @Select(value = "select * from tb_wx_collect where rec_status = 'A' and wx_id = #{wxOpenId} and goods_id = #{goodsId} ORDER BY create_time desc")
+    WxCollectEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId);
+}

+ 36 - 0
gis_mapper/src/main/java/com/gis/mapper/WxCommentMapper.java

@@ -0,0 +1,36 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.WxCommentEntity;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.WxTrackCommentResponse;
+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 WxCommentMapper extends IBaseMapper<WxCommentEntity, Long> {
+
+    @Select(value = "select a.id, a.wx_id, a.star, a.create_time, a.update_time, a.nick_name, a.avatar_url, " +
+            "a.goods_id, a.comment, a.is_star,"+
+            "b.thumb as thumb, b.web_site as web_site, b.name as goods_name, " +
+            "b.description as description " +
+            "from tb_wx_comment a left join tb_goods b on b.id = a.goods_id " +
+            "where a.rec_status = 'A' ORDER BY a.create_time desc")
+    List<WxTrackCommentResponse> findPageAll(PageRequest param);
+
+
+    @Select(value = "select a.id, a.wx_id, a.star, a.create_time, a.update_time, a.nick_name, a.avatar_url, " +
+            "a.goods_id, a.comment, a.is_star,"+
+            "b.thumb as thumb, b.web_site as web_site, b.name as goods_name, " +
+            "b.description as description " +
+            "from tb_wx_comment a left join tb_goods b on b.id = a.goods_id " +
+            "where a.rec_status = 'A' and a.wx_id = #{wxId} ORDER BY a.create_time desc")
+    List<WxTrackCommentResponse> findPageAllByWxId(String wxId);
+
+    @Select(value = "select * from tb_wx_comment where rec_status = 'A' and goods_id = #{goodsId} ORDER BY create_time desc  ")
+    List<WxCommentEntity> findByGoodsId(String goodsId);
+}

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

@@ -0,0 +1,25 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.WxStarEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+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 WxStarMapper extends IBaseMapper<WxStarEntity, Long> {
+
+    @Select(value = "select a.id, a.wx_id, a.create_time, a.update_time, " +
+            "b.id as goods_id, b.name as goods_name, b.thumb as thumb, b.description as description, b.web_site as web_site " +
+            "from tb_wx_star a left join tb_goods b on b.id = a.goods_id " +
+            "where a.rec_status = 'A' and a.wx_id = #{wxId} ORDER BY a.create_time desc")
+    List<WxCollectStarResponse> findPageAll(String wxId);
+
+
+    @Select(value = "select * from tb_wx_star where rec_status = 'A' and wx_id = #{wxOpenId} and goods_id = #{goodsId} ORDER BY create_time desc")
+    WxStarEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId);
+}

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

@@ -0,0 +1,25 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.entity.WxTrackEntity;
+import com.gis.domain.response.WxTrackCommentResponse;
+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 WxTrackMapper extends IBaseMapper<WxTrackEntity, Long> {
+
+    @Select(value = "select a.id, a.wx_id, a.create_time, a.update_time,  "+
+            "b.thumb as thumb, b.web_site as web_site, b.name as goods_name, b.dynasty_id as dynasty_id, b.id as goods_id, " +
+            "b.description as description, c.name as dynasty_name " +
+            "from tb_wx_track a left join tb_goods b on b.id = a.goods_id left join tb_dynasty c on c.id = b.dynasty_id " +
+            "where a.rec_status = 'A' and a.wx_id = #{wxId} ORDER BY a.create_time desc")
+    List<WxTrackCommentResponse> findPageAll(String wxId);
+
+    @Select(value = "select * from tb_wx_track where rec_status = 'A' and wx_id = #{wxOpenId} and goods_id = #{goodsId} ORDER BY create_time desc")
+    WxTrackEntity findGoodIdAndWxId(String wxOpenId, Long goodsId);
+}

+ 63 - 0
gis_mapper/src/main/java/com/gis/mapper/provider/GoodsProvider.java

@@ -0,0 +1,63 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.request.GoodsPageRequest;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Created by owen on 2020/6/13 0013 10:56
+ */
+@Log4j2
+public class GoodsProvider {
+
+
+    public String findBySearchKey(GoodsPageRequest param){
+        StringBuffer sql = new StringBuffer(
+                "select a.id, a.name, a.dynasty_id, a.description, a.category_id, a.level, a.create_time, a.update_time, " +
+                        "a.img, a.thumb, a.web_site, a.count_star, a.count_track, a.count_comment, b.name as dynasty_name, c.name as category_name " +
+                        "from tb_goods a left join tb_dynasty b on b.id = a.dynasty_id left join tb_category c on c.id = a.category_id where a.rec_status = 'A' ");
+
+        String searchKey = param.getSearchKey();
+        if(!StringUtils.isAllBlank(searchKey)){
+            sql.append(" and ( a.name like '%").append(searchKey).append("%' )");
+
+        }
+
+        Long dynastyId = param.getDynastyId();
+        if (dynastyId != null) {
+            sql.append(" and b.id = ").append(dynastyId);
+        }
+
+        Integer level = param.getLevel();
+        if (level != null) {
+            sql.append(" and a.level = ").append(level);
+        }
+
+        Integer categoryId = param.getCategoryId();
+        if (categoryId != null) {
+            sql.append(" and c.id = ").append(categoryId);
+        }
+
+        String orderBy = param.getOrderBy();
+        if (StringUtils.isNotBlank(orderBy)) {
+            if ("star".equals(orderBy)) {
+                sql.append(" order by a.count_star desc");
+            }
+
+            if ("track".equals(orderBy)) {
+                sql.append(" order by a.count_track desc");
+            }
+
+            if ("comment".equals(orderBy)) {
+                sql.append(" order by a.count_comment desc");
+            }
+        } else {
+
+            sql.append(" order by a.create_time desc");
+        }
+
+
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+}

+ 39 - 0
gis_mapper/src/main/java/com/gis/mapper/provider/LogProvider.java

@@ -0,0 +1,39 @@
+package com.gis.mapper.provider;
+
+import com.gis.domain.request.PageRequest;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+
+
+/**
+ * Created by owen on 2020/5/13.
+ */
+@Log4j2
+public class LogProvider {
+
+    public String findBySearchKey(PageRequest param){
+        StringBuffer sql = new StringBuffer(
+                "select z.type, z.description, z.create_time, u.user_name from tb_log z left join sys_user u on z.user_id = u.id where z.rec_status = 'A' ");
+
+
+//        if(StringUtils.isNotBlank(param.getStartTime()) && StringUtils.isNotBlank(param.getEndTime())){
+//
+//            sql.append(" and z.create_time >= ").append("'").append(param.getStartTime()).append("'");
+//            sql.append(" and z.create_time <= ").append("'").append(param.getEndTime()).append("'");
+//        }
+
+        String searchKey = param.getSearchKey();
+        if(!StringUtils.isAllBlank(searchKey)){
+            sql.append(" and (( u.user_name like '%").append(searchKey).append("%' )");
+            sql.append(" or ( z.description like '%").append(searchKey).append("%' )");
+            sql.append(" or ( z.type like '%").append(searchKey).append("%' ))");
+        }
+
+        sql.append(" order by z.create_time desc");
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+
+
+
+}

+ 34 - 0
gis_mapper/src/main/java/com/gis/mapper/provider/UserProvider.java

@@ -0,0 +1,34 @@
+package com.gis.mapper.provider;
+
+import cn.hutool.core.util.StrUtil;
+import com.gis.domain.request.UserPageRequest;
+import lombok.extern.log4j.Log4j2;
+
+/**
+ * Created by owen on 2020/5/9 0009 15:23
+ */
+
+@Log4j2
+public class UserProvider {
+
+    public String findBySearchKey(UserPageRequest param){
+        StringBuffer sql = new StringBuffer(
+                "SELECT * FROM sys_user where rec_status = 'A' ");
+        String searchKey = param.getSearchKey();
+        if(StrUtil.isNotBlank(searchKey)){
+            sql.append(" and (");
+            sql.append(" user_name like '%").append(searchKey).append("%'");
+            sql.append(" or phone like '%").append(searchKey).append("%'");
+            sql.append( ")");
+        }
+
+        Integer status = param.getStatus();
+        if (status != null) {
+            sql.append("and status = ").append(status);
+        }
+
+        sql.append(" ORDER BY create_time DESC");
+        log.info("sql: {}", sql.toString());
+        return sql.toString();
+    }
+}

+ 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_gis</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>

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

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

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

@@ -0,0 +1,23 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.GoodsEntity;
+import com.gis.domain.request.GoodsPageRequest;
+import com.gis.domain.response.GoodsResponse;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface GoodsService extends IBaseService<GoodsEntity, Long> {
+
+    List<GoodsResponse> search(GoodsPageRequest param);
+
+    GoodsResponse rFindById(Long id);
+
+
+
+}

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

+ 18 - 0
gis_service/src/main/java/com/gis/service/LogService.java

@@ -0,0 +1,18 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.LogEntity;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.LogResponse;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/5/12 0011 16:14
+ */
+public interface LogService extends IBaseService<LogEntity, Long> {
+
+
+    List<LogResponse> search(PageRequest param);
+}

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

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

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

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

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

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

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

@@ -0,0 +1,22 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.SysUserEntity;
+import com.gis.domain.request.UserPageRequest;
+
+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<SysUserEntity> findBySearchKey(UserPageRequest param);
+}

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

@@ -0,0 +1,19 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.WxCollectEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface WxCollectService extends IBaseService<WxCollectEntity, Long> {
+
+
+    List<WxCollectStarResponse> findPageAll(String openId);
+
+    WxCollectEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId);
+}

+ 22 - 0
gis_service/src/main/java/com/gis/service/WxCommentService.java

@@ -0,0 +1,22 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.WxCommentEntity;
+import com.gis.domain.request.CommentPageRequest;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.WxTrackCommentResponse;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface WxCommentService extends IBaseService<WxCommentEntity, Long> {
+
+
+    List<WxTrackCommentResponse> findPageAll(PageRequest param);
+    List<WxTrackCommentResponse> findPageAllByWxId(String openId);
+
+    List<WxCommentEntity> findByGoodsId(CommentPageRequest param);
+}

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

@@ -0,0 +1,19 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.WxStarEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface WxStarService extends IBaseService<WxStarEntity, Long> {
+
+
+    List<WxCollectStarResponse> findPageAll(String openId);
+
+    WxStarEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId);
+}

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

@@ -0,0 +1,19 @@
+package com.gis.service;
+
+
+import com.gis.domain.entity.WxTrackEntity;
+import com.gis.domain.response.WxTrackCommentResponse;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:14
+ */
+public interface WxTrackService extends IBaseService<WxTrackEntity, Long> {
+
+
+    List<WxTrackCommentResponse> findPageAll(String openId);
+
+    WxTrackEntity findGoodIdAndWxId(String wxOpenId, Long goodsId);
+}

+ 28 - 0
gis_service/src/main/java/com/gis/service/impl/FileServiceImpl.java

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

+ 42 - 0
gis_service/src/main/java/com/gis/service/impl/GoodsServiceImpl.java

@@ -0,0 +1,42 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.GoodsEntity;
+import com.gis.domain.request.GoodsPageRequest;
+import com.gis.domain.response.GoodsResponse;
+import com.gis.mapper.GoodsMapper;
+import com.gis.mapper.IBaseMapper;
+import com.gis.service.GoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class GoodsServiceImpl extends IBaseServiceImpl<GoodsEntity, Long> implements GoodsService {
+
+    @Autowired
+    private GoodsMapper entityMapper;
+
+    @Override
+    public IBaseMapper<GoodsEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public List<GoodsResponse> search(GoodsPageRequest param) {
+        return entityMapper.search(param);
+    }
+
+    @Override
+    public GoodsResponse rFindById(Long id) {
+        return entityMapper.rFindById(id);
+    }
+
+
+}

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

@@ -0,0 +1,167 @@
+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));
+    }
+}

+ 34 - 0
gis_service/src/main/java/com/gis/service/impl/LogServiceImpl.java

@@ -0,0 +1,34 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.LogEntity;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.LogResponse;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.LogMapper;
+import com.gis.service.LogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/5/12 0011 16:16
+ */
+@Service
+public class LogServiceImpl extends IBaseServiceImpl<LogEntity, Long> implements LogService {
+
+    @Autowired
+    private LogMapper entityMapper;
+
+    @Override
+    public IBaseMapper<LogEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public List<LogResponse> search(PageRequest param) {
+        return entityMapper.search(param);
+    }
+}

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

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

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

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

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

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

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

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

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

@@ -0,0 +1,38 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.WxCollectEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.WxCollectMapper;
+import com.gis.service.WxCollectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class WxCollectServiceImpl extends IBaseServiceImpl<WxCollectEntity, Long> implements WxCollectService {
+
+    @Autowired
+    private WxCollectMapper entityMapper;
+
+    @Override
+    public IBaseMapper<WxCollectEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Override
+    public List<WxCollectStarResponse> findPageAll(String openId) {
+        return entityMapper.findPageAll(openId);
+    }
+
+    @Override
+    public WxCollectEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId) {
+        return entityMapper.findByWxIdAndGoodsId(wxOpenId, goodsId);
+    }
+
+}

+ 45 - 0
gis_service/src/main/java/com/gis/service/impl/WxCommentServiceImpl.java

@@ -0,0 +1,45 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.WxCommentEntity;
+import com.gis.domain.request.CommentPageRequest;
+import com.gis.domain.request.PageRequest;
+import com.gis.domain.response.WxTrackCommentResponse;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.WxCommentMapper;
+import com.gis.service.WxCommentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class WxCommentServiceImpl extends IBaseServiceImpl<WxCommentEntity, Long> implements WxCommentService {
+
+    @Autowired
+    private WxCommentMapper entityMapper;
+
+    @Override
+    public IBaseMapper<WxCommentEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public List<WxTrackCommentResponse> findPageAll(PageRequest param) {
+        return entityMapper.findPageAll(param);
+    }
+
+    @Override
+    public List<WxTrackCommentResponse> findPageAllByWxId(String openId) {
+        return entityMapper.findPageAllByWxId(openId);
+    }
+
+    @Override
+    public List<WxCommentEntity> findByGoodsId(CommentPageRequest param) {
+        return entityMapper.findByGoodsId(param.getGoodsId());
+    }
+}

+ 39 - 0
gis_service/src/main/java/com/gis/service/impl/WxStarServiceImpl.java

@@ -0,0 +1,39 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.WxStarEntity;
+import com.gis.domain.response.WxCollectStarResponse;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.WxStarMapper;
+import com.gis.service.WxStarService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class WxStarServiceImpl extends IBaseServiceImpl<WxStarEntity, Long> implements WxStarService {
+
+    @Autowired
+    private WxStarMapper entityMapper;
+
+    @Override
+    public IBaseMapper<WxStarEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+    @Override
+    public List<WxCollectStarResponse> findPageAll(String openId) {
+        return entityMapper.findPageAll(openId);
+    }
+
+    @Override
+    public WxStarEntity findByWxIdAndGoodsId(String wxOpenId, Long goodsId) {
+        return entityMapper.findByWxIdAndGoodsId(wxOpenId, goodsId);
+    }
+
+
+}

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

@@ -0,0 +1,38 @@
+package com.gis.service.impl;
+
+import com.gis.domain.entity.WxTrackEntity;
+import com.gis.domain.response.WxTrackCommentResponse;
+import com.gis.mapper.IBaseMapper;
+import com.gis.mapper.WxTrackMapper;
+import com.gis.service.WxTrackService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+/**
+ * Created by owen on 2020/3/11 0011 16:16
+ */
+@Service
+public class WxTrackServiceImpl extends IBaseServiceImpl<WxTrackEntity, Long> implements WxTrackService {
+
+    @Autowired
+    private WxTrackMapper entityMapper;
+
+    @Override
+    public IBaseMapper<WxTrackEntity, Long> getBaseMapper() {
+        return this.entityMapper;
+    }
+
+
+    @Override
+    public List<WxTrackCommentResponse> findPageAll(String openId) {
+        return entityMapper.findPageAll(openId);
+    }
+
+    @Override
+    public WxTrackEntity findGoodIdAndWxId(String wxOpenId, Long goodsId) {
+        return entityMapper.findGoodIdAndWxId(wxOpenId, goodsId);
+    }
+}

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


Vissa filer visades inte eftersom för många filer har ändrats