瀏覽代碼

澳门军史馆,首次提交

wuweihao 4 年之前
當前提交
8904934fc2
共有 100 個文件被更改,包括 28486 次插入0 次删除
  1. 86 0
      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. 67 0
      gis_application/src/main/resources/application-dev.properties
  6. 74 0
      gis_application/src/main/resources/application-sit.properties
  7. 38 0
      gis_application/src/main/resources/application.properties
  8. 17 0
      gis_application/src/main/resources/data/images.json
  9. 473 0
      gis_application/src/main/resources/data/scene.js
  10. 89 0
      gis_application/src/main/resources/data/someData.json
  11. 1270 0
      gis_application/src/main/resources/db/army_cms.sql
  12. 156 0
      gis_application/src/main/resources/logback-spring.xml
  13. 194 0
      gis_common/pom.xml
  14. 56 0
      gis_common/src/main/java/com/gis/common/config/CommonInterceptor.java
  15. 88 0
      gis_common/src/main/java/com/gis/common/config/Swagger2.java
  16. 85 0
      gis_common/src/main/java/com/gis/common/config/WebMvcConfig.java
  17. 28 0
      gis_common/src/main/java/com/gis/common/constant/TypeCode.java
  18. 35 0
      gis_common/src/main/java/com/gis/common/exception/BaseRuntimeException.java
  19. 34 0
      gis_common/src/main/java/com/gis/common/exception/JwtAuthenticationException.java
  20. 7340 0
      gis_common/src/main/java/com/gis/common/proto/BigSceneProto.java
  21. 4654 0
      gis_common/src/main/java/com/gis/common/proto/Common.java
  22. 4345 0
      gis_common/src/main/java/com/gis/common/proto/Visionmodeldata.java
  23. 37 0
      gis_common/src/main/java/com/gis/common/proto/constant/ConstantCmd.java
  24. 41 0
      gis_common/src/main/java/com/gis/common/proto/constant/ConstantFileName.java
  25. 61 0
      gis_common/src/main/java/com/gis/common/proto/constant/ConstantFilePath.java
  26. 156 0
      gis_common/src/main/java/com/gis/common/proto/format/CouchDBFormat.java
  27. 703 0
      gis_common/src/main/java/com/gis/common/proto/format/HtmlFormat.java
  28. 1338 0
      gis_common/src/main/java/com/gis/common/proto/format/JavaPropsFormat.java
  29. 1603 0
      gis_common/src/main/java/com/gis/common/proto/format/JsonFormat.java
  30. 602 0
      gis_common/src/main/java/com/gis/common/proto/format/SmileFormat.java
  31. 1333 0
      gis_common/src/main/java/com/gis/common/proto/format/XmlFormat.java
  32. 219 0
      gis_common/src/main/java/com/gis/common/proto/util/ConvertUtils.java
  33. 234 0
      gis_common/src/main/java/com/gis/common/proto/util/CreateObjUtil.java
  34. 61 0
      gis_common/src/main/java/com/gis/common/proto/util/StreamGobbler.java
  35. 235 0
      gis_common/src/main/java/com/gis/common/util/AliyunOssUtil.java
  36. 210 0
      gis_common/src/main/java/com/gis/common/util/FileUtils.java
  37. 194 0
      gis_common/src/main/java/com/gis/common/util/PasswordUtils.java
  38. 20 0
      gis_common/src/main/java/com/gis/common/util/RandomUtils.java
  39. 20 0
      gis_common/src/main/java/com/gis/common/util/RegexUtil.java
  40. 101 0
      gis_common/src/main/java/com/gis/common/util/Result.java
  41. 22 0
      gis_domain/pom.xml
  42. 27 0
      gis_domain/src/main/java/com/gis/domain/dto/AuditDto.java
  43. 32 0
      gis_domain/src/main/java/com/gis/domain/dto/CommentRequest.java
  44. 49 0
      gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java
  45. 22 0
      gis_domain/src/main/java/com/gis/domain/dto/FodderPageDto.java
  46. 28 0
      gis_domain/src/main/java/com/gis/domain/dto/KnowledgeDto.java
  47. 28 0
      gis_domain/src/main/java/com/gis/domain/dto/LoginRequest.java
  48. 31 0
      gis_domain/src/main/java/com/gis/domain/dto/MenuRequest.java
  49. 22 0
      gis_domain/src/main/java/com/gis/domain/dto/NewsPageDateRequest.java
  50. 50 0
      gis_domain/src/main/java/com/gis/domain/dto/NewsRequest.java
  51. 27 0
      gis_domain/src/main/java/com/gis/domain/dto/PageDateDto.java
  52. 26 0
      gis_domain/src/main/java/com/gis/domain/dto/PageDto.java
  53. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/PasswordRequest.java
  54. 58 0
      gis_domain/src/main/java/com/gis/domain/dto/RegisterDto.java
  55. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/ResetPasswordDto.java
  56. 24 0
      gis_domain/src/main/java/com/gis/domain/dto/RoamViableDto.java
  57. 26 0
      gis_domain/src/main/java/com/gis/domain/dto/RoleAccreditRequest.java
  58. 30 0
      gis_domain/src/main/java/com/gis/domain/dto/RoleRequest.java
  59. 39 0
      gis_domain/src/main/java/com/gis/domain/dto/SceneDataDto.java
  60. 25 0
      gis_domain/src/main/java/com/gis/domain/dto/ScenePageDto.java
  61. 36 0
      gis_domain/src/main/java/com/gis/domain/dto/SlideshowDto.java
  62. 21 0
      gis_domain/src/main/java/com/gis/domain/dto/SlideshowPageDateDto.java
  63. 23 0
      gis_domain/src/main/java/com/gis/domain/dto/SpiritPageDateDto.java
  64. 47 0
      gis_domain/src/main/java/com/gis/domain/dto/SpiritRequest.java
  65. 62 0
      gis_domain/src/main/java/com/gis/domain/dto/UserDto.java
  66. 23 0
      gis_domain/src/main/java/com/gis/domain/dto/UserPageDateDto.java
  67. 46 0
      gis_domain/src/main/java/com/gis/domain/dto/VideoDto.java
  68. 38 0
      gis_domain/src/main/java/com/gis/domain/po/BaseEntity.java
  69. 45 0
      gis_domain/src/main/java/com/gis/domain/po/CommentEntity.java
  70. 50 0
      gis_domain/src/main/java/com/gis/domain/po/FileEntity.java
  71. 46 0
      gis_domain/src/main/java/com/gis/domain/po/FodderEntity.java
  72. 35 0
      gis_domain/src/main/java/com/gis/domain/po/KnowledgeEntity.java
  73. 37 0
      gis_domain/src/main/java/com/gis/domain/po/LogEntity.java
  74. 36 0
      gis_domain/src/main/java/com/gis/domain/po/MenuEntity.java
  75. 66 0
      gis_domain/src/main/java/com/gis/domain/po/NewsEntity.java
  76. 56 0
      gis_domain/src/main/java/com/gis/domain/po/SceneEntity.java
  77. 56 0
      gis_domain/src/main/java/com/gis/domain/po/SlideshowEntity.java
  78. 64 0
      gis_domain/src/main/java/com/gis/domain/po/SpiritEntity.java
  79. 62 0
      gis_domain/src/main/java/com/gis/domain/po/SysUserEntity.java
  80. 44 0
      gis_domain/src/main/java/com/gis/domain/po/VideoEntity.java
  81. 22 0
      gis_domain/src/main/java/com/gis/domain/po/ViewEntity.java
  82. 45 0
      gis_domain/src/main/java/com/gis/domain/vo/CommentVo.java
  83. 28 0
      gis_domain/src/main/java/com/gis/domain/vo/KnowledgeVo.java
  84. 24 0
      gis_domain/src/main/java/com/gis/domain/vo/LogVo.java
  85. 55 0
      gis_domain/src/main/java/com/gis/domain/vo/NewsVo.java
  86. 44 0
      gis_domain/src/main/java/com/gis/domain/vo/SlideshowVo.java
  87. 53 0
      gis_domain/src/main/java/com/gis/domain/vo/SpiritVo.java
  88. 40 0
      gis_domain/src/main/java/com/gis/domain/vo/VideoVo.java
  89. 22 0
      gis_mapper/pom.xml
  90. 22 0
      gis_mapper/src/main/java/com/gis/mapper/CommentMapper.java
  91. 31 0
      gis_mapper/src/main/java/com/gis/mapper/CommonMapper.java
  92. 49 0
      gis_mapper/src/main/java/com/gis/mapper/FileMapper.java
  93. 21 0
      gis_mapper/src/main/java/com/gis/mapper/FodderMapper.java
  94. 18 0
      gis_mapper/src/main/java/com/gis/mapper/IBaseMapper.java
  95. 32 0
      gis_mapper/src/main/java/com/gis/mapper/KnowledgeMapper.java
  96. 23 0
      gis_mapper/src/main/java/com/gis/mapper/LogMapper.java
  97. 12 0
      gis_mapper/src/main/java/com/gis/mapper/MenuMapper.java
  98. 41 0
      gis_mapper/src/main/java/com/gis/mapper/NewsMapper.java
  99. 35 0
      gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java
  100. 0 0
      gis_mapper/src/main/java/com/gis/mapper/SlideshowMapper.java

+ 86 - 0
README.md

@@ -0,0 +1,86 @@
+# 郑州部队
+
+##sit
+    堡垒机-消安本地
+    tomcat:
+        /本地消安/root/user/java/tomcat-8101-army/webapps/
+        
+    访问url:
+        http://192.168.0.163:8101/    
+        
+        <Context path="" docBase="/root/user/java/tomcat_army_cms_8101/webapps/armycms" debug="0" reloadable="true" crossContext="true"/>
+        <Context path="/data" docBase="/root/user/army_cms_data/" reloadable="true" crossContext="true" />
+        
+        
+     编辑场景url:
+     http://192.168.0.44:8101/edit-backstage/edit.html?m=ar_jvWeBmEgQ
+     
+     
+     场景展现url:
+     http://192.168.0.44:8101/SuperTwo/index.html?m=ar_jvWeBmEgQ
+        
+        
+ #data文件夹
+ 
+        --ar_WTJ1ooJDD 场景码
+            - xxx_50k_texture_jpg(文通)
+            - vision.txt(文通)
+            
+            - vision.modeldata(java通过是vision.txt转的)
+            - data2.js(java生成的空json)
+            - someData.json(java生成)
+            - xxx_50k.dam(java生成)
+            
+            
+            
+ # 数据处理逻辑:
+    	1. 文通部门上传文件到指定目录
+    	2. 调用算法切图(slice_skybox)         (算法处理)
+    	3. 调用算法将obj_to_txt                  (算法处理)
+    	4. 转换前端需要的文件
+    		4.1 对算法生成的result文件夹的upload.json进程校验,处理相应逻辑
+    			4.1.1 图片归类到相应文件夹      (java处理)
+    			4.1.2 将modeldata.txt转xxx.dam    (java处理)
+    		4.2 vision.txt转vision.modeldata   (java处理) 【模型和相机点位的数据(vision.modeldata,******.dam)】
+    		4.3 生成data2.js                     (java处理)
+    		4.4 创建someData.json                 (java处理)          
+
+
+
+# 需求确认:
+
+1. 系统管理员,是可以看所有数据,还是只可以看系统管理的数据?
+2. 系统管理员是直接添加用户是就给,还是数据库后台手动给
+3. 系统管理员账户可以删除吗?
+4. 是有一个系统管理员,还是多个?
+
+5. 精品典藏的数据管理
+
+    列表:
+        缩略图应该是同一个
+    
+     
+2020-7-16
+    展示页:
+    
+    
+redis 模糊查询key
+后来测试发现模糊查询是可以用的, 找了下资料, 改成
+
+Set<String> keys = redisTemplate.keys("noteUserListenedPoi:" + "*");
+redisTemplate.delete(keys);
+
+# 2021-01-07
+  原型图: https://lanhuapp.com/url/fZndv
+  
+  sit:
+  服务器:192.168.0.44
+  tomcat: tomcat_cms_army_macao_8110
+  doc: http://192.168.0.44:8110/doc.html
+  web: http://192.168.0.44:8110/backstage
+  
+  <Context path="" docBase="/root/user/java/tomcat_cms_army_macao_8110/webapps/cms_army_macao" debug="0" reloadable="true" crossContext="true"/> 
+  <Context path="/data" docBase="/root/user/" reloadable="true" crossContext="true" />
+
+    
+                  

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

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

@@ -0,0 +1,67 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=root
+#spring.datasource.druid.url=jdbc:mysql://192.168.0.44:3306/army_cms?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#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=E:/javaProject/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+# \u672C\u5730\u4FDD\u5B58\u8DEF\u5F84
+file.path=F:\\test\\ngin\\${project.name}_data\\
+# 使用本地存在,不用oss时使用; 需要开启nginx
+file.address=/data/${project.name}_data/
+
+#server.domain =http://192.168.0.135/
+server.domain =http://192.168.1.100/
+
+
+
+

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

@@ -0,0 +1,74 @@
+
+#DB
+spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
+spring.datasource.druid.url=jdbc:mysql://localhost:3306/${project.name}?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+spring.datasource.druid.username=root
+spring.datasource.druid.password=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/${project.name}_log
+logging.config=classpath:logback-spring.xml
+logging.level.com.gis=debug
+
+# \u672C\u5730\u4FDD\u5B58\u8DEF\u5F84
+file.path=/root/user/${project.name}_data/
+
+
+# 使用本地存在,不用oss时使用; 需要开启nginx
+file.address=/data/${project.name}_data/
+
+
+#server.domain =http://192.168.0.44:8101/
+server.domain =http://192.168.1.100:8080/
+
+
+# swagger login
+# 开启basic登录认证
+#knife4j.basic.enable=true
+#knife4j.basic.username=owen
+#knife4j.basic.password=owen
+
+
+

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

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

+ 17 - 0
gis_application/src/main/resources/data/images.json

@@ -0,0 +1,17 @@
+
+{
+"metadata": "{\"camera_mode\":0,\"camera_position\":{\"x\":17.319578170776367,\"y\":0.5689632296562195,\"z\":30.42438507080078},\"camera_quaternion\":{\"x\":-0.0000020361233819675194,\"y\":0.9999978870169733,\"z\":-0.0012442941874225735,\"w\":-0.0016363646960161576},\"ortho_zoom\":-1,\"ss_zoom\":1,\"scan_id\":\"b1498df53a554a0bafec6646639964e6\",\"is_ortho\":false,\"floorVisibility\":[1]}",
+"created": "2019-04-12T01:15:48.811428Z",
+"modified": "2019-04-12T01:15:48.811961Z",
+"sid": "update",
+"name": "04.12.2019_09.15.38",
+"height": 1707,
+"width": 3034,
+"is_hero": true,
+"category": "user",
+"vision_generated_label": "",
+"vision_generated_name": "",
+"vision_image_index": -1,
+"created_by": 4084,
+"rating": null
+}

+ 473 - 0
gis_application/src/main/resources/data/scene.js

@@ -0,0 +1,473 @@
+const Router = require('koa-router');
+const fs = require('fs');
+const path = require('path');
+const url = require('url');
+const request = require('request')
+const router = new Router();
+const sys = require('../config/sys')
+const sceneDir = path.join(__dirname, '../', sys.static_dir, sys.scene_dir)
+const uploadFile = require('../util/upload')
+const copyDir = require('../util/copydir')
+const upqiniu = require('../util/upqiniu')
+
+// 获取一个文件夹所有第一子文件夹
+function getFiles() {
+  return new Promise((resolve, reject) => {
+    fs.readdir(sceneDir, (err, files) => {
+      if (err) {
+        reject(err)
+      } else {
+        resolve(files)
+      }
+    })
+  })
+}
+
+// 删除文件夹所有文件
+function deleteFolder(dir) {
+  var files = [];
+  if (fs.existsSync(dir)) {
+    files = fs.readdirSync(dir);
+    files.forEach(function (file, index) {
+      var curPath = dir + "/" + file;
+      if (fs.statSync(curPath).isDirectory()) { // recurse
+        deleteFolder(curPath);
+      } else {
+        fs.unlinkSync(curPath);
+      }
+    });
+    fs.rmdirSync(dir);
+  }
+}
+
+// 清除一个json复合正则的字段
+function clearRgFileds(obj, rg) {
+  let type = Object.prototype.toString.call(obj)
+  if (type === '[object Object]') {
+    for (let key in obj) filter(obj[key], key)
+  } else if (type === '[object Array]') {
+    for (let i = 0; i < obj.length; i++) filter(obj[i], i)
+  }
+
+  function filter (filed, key) {
+    let filedType = Object.prototype.toString.call(obj[key])
+    if (filedType === '[object Object]' || filedType === '[object Array]') {
+      clearRgFileds(obj[key], rg)
+    } else if (filed && rg.test(filed.toString())) {
+      if (type === '[object Object]') {
+        delete obj[key]
+      } else {
+        obj.splice(key, 1)
+      }
+    }
+  }
+}
+
+
+async function savehots(hots = {}, name) {
+  let dataFile = 'data2.js'
+  let dataPath = path.join(sceneDir, name, dataFile)
+  let infoFile = 'hot/js/data.js'
+  let infoPath = path.join(sceneDir, name, infoFile)
+  let data = JSON.parse(fs.readFileSync(dataPath))
+  let hotJSON = {}
+  let infoJSON = {}
+
+  Object.keys(hots).forEach(hotKey => {
+    hotJSON[hotKey] = {
+      position: hots[hotKey].position,
+      rotation: hots[hotKey].rotation,
+      link: `//www.4dmodel.com/SuperTwo/hot_online/index.html?m=${hotKey}`
+    }
+
+    infoJSON[hotKey] = hots[hotKey].infoAttribute || ({
+      title: '',
+      content: '',
+      iframes: [],
+      modules: [],
+      images: [],
+      videos: []
+    })
+  })
+
+  data.hots = hotJSON
+
+  fs.writeFileSync(dataPath, JSON.stringify(data))
+  fs.writeFileSync(infoPath, JSON.stringify(infoJSON))
+
+  await upqiniu(name, dataFile)
+  await upqiniu(name, infoFile)
+}
+
+async function saveGuide(guides = [], name) {
+  let dataFile = 'data2.js'
+  let someFile = 'someData.json'
+  let dataPath = path.join(sceneDir, name, dataFile)
+  let somDataPath = path.join(sceneDir, name, someFile)
+  let data = JSON.parse(fs.readFileSync(dataPath));
+  let somData = JSON.parse(fs.readFileSync(somDataPath))
+  let audio = {}
+  let images = []
+
+  somData.model.images.forEach(i => i && (i.thumbnail_signed_src || images.push(i)))
+  guides.forEach(i => i.thumbnail_signed_src && images.push(i))
+  
+
+images.forEach(guide => {
+    try {
+      audio[JSON.parse(guide.metadata).scan_id] = {
+        time: 40000
+      }
+    } catch (e) {
+      
+    }
+  })
+
+  somData.model.images = images
+  data.audio = audio
+  fs.writeFileSync(somDataPath, JSON.stringify(somData))
+  fs.writeFileSync(dataPath, JSON.stringify(data))
+
+  await upqiniu(name, dataFile)
+  await upqiniu(name, someFile)
+}
+
+async function saveMusics(musics = {}, name) {
+  let dataFile = 'data2.js'
+  let dataPath = path.join(sceneDir, name, dataFile)
+  let data = JSON.parse(fs.readFileSync(dataPath));
+
+  data.tourAudio = musics
+
+  fs.writeFileSync(dataPath, JSON.stringify(data))
+  
+  await upqiniu(name, dataFile)
+}
+
+async function saveOverlays(overlays,name){
+  let dataFile = 'data2.js'
+  let dataPath = path.join(sceneDir, name, dataFile)
+  let data = JSON.parse(fs.readFileSync(dataPath));
+
+  data.overlays = overlays
+
+  fs.writeFileSync(dataPath, JSON.stringify(data))
+  
+  await upqiniu(name, dataFile)
+}
+
+async function saveInfo(info, name) {
+  let dataFile = 'data2.js'
+  let someFile = 'someData.json'
+  let dataPath = path.join(sceneDir, name, dataFile)
+  let data = JSON.parse(fs.readFileSync(dataPath));
+  let somDataPath = path.join(sceneDir, name, someFile);
+  let somData = JSON.parse(fs.readFileSync(somDataPath));
+
+  
+  somData.model.name = info.name
+  somData.model.summary = info.summary
+  somData.model.camera_start = info.camera_start
+
+  Object.keys(info).forEach(key => {
+    somData[key] = info[key]
+  })
+
+  // somData.backgroundMusic = info.backgroundMusic
+  // somData.hoticon = info.hoticon
+  somData.loadlogo = info.loadlogo === "true" ? true : false
+
+  data.weixinDesc = info.weixinDesc
+
+  fs.writeFileSync(somDataPath, JSON.stringify(somData))
+  fs.writeFileSync(dataPath, JSON.stringify(data))
+
+  await upqiniu(name, dataFile)
+  await upqiniu(name, someFile)
+}
+
+// 添加场景
+router.post('/addscene', async ctx => {
+  let name = ctx.request.body.name
+  let files = await getFiles()
+  let index = files.findIndex(file => file === name)
+
+  if (~index) {
+    return ctx.body = {
+      msg: '该场景已存在,请更改场景名称', 
+      code: 500
+    }
+  }
+
+  await new Promise((resolve, reject) => {
+    fs.mkdir(path.join(sceneDir, name), err => {
+      if (err) {
+        reject(err)
+      } else {
+        resolve()
+      }
+    })
+  })
+  
+  ctx.body = {
+    content: '成功创建场景',
+    code: 200
+  }
+})
+
+// 删除场景
+router.post('/delscene', async ctx => {
+  let dir = path.join(sceneDir, ctx.request.body.name)
+  deleteFolder(dir)
+
+  ctx.body = {
+    code: 200
+  }
+})
+
+// 获取所有场景
+router.get('/list', async ctx => {
+  let files = await getFiles()
+
+  let content = files.map(file => {
+    let name = ''
+    try {
+      let somedata = JSON.parse(fs.readFileSync(path.join(sceneDir, file, 'someData.json')))
+      name = somedata.name || somedata.model.name
+      
+    } catch (e) {
+    }
+
+    return {
+      name: file,
+      title: name,
+      query: url.format({
+        protocol: sys.protocol,
+        host: 'www.4dmodel.com',
+        port: sys.port,
+        pathname: sys.scene_query,
+        query: {m: file}
+      }),
+      edit: url.format({
+        protocol: sys.protocol,
+        host: sys.host,
+        port: sys.port,
+        pathname: sys.scene_edit,
+        query: { m: file }
+      })
+    }
+  })
+  
+  ctx.body = {
+    content,
+    code: 200
+  }
+})
+
+// 转化运行场景需要的参数
+router.post('/transform', async ctx => {
+  let url = ctx.request.body.url
+  let modelDataUrl = path.join(sceneDir, ctx.request.body.name, 'modeldata.js')
+  let someDataUrl = path.join(sceneDir, ctx.request.body.name, 'someData.json')
+  let readFile
+  let transformData
+
+  if (fs.existsSync(someDataUrl)) {
+    readFile = 'someData.json'
+    transformData = fs.readFileSync(someDataUrl)
+  } else if (fs.existsSync(modelDataUrl)) {
+    readFile = 'modeldata.js'
+    transformData = fs.readFileSync(modelDataUrl)
+  } else {
+    transformData = await new Promise((resolve, reject) => {
+      request(url, function(err, res, body) {
+        if (err) {
+          reject(err)
+        } else {
+          resolve(body)
+        }
+      })
+    })
+
+    readFile = url
+  }
+
+  if (!transformData) {
+    return ctx.body = {
+      msg: '该场景缺少核心启动文件!',
+      code: 500
+    }
+  }
+
+  try {
+    transformData = JSON.parse(transformData)
+  } catch (e) {
+    return ctx.body = {
+      code: 500,
+      msg: readFile + '不是有效的json格式文件!'
+    }
+  }
+
+  transformData = transformSomeData(transformData)
+  transformData.model.sid = ctx.request.body.name
+
+  let hotUrl = path.join(sceneDir, ctx.request.body.name, 'hot')
+  if (!fs.existsSync(hotUrl)) {
+    await new Promise((resolve, reject) => {
+      copyDir(path.join(__dirname, '../', sys.static_dir, './hottemp'), hotUrl, resolve)
+    })
+  }
+
+  let dataPath = path.join(sceneDir, ctx.request.body.name, 'data2.js')
+  fs.writeFileSync(dataPath, '{}')
+
+  await upqiniu(ctx.request.body.name, 'data2.js')
+
+  fs.writeFileSync(someDataUrl, JSON.stringify(transformData))
+
+  await upqiniu(ctx.request.body.name, 'someData.json')
+
+  ctx.body = { code: 200 }
+})
+
+
+// 保存配置
+router.post('/savesetting', async ctx => {
+  let { name, hots, guides = [], info, tourAudio = {},overlays=[]  } = ctx.request.body
+
+  if (!guides.length) {
+    let ret = []
+    for (let key in guides) {
+      ret.push(guides[key])
+    }
+    guides = ret
+  }
+
+  await saveGuide(guides, name)
+  await savehots(hots, name)
+  await saveInfo(info, name)
+  await saveMusics(tourAudio, name)
+  await saveOverlays(overlays, name)
+
+  ctx.body = {
+    code: 200, 
+    msg: '修改成功!'
+  }
+})
+
+// 上传文件
+router.post('/uploadFile', async ctx => {
+  let result = await uploadFile(ctx, sceneDir);
+  let file = result.file.substr(('/'+result.name+'/').length);
+  let qiniuLocal = await upqiniu(result.name, file);
+
+  ctx.body = {
+    code: 200,
+    msg: '文件上传成功',
+    content: qiniuLocal
+  }
+})
+
+
+router.get('/getSomeData', async ctx => {
+  let url = ctx.request.query.url
+  let data = await new Promise((resolve, reject) => {
+    request(url, function (err, res, body) {
+      if (err) {
+        reject(err)
+      } else {
+        resolve(body)
+      }
+    })
+  })
+
+  try {
+    transformData = transformSomeData(JSON.parse(data))
+  } catch (e) {
+    return ctx.body = {
+      code: 500,
+      msg: url + '不是有效的json格式文件!'
+    }
+  }
+
+  ctx.body = transformData
+})
+
+
+
+function transformSomeData(transformData) {
+
+  if (!transformData.model) {
+    transformData = {
+      model: transformData
+    }
+    delete transformData.model.icon
+    delete transformData.model.camera_start
+    transformData.model.address = JSON.stringify(transformData.model.address)
+  }
+
+  clearRgFileds(transformData, /\/\//)
+
+  let delFileds = [
+    'enable_social_sharing', 'social_sharing_enabled', 'account_social_sharing_default',
+    'owner', 'address', 'is_vr', 'vision_version', 'created', 'unit_type', 'owner'
+  ]
+  let assigFileds = {
+    files: {
+      templates: ['data/{{number}}/{{filename}}']
+    },
+
+  }
+
+  delFileds.forEach(filed => {
+    delete transformData[filed]
+    delete transformData.model[filed]
+  })
+  Object.keys(assigFileds).forEach(filed => transformData[filed] = assigFileds[filed])
+
+  if (!transformData.model.camera_start) {
+    for (let i = 0; i < transformData.model.images.length; i++) {
+      let metadata = JSON.parse(transformData.model.images[0].metadata)
+
+      if (metadata.scan_id) {
+        transformData.model.camera_start = {
+          camera: {
+            "zoom": -1,
+            "quaternion": [
+              metadata.camera_quaternion.x,
+              metadata.camera_quaternion.y,
+              metadata.camera_quaternion.z,
+              metadata.camera_quaternion.w
+            ]
+          },
+          pano: {
+            "uuid": metadata.scan_id
+          },
+          "mode": 0
+        }
+        break;
+      }
+    }
+
+  }
+
+  let deufaltPlayer = {
+    "presented_by": true,
+    "highlight_reel": true,
+    "floor_plan": true,
+    "tour_buttons": true,
+    "dollhouse": true,
+    "fast_transitions": false,
+    "autoplay": false,
+  }
+
+  transformData.model.player_options = transformData.model.player_options || {};
+  Object.keys(deufaltPlayer).forEach(key => transformData.model.player_options[key] = deufaltPlayer[key])
+
+  transformData.model.images = [transformData.model.images[0]]
+
+  return transformData
+}
+
+
+module.exports = exports = {router};

+ 89 - 0
gis_application/src/main/resources/data/someData.json

@@ -0,0 +1,89 @@
+{
+  "model": {
+    "sid": "zhengzhou",
+    "name": "526190409SZGX",
+    "status": "viewable",
+    "floors": "",
+    "metainfo": { "allowed_methods": ["GET", "OPTIONS", "HEAD"] },
+    "images": [
+      {
+        "metadata": "{\"camera_mode\":0,\"camera_position\":{\"x\":17.319578170776367,\"y\":0.5689632296562195,\"z\":30.42438507080078},\"camera_quaternion\":{\"x\":-0.0000020361233819675194,\"y\":0.9999978870169733,\"z\":-0.0012442941874225735,\"w\":-0.0016363646960161576},\"ortho_zoom\":-1,\"ss_zoom\":1,\"scan_id\":\"b1498df53a554a0bafec6646639964e6\",\"is_ortho\":false,\"floorVisibility\":[1]}",
+        "created": "2019-04-12T01:15:48.811428Z",
+        "modified": "2019-04-12T01:15:48.811961Z",
+        "sid": "3itPh3K83Bq",
+        "name": "04.12.2019_09.15.38",
+        "height": 1707,
+        "width": 3034,
+        "is_hero": true,
+        "category": "user",
+        "vision_generated_label": "",
+        "vision_generated_name": "",
+        "vision_image_index": -1,
+        "created_by": 4084,
+        "rating": null
+      }
+    ],
+    "job": { "uuid": "dacf7dfa24ae47fab8fcebfe4dc41ab9" },
+    "player_options": {
+      "presented_by": true,
+      "highlight_reel": true,
+      "floor_plan": true,
+      "tour_buttons": true,
+      "dollhouse": true,
+      "fast_transitions": false,
+      "autoplay": false,
+      "contact_email": true,
+      "address": true,
+      "contact_name": true,
+      "model_summary": true,
+      "contact_phone": true,
+      "model_name": true,
+      "external_url": true
+    },
+    "modified": "2019-04-12T06:39:16.940410Z",
+    "is_public": true,
+    "summary": "",
+    "presented_by": "",
+    "contact_name": "",
+    "contact_phone": "",
+    "formatted_contact_phone": "",
+    "contact_email": "",
+    "external_url": "",
+    "camera_start": {
+      "camera": {
+        "zoom": "-1",
+        "quaternion": ["0.7013", "-0.7026", "0.0907", "-0.08"]
+      },
+      "pano": { "uuid": "2" },
+      "mode": "0"
+    }
+  },
+  "files": { "templates": ["data/{{number}}/{{filename}}"] },
+  "name": "526190409SZGX",
+  "summary": "",
+  "hoticon": {
+    "default": "images/4dagePoint2.png",
+    "higt": "images/4dagePoint.png"
+  },
+  "camera_start": {
+    "camera": {
+      "zoom": "-1",
+      "quaternion": ["0.7013", "-0.7026", "0.0907", "-0.08"]
+    },
+    "pano": { "uuid": "2" },
+    "mode": "0"
+  },
+  "loadlogo": false,
+  "special": false,
+  "vision_version": false,
+  "hotImageScale": false,
+  "hideFloorMarker": false,
+  "hideMouseMarker": false,
+  "floorMarkerColor": "#4bcdfc",
+  "mouseMarkerColor": "#4bcdfc",
+  "momentTour": "walk",
+  "showHotListSta": false,
+  "hotIconScale": "1",
+  "supportsVR": false,
+  "weixinDesc": ""
+}

文件差異過大導致無法顯示
+ 1270 - 0
gis_application/src/main/resources/db/army_cms.sql


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

+ 194 - 0
gis_common/pom.xml

@@ -0,0 +1,194 @@
+<?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_army_macao</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>-->
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</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>-->
+
+        <!-- 针对proto包 转换格式用-->
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>com.googlecode.protobuf-java-format</groupId>
+            <artifactId>protobuf-java-format</artifactId>
+            <version>1.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-mapper-asl</artifactId>
+            <version>1.9.11</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-smile</artifactId>
+            <version>1.9.12</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.belerweb</groupId>
+            <artifactId>pinyin4j</artifactId>
+            <version>2.5.1</version>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>io.gitbub.wnjustdoit</groupId>-->
+            <!--<artifactId>pinyin4j</artifactId>-->
+            <!--&lt;!&ndash;<version>1.0.0</version>&ndash;&gt;-->
+        <!--</dependency>-->
+
+
+    </dependencies>
+
+
+</project>

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

@@ -0,0 +1,56 @@
+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")){
+        }
+
+
+        // uat环境禁止访问api文档
+        if (active.equals("pro")) {
+            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")){
+        }
+    }
+
+
+
+
+}

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

@@ -0,0 +1,88 @@
+package com.gis.common.config;
+
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
+import com.google.common.collect.Lists;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.service.ApiKey;
+import springfox.documentation.service.AuthorizationScope;
+import springfox.documentation.service.SecurityReference;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spi.service.contexts.SecurityContext;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by owen on 2020/2/18
+ *
+ * 集成Swagger有3步:
+ * 1.pom.xml添加依赖
+ * 2.添加Swagger2.class
+ * 3.Application.class 加上注解@EnableSwagger2 表示开启Swagger
+ * 4.http://localhost:8080/doc.html#/
+ *
+ * 2.9.2 不需要字启动类配置注解
+ */
+@EnableKnife4j  // basic认证需要开启这个注解
+@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("驻澳部队cms APIs")
+                .description("驻澳部队cms 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;
+    }
+}

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

@@ -0,0 +1,85 @@
+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);
+    }
+
+//    @Bean
+//    public DriverMangerListener driverMangerListener(){
+//       return new DriverMangerListener();
+//    }
+
+}

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

@@ -0,0 +1,28 @@
+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 = "cms_army_token_";
+
+    /**api token key*/
+    public static final String TOKEN_API_KEY = "apiKey";
+
+    /**文件外键id前缀*/
+    public static final String FILE_GOODS = "goods_";
+
+
+    public static final String MODEL_GOODS_IMG = "goodsImg";
+
+    public static final String MODEL_GOODS_MODEL = "goodsModel";
+
+    public static final String MODEL_GOODS_VIDEO = "goodsVideo";
+
+    public static final String MODEL_FODDER_IMG = "fodderImg";
+
+    public static final String MODEL_FODDER_VIDEO = "fodderVideo";
+}
+

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

文件差異過大導致無法顯示
+ 7340 - 0
gis_common/src/main/java/com/gis/common/proto/BigSceneProto.java


文件差異過大導致無法顯示
+ 4654 - 0
gis_common/src/main/java/com/gis/common/proto/Common.java


文件差異過大導致無法顯示
+ 4345 - 0
gis_common/src/main/java/com/gis/common/proto/Visionmodeldata.java


+ 37 - 0
gis_common/src/main/java/com/gis/common/proto/constant/ConstantCmd.java

@@ -0,0 +1,37 @@
+package com.gis.common.proto.constant;
+
+public class ConstantCmd {
+
+	  //生成模型的命令
+	  public static final String BUILD_MODEL_COMMAND = "bash /home/ubuntu/bin/Launcher.sh ";
+
+	  // 生成切片图
+	  public static final String SLICE_SKYBOX = "bash /home/ubuntu/bin/Skybox.sh ";
+
+	  // 把obj文件传txt文件
+	  public static final String OBJ_TO_TXT = "bash /home/ubuntu/bin/obj2txt.sh ";
+
+//	  public static final String BUILD_MODEL_SFM_COMMAND = "bash /home/ubuntu/run_sfm.sh ";
+//
+//	  public static final String REBUILD_MODEL_FLLOR = "bash /home/ubuntu/bin/Panoramix_Floorplan.sh ";
+//	  //切图命令
+//	  public static final String CUT_IMG_COMMAND = "bash /home/ubuntu/OpenSfM/bin/run_cube.sh ";
+//	  //调整图片的命令
+//	  public static final String ADJUST_IMG_COMMAND = "/home/ubuntu/OpenSfM/bin/run_skybox ";
+//
+//
+//
+//	  //转台拼图命令
+//	  public static final String BUILD_PANORAMA = "AutopanoGiga /home/ubuntu/data/";
+//	  //六目,拼图,计算,切图(二代)
+//	  public static final String BUILD_FOR_SIX = "bash /home/ubuntu/run_all_m6.sh ";
+//
+//	//合并音频
+//	public static final String MERGE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_synthesis.sh ";
+//
+//	//生成一段静音音频
+//	public static final String CREATE_MUTE_VIDEO = "bash /monchickey/ffmpeg/bin/ff_mtue.sh ";
+//
+//	public static final String OSS_UTIL_CP ="bash /opt/ossutil/oss.sh ";
+
+}

+ 41 - 0
gis_common/src/main/java/com/gis/common/proto/constant/ConstantFileName.java

@@ -0,0 +1,41 @@
+package com.gis.common.proto.constant;
+
+public class ConstantFileName {
+//    //背景音乐
+//    public static final String BACKGROUND_MUSIC = "bg.mp3";
+//    //编辑页面,第二代
+//    public static final String MODEL_DATAFILE = "modeldata.json";
+//    public static final String HOT_DATAFILE = "hot.json";
+//    public static final String MEDIA_DATAFILE = "mediaInfo.json";
+//    public static final String SCREEN_CRP_DATAFILE = "screenCap";
+//    //导览(一代)
+//    public static final String GUIDE_DATAFILE = "tour.json";
+//
+//    //文件夹名称
+//    public static final String GUIDE_MEDIA_FOLDER = "guide";
+//    public static final String HOT_MEDIA_FOLDER = "hot";
+//    public static final String OTHER_MEDIA_FOLDER = "other";
+//
+//    //论坛过滤文档
+//    public static final String BBS_SENSITIVE = "SensitiveWord.txt";
+//    public static final String LOGO_NAME = "logo.jpg";
+//
+//    //app部分
+//    public static final String APP_FOLDER = "appupload";
+//
+//    public static final String FLOOR_LOGO_PIC_NAME = "floorLogoImg.png";
+//
+//    public static final String TOUR_LIST = "tourList.json";
+//    public static final String VOICE_NAME = "201810";
+//    public static final String WECHAT_VOICE_NAME = "wechat";
+//
+//    public static final String TOURLIST_FOLDER = "tour";
+//    //public static final String TEMPFILES = "tempFiles";
+//
+//
+//
+//    public static final String BUCKET_NAME = "4dkankan";
+
+    // 这个码要跟前端一致
+    public static final String modelUUID = "dacf7dfa24ae47fab8fcebfe4dc41ab9";
+}

+ 61 - 0
gis_common/src/main/java/com/gis/common/proto/constant/ConstantFilePath.java

@@ -0,0 +1,61 @@
+package com.gis.common.proto.constant;
+
+public class ConstantFilePath {
+//    public static final String BASE_PATH = "/mnt/4Dkankan";
+//    //论坛上传图片后,服务器存放的地址
+//    public static final String BBS_IMAGES_PATH = "/mnt/4Dkankan/bbs/upload/image/";
+//    // 用户上传图片
+//    public static final String USER_IMAGES_PATH = "/mnt/4Dkankan/user/";
+//    // 图片暂存地址(创建二维码等)
+//    public static final String TEMP_IMAGES_PATH = "/mnt/4Dkankan/temp/upload/image/";
+//    // 场景
+////    public static final String SCENE_PATH = "/mnt/4Dkankan/scene/";
+//
+//    // 代理商
+//    public static final String AGENT_PATH = "/mnt/4Dkankan/agent/";
+//    // 场景二维码
+//    public static final String SCENE_QR_CODE_PATH = "/mnt/4Dkankan/sceneQRcode/";
+//    // excel
+//    public static final String EXCEL_PATH = "/mnt/4Dkankan/excel/";
+//    // medias
+//    public static final String MEDIAS_PATH = "/mnt/4Dkankan/medias/";
+//    // logo
+//    public static final String LOGO_PATH = "/mnt/4Dkankan/logo/";
+//    // login qr code
+//    public static final String LOGIN_QR_CODE_PATH = "/mnt/4Dkankan/login/qrcode/";
+//
+//    public static final String WEIXIN_CERT = "/mnt/home/ubuntu/user/apiclient_cert.p12";
+//
+//    public static final String PREFIX = "/home/user";
+//    public static final String CREATE_MODEL_PATH = PREFIX + "/photo_data/model/";
+//    //大场景
+//    public static final String CREATE_BIG_SCENE_PATH = PREFIX + "/photo_data/bigscene/";
+//    //生成模型的路径
+////    public static final String BUILD_MODEL_PATH = "/mnt/data/";
+//
+//
+//    //支付二维码图片存放路径
+//    public static final String ALI_QRCODE_FOLDER = "/mnt/4Dkankan/alicode/";
+//    public static final String WEIXIN_QRCODE_FOLDER = "/mnt/4Dkankan/weixincode/";
+//
+//    public static final String OSS_PREFIX = "home/";
+
+    //生成模型的路径, 计算模型使用
+//    public static final String BUILD_MODEL_PATH = "/data/kanfang/pano/";
+
+
+    // 123kanfang 保存到阿里云位置, 前面不能有/
+//    public static final String UPLOAD_SCENE_PATH = "4dkktmp/images/images";
+
+    // oss 存放路径
+    public static final String UPLOAD_HOUSE_PATH = "kanfang/house/";
+
+    // oss 算法生成文件存放路径(high: 垂直校验全景图, low: 生成模型缩略图)
+    /**
+     * oss 算法生成文件存放路径(high: 垂直校验全景图, low: 生成模型缩略图)
+     * images/images + d_场景码
+     * 场景码建议9位
+     */
+    public static final String OSS_IMAGE_PATH = "images/images";
+
+}

+ 156 - 0
gis_common/src/main/java/com/gis/common/proto/format/CouchDBFormat.java

@@ -0,0 +1,156 @@
+package com.gis.common.proto.format;
+
+
+import com.google.protobuf.ExtensionRegistry;
+import com.google.protobuf.Message;
+import com.google.protobuf.UnknownFieldSet;
+
+import java.io.IOException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: aantonov
+ * Date: Mar 16, 2010
+ * Time: 4:06:05 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class CouchDBFormat extends JsonFormat {
+
+    /**
+     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
+     * (This representation is the new version of the classic "ProtocolPrinter" output from the
+     * original Protocol Buffer system)
+     */
+    public static void print(Message message, Appendable output) throws IOException {
+        CouchDBGenerator generator = new CouchDBGenerator(output);
+        generator.print("{");
+        print(message, generator);
+        generator.print("}");
+    }
+
+    /**
+     * Outputs a textual representation of {@code fields} to {@code output}.
+     */
+    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
+        CouchDBGenerator generator = new CouchDBGenerator(output);
+        generator.print("{");
+        printUnknownFields(fields, generator);
+        generator.print("}");
+    }
+
+    /**
+     * Like {@code print()}, but writes directly to a {@code String} and returns it.
+     */
+    public static String printToString(Message message) {
+        try {
+            StringBuilder text = new StringBuilder();
+            print(message, text);
+            return text.toString();
+        } catch (IOException e) {
+            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
+                                       e);
+        }
+    }
+
+    /**
+     * Like {@code print()}, but writes directly to a {@code String} and returns it.
+     */
+    public static String printToString(UnknownFieldSet fields) {
+        try {
+            StringBuilder text = new StringBuilder();
+            print(fields, text);
+            return text.toString();
+        } catch (IOException e) {
+            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
+                                       e);
+        }
+    }
+
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     */
+    public static void merge(Readable input, Message.Builder builder) throws IOException {
+        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
+    }
+
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     */
+    public static void merge(CharSequence input, Message.Builder builder) throws ParseException {
+        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
+    }
+
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
+     */
+    public static void merge(Readable input,
+                             ExtensionRegistry extensionRegistry,
+                             Message.Builder builder) throws IOException {
+        // Read the entire input to a String then parse that.
+
+        // If StreamTokenizer were not quite so crippled, or if there were a kind
+        // of Reader that could read in chunks that match some particular regex,
+        // or if we wanted to write a custom Reader to tokenize our stream, then
+        // we would not have to read to one big String. Alas, none of these is
+        // the case. Oh well.
+
+        merge(JsonFormat.toStringBuilder(input), extensionRegistry, builder);
+    }
+
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
+     */
+    public static void merge(CharSequence input,
+                             ExtensionRegistry extensionRegistry,
+                             Message.Builder builder) throws ParseException {
+        Tokenizer tokenizer = new Tokenizer(input);
+
+        // Based on the state machine @ http://json.org/
+
+        tokenizer.consume("{"); // Needs to happen when the object starts.
+        while (!tokenizer.tryConsume("}")) { // Continue till the object is done
+            JsonFormat.mergeField(tokenizer, extensionRegistry, builder);
+        }
+    }
+
+    protected static class Tokenizer extends JsonFormat.Tokenizer {
+
+        /**
+         * Construct a tokenizer that parses tokens from the given text.
+         */
+        public Tokenizer(CharSequence text) {
+            super(text);
+        }
+
+        @Override
+        public String consumeIdentifier() throws ParseException {
+            String id = super.consumeIdentifier();
+            if ("_id".equals(id)) {
+                return "id";
+            } else if ("_rev".equals(id)) {
+                return "rev";
+            }
+            return id;
+        }
+    }
+
+    protected static class CouchDBGenerator extends JsonFormat.JsonGenerator {
+
+        public CouchDBGenerator(Appendable output) {
+            super(output);
+        }
+
+        @Override
+        public void print(CharSequence text) throws IOException {
+            if ("id".equals(text)) {
+                super.print("_id");
+            } else if ("rev".equals(text)) {
+                super.print("_rev");
+            } else {
+                super.print(text);
+            }
+        }
+    }
+}

+ 703 - 0
gis_common/src/main/java/com/gis/common/proto/format/HtmlFormat.java

@@ -0,0 +1,703 @@
+package com.gis.common.proto.format;
+/* 
+    Copyright (c) 2009, Orbitz World Wide
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without modification, 
+    are permitted provided that the following conditions are met:
+
+        * Redistributions of source code must retain the above copyright notice, 
+          this list of conditions and the following disclaimer.
+        * Redistributions in binary form must reproduce the above copyright notice, 
+          this list of conditions and the following disclaimer in the documentation 
+          and/or other materials provided with the distribution.
+        * Neither the name of the Orbitz World Wide nor the names of its contributors 
+          may be used to endorse or promote products derived from this software 
+          without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+import com.google.protobuf.ByteString;
+import com.google.protobuf.Descriptors.EnumValueDescriptor;
+import com.google.protobuf.Descriptors.FieldDescriptor;
+import com.google.protobuf.Message;
+import com.google.protobuf.UnknownFieldSet;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * Provide ascii html formatting support for proto2 instances.
+ * <p>
+ * (c) 2009-10 Orbitz World Wide. All Rights Reserved.
+ * 
+ * @author eliran.bivas@gmail.com Eliran Bivas
+ * @version $HtmlFormat.java Mar 12, 2009 4:00:33 PM$
+ */
+public final class HtmlFormat {
+
+    private static final String META_CONTENT = "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />";
+    private static final String MAIN_DIV_STYLE = "color: black; font-size: 14px; font-family: sans-serif; font-weight: bolder; margin-bottom: 10px;";
+    private static final String FIELD_NAME_STYLE = "font-weight: bold; color: #669966;font-size: 14px; font-family: sans-serif;";
+    private static final String FIELD_VALUE_STYLE = "color: #3300FF;font-size: 13px; font-family: sans-serif;";
+
+    /**
+     * Outputs a textual representation of the Protocol Message supplied into the parameter output.
+     * (This representation is the new version of the classic "ProtocolPrinter" output from the
+     * original Protocol Buffer system)
+     */
+    public static void print(Message message, Appendable output) throws IOException {
+        HtmlGenerator generator = new HtmlGenerator(output);
+        printTitle(message, generator);
+        print(message, generator);
+        generator.print("</body></html>");
+    }
+
+    private static void printTitle(final Message message, final HtmlGenerator generator) throws IOException {
+        generator.print("<html><head>");
+        generator.print(META_CONTENT);
+        generator.print("<title>");
+        generator.print(message.getDescriptorForType().getFullName());
+        generator.print("</title></head><body>");
+        generator.print("<div style=\"");
+        generator.print(MAIN_DIV_STYLE);
+        generator.print("\">message : ");
+        generator.print(message.getDescriptorForType().getFullName());
+        generator.print("</div>");
+    }
+
+    /**
+     * Outputs a textual representation of {@code fields} to {@code output}.
+     */
+    public static void print(UnknownFieldSet fields, Appendable output) throws IOException {
+        HtmlGenerator generator = new HtmlGenerator(output);
+        generator.print("<html>");
+        generator.print(META_CONTENT);
+        generator.print("</head><body>");
+        printUnknownFields(fields, generator);
+        generator.print("</body></html>");
+    }
+
+    /**
+     * Like {@code print()}, but writes directly to a {@code String} and returns it.
+     */
+    public static String printToString(Message message) {
+        try {
+            StringBuilder text = new StringBuilder();
+            print(message, text);
+            return text.toString();
+        } catch (IOException e) {
+            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
+                                       e);
+        }
+    }
+
+    /**
+     * Like {@code print()}, but writes directly to a {@code String} and returns it.
+     */
+    public static String printToString(UnknownFieldSet fields) {
+        try {
+            StringBuilder text = new StringBuilder();
+            print(fields, text);
+            return text.toString();
+        } catch (IOException e) {
+            throw new RuntimeException("Writing to a StringBuilder threw an IOException (should never happen).",
+                                       e);
+        }
+    }
+
+    private static void print(Message message, HtmlGenerator generator) throws IOException {
+
+        for (Map.Entry<FieldDescriptor, Object> field : message.getAllFields().entrySet()) {
+            printField(field.getKey(), field.getValue(), generator);
+        }
+        printUnknownFields(message.getUnknownFields(), generator);
+    }
+
+    public static void printField(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
+
+        if (field.isRepeated()) {
+            // Repeated field. Print each element.
+            for (Object element : (List<?>) value) {
+                printSingleField(field, element, generator);
+            }
+        } else {
+            printSingleField(field, value, generator);
+        }
+    }
+
+    private static void printSingleField(FieldDescriptor field,
+                                         Object value,
+                                         HtmlGenerator generator) throws IOException {
+        if (field.isExtension()) {
+            generator.print("[<span style=\"");
+            generator.print(FIELD_NAME_STYLE);
+            generator.print("\">");
+            // We special-case MessageSet elements for compatibility with proto1.
+            if (field.getContainingType().getOptions().getMessageSetWireFormat()
+                            && (field.getType() == FieldDescriptor.Type.MESSAGE) && (field.isOptional())
+                            // object equality
+                            && (field.getExtensionScope() == field.getMessageType())) {
+                generator.print(field.getMessageType().getFullName());
+            } else {
+                generator.print(field.getFullName());
+            }
+            generator.print("</span>]");
+        } else {
+            generator.print("<span style=\"");
+            generator.print(FIELD_NAME_STYLE);
+            generator.print("\">");
+            if (field.getType() == FieldDescriptor.Type.GROUP) {
+                // Groups must be serialized with their original capitalization.
+                generator.print(field.getMessageType().getName());
+            } else {
+                generator.print(field.getName());
+            }
+            generator.print("</span>");
+        }
+
+        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
+            generator.print(" <span style=\"color: red;\">{</span><br/>");
+            generator.indent();
+        } else {
+            generator.print(": ");
+        }
+
+        printFieldValue(field, value, generator);
+
+        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
+            generator.outdent();
+            generator.print("<span style=\"color: red;\">}</span>");
+        }
+        generator.print("<br/>");
+    }
+
+    private static void printFieldValue(FieldDescriptor field, Object value, HtmlGenerator generator) throws IOException {
+        generator.print("<span style=\"");
+        generator.print(FIELD_VALUE_STYLE);
+        generator.print("\">");
+        switch (field.getType()) {
+            case INT32:
+            case INT64:
+            case SINT32:
+            case SINT64:
+            case SFIXED32:
+            case SFIXED64:
+            case FLOAT:
+            case DOUBLE:
+            case BOOL:
+                // Good old toString() does what we want for these types.
+                generator.print(value.toString());
+                break;
+
+            case UINT32:
+            case FIXED32:
+                generator.print(unsignedToString((Integer) value));
+                break;
+
+            case UINT64:
+            case FIXED64:
+                generator.print(unsignedToString((Long) value));
+                break;
+
+            case STRING:
+                generator.print("\"");
+                generator.print(value.toString());
+                generator.print("\"");
+                break;
+
+            case BYTES: {
+                generator.print("\"");
+                generator.print(escapeBytes((ByteString) value));
+                generator.print("\"");
+                break;
+            }
+
+            case ENUM: {
+                generator.print(((EnumValueDescriptor) value).getName());
+                break;
+            }
+
+            case MESSAGE:
+            case GROUP:
+                print((Message) value, generator);
+                break;
+        }
+        generator.print("</span>");
+    }
+
+    private static void printUnknownFields(UnknownFieldSet unknownFields, HtmlGenerator generator) throws IOException {
+        for (Map.Entry<Integer, UnknownFieldSet.Field> entry : unknownFields.asMap().entrySet()) {
+            UnknownFieldSet.Field field = entry.getValue();
+
+            for (long value : field.getVarintList()) {
+                generator.print(entry.getKey().toString());
+                generator.print(": ");
+                generator.print(unsignedToString(value));
+                generator.print("<br/>");
+            }
+            for (int value : field.getFixed32List()) {
+                generator.print(entry.getKey().toString());
+                generator.print(": ");
+                generator.print(String.format((Locale) null, "0x%08x", value));
+                generator.print("<br/>");
+            }
+            for (long value : field.getFixed64List()) {
+                generator.print(entry.getKey().toString());
+                generator.print(": ");
+                generator.print(String.format((Locale) null, "0x%016x", value));
+                generator.print("<br/>");
+            }
+            for (ByteString value : field.getLengthDelimitedList()) {
+                generator.print(entry.getKey().toString());
+                generator.print(": \"");
+                generator.print(escapeBytes(value));
+                generator.print("\"<br/>");
+            }
+            for (UnknownFieldSet value : field.getGroupList()) {
+                generator.print(entry.getKey().toString());
+                generator.print(" <span style=\"color: red;\">{</span><br/>");
+                generator.indent();
+                printUnknownFields(value, generator);
+                generator.outdent();
+                generator.print("<span style=\"color: red;\">}</span><br/>");
+            }
+        }
+    }
+
+    /**
+     * Convert an unsigned 32-bit integer to a string.
+     */
+    private static String unsignedToString(int value) {
+        if (value >= 0) {
+            return Integer.toString(value);
+        } else {
+            return Long.toString((value) & 0x00000000FFFFFFFFL);
+        }
+    }
+
+    /**
+     * Convert an unsigned 64-bit integer to a string.
+     */
+    private static String unsignedToString(long value) {
+        if (value >= 0) {
+            return Long.toString(value);
+        } else {
+            // Pull off the most-significant bit so that BigInteger doesn't think
+            // the number is negative, then set it again using setBit().
+            return BigInteger.valueOf(value & 0x7FFFFFFFFFFFFFFFL).setBit(63).toString();
+        }
+    }
+
+    /**
+     * An inner class for writing text to the output stream.
+     */
+    static private final class HtmlGenerator {
+
+        Appendable output;
+        boolean atStartOfLine = true;
+
+        public HtmlGenerator(Appendable output) {
+            this.output = output;
+        }
+
+        /**
+         * Indent text by two spaces. After calling Indent(), two spaces will be inserted at the
+         * beginning of each line of text. Indent() may be called multiple times to produce deeper
+         * indents.
+         * 
+         * @throws IOException
+         */
+        public void indent() throws IOException {
+            print("<div style=\"margin-left: 25px\">");
+        }
+
+        /**
+         * Reduces the current indent level by two spaces, or crashes if the indent level is zero.
+         * 
+         * @throws IOException
+         */
+        public void outdent() throws IOException {
+            print("</div>");
+        }
+
+        /**
+         * Print text to the output stream.
+         */
+        public void print(CharSequence text) throws IOException {
+            int size = text.length();
+            int pos = 0;
+
+            for (int i = 0; i < size; i++) {
+                if (text.charAt(i) == '\n') {
+                    write("<br/>", i - pos + 1);
+                    pos = i + 1;
+                    atStartOfLine = true;
+                }
+            }
+            write(text.subSequence(pos, size), size - pos);
+        }
+
+        private void write(CharSequence data, int size) throws IOException {
+            if (size == 0) {
+                return;
+            }
+            if (atStartOfLine) {
+                atStartOfLine = false;
+            }
+            output.append(data);
+        }
+    }
+
+    // =================================================================
+    // Utility functions
+    //
+    // Some of these methods are package-private because Descriptors.java uses
+    // them.
+
+    /**
+     * Escapes bytes in the format used in protocol buffer text format, which is the same as the
+     * format used for C string literals. All bytes that are not printable 7-bit ASCII characters
+     * are escaped, as well as backslash, single-quote, and double-quote characters. Characters for
+     * which no defined short-hand escape sequence is defined will be escaped using 3-digit octal
+     * sequences.
+     */
+    static String escapeBytes(ByteString input) {
+        StringBuilder builder = new StringBuilder(input.size());
+        for (int i = 0; i < input.size(); i++) {
+            byte b = input.byteAt(i);
+            switch (b) {
+                // Java does not recognize \a or \v, apparently.
+                case 0x07:
+                    builder.append("\\a");
+                    break;
+                case '\b':
+                    builder.append("\\b");
+                    break;
+                case '\f':
+                    builder.append("\\f");
+                    break;
+                case '\n':
+                    builder.append("\\n");
+                    break;
+                case '\r':
+                    builder.append("\\r");
+                    break;
+                case '\t':
+                    builder.append("\\t");
+                    break;
+                case 0x0b:
+                    builder.append("\\v");
+                    break;
+                case '\\':
+                    builder.append("\\\\");
+                    break;
+                case '\'':
+                    builder.append("\\\'");
+                    break;
+                case '"':
+                    builder.append("\\\"");
+                    break;
+                default:
+                    if (b >= 0x20) {
+                        builder.append((char) b);
+                    } else {
+                        builder.append('\\');
+                        builder.append((char) ('0' + ((b >>> 6) & 3)));
+                        builder.append((char) ('0' + ((b >>> 3) & 7)));
+                        builder.append((char) ('0' + (b & 7)));
+                    }
+                    break;
+            }
+        }
+        return builder.toString();
+    }
+
+    /**
+     * Un-escape a byte sequence as escaped using
+     * {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}. Two-digit hex escapes (starting with
+     * "\x") are also recognized.
+     */
+    static ByteString unescapeBytes(CharSequence input) throws InvalidEscapeSequence {
+        byte[] result = new byte[input.length()];
+        int pos = 0;
+        for (int i = 0; i < input.length(); i++) {
+            char c = input.charAt(i);
+            if (c == '\\') {
+                if (i + 1 < input.length()) {
+                    ++i;
+                    c = input.charAt(i);
+                    if (isOctal(c)) {
+                        // Octal escape.
+                        int code = digitValue(c);
+                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
+                            ++i;
+                            code = code * 8 + digitValue(input.charAt(i));
+                        }
+                        if ((i + 1 < input.length()) && isOctal(input.charAt(i + 1))) {
+                            ++i;
+                            code = code * 8 + digitValue(input.charAt(i));
+                        }
+                        result[pos++] = (byte) code;
+                    } else {
+                        switch (c) {
+                            case 'a':
+                                result[pos++] = 0x07;
+                                break;
+                            case 'b':
+                                result[pos++] = '\b';
+                                break;
+                            case 'f':
+                                result[pos++] = '\f';
+                                break;
+                            case 'n':
+                                result[pos++] = '\n';
+                                break;
+                            case 'r':
+                                result[pos++] = '\r';
+                                break;
+                            case 't':
+                                result[pos++] = '\t';
+                                break;
+                            case 'v':
+                                result[pos++] = 0x0b;
+                                break;
+                            case '\\':
+                                result[pos++] = '\\';
+                                break;
+                            case '\'':
+                                result[pos++] = '\'';
+                                break;
+                            case '"':
+                                result[pos++] = '\"';
+                                break;
+
+                            case 'x':
+                                // hex escape
+                                int code = 0;
+                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
+                                    ++i;
+                                    code = digitValue(input.charAt(i));
+                                } else {
+                                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\x' with no digits");
+                                }
+                                if ((i + 1 < input.length()) && isHex(input.charAt(i + 1))) {
+                                    ++i;
+                                    code = code * 16 + digitValue(input.charAt(i));
+                                }
+                                result[pos++] = (byte) code;
+                                break;
+
+                            default:
+                                throw new InvalidEscapeSequence("Invalid escape sequence: '\\" + c
+                                                                + "'");
+                        }
+                    }
+                } else {
+                    throw new InvalidEscapeSequence("Invalid escape sequence: '\\' at end of string.");
+                }
+            } else {
+                result[pos++] = (byte) c;
+            }
+        }
+
+        return ByteString.copyFrom(result, 0, pos);
+    }
+
+    /**
+     * Thrown by {@link JsonFormat#unescapeBytes} and {@link JsonFormat#unescapeText} when an
+     * invalid escape sequence is seen.
+     */
+    static class InvalidEscapeSequence extends IOException {
+
+        private static final long serialVersionUID = 1L;
+
+        public InvalidEscapeSequence(String description) {
+            super(description);
+        }
+    }
+
+    /**
+     * Like {@link #escapeBytes(com.googlecode.protobuf.format.ByteString)}, but escapes a text string.
+     * Non-ASCII characters are first encoded as UTF-8, then each byte is escaped individually as a
+     * 3-digit octal escape. Yes, it's weird.
+     */
+    static String escapeText(String input) {
+        return escapeBytes(ByteString.copyFromUtf8(input));
+    }
+
+    /**
+     * Un-escape a text string as escaped using {@link #escapeText(String)}. Two-digit hex escapes
+     * (starting with "\x") are also recognized.
+     */
+    static String unescapeText(String input) throws InvalidEscapeSequence {
+        return unescapeBytes(input).toStringUtf8();
+    }
+
+    /**
+     * Is this an octal digit?
+     */
+    private static boolean isOctal(char c) {
+        return ('0' <= c) && (c <= '7');
+    }
+
+    /**
+     * Is this a hex digit?
+     */
+    private static boolean isHex(char c) {
+        return (('0' <= c) && (c <= '9')) || (('a' <= c) && (c <= 'f'))
+        || (('A' <= c) && (c <= 'F'));
+    }
+
+    /**
+     * Interpret a character as a digit (in any base up to 36) and return the numeric value. This is
+     * like {@code Character.digit()} but we don't accept non-ASCII digits.
+     */
+    private static int digitValue(char c) {
+        if (('0' <= c) && (c <= '9')) {
+            return c - '0';
+        } else if (('a' <= c) && (c <= 'z')) {
+            return c - 'a' + 10;
+        } else {
+            return c - 'A' + 10;
+        }
+    }
+
+    /**
+     * Parse a 32-bit signed integer from the text. Unlike the Java standard {@code
+     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
+     * hexidecimal and octal numbers, respectively.
+     */
+    static int parseInt32(String text) throws NumberFormatException {
+        return (int) parseInteger(text, true, false);
+    }
+
+    /**
+     * Parse a 32-bit unsigned integer from the text. Unlike the Java standard {@code
+     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
+     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code int}
+     * when returned since Java has no unsigned integer type.
+     */
+    static int parseUInt32(String text) throws NumberFormatException {
+        return (int) parseInteger(text, false, false);
+    }
+
+    /**
+     * Parse a 64-bit signed integer from the text. Unlike the Java standard {@code
+     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
+     * hexidecimal and octal numbers, respectively.
+     */
+    static long parseInt64(String text) throws NumberFormatException {
+        return parseInteger(text, true, true);
+    }
+
+    /**
+     * Parse a 64-bit unsigned integer from the text. Unlike the Java standard {@code
+     * Integer.parseInt()}, this function recognizes the prefixes "0x" and "0" to signify
+     * hexidecimal and octal numbers, respectively. The result is coerced to a (signed) {@code long}
+     * when returned since Java has no unsigned long type.
+     */
+    static long parseUInt64(String text) throws NumberFormatException {
+        return parseInteger(text, false, true);
+    }
+
+    private static long parseInteger(String text, boolean isSigned, boolean isLong) throws NumberFormatException {
+        int pos = 0;
+
+        boolean negative = false;
+        if (text.startsWith("-", pos)) {
+            if (!isSigned) {
+                throw new NumberFormatException("Number must be positive: " + text);
+            }
+            ++pos;
+            negative = true;
+        }
+
+        int radix = 10;
+        if (text.startsWith("0x", pos)) {
+            pos += 2;
+            radix = 16;
+        } else if (text.startsWith("0", pos)) {
+            radix = 8;
+        }
+
+        String numberText = text.substring(pos);
+
+        long result = 0;
+        if (numberText.length() < 16) {
+            // Can safely assume no overflow.
+            result = Long.parseLong(numberText, radix);
+            if (negative) {
+                result = -result;
+            }
+
+            // Check bounds.
+            // No need to check for 64-bit numbers since they'd have to be 16 chars
+            // or longer to overflow.
+            if (!isLong) {
+                if (isSigned) {
+                    if ((result > Integer.MAX_VALUE) || (result < Integer.MIN_VALUE)) {
+                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
+                                                        + text);
+                    }
+                } else {
+                    if ((result >= (1L << 32)) || (result < 0)) {
+                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
+                                                        + text);
+                    }
+                }
+            }
+        } else {
+            BigInteger bigValue = new BigInteger(numberText, radix);
+            if (negative) {
+                bigValue = bigValue.negate();
+            }
+
+            // Check bounds.
+            if (!isLong) {
+                if (isSigned) {
+                    if (bigValue.bitLength() > 31) {
+                        throw new NumberFormatException("Number out of range for 32-bit signed integer: "
+                                                        + text);
+                    }
+                } else {
+                    if (bigValue.bitLength() > 32) {
+                        throw new NumberFormatException("Number out of range for 32-bit unsigned integer: "
+                                                        + text);
+                    }
+                }
+            } else {
+                if (isSigned) {
+                    if (bigValue.bitLength() > 63) {
+                        throw new NumberFormatException("Number out of range for 64-bit signed integer: "
+                                                        + text);
+                    }
+                } else {
+                    if (bigValue.bitLength() > 64) {
+                        throw new NumberFormatException("Number out of range for 64-bit unsigned integer: "
+                                                        + text);
+                    }
+                }
+            }
+
+            result = bigValue.longValue();
+        }
+
+        return result;
+    }
+}

文件差異過大導致無法顯示
+ 1338 - 0
gis_common/src/main/java/com/gis/common/proto/format/JavaPropsFormat.java


文件差異過大導致無法顯示
+ 1603 - 0
gis_common/src/main/java/com/gis/common/proto/format/JsonFormat.java


+ 602 - 0
gis_common/src/main/java/com/gis/common/proto/format/SmileFormat.java

@@ -0,0 +1,602 @@
+package com.gis.common.proto.format;
+/* 
+	Copyright (c) 2009, Orbitz World Wide
+	All rights reserved.
+
+	Redistribution and use in source and binary forms, with or without modification, 
+	are permitted provided that the following conditions are met:
+
+		* Redistributions of source code must retain the above copyright notice, 
+		  this list of conditions and the following disclaimer.
+		* Redistributions in binary form must reproduce the above copyright notice, 
+		  this list of conditions and the following disclaimer in the documentation 
+		  and/or other materials provided with the distribution.
+		* Neither the name of the Orbitz World Wide nor the names of its contributors 
+		  may be used to endorse or promote products derived from this software 
+		  without specific prior written permission.
+
+	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+	"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+	LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+	A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+	OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+	SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+	LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+	DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+	THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+	(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+	OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+import com.google.protobuf.*;
+import com.google.protobuf.Descriptors.Descriptor;
+import com.google.protobuf.Descriptors.EnumDescriptor;
+import com.google.protobuf.Descriptors.EnumValueDescriptor;
+import com.google.protobuf.Descriptors.FieldDescriptor;
+import org.codehaus.jackson.JsonGenerator;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.JsonParser;
+import org.codehaus.jackson.JsonToken;
+import org.codehaus.jackson.smile.SmileFactory;
+import org.codehaus.jackson.smile.SmileGenerator;
+import org.codehaus.jackson.smile.SmileParser;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+/**
+ * Provide ascii text parsing and formatting support for proto2 instances. The implementation
+ * largely follows google/protobuf/text_format.cc.
+ * <p>
+ * (c) 2011 Neustar, Inc. All Rights Reserved.
+ *
+ * @author jeffrey.damick@neustar.biz Jeffrey Damick
+ *         Based on the original code by:
+ * @author eliran.bivas@gmail.com Eliran Bivas
+ * @author aantonov@orbitz.com Alex Antonov
+ *         <p/>
+ * @author wenboz@google.com Wenbo Zhu
+ * @author kenton@google.com Kenton Varda
+ */
+public class SmileFormat {
+    private static SmileFactory smileFactory = new SmileFactory();
+	
+		
+    /**
+     * Outputs a Smile representation of the Protocol Message supplied into the parameter output.
+     * (This representation is the new version of the classic "ProtocolPrinter" output from the
+     * original Protocol Buffer system)
+     */
+    public static void print(Message message, OutputStream output) throws IOException {
+        JsonGenerator generator = createGenerator(output);
+    	print(message, generator);
+    	generator.close();
+    }
+    
+    /**
+     * Outputs a Smile representation of the Protocol Message supplied into the parameter output.
+     * (This representation is the new version of the classic "ProtocolPrinter" output from the
+     * original Protocol Buffer system)
+     */
+    public static void print(Message message, JsonGenerator generator) throws IOException {
+    	generator.writeStartObject();
+    	printMessage(message, generator);
+        generator.writeEndObject();
+        generator.flush();
+    }
+
+    /**
+     * Outputs a Smile representation of {@code fields} to {@code output}.
+     */
+    public static void print(UnknownFieldSet fields, OutputStream output) throws IOException {
+    	JsonGenerator generator = createGenerator(output);
+    	generator.writeStartObject();
+    	printUnknownFields(fields, generator);
+        generator.writeEndObject();
+        generator.close();
+    }
+    
+    
+    
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     */
+    public static void merge(InputStream input, Message.Builder builder) throws IOException {
+        merge(input, ExtensionRegistry.getEmptyRegistry(), builder);
+    }
+
+        
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
+     * @throws IOException 
+     */
+    public static void merge(InputStream input,
+                             ExtensionRegistry extensionRegistry,
+                             Message.Builder builder) throws IOException {
+    	
+    	SmileParser parser = smileFactory.createJsonParser(input); 
+    	merge(parser, extensionRegistry, builder);
+    }
+    
+    /**
+     * Parse a text-format message from {@code input} and merge the contents into {@code builder}.
+     * Extensions will be recognized if they are registered in {@code extensionRegistry}.
+     * @throws IOException 
+     */
+    public static void merge(JsonParser parser,                 
+    						 ExtensionRegistry extensionRegistry,
+                             Message.Builder builder) throws IOException {
+    	
+        JsonToken token = parser.nextToken();
+        if (token.equals(JsonToken.START_OBJECT)) {
+        	token = parser.nextToken();
+        }
+        while (token != null && !token.equals(JsonToken.END_OBJECT)) {
+        	mergeField(parser, extensionRegistry, builder);
+        	token = parser.nextToken();
+        }
+        
+        // Test to make sure the tokenizer has reached the end of the stream.
+        if (parser.nextToken() != null) {
+            throw new RuntimeException("Expecting the end of the stream, but there seems to be more data!  Check the input for a valid JSON format.");
+        }
+    }
+    
+    
+    
+    protected static JsonGenerator createGenerator(OutputStream output) throws IOException {
+    	SmileGenerator generator = smileFactory.createJsonGenerator(output);
+    	generator.enable(SmileGenerator.Feature.WRITE_HEADER);
+    	generator.enable(SmileGenerator.Feature.WRITE_END_MARKER);
+    	return generator;
+    }
+
+    
+    protected static void printMessage(Message message, JsonGenerator generator) throws IOException {
+
+        for (Iterator<Map.Entry<FieldDescriptor, Object>> iter = message.getAllFields().entrySet().iterator(); iter.hasNext();) {
+            Map.Entry<FieldDescriptor, Object> field = iter.next();
+            printField(field.getKey(), field.getValue(), generator);
+        }
+        printUnknownFields(message.getUnknownFields(), generator);
+    }
+
+    public static void printField(FieldDescriptor field, Object value, JsonGenerator generator) throws IOException {
+
+        printSingleField(field, value, generator);
+    }
+
+    private static void printSingleField(FieldDescriptor field,
+                                         Object value,
+                                         JsonGenerator generator) throws IOException {
+        if (field.isExtension()) {
+            // We special-case MessageSet elements for compatibility with proto1.
+            if (field.getContainingType().getOptions().getMessageSetWireFormat()
+                && (field.getType() == FieldDescriptor.Type.MESSAGE) && (field.isOptional())
+                // object equality
+                && (field.getExtensionScope() == field.getMessageType())) {
+                generator.writeFieldName(field.getMessageType().getFullName());
+            } else {
+            	// extensions will have '.' in them, while normal fields wont..
+            	generator.writeFieldName(field.getFullName());
+            }
+        } else {
+            if (field.getType() == FieldDescriptor.Type.GROUP) {
+                // Groups must be serialized with their original capitalization.
+                generator.writeFieldName(field.getMessageType().getName());
+            } else {
+                generator.writeFieldName(field.getName());
+            }
+        }
+
+        // Done with the name, on to the value
+        if (field.isRepeated()) {
+            // Repeated field. Print each element.
+            generator.writeStartArray();
+            for (Iterator<?> iter = ((List<?>) value).iterator(); iter.hasNext();) {
+                printFieldValue(field, iter.next(), generator);
+            }
+            generator.writeEndArray();
+        } else {
+            printFieldValue(field, value, generator);
+        }
+    }
+
+    private static void printFieldValue(FieldDescriptor field, Object value, JsonGenerator generator) throws IOException {
+    	// TODO: look at using field.getType().getJavaType(), to simplify this..
+    	switch (field.getType()) {
+            case INT32:
+            case SINT32:
+            case SFIXED32:
+            	generator.writeNumber((Integer)value);
+            	break;
+            
+            case INT64:
+            case SINT64:
+            case SFIXED64:
+            	generator.writeNumber((Long)value);
+            	break;
+            	
+            case FLOAT:
+            	generator.writeNumber((Float)value);
+            	break;
+            	
+            case DOUBLE:
+            	generator.writeNumber((Double)value);
+            	break;
+            	
+            case BOOL:
+                // Good old toString() does what we want for these types.
+                generator.writeBoolean((Boolean)value);
+                break;
+
+            case UINT32:
+            case FIXED32:
+                generator.writeNumber(unsignedInt((Integer) value));
+                break;
+
+            case UINT64:
+            case FIXED64:
+                generator.writeNumber(unsignedLong((Long) value));
+                break;
+
+            case STRING:
+            	generator.writeString((String) value);
+                break;
+
+            case BYTES: {
+            	// Here we break with JsonFormat - since there is an issue with non-utf8 bytes..
+            	generator.writeBinary(((ByteString)value).toByteArray());
+                break;
+            }
+
+            case ENUM: {
+            	generator.writeString(((EnumValueDescriptor) value).getName());
+                break;
+            }
+
+            case MESSAGE:
+            case GROUP:
+            	generator.writeStartObject();
+                printMessage((Message) value, generator);
+                generator.writeEndObject();
+                break;
+        }
+    }
+
+    protected static void printUnknownFields(UnknownFieldSet unknownFields, JsonGenerator generator) throws IOException {
+        for (Map.Entry<Integer, UnknownFieldSet.Field> entry : unknownFields.asMap().entrySet()) {
+            UnknownFieldSet.Field field = entry.getValue();
+            
+            generator.writeArrayFieldStart(entry.getKey().toString());
+            for (long value : field.getVarintList()) {
+                generator.writeNumber(value);
+            }
+            for (int value : field.getFixed32List()) {
+                generator.writeNumber(value);
+            }
+            for (long value : field.getFixed64List()) {
+                generator.writeNumber(value);
+            }
+            for (ByteString value : field.getLengthDelimitedList()) {
+            	// here we break with the JsonFormat to support non-utf8 bytes
+            	generator.writeBinary(value.toByteArray());
+            }
+            for (UnknownFieldSet value : field.getGroupList()) {
+                generator.writeStartObject();
+                printUnknownFields(value, generator);
+                generator.writeEndObject();
+            }
+            generator.writeEndArray();
+        }
+    }
+
+
+
+    // =================================================================
+    // Parsing
+   
+    private static final Pattern DIGITS = Pattern.compile(
+          "[0-9]",
+          Pattern.CASE_INSENSITIVE);
+
+    /**
+     * Parse a single field from {@code parser} and merge it into {@code builder}. If a ',' is
+     * detected after the field ends, the next field will be parsed automatically
+     * @throws IOException 
+     * @throws JsonParseException 
+     */
+    protected static void mergeField(JsonParser parser,
+                                   ExtensionRegistry extensionRegistry,
+                                   Message.Builder builder) throws JsonParseException, IOException {
+        FieldDescriptor field = null;
+        Descriptor type = builder.getDescriptorForType();
+        boolean unknown = false;
+        ExtensionRegistry.ExtensionInfo extension = null;
+        JsonToken token = parser.getCurrentToken();
+
+        if (token != null) {
+            String name = parser.getCurrentName();
+            
+            if (name.contains(".")) {
+            	// should be an extension
+            	extension = extensionRegistry.findExtensionByName(name);
+                if (extension == null) {
+                    throw new RuntimeException("Extension \""
+                    		+ name + "\" not found in the ExtensionRegistry.");
+                } else if (extension.descriptor.getContainingType() != type) {
+                    throw new RuntimeException("Extension \"" + name
+                    		+ "\" does not extend message type \""
+                    		+ type.getFullName() + "\".");
+                }
+
+            	field = extension.descriptor;
+            } else {
+            	field = type.findFieldByName(name);
+            }
+
+            // Group names are expected to be capitalized as they appear in the
+            // .proto file, which actually matches their type names, not their field
+            // names.
+            if (field == null) {
+                // Explicitly specify US locale so that this code does not break when
+                // executing in Turkey.
+                String lowerName = name.toLowerCase(Locale.US);
+                field = type.findFieldByName(lowerName);
+                // If the case-insensitive match worked but the field is NOT a group,
+                if ((field != null) && (field.getType() != FieldDescriptor.Type.GROUP)) {
+                    field = null;
+                }
+            }
+            // Again, special-case group names as described above.
+            if ((field != null) && (field.getType() == FieldDescriptor.Type.GROUP)
+                && !field.getMessageType().getName().equals(name)
+                && !field.getMessageType().getFullName().equalsIgnoreCase(name) /* extension */) {
+                field = null;
+            }
+
+            // Last try to lookup by field-index if 'name' is numeric,
+            // which indicates a possible unknown field
+            if (field == null && DIGITS.matcher(name).matches()) {
+                field = type.findFieldByNumber(Integer.parseInt(name));
+                unknown = true;
+            }
+
+            // no throwing exceptions if field not found, since it could be a different version.
+            if (field == null) {
+            	UnknownFieldSet.Builder unknownsBuilder = UnknownFieldSet.newBuilder();
+            	handleMissingField(name, parser, extensionRegistry, unknownsBuilder);
+            	builder.setUnknownFields(unknownsBuilder.build());
+            }
+        }
+
+        if (field != null) {
+        	token = parser.nextToken();
+        	
+            boolean array = token.equals(JsonToken.START_ARRAY);
+
+            if (array) {
+            	token = parser.nextToken();
+                while (!token.equals(JsonToken.END_ARRAY)) {
+                    handleValue(parser, extensionRegistry, builder, field, extension, unknown);
+                    token = parser.nextToken();
+                }
+            } else {
+                handleValue(parser, extensionRegistry, builder, field, extension, unknown);
+            }
+        }
+    }
+
+    private static void handleMissingField(String fieldName, JsonParser parser,
+                                           ExtensionRegistry extensionRegistry,
+                                           UnknownFieldSet.Builder builder) throws IOException {
+    	
+        JsonToken token = parser.nextToken();
+        if (token.equals(JsonToken.START_OBJECT)) {
+            // Message structure
+        	token = parser.nextToken(); // skip name
+        	while (token != null && !token.equals(JsonToken.END_OBJECT)) {
+                handleMissingField(fieldName, parser, extensionRegistry, builder);
+                token = parser.nextToken(); // get } or field name
+            }
+        } else if (token.equals(JsonToken.START_ARRAY)) {
+            // Collection
+            do {
+                handleMissingField(fieldName, parser, extensionRegistry, builder);
+                token = parser.getCurrentToken(); // got value or ]
+            } while (token != null && !token.equals(JsonToken.END_ARRAY));
+        } else {
+            // Primitive value
+        	// NULL, INT, BOOL, STRING
+        	// nothing to do..
+        }
+    }
+
+    private static void handleValue(JsonParser parser,
+                                    ExtensionRegistry extensionRegistry,
+                                    Message.Builder builder,
+                                    FieldDescriptor field,
+                                    ExtensionRegistry.ExtensionInfo extension,
+                                    boolean unknown) throws IOException {
+
+        Object value = null;
+        if (field.getJavaType() == FieldDescriptor.JavaType.MESSAGE) {
+            value = handleObject(parser, extensionRegistry, builder, field, extension, unknown);
+        } else {
+            value = handlePrimitive(parser, field);
+        }
+        if (value != null) {
+            if (field.isRepeated()) {
+                builder.addRepeatedField(field, value);
+            } else {
+                builder.setField(field, value);
+            }
+        }
+    }
+
+    private static Object handlePrimitive(JsonParser parser, FieldDescriptor field) throws IOException {
+        Object value = null;
+        
+        JsonToken token = parser.getCurrentToken();
+        
+        if (token.equals(JsonToken.VALUE_NULL)) {
+            return value;
+        }
+        
+        switch (field.getType()) {
+            case INT32:
+            case SINT32:
+            case SFIXED32:
+            	value = parser.getIntValue();
+                break;
+
+            case INT64:
+            case SINT64:
+            case SFIXED64:
+            	value = parser.getLongValue();
+                break;
+
+            case UINT32:
+            case FIXED32:
+            	int valueInt = parser.getIntValue();
+            	if (valueInt < 0) {
+            		throw new NumberFormatException("Number must be positive: " + valueInt);
+            	}
+            	value = valueInt;
+                break;
+
+            case UINT64:
+            case FIXED64:
+            	long valueLong = parser.getLongValue();
+            	if (valueLong < 0) {
+            		throw new NumberFormatException("Number must be positive: " + valueLong);
+            	}
+            	value = valueLong;
+                break;
+
+            case FLOAT:
+            	value = parser.getFloatValue();
+                break;
+
+            case DOUBLE:
+            	value = parser.getDoubleValue();
+                break;
+
+            case BOOL:
+            	value = parser.getBooleanValue();
+                break;
+
+            case STRING:
+            	value = parser.getText();
+                break;
+
+            case BYTES:
+            	value = ByteString.copyFrom(parser.getBinaryValue());
+                break;
+
+            case ENUM: {
+                EnumDescriptor enumType = field.getEnumType();
+                if (token.equals(JsonToken.VALUE_NUMBER_INT)) {
+                    int number = parser.getIntValue();
+                    value = enumType.findValueByNumber(number);
+                    if (value == null) {
+                        throw new RuntimeException("Enum type \""
+                        		+ enumType.getFullName()
+                        		+ "\" has no value with number "
+                        		+ number + ".");
+                    }
+                } else {
+                    String id = parser.getText();
+                    value = enumType.findValueByName(id);
+                    if (value == null) {
+                    	throw new RuntimeException("Enum type \""
+                    			+ enumType.getFullName()
+                    			+ "\" has no value named \""
+                    			+ id + "\".");
+                    }
+                }
+                break;
+            }
+
+            case MESSAGE:
+            case GROUP:
+                throw new RuntimeException("Can't get here.");
+        }
+        return value;
+    }
+    
+
+    private static Object handleObject(JsonParser parser,
+                                       ExtensionRegistry extensionRegistry,
+                                       Message.Builder builder,
+                                       FieldDescriptor field,
+                                       ExtensionRegistry.ExtensionInfo extension,
+                                       boolean unknown) throws IOException {
+
+        Message.Builder subBuilder;
+        if (extension == null) {
+            subBuilder = builder.newBuilderForField(field);
+        } else {
+            subBuilder = extension.defaultInstance.newBuilderForType();
+        }
+
+        JsonToken token = parser.getCurrentToken();
+
+        if (unknown) {
+        	ByteString data = ByteString.copyFrom(parser.getBinaryValue());
+            try {
+                subBuilder.mergeFrom(data);
+                return subBuilder.build();
+            } catch (InvalidProtocolBufferException e) {
+                throw new RuntimeException("Failed to build " + field.getFullName() + " from " + data);
+            }
+        }
+
+        //token = parser.nextToken();
+        if (token.equals(JsonToken.START_OBJECT)) {
+	        token = parser.nextToken();
+	        while (token != null && !token.equals(JsonToken.END_OBJECT)) {
+	            mergeField(parser, extensionRegistry, subBuilder);
+	            token = parser.nextToken();
+	        }
+        }
+        return subBuilder.build();
+    }
+
+    // =================================================================
+    // Utility functions
+    //
+    // Some of these methods are package-private because Descriptors.java uses
+    // them.
+    
+    /**
+     * Convert an unsigned 32-bit integer to a string.
+     */
+    private static Integer unsignedInt(int value) {
+        if (value < 0) {
+            return (int) ((value) & 0x00000000FFFFFFFFL);
+        }
+        return value;
+    }
+
+    /**
+     * Convert an unsigned 64-bit integer to a string.
+     */
+    private static Long unsignedLong(long value) {
+        if (value < 0) {
+            // Pull off the most-significant bit so that BigInteger doesn't think
+            // the number is negative, then set it again using setBit().
+            return BigInteger.valueOf(value & 0x7FFFFFFFFFFFFFFFL).setBit(63).longValue();
+        }
+        return value;
+    }
+}

文件差異過大導致無法顯示
+ 1333 - 0
gis_common/src/main/java/com/gis/common/proto/format/XmlFormat.java


+ 219 - 0
gis_common/src/main/java/com/gis/common/proto/util/ConvertUtils.java

@@ -0,0 +1,219 @@
+package com.gis.common.proto.util;
+
+import com.gis.common.proto.Visionmodeldata;
+import com.gis.common.proto.format.JsonFormat;
+import lombok.extern.log4j.Log4j2;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+@Log4j2
+public class ConvertUtils {
+
+    public static void convertVisionModelDataToTxt(String srcPath, String desPath) throws Exception {
+
+        BufferedOutputStream bos = null;
+        BufferedInputStream bis = null;
+        try {
+            File file = new File(srcPath);
+            FileInputStream fis = new FileInputStream(file);
+
+            Visionmodeldata.NavigationInfo data_NavigationInfo = Visionmodeldata.NavigationInfo.parseFrom(fis);
+
+            String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
+            ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());
+            bos = new BufferedOutputStream(new FileOutputStream(desPath));//设置输出路径
+            bis = new BufferedInputStream(stream);
+            int b = -1;
+            while ((b = bis.read()) != -1) {
+                bos.write(b);
+            }
+            //out.close();
+            bis.close();
+            bos.close();
+        } catch (Exception e) {
+            StringWriter trace = new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        } finally {
+            if (bos != null) {
+                bos.close();
+            }
+            if (bis != null) {
+                bis.close();
+            }
+        }
+    }
+
+    public static void convertTxtToVisionModelData(String srcPath, String desPath) throws Exception {
+        BufferedOutputStream bos = null;
+        BufferedInputStream bis = null;
+        try {
+            Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
+            String jsonFormat = readTxtFileToJson(srcPath);
+            JsonFormat.merge(jsonFormat, builder);
+            byte[] buf = builder.build().toByteArray();
+
+            //把序列化后的数据写入本地磁盘
+            ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+            bos = new BufferedOutputStream(new FileOutputStream(desPath));//设置输出路径
+            bis = new BufferedInputStream(stream);
+            int b = -1;
+            while ((b = bis.read()) != -1) {
+                bos.write(b);
+            }
+            bis.close();
+            bos.close();
+        } catch (Exception e) {
+            StringWriter trace = new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        } finally {
+            if (bos != null) {
+                bos.close();
+            }
+            if (bis != null) {
+                bis.close();
+            }
+        }
+    }
+
+    public static String readTxtFileToJson(String filePath) {
+        try {
+            String encoding = "UTF-8";
+            File file = new File(filePath);
+            if (file.isFile() && file.exists()) {
+                InputStreamReader read = new InputStreamReader(
+                        new FileInputStream(file), encoding);
+                BufferedReader bufferedReader = new BufferedReader(read);
+                String lineTxt = null;
+                String result = "";
+                while ((lineTxt = bufferedReader.readLine()) != null) {
+                    result += lineTxt;
+                }
+                read.close();
+                return result;
+            } else {
+                return null;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+
+    public List<List<String>> descartes(List<List<String>> dimValue) {
+        List<List<String>> res = new ArrayList<>();
+        if (dimValue == null || dimValue.size() == 0)
+            return res;
+        backtrace(dimValue, 0, res, new ArrayList<>());
+        return res;
+
+    }
+
+    /**
+     * 递归回溯法求解
+     *
+     * @param dimValue 原始数据集合
+     * @param index 当前执行的集合索引
+     * @param result 结果集合
+     * @param curList 当前的单个结果集
+     */
+    private void backtrace(List<List<String>> dimValue, int index,
+                           List<List<String>> result, List<String> curList) {
+
+        if (curList.size() == dimValue.size())
+            result.add(new ArrayList<>(curList));
+        else
+            for (int j = 0; j < dimValue.get(index).size(); j++) {
+                curList.add(dimValue.get(index).get(j));
+                backtrace(dimValue, index + 1, result, curList);
+                curList.remove(curList.size() - 1);
+            }
+
+    }
+
+    public static void main(String[] args) {
+        List<String> list1 = new ArrayList<String>();
+        list1.add("普通会员");
+        list1.add("专业会员");
+        list1.add("商业会员");
+        List<String> list2 = new ArrayList<String>();
+        list2.add("1G");
+        list2.add("1T");
+        List<List<String>> dimValue = new ArrayList<List<String>>();
+        dimValue.add(list1);
+        dimValue.add(list2);
+
+        // 递归实现笛卡尔积
+        ConvertUtils s = new ConvertUtils();
+        List<List<String>> res = s.descartes(dimValue);
+        System.out.println("递归实现笛卡尔乘积: 共 " + res.size() + " 个结果");
+        for (List<String> list : res) {
+            for (String string : list) {
+                System.out.print(string + " ");
+            }
+            System.out.println();
+        }
+    }
+
+//    public static void convertTxtToVisionmodeldata(String srcpath,String despath)throws Exception
+//    {
+//        try
+//        {
+//            Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
+//            String jsonFormat = readTxtFileToJson(srcpath);
+//            JsonFormat.merge(jsonFormat, builder);
+//            byte[] buf= builder.build().toByteArray();
+//
+//            //把序列化后的数据写入本地磁盘
+//            ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+//            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
+//            BufferedInputStream bis = new BufferedInputStream(stream);
+//            int b = -1;
+//            while ((b = bis.read()) != -1) {
+//                bos.write(b);
+//            }
+//            bis.close();
+//            bos.close();
+//        }
+//        catch(Exception e)
+//        {
+//            StringWriter trace=new StringWriter();
+//            e.printStackTrace(new PrintWriter(trace));
+//            log.error(trace.toString());
+//        }
+//    }
+
+//    public static void convertVisionmodeldataToTxt(String srcpath,String despath)throws Exception
+//    {
+//        try
+//        {
+//            File file = new File(srcpath);
+//            FileInputStream fis=new FileInputStream(file);
+//
+//            Visionmodeldata.NavigationInfo data_NavigationInfo = Visionmodeldata.NavigationInfo.parseFrom(fis);
+//
+//            //PrintStream out = new PrintStream(despath);
+//            String jsonFormat1 = JsonFormat.printToString(data_NavigationInfo);
+//            ByteArrayInputStream stream = new ByteArrayInputStream(jsonFormat1.getBytes());
+//            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
+//            BufferedInputStream bis = new BufferedInputStream(stream);
+//            int b = -1;
+//            while ((b = bis.read()) != -1) {
+//                bos.write(b);
+//            }
+//            //out.close();
+//            bis.close();
+//            bos.close();
+//        }
+//        catch(Exception e)
+//        {
+//            StringWriter trace=new StringWriter();
+//            e.printStackTrace(new PrintWriter(trace));
+//            log.error(trace.toString());
+//        }
+//    }
+}

+ 234 - 0
gis_common/src/main/java/com/gis/common/proto/util/CreateObjUtil.java

@@ -0,0 +1,234 @@
+package com.gis.common.proto.util;
+
+import com.gis.common.proto.BigSceneProto;
+import com.gis.common.proto.Common;
+import com.gis.common.proto.Visionmodeldata;
+import com.gis.common.proto.constant.ConstantCmd;
+import com.gis.common.proto.constant.ConstantFileName;
+import com.gis.common.proto.format.JsonFormat;
+import com.google.protobuf.TextFormat;
+import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+
+import java.io.*;
+
+/**
+ * Created by Owen on 2019/12/17 0017 11:40
+ *
+ * 3d模型数据转换工具类
+ */
+@Log4j2
+public class CreateObjUtil {
+
+
+    /**
+     * 调用算法 xx.sh 脚本
+     * @param command
+     */
+    public static void callshell(String command){
+        try {
+            Process process = Runtime.getRuntime().exec(command);
+            StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
+            errorGobbler.start();
+            StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");
+            outGobbler.start();
+            process.waitFor();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * txt to dam
+     * @param srcpath txt 地址
+     * @param despath 生成dam地址
+     * @throws Exception
+     */
+    public static void convertTxtToDam(String srcpath,String despath)throws Exception
+    {
+        try
+        {
+            BigSceneProto.binary_mesh.Builder builder= BigSceneProto.binary_mesh.newBuilder();
+            InputStream inputStream = new FileInputStream(srcpath);
+            InputStreamReader reader = new InputStreamReader(inputStream, "ASCII");
+            TextFormat.merge(reader, builder);
+            byte[] buf= builder.build().toByteArray();
+
+
+            //把序列化后的数据写入本地磁盘
+            ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
+            BufferedInputStream bis = new BufferedInputStream(stream);
+            int b = -1;
+            while ((b = bis.read()) != -1) {
+                bos.write(b);
+            }
+            bis.close();
+            bos.close();
+        }
+        catch(Exception e)
+        {
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        }
+    }
+
+
+    public static void convertDamToLzma(String folderName)throws Exception {
+        log.info("folderName: {}", folderName);
+        try {
+            String command = "lzma "+ folderName + ConstantFileName.modelUUID+"_50k.dam";
+            log.info("开始转换lzma :{}", command );
+            callshell(command);
+            log.info("转换lzma完毕");
+        }
+        catch(Exception e)
+        {
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        }
+
+    }
+
+
+    /**
+     * vision.txt转vision.modeldata
+     * @param srcpath
+     * @param despath
+     * @throws Exception
+     */
+    public static void convertTxtToVisionmodeldata(String srcpath,String despath)throws Exception
+    {
+        try
+        {
+            Visionmodeldata.NavigationInfo.Builder builder = Visionmodeldata.NavigationInfo.newBuilder();
+            String jsonFormat = readTxtFileToJson(srcpath);
+            JsonFormat.merge(jsonFormat, builder);
+            byte[] buf= builder.build().toByteArray();
+
+            //把序列化后的数据写入本地磁盘
+            ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
+            BufferedInputStream bis = new BufferedInputStream(stream);
+            int b = -1;
+            while ((b = bis.read()) != -1) {
+                bos.write(b);
+            }
+            bis.close();
+            bos.close();
+        }
+        catch(Exception e)
+        {
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        }
+    }
+
+    public static String readTxtFileToJson(String filePath){
+        try {
+            String encoding="UTF-8";
+            File file=new File(filePath);
+            if(file.isFile() && file.exists()){
+                InputStreamReader read = new InputStreamReader(
+                        new FileInputStream(file),encoding);
+                BufferedReader bufferedReader = new BufferedReader(read);
+                String lineTxt = null;
+                String result="";
+                while((lineTxt = bufferedReader.readLine()) != null){
+                    result+=lineTxt;
+                    //log.info(lineTxt);
+                }
+                read.close();
+                return result;
+            }else{
+                return null;
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+
+    }
+
+    //开始建模
+    public static void build3dModel(String folderName,String isModel) throws Exception{
+        log.info("开始建模");
+        String command = ConstantCmd.BUILD_MODEL_COMMAND+folderName;
+        // cmd: bash /home/ubuntu/bin/Launcher.sh /data/kanfang/10002/pano
+        log.info("cmd: {}",command);
+        callshell(command);
+        log.info("计算完毕:" + command);
+    }
+
+    public static void convertTxtToVisionmodeldataCommon(String srcpath,String despath)throws Exception
+    {
+        try
+        {
+            Common.NavigationInfo.Builder builder = Common.NavigationInfo.newBuilder();
+            String jsonFormat = readTxtFileToJson(srcpath);
+            log.warn("jsonFormat: {}", jsonFormat);
+
+            // 临时处理,等算法处理好这个问题,可以删除此方法
+            jsonFormat = deviceJson(jsonFormat);
+
+            JsonFormat.merge(jsonFormat, builder);
+            byte[] buf= builder.build().toByteArray();
+
+            //把序列化后的数据写入本地磁盘
+            ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(despath));//设置输出路径
+            BufferedInputStream bis = new BufferedInputStream(stream);
+            int b = -1;
+            while ((b = bis.read()) != -1) {
+                bos.write(b);
+            }
+            bis.close();
+            bos.close();
+        }
+        catch(Exception e)
+        {
+            StringWriter trace=new StringWriter();
+            e.printStackTrace(new PrintWriter(trace));
+            log.error(trace.toString());
+        }
+    }
+
+
+    private static String deviceJson(String str) {
+        String rep = "\"device\":vision_\\d,";
+        if (str.contains("\"device\":vision")) {
+            log.warn("device 临时特殊处理一下");
+            str = StringUtils.replaceAll(str, rep, "");
+        }
+        log.info("update json: {}", str);
+        return str;
+    }
+
+    public static void main(String[] args) {
+
+        String path = "F:\\test\\army\\convert\\";
+        try {
+            convertTxtToVisionmodeldata(path+"vision.txt", path+"vision.modeldata");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    @Test
+    public void modelDataTxtToDamTest(){
+        String path = "F:\\test\\army\\convert\\";
+//        ConstantFileName.modelUUID+"_50k.dam"
+        try {
+            convertTxtToDam(path+"test.txt", path+ConstantFileName.modelUUID+"_50k.dam");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

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

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

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

@@ -0,0 +1,235 @@
+package com.gis.common.util;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
+import com.aliyun.oss.model.OSSObjectSummary;
+import com.aliyun.oss.model.ObjectListing;
+import com.aliyun.oss.model.PutObjectResult;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 阿里云oss工具类
+ */
+@Slf4j
+public class AliyunOssUtil {
+
+
+    private static final String END_POINT = "http://oss-cn-shenzhen.aliyuncs.com";
+	private static final String ACCESS_KEY_ID = "LTAIUrvuHqj8pvry";
+	private static final String ACCESS_KEY_SECREY = "JLOVl0k8Ke0aaM8nLMMiUAZ3EiiqI4";
+	private static final String BUCKET_NAME = "4dkankan";
+
+	// 加载对象
+	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();
+//		}
+//	}
+
+}

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

@@ -0,0 +1,210 @@
+package com.gis.common.util;
+
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.img.ImgUtil;
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.lang.Validator;
+import cn.hutool.core.util.URLUtil;
+import com.gis.common.exception.BaseRuntimeException;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.Test;
+import org.springframework.util.ResourceUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
+/**
+ * Created by owen on 2020/5/12 0012 17:21
+ */
+@Slf4j
+public class FileUtils {
+
+
+    /**
+     * 多文件上传
+     * savePath 路径(目录)
+     */
+    public static List<Map<String, String>> uploads(MultipartFile[] files, String savePath) throws IOException {
+        if (files == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+        savePath = savePath + time + File.separator;
+        FileUtil.mkdir(time);
+
+        ArrayList<Map<String, String>> list = new ArrayList<>();
+
+        String path;
+        int i = 0;
+        for (MultipartFile file : files) {
+            String fileName = file.getOriginalFilename();
+            String suffix = StringUtils.substringAfterLast(fileName, ".");
+            suffix = StringUtils.lowerCase(suffix);
+            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 HashMap<String, String> upload(MultipartFile file, String savePath) throws IOException {
+        if (file == null) {
+            log.error("文件不能为空");
+            return null;
+        }
+
+        String time = DateUtil.format(new Date(), "yyyyMMdd_HHmmssSSS");
+
+        String fileName = file.getOriginalFilename();
+
+//        if (Validator.hasChinese(fileName)) {
+//            log.error("文件名不能有中文字符: {}", fileName);
+//            throw new BaseRuntimeException("文件名不能有中文字符:" + fileName);
+//        }
+
+        String suffix = StringUtils.substringAfterLast(fileName, ".");
+
+        suffix = StringUtils.lowerCase(suffix);
+
+        String newName = time  + "."  +suffix;
+        savePath = savePath  + newName;
+
+        FileUtil.writeFromStream(file.getInputStream(), savePath);
+        HashMap<String, String> fileInfo = new HashMap<>();
+
+        fileInfo.put("path", savePath);
+        fileInfo.put("name", fileName);
+        fileInfo.put("newName", newName);
+
+        return fileInfo;
+
+    }
+
+
+    /**
+     * 根据路径写入文件,适合oss
+     * @param inPath 网络输入路径
+     * @param outPath 保存文件路径
+     * @throws IOException
+     */
+    public static void fielWrite(String inPath, String outPath) throws IOException {
+        InputStream in = URLUtil.getStream(new URL(inPath));
+        FileUtil.writeFromStream(in, outPath);
+    }
+
+
+    /**
+     * 获取文件资源路径
+     * 这方法,测试时是用当前类路径,当打包成jar包时时,会变成跟目录下。所以要把资源文件放入口类的资源文件夹
+     * @param filePath 文件路径
+     * @return
+     * @throws IOException
+     */
+    public static String getResourceUrl(String filePath) throws IOException {
+        String path = ResourceUtils.getURL("classpath:").getPath();
+        path = path + filePath;
+        return path;
+    }
+
+    @Test
+    public void test(){
+        String a = "aaaa.JPG";
+
+        String s = StringUtils.substringAfterLast(a, ".");
+
+        System.out.println(StringUtils.lowerCase(s));
+    }
+
+
+    public static void main(String[] args) {
+        batchThumb();
+    }
+
+    public static void batchThumb(){
+        String base = "C:\\Users\\4dage\\Desktop\\army_doc\\img\\";
+
+        String path = null;
+        String savePath = null;
+        for (int i = 1; i < 2 ; i++) {
+            path = base + i + ".png";
+            log.info("path: {}", path);
+            savePath = base + "thumb\\thumb_" + i + ".png";
+            createThumb(path, savePath);
+        }
+    }
+
+
+    private static String createThumb(String filePath, String savePath){
+        ImgUtil.scale(FileUtil.file(filePath), FileUtil.file(savePath), 0.2f);
+
+        return null;
+    }
+
+
+    /**
+     * @param fileName 文件名
+     * @return 文件的type
+     */
+    public static String getFileType(String fileName) {
+        log.info("getContentType:" + fileName);
+        // 文件的后缀名
+        String fileExtension = fileName.substring(fileName.lastIndexOf("."));
+        if (".bmp".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".gif".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".jpeg".equalsIgnoreCase(fileExtension) || ".jpg".equalsIgnoreCase(fileExtension)
+                || ".png".equalsIgnoreCase(fileExtension)) {
+            return "image";
+        }
+        if (".txt".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        if (".mp4".equalsIgnoreCase(fileExtension)) {
+            return "video";
+        }
+        if (".4dage".equalsIgnoreCase(fileExtension)) {
+            return "model";
+        }
+
+        if (".ppt".equalsIgnoreCase(fileExtension) || "pptx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        if (".xls".equalsIgnoreCase(fileExtension) || "xlsx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        if (".doc".equalsIgnoreCase(fileExtension) || "docx".equalsIgnoreCase(fileExtension)) {
+            return "doc";
+        }
+        // 默认返回类型
+        return "image";
+    }
+}

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

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

@@ -0,0 +1,20 @@
+package com.gis.common.util;
+
+public class RegexUtil {
+    //specific symbol
+
+    /** 处理特殊符号,变空值*/
+    public static String specificSymbol(String str){
+
+        String regEx = "[\\s`~!@#$%^&*()+=|{}':;\\[\\]<>/?·~!@#¥%……&*()——+|{}【】‘;:“”。,、?]";
+        return str.replaceAll(regEx, "");
+    }
+
+    public static void main(String[] args) {
+        String str = "我·是 中—国(人), 你-在{干嘛}--哈—哈。 ddd.jpg";
+        System.out.println(specificSymbol(str));
+    }
+
+}
+
+

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

+ 27 - 0
gis_domain/src/main/java/com/gis/domain/dto/AuditDto.java

@@ -0,0 +1,27 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class AuditDto {
+
+    @NotNull(message = "id不能为空")
+    @ApiModelProperty(value = "id" , required = true)
+    private Long id;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @NotNull(message = "类型不能为空")
+    @ApiModelProperty(value = "审核状态:3:审核不通过,4:审核通过" , required = true)
+    private Integer status;
+
+
+}

+ 32 - 0
gis_domain/src/main/java/com/gis/domain/dto/CommentRequest.java

@@ -0,0 +1,32 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class CommentRequest {
+
+//    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+//    private Long id;
+
+    @NotBlank(message = "留言人")
+    @ApiModelProperty(value = "留言人", required = true)
+    private String nickName;
+
+    @NotBlank(message = "留言不能为空")
+    @ApiModelProperty(value = "留言", required = true)
+    private String msg;
+
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+//    @NotNull(message = "显示设置不能为空")
+//    @ApiModelProperty(value = "是否显示,1:是, 0:否", required = true)
+//    private Integer display;
+}

+ 49 - 0
gis_domain/src/main/java/com/gis/domain/dto/FodderDto.java

@@ -0,0 +1,49 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class FodderDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @NotNull(message = "类型不能为空")
+    @ApiModelProperty(value = "类型:1:图片, 2:视频, 3: 模型" , required = true)
+    private Integer type;
+
+//    @ApiModelProperty(value = "文件url")
+//    private String fileUrl;
+//
+//    @ApiModelProperty(value = "文件名称")
+//    private String fileName;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    @NotNull(message = "文件id不能为空")
+    @ApiModelProperty(value = "文件id")
+    private Long fileId;
+
+    @NotNull(message = "所属类别不能为空")
+    @ApiModelProperty(value = "所属类别")
+    private String category;
+
+
+
+
+}

+ 22 - 0
gis_domain/src/main/java/com/gis/domain/dto/FodderPageDto.java

@@ -0,0 +1,22 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class FodderPageDto extends PageDto{
+
+//    @NotBlank(message = "类型不能为空")
+    @ApiModelProperty(value = "类型:1:图片, 2:视频, 3: 模型")
+    private Integer type;
+
+    @ApiModelProperty(value = "所属类别")
+    private String category;
+
+
+}

+ 28 - 0
gis_domain/src/main/java/com/gis/domain/dto/KnowledgeDto.java

@@ -0,0 +1,28 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class KnowledgeDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "标题")
+    private String name;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "知识url")
+    private String knowledgeUrl;
+
+
+}

+ 28 - 0
gis_domain/src/main/java/com/gis/domain/dto/LoginRequest.java

@@ -0,0 +1,28 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 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;
+
+    @NotBlank(message = "from不能为空")
+    @ApiModelProperty(value = "区分用户去向,cms:管理后台,web:展示页")
+    private String from;
+
+
+}

+ 31 - 0
gis_domain/src/main/java/com/gis/domain/dto/MenuRequest.java

@@ -0,0 +1,31 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class MenuRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "名称不能为空")
+    @ApiModelProperty(value = "名称", required = true)
+    private String name;
+
+    @NotNull(message = "排序不能为空")
+    @ApiModelProperty(value = "排序", required = true)
+    private Integer sort;
+
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "类型:1:图片, 2:视频,3:模型, 0:默认类型")
+    private Integer type;
+}

+ 22 - 0
gis_domain/src/main/java/com/gis/domain/dto/NewsPageDateRequest.java

@@ -0,0 +1,22 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class NewsPageDateRequest extends PageDateDto {
+
+    @ApiModelProperty(value = "类型,news:新闻, notice:公告" )
+    private String type;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过, 5:待审核(列表专用)", required = true)
+    private Integer status;
+
+//    @ApiModelProperty(value = "状态,1:审核通过,0:待审核")
+//    private Integer auditStatus;
+
+
+}

+ 50 - 0
gis_domain/src/main/java/com/gis/domain/dto/NewsRequest.java

@@ -0,0 +1,50 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class NewsRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+
+    @NotBlank(message = "类型不能为空")
+    @ApiModelProperty(value = "类型,news:新闻, notice:公告", required = true )
+    private String type;
+
+    @NotBlank(message = "标题不能为空")
+    @ApiModelProperty(value = "标题", required = true )
+    private String title;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @NotNull(message = "显示设置不能为空")
+    @ApiModelProperty(value = "是否显示,1:是, 0:否", required = true)
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @NotBlank(message = "作者不能为空")
+    @ApiModelProperty(value = "作者", required = true)
+    private String author;
+
+}

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

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

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

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

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

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/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;
+}

+ 58 - 0
gis_domain/src/main/java/com/gis/domain/dto/RegisterDto.java

@@ -0,0 +1,58 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ * 游客注册
+ */
+@Data
+public class RegisterDto {
+
+    @NotBlank(message = "真实姓名不能为空")
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+
+    @NotBlank(message = "身份证号(军号)不能为空")
+    @ApiModelProperty(value = "身份证号(军号)", required = true)
+    private String userName;
+
+    @NotBlank(message = "昵称不能为空")
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    @NotNull(message = "性别不能为空")
+    @ApiModelProperty(value = "性别 0:男  1:女")
+    private Integer sex;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+//    @NotBlank(message = "单位不能为空")
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    @Length(min = 6,message = "长度不能小于6位")
+    @Length(max = 12, message = "长度不能大于12位")
+    @ApiModelProperty(value = "登录密码")
+    private String password;
+
+    @Length(min = 6,message = "长度不能小于6位")
+    @Length(max = 12, message = "长度不能大于12位")
+    @ApiModelProperty(value = "确认密码")
+    private String verifyPassword;
+
+
+
+}

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

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class ResetPasswordDto {
+
+    @NotBlank(message = "注册姓名不能为空")
+    @ApiModelProperty(value = "姓名",  required = true)
+    private String realName;
+
+    @NotBlank(message = "身份证号不能为空")
+    @ApiModelProperty(value = "身份证号",  required = true)
+    private String userName;
+}

+ 24 - 0
gis_domain/src/main/java/com/gis/domain/dto/RoamViableDto.java

@@ -0,0 +1,24 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/7/27 0027 16:01
+ *
+ * 漫游可行
+ */
+
+@Data
+public class RoamViableDto {
+
+    @NotBlank(message = "场景码不能为空")
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @NotBlank(message = "漫游数据不能为空")
+    @ApiModelProperty(value = "漫游数据")
+    private String data;
+}

+ 26 - 0
gis_domain/src/main/java/com/gis/domain/dto/RoleAccreditRequest.java

@@ -0,0 +1,26 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+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;
+}

+ 30 - 0
gis_domain/src/main/java/com/gis/domain/dto/RoleRequest.java

@@ -0,0 +1,30 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 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 ;
+}

+ 39 - 0
gis_domain/src/main/java/com/gis/domain/dto/SceneDataDto.java

@@ -0,0 +1,39 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.util.List;
+
+
+/**
+ * Created by Owen on 2019/10/28 0028 12:24
+ *
+ * 编辑场景使用
+ */
+@Data
+public class SceneDataDto {
+
+//    private String name;
+
+    @NotBlank(message = "场景码不能为空")
+    @ApiModelProperty(value = "场景码", required = true)
+    private String sceneCode;
+
+    /** data2.js */
+    private String hots;
+
+    private String guides;
+
+    /** someData.json model */
+    private String info;
+
+    /** data2.js */
+    private String tourAudio;
+
+    /** data2.js 数组*/
+    private String overlays;
+
+
+}

+ 25 - 0
gis_domain/src/main/java/com/gis/domain/dto/ScenePageDto.java

@@ -0,0 +1,25 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+
+/**
+ * Created by Owen on 2020/08/18 0028 12:24
+ *
+ *
+ */
+@Data
+public class ScenePageDto extends PageDto {
+
+
+    @NotBlank(message = "类型不能为空")
+    @ApiModelProperty(value = "类型,in:室内, out:室外", required = true)
+    private String type;
+
+
+
+
+}

+ 36 - 0
gis_domain/src/main/java/com/gis/domain/dto/SlideshowDto.java

@@ -0,0 +1,36 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ *
+ * 轮播图
+ */
+@Data
+public class SlideshowDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "标题不能为空")
+    @ApiModelProperty(value = "标题", required = true )
+    private String title;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+}

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

@@ -0,0 +1,21 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ *
+ * 轮播图
+ */
+@Data
+public class SlideshowPageDateDto extends PageDateDto {
+
+//    @ApiModelProperty(value = "状态,1:审核通过,0:待审核")
+//    private Integer auditStatus;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过, 5:待审核(列表专用)", required = true)
+    private Integer status;
+
+
+}

+ 23 - 0
gis_domain/src/main/java/com/gis/domain/dto/SpiritPageDateDto.java

@@ -0,0 +1,23 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ *
+ * 特有精神
+ */
+@Data
+public class SpiritPageDateDto extends PageDateDto {
+
+//    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过", required = true)
+//    private Integer status;
+//
+//    @ApiModelProperty(value = "状态,1:审核通过,0:待审核")
+//    private Integer auditStatus;
+@ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过, 5:待审核(列表专用)", required = true)
+private Integer status;
+
+
+}

+ 47 - 0
gis_domain/src/main/java/com/gis/domain/dto/SpiritRequest.java

@@ -0,0 +1,47 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class
+SpiritRequest {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "标题不能为空")
+    @ApiModelProperty(value = "标题", required = true )
+    private String title;
+
+    @ApiModelProperty(value = "归属单位")
+    private String unit;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @NotNull(message = "显示设置不能为空")
+    @ApiModelProperty(value = "是否显示,1:是, 0:否", required = true)
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @NotBlank(message = "作者不能为空")
+    @ApiModelProperty(value = "作者", required = true)
+    private String author;
+
+
+}

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

@@ -0,0 +1,62 @@
+package com.gis.domain.dto;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/28 0028 16:36
+ */
+@Data
+public class UserDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+
+//    @NotBlank(message = "真实姓名不能为空")
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+
+    @NotBlank(message = "管理员账号不能为空")
+    @ApiModelProperty(value = "管理员账号", required = true)
+    private String userName;
+
+//    @NotBlank(message = "昵称不能为空")
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+//    @NotNull(message = "性别不能为空")
+    @ApiModelProperty(value = "性别 0:男  1:女")
+    private Integer sex;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+//    @NotBlank(message = "单位不能为空")
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+    @NotNull(message = "启用状态不能为空")
+    @ApiModelProperty(value = "状态 1:启用  0:停用 ")
+    private Integer status;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+
+    @NotNull(message = "角色不能为空")
+    @ApiModelProperty(value = "角色,sys_admin:系统管理员,sys_high:高级管理员, sys_normal:普通管理员, sys_visitor:游客" ,required = true)
+    private String role;
+
+}

+ 23 - 0
gis_domain/src/main/java/com/gis/domain/dto/UserPageDateDto.java

@@ -0,0 +1,23 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class UserPageDateDto extends PageDateDto {
+
+    @ApiModelProperty(value = "角色,sys_admin:系统管理员,sys_high:高级管理员, sys_normal:普通管理员, sys_visitor:游客")
+    private String role;
+
+    @ApiModelProperty(value = "用户类型, 1:系统用户, 0:游客")
+    private int type;
+
+
+
+
+}

+ 46 - 0
gis_domain/src/main/java/com/gis/domain/dto/VideoDto.java

@@ -0,0 +1,46 @@
+package com.gis.domain.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class VideoDto {
+
+    @ApiModelProperty(value = "id, 修改时必须传,新增忽略", name = "id")
+    private Long id;
+
+    @NotBlank(message = "标题不能为空")
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @NotBlank(message = "高清图url不能为空")
+    @ApiModelProperty(value = "高清图url", required = true)
+    private String img;
+
+    @NotBlank(message = "缩略图url不能为空")
+    @ApiModelProperty(value = "缩略图url", required = true)
+    private String thumb;
+
+    @NotBlank(message = "视频url不能为空")
+    @ApiModelProperty(value = "视频url", required = true)
+    private String video;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @NotBlank(message = "文件id不能为空")
+    @ApiModelProperty(value = "文件id" , required = true)
+    private String fileId;
+
+    @NotBlank(message = "文件名称不能为空")
+    @ApiModelProperty(value = "文件名称" , required = true)
+    private String fileName;
+}

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

@@ -0,0 +1,38 @@
+package com.gis.domain.po;
+
+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;
+}

+ 45 - 0
gis_domain/src/main/java/com/gis/domain/po/CommentEntity.java

@@ -0,0 +1,45 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 留言评论
+ */
+@Data
+@Table(name = "tb_comment")
+public class CommentEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    @ApiModelProperty(value = "消息")
+    private String msg;
+
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+
+
+
+
+
+
+}

+ 50 - 0
gis_domain/src/main/java/com/gis/domain/po/FileEntity.java

@@ -0,0 +1,50 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import java.io.Serializable;
+
+/**
+ * 文件表
+ */
+@Data
+@Table(name = "tb_file")
+public class FileEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -5191917184688236778L;
+
+
+    @ApiModelProperty(value = "文件名")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件保存路径")
+    private String filePath;
+
+    @ApiModelProperty(value = "访问url")
+    private String urlPath;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "封面图,1:是,0:否")
+    private Integer cover;
+
+    @ApiModelProperty(value = "外键id")
+    private String fkId;
+
+    @ApiModelProperty(value = "模块类型")
+    private String type;
+
+    @Transient
+    @ApiModelProperty(value = "年份")
+    private Integer year;
+
+
+    @ApiModelProperty(value = "是否显示(goods img使用),1:是,0:否")
+    private Integer display;
+
+
+}

+ 46 - 0
gis_domain/src/main/java/com/gis/domain/po/FodderEntity.java

@@ -0,0 +1,46 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 场景素材,图片、视频
+ */
+@Data
+@Table(name = "tb_fodder")
+public class FodderEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477844493946L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "类型:1:图片, 2:视频, 3: 模型")
+    private Integer type;
+
+    @ApiModelProperty(value = "文件url")
+    private String fileUrl;
+
+    // 字段唯一值
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+    @ApiModelProperty(value = "文件id")
+    private Long fileId;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "描述")
+    private String description;
+
+    @ApiModelProperty(value = "所属类别")
+    private String category;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+}

+ 35 - 0
gis_domain/src/main/java/com/gis/domain/po/KnowledgeEntity.java

@@ -0,0 +1,35 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 精品典藏表
+ */
+@Data
+@Table(name = "tb_knowledge")
+public class KnowledgeEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "标题")
+    private String name;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "知识url")
+    private String knowledgeUrl;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+//    @ApiModelProperty(value = "排序")
+//    private Integer sort;
+
+
+
+}

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

@@ -0,0 +1,37 @@
+package com.gis.domain.po;
+
+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;
+
+}

+ 36 - 0
gis_domain/src/main/java/com/gis/domain/po/MenuEntity.java

@@ -0,0 +1,36 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Table(name = "tb_menu")
+public class MenuEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "编辑者名称")
+    private String editName;
+
+    @ApiModelProperty(value = "类型:1:图片, 2:视频,3:模型, 0:默认类型")
+    private Integer type;
+
+
+
+
+
+
+
+}

+ 66 - 0
gis_domain/src/main/java/com/gis/domain/po/NewsEntity.java

@@ -0,0 +1,66 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ * 史馆动态
+ */
+@Data
+@Table(name = "tb_news")
+public class NewsEntity extends BaseEntity {
+
+    @ApiModelProperty(value = "类型,news:新闻, notice:公告" )
+    private String type;
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "阅读量")
+    private Integer viewCount;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "审核者Id")
+    private Long auditId;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "作者")
+    private String author;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+
+
+
+
+
+
+
+
+}

+ 56 - 0
gis_domain/src/main/java/com/gis/domain/po/SceneEntity.java

@@ -0,0 +1,56 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Entity
+@Table(name = "tb_scene")
+public class SceneEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477843493946L;
+
+    @ApiModelProperty(value = "场景码")
+    private String sceneCode;
+
+    @ApiModelProperty(value = "存放地址")
+    private String path;
+
+    @ApiModelProperty(value = "场景名称")
+    private String sceneTitle;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交用户名称")
+    private String submitName;
+
+    @ApiModelProperty(value = "审核者Id")
+    private Long auditId;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "类型,in:室内, out:室外")
+    private String type;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 56 - 0
gis_domain/src/main/java/com/gis/domain/po/SlideshowEntity.java

@@ -0,0 +1,56 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ * 轮播图
+ */
+@Data
+@Table(name = "tb_slideshow")
+public class SlideshowEntity extends BaseEntity implements Serializable {
+
+
+    private static final long serialVersionUID = 213587760750772829L;
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "审核者Id")
+    private Long auditId;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+
+
+
+
+
+
+}

+ 64 - 0
gis_domain/src/main/java/com/gis/domain/po/SpiritEntity.java

@@ -0,0 +1,64 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ * 特有精神
+ */
+@Data
+@Table(name = "tb_spirit")
+public class SpiritEntity extends BaseEntity {
+
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "归属单位")
+    private String unit;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "阅读量")
+    private Integer viewCount;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "审核者Id")
+    private Long auditId;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "作者")
+    private String author;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+
+
+
+
+
+
+
+
+}

+ 62 - 0
gis_domain/src/main/java/com/gis/domain/po/SysUserEntity.java

@@ -0,0 +1,62 @@
+package com.gis.domain.po;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 用户表
+ */
+@Data
+@Entity
+@Table(name = "sys_user")
+public class SysUserEntity extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -853504493430501564L;
+
+    @ApiModelProperty(value = "身份证号(军号)")
+    private String userName;
+
+    @JSONField(serialize = false)
+    private String password;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    @ApiModelProperty(value = "性别 0:男  1:女")
+    private Integer sex;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    @ApiModelProperty(value = "地址")
+    private String address;
+
+//    @ApiModelProperty(value = "超级管理员,1:是, 0:否")
+//    private Integer sysManager;
+
+    @ApiModelProperty(value = "状态 1:启用  0:停用 ")
+    private Integer status;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "角色,sys_admin:系统管理员,sys_high:高级管理员, sys_normal:普通管理员, sys_visitor:游客")
+    private String role;
+
+
+
+}

+ 44 - 0
gis_domain/src/main/java/com/gis/domain/po/VideoEntity.java

@@ -0,0 +1,44 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ * 史馆动态
+ */
+@Data
+@Table(name = "tb_video")
+public class VideoEntity extends BaseEntity {
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "视频url")
+    private String video;
+
+    @ApiModelProperty(value = "素材描述")
+    private String description;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "文件id")
+    private String fileId;
+
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+
+}

+ 22 - 0
gis_domain/src/main/java/com/gis/domain/po/ViewEntity.java

@@ -0,0 +1,22 @@
+package com.gis.domain.po;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+
+/**
+ * Created by owen on 2020/6/10 0010 17:39
+ * 访问量
+ */
+@Data
+@Table(name = "tb_view")
+public class ViewEntity extends BaseEntity {
+
+    @ApiModelProperty(value = "ip" )
+    private String ip;
+
+    @ApiModelProperty(value = "请求地址")
+    private String path;
+
+}

+ 45 - 0
gis_domain/src/main/java/com/gis/domain/vo/CommentVo.java

@@ -0,0 +1,45 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * 留言评论
+ */
+@Data
+public class CommentVo extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = -8093446477743493946L;
+
+    @ApiModelProperty(value = "用户id")
+    private Long userId;
+
+    @ApiModelProperty(value = "真实姓名")
+    private String realName;
+
+    @ApiModelProperty(value = "昵称")
+    private String nickName;
+
+    @ApiModelProperty(value = "单位")
+    private String unit;
+
+    @ApiModelProperty(value = "消息")
+    private String msg;
+
+    @ApiModelProperty(value = "父级id")
+    private Long parentId;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+
+
+
+
+
+
+}

+ 28 - 0
gis_domain/src/main/java/com/gis/domain/vo/KnowledgeVo.java

@@ -0,0 +1,28 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class KnowledgeVo extends BaseEntity {
+
+    @ApiModelProperty(value = "标题")
+    private String name;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "知识url")
+    private String knowledgeUrl;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交者名称")
+    private String submitName;
+
+}

+ 24 - 0
gis_domain/src/main/java/com/gis/domain/vo/LogVo.java

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

+ 55 - 0
gis_domain/src/main/java/com/gis/domain/vo/NewsVo.java

@@ -0,0 +1,55 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class NewsVo  extends BaseEntity {
+
+    @ApiModelProperty(value = "类型,news:新闻, notice:公告")
+    private String type;
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "简介")
+    private String description;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交者名称")
+    private String submitName;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "阅读量")
+    private Integer viewCount;
+
+    @ApiModelProperty(value = "作者")
+    private String author;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 44 - 0
gis_domain/src/main/java/com/gis/domain/vo/SlideshowVo.java

@@ -0,0 +1,44 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class SlideshowVo  extends BaseEntity {
+
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "场景url")
+    private String webSite;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交者名称")
+    private String submitName;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 53 - 0
gis_domain/src/main/java/com/gis/domain/vo/SpiritVo.java

@@ -0,0 +1,53 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class SpiritVo  extends BaseEntity {
+
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "归属单位")
+    private String unit;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "信息正文")
+    private String content;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交者名称")
+    private String submitName;
+
+    @ApiModelProperty(value = "状态,1:草稿中,2:待审核,3:审核不通过,4:审核通过")
+    private Integer status;
+
+    @ApiModelProperty(value = "原因")
+    private String reason;
+
+    @ApiModelProperty(value = "阅读量")
+    private Integer viewCount;
+
+    @ApiModelProperty(value = "作者")
+    private String author;
+
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+}

+ 40 - 0
gis_domain/src/main/java/com/gis/domain/vo/VideoVo.java

@@ -0,0 +1,40 @@
+package com.gis.domain.vo;
+
+import com.gis.domain.po.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by owen on 2020/5/9 0009 12:20
+ */
+@Data
+public class VideoVo extends BaseEntity {
+
+
+
+    @ApiModelProperty(value = "标题" )
+    private String title;
+
+    @ApiModelProperty(value = "高清图url")
+    private String img;
+
+    @ApiModelProperty(value = "缩略图url")
+    private String thumb;
+
+    @ApiModelProperty(value = "视频url")
+    private String video;
+
+    @ApiModelProperty(value = "是否显示,1:是, 0:否")
+    private Integer display;
+
+    @ApiModelProperty(value = "提交用户Id")
+    private Long submitId;
+
+    @ApiModelProperty(value = "提交者名称")
+    private String submitName;
+
+    @ApiModelProperty(value = "文件名称")
+    private String fileName;
+
+
+}

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

+ 22 - 0
gis_mapper/src/main/java/com/gis/mapper/CommentMapper.java

@@ -0,0 +1,22 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDateDto;
+import com.gis.domain.po.CommentEntity;
+import com.gis.domain.vo.CommentVo;
+import com.gis.mapper.provider.CommentProvider;
+import com.gis.mapper.provider.SpiritProvider;
+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 CommentMapper extends IBaseMapper<CommentEntity, Long> {
+
+
+    @SelectProvider(type = CommentProvider.class, method = "search")
+    List<CommentEntity> search(PageDateDto param, Integer display);
+}

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

@@ -0,0 +1,31 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.po.CommentEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 公共mapper
+ */
+@Component
+@Mapper
+public interface CommonMapper extends IBaseMapper<CommentEntity, Long> {
+
+    @Select(value = "select * from tb_topic where rec_status = 'A' ")
+    List<Map> getTopic();
+
+    @Update(value = "update tb_topic set display = 1 where id = #{id} ")
+    void setTopic(Long id);
+
+    @Update(value = "update tb_topic set display = 0 ")
+    void setAllDisable();
+
+    @Select(value = "select * from tb_topic where rec_status = 'A' AND display = 1 ")
+    Map getActivityTopic();
+}

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

@@ -0,0 +1,49 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.po.FileEntity;
+import com.gis.mapper.provider.FileProvider;
+import org.apache.ibatis.annotations.*;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+
+@Component
+@Mapper
+public interface FileMapper extends IBaseMapper<FileEntity, Long> {
+
+
+    @Update(value = "update tb_file set fk_id = #{fkId}, type = #{type} where id = #{id} ")
+    void setFkIdByIds(String id, Long fkId, String type);
+
+    @Select(value = "select * from tb_file where rec_status = 'A' AND fk_id = #{fkId}")
+    List<FileEntity> findByFkId(String fkId);
+
+    @Delete(value = "DELETE FROM tb_file WHERE fk_id = #{fkId}")
+    void deleteByFkId(String fkId);
+
+    @Update(value = "update tb_file set cover = 0 where type = #{modelType} ")
+    void setCoverDefault(String modelType);
+
+    @Update(value = "update tb_file set cover = 1 where id = #{id}")
+    void setCover(Long id);
+
+    @Update(value = "update tb_file set cover = 0 where type = #{modelType} and fk_id = #{fkId} ")
+    void setCoverByFkId(Long fkId, String modelType);
+
+    @Select(value = "select * from tb_file where rec_status = 'A' AND fk_id = #{fkId} and type = #{modelType}")
+    List<FileEntity> findByFkIdAndType(Long fkId, String modelType);
+
+//    @Update(value = "update tb_file set cover = 1 where type = #{modelType} and fk_id = #{fkId} ")
+//    void setFkIdAndType(Long fkId, String modelType);
+
+    @Update(value = "update tb_file set type = #{modelType}, fk_id = #{fkId}, cover = 1 where id = #{fileId}")
+    void setFkIdAndTypeById(Long fkId, String modelType, String fileId);
+
+    @SelectProvider(type = FileProvider.class, method = "setDisplayByIds")
+    void setDisplayByIds(Integer display, String fileIds);
+
+    @Select(value = "select * from tb_file where rec_status = 'A' AND display = #{display} and type = #{modelType} order by create_time")
+    List<FileEntity> findDisplayByType(int display, String modelType);
+}

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

@@ -0,0 +1,21 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.FodderPageDto;
+import com.gis.domain.po.FodderEntity;
+import com.gis.mapper.provider.FodderProvider;
+import com.gis.mapper.provider.SceneProvider;
+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 FodderMapper extends IBaseMapper<FodderEntity, Long> {
+
+    @SelectProvider(type = FodderProvider.class, method = "search")
+    List<FodderEntity> search(FodderPageDto param);
+}

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

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

+ 32 - 0
gis_mapper/src/main/java/com/gis/mapper/KnowledgeMapper.java

@@ -0,0 +1,32 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDateDto;
+import com.gis.domain.po.KnowledgeEntity;
+import com.gis.domain.vo.KnowledgeVo;
+import com.gis.mapper.provider.KnowledgeProvider;
+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 KnowledgeMapper extends IBaseMapper<KnowledgeEntity, Long> {
+
+    @SelectProvider(type = KnowledgeProvider.class, method = "search")
+    List<KnowledgeVo> search(PageDateDto param);
+
+////    @Select("select * from tb_goods where rec_status = 'A' AND display = 1 and status = 4 and type = #{type} and year = #{year} order by create_time desc")
+////    List<GoodsVo> findDisplay(Integer type, Integer year);
+//
+//    @SelectProvider(type = GoodsProvider.class, method = "findDisplay")
+//    List<GoodsVo> findDisplay(KnowledgePageDateDto param);
+//
+//    @Update("update tb_goods set view_count = view_count + 1 where id = #{id} ")
+//    void setView(Long id);
+//
+//    @Select("select year from tb_goods where rec_status = 'A' and type = #{type} and status = 4 and year is not null order by year asc")
+//    Set<Integer> getYear(Integer type);
+}

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

@@ -0,0 +1,23 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDto;
+import com.gis.domain.po.LogEntity;
+import com.gis.domain.vo.LogVo;
+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<LogVo> search(PageDto param);
+}

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

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

+ 41 - 0
gis_mapper/src/main/java/com/gis/mapper/NewsMapper.java

@@ -0,0 +1,41 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDto;
+import com.gis.domain.po.NewsEntity;
+import com.gis.domain.dto.NewsPageDateRequest;
+import com.gis.domain.vo.NewsVo;
+import com.gis.mapper.provider.NewsProvider;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface NewsMapper extends IBaseMapper<NewsEntity, Long> {
+
+    @SelectProvider(type = NewsProvider.class, method = "search")
+    List<NewsVo> search(NewsPageDateRequest param, Long userId);
+
+    @SelectProvider(type = NewsProvider.class, method = "webSearch")
+    List<NewsVo> webSearch(PageDto webPageDto);
+
+    @Update("update tb_news set view_count = view_count + 1 where id = #{id} ")
+    void setView(Long id);
+
+//    @Select("select * from tb_news where rec_status = 'A' AND display = 1 and status = 4 and type = #{type} order by create_time desc")
+//    List<NewsVo> findDisplay(String type);
+
+
+    @Select("select a.id, a.type, a.title, a.description, a.img, a.thumb, a.display, a.view_count, a.status, a.reason, " +
+            "a.author, a.content, a.create_time, a.update_time," +
+            "a.submit_id, b.real_name as submit_name from tb_news a left join sys_user b on b.id = a.submit_id where a.rec_status = 'A' " +
+            "AND a.display = 1 and a.status = 4 and a.type = #{type} order by a.create_time desc")
+    List<NewsVo> findDisplay(String type);
+
+
+}

+ 35 - 0
gis_mapper/src/main/java/com/gis/mapper/SceneMapper.java

@@ -0,0 +1,35 @@
+package com.gis.mapper;
+
+
+import com.gis.domain.dto.PageDto;
+import com.gis.domain.dto.ScenePageDto;
+import com.gis.domain.po.SceneEntity;
+import com.gis.mapper.provider.SceneProvider;
+import com.gis.mapper.provider.SpiritProvider;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.SelectProvider;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+@Mapper
+public interface SceneMapper extends IBaseMapper<SceneEntity, Long> {
+
+    @Select("select * from tb_scene where scene_code = #{m}")
+    SceneEntity findBySceneCode(String m);
+
+    @SelectProvider(type = SceneProvider.class, method = "search")
+    List<SceneEntity> search(ScenePageDto param);
+
+    @Update("update tb_scene set display = 0 where display = 1 ")
+    void setDisable();
+
+    @Update("update tb_scene set display = 1 where id = #{id} ")
+    void setDisplay(Long id);
+
+    @Update("update tb_scene set display = 0 where rec_status = 'A' and display = 1 and type = #{type}")
+    void setDisableByType(String type);
+}

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


部分文件因文件數量過多而無法顯示