lyhzzz 1 неделя назад
Родитель
Сommit
f46a16a2b9
88 измененных файлов с 28876 добавлено и 0 удалено
  1. 38 0
      .gitignore
  2. 8 0
      .idea/.gitignore
  3. 7 0
      .idea/encodings.xml
  4. 13 0
      .idea/misc.xml
  5. 124 0
      .idea/uiDesigner.xml
  6. 6 0
      .idea/vcs.xml
  7. 173 0
      pom.xml
  8. 32 0
      src/main/java/com/fdkankan/modeling/ModelingApplication.java
  9. 74 0
      src/main/java/com/fdkankan/modeling/config/RabbitConfig.java
  10. 34 0
      src/main/java/com/fdkankan/modeling/consants/BuildStatusEnum.java
  11. 51 0
      src/main/java/com/fdkankan/modeling/consants/ConstantCmd.java
  12. 39 0
      src/main/java/com/fdkankan/modeling/consants/ConstantFileName.java
  13. 58 0
      src/main/java/com/fdkankan/modeling/consants/ConstantFilePath.java
  14. 29 0
      src/main/java/com/fdkankan/modeling/consants/ConstantUrl.java
  15. 121 0
      src/main/java/com/fdkankan/modeling/consants/SysConstants.java
  16. 79 0
      src/main/java/com/fdkankan/modeling/entity/BuildLog.java
  17. 141 0
      src/main/java/com/fdkankan/modeling/entity/CameraDetail.java
  18. 111 0
      src/main/java/com/fdkankan/modeling/entity/CameraInstance.java
  19. 213 0
      src/main/java/com/fdkankan/modeling/entity/Company.java
  20. 57 0
      src/main/java/com/fdkankan/modeling/entity/MqEcs.java
  21. 69 0
      src/main/java/com/fdkankan/modeling/entity/MqScaling.java
  22. 237 0
      src/main/java/com/fdkankan/modeling/entity/Scene.java
  23. 251 0
      src/main/java/com/fdkankan/modeling/entity/ScenePro.java
  24. 273 0
      src/main/java/com/fdkankan/modeling/entity/SceneProEdit.java
  25. 135 0
      src/main/java/com/fdkankan/modeling/entity/User.java
  26. 20 0
      src/main/java/com/fdkankan/modeling/exception/BuildException.java
  27. 98 0
      src/main/java/com/fdkankan/modeling/generate/AutoGenerate.java
  28. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ICameraDetailMapper.java
  29. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ICameraInstanceMapper.java
  30. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ICompanyMapper.java
  31. 18 0
      src/main/java/com/fdkankan/modeling/mapper/IMqEcsMapper.java
  32. 18 0
      src/main/java/com/fdkankan/modeling/mapper/IMqScalingMapper.java
  33. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ISceneMapper.java
  34. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ISceneProEditMapper.java
  35. 18 0
      src/main/java/com/fdkankan/modeling/mapper/ISceneProMapper.java
  36. 18 0
      src/main/java/com/fdkankan/modeling/mapper/IUserMapper.java
  37. 545 0
      src/main/java/com/fdkankan/modeling/mq/BuildSceneReceiver.java
  38. 37 0
      src/main/java/com/fdkankan/modeling/mq/QueueNameService.java
  39. 7340 0
      src/main/java/com/fdkankan/modeling/proto/BigSceneProto.java
  40. 4654 0
      src/main/java/com/fdkankan/modeling/proto/Common.java
  41. 4345 0
      src/main/java/com/fdkankan/modeling/proto/Visionmodeldata.java
  42. 156 0
      src/main/java/com/fdkankan/modeling/proto/format/CouchDBFormat.java
  43. 703 0
      src/main/java/com/fdkankan/modeling/proto/format/HtmlFormat.java
  44. 1338 0
      src/main/java/com/fdkankan/modeling/proto/format/JavaPropsFormat.java
  45. 1603 0
      src/main/java/com/fdkankan/modeling/proto/format/JsonFormat.java
  46. 602 0
      src/main/java/com/fdkankan/modeling/proto/format/SmileFormat.java
  47. 1333 0
      src/main/java/com/fdkankan/modeling/proto/format/XmlFormat.java
  48. 19 0
      src/main/java/com/fdkankan/modeling/service/ICameraDetailService.java
  49. 16 0
      src/main/java/com/fdkankan/modeling/service/ICameraInstanceService.java
  50. 16 0
      src/main/java/com/fdkankan/modeling/service/ICompanyService.java
  51. 21 0
      src/main/java/com/fdkankan/modeling/service/IMqEcsService.java
  52. 16 0
      src/main/java/com/fdkankan/modeling/service/IMqScalingService.java
  53. 17 0
      src/main/java/com/fdkankan/modeling/service/ISceneProEditService.java
  54. 29 0
      src/main/java/com/fdkankan/modeling/service/ISceneProService.java
  55. 19 0
      src/main/java/com/fdkankan/modeling/service/ISceneService.java
  56. 19 0
      src/main/java/com/fdkankan/modeling/service/IUserService.java
  57. 36 0
      src/main/java/com/fdkankan/modeling/service/impl/CameraDetailServiceImpl.java
  58. 20 0
      src/main/java/com/fdkankan/modeling/service/impl/CameraInstanceServiceImpl.java
  59. 20 0
      src/main/java/com/fdkankan/modeling/service/impl/CompanyServiceImpl.java
  60. 44 0
      src/main/java/com/fdkankan/modeling/service/impl/MqEcsServiceImpl.java
  61. 20 0
      src/main/java/com/fdkankan/modeling/service/impl/MqScalingServiceImpl.java
  62. 27 0
      src/main/java/com/fdkankan/modeling/service/impl/SceneProEditServiceImpl.java
  63. 90 0
      src/main/java/com/fdkankan/modeling/service/impl/SceneProServiceImpl.java
  64. 39 0
      src/main/java/com/fdkankan/modeling/service/impl/SceneServiceImpl.java
  65. 69 0
      src/main/java/com/fdkankan/modeling/service/impl/UserServiceImpl.java
  66. 47 0
      src/main/java/com/fdkankan/modeling/task/TaskService.java
  67. 65 0
      src/main/java/com/fdkankan/modeling/util/Base64Converter.java
  68. 387 0
      src/main/java/com/fdkankan/modeling/util/ComputerUtil.java
  69. 625 0
      src/main/java/com/fdkankan/modeling/util/CreateObjUtil.java
  70. 96 0
      src/main/java/com/fdkankan/modeling/util/DingDingUtils.java
  71. 81 0
      src/main/java/com/fdkankan/modeling/util/ECSUtils.java
  72. 940 0
      src/main/java/com/fdkankan/modeling/util/FileUtils.java
  73. 96 0
      src/main/java/com/fdkankan/modeling/util/GYUploadToOssUtil.java
  74. 61 0
      src/main/java/com/fdkankan/modeling/util/StreamGobbler.java
  75. 208 0
      src/main/java/com/fdkankan/modeling/util/UploadToOssUtil.java
  76. 38 0
      src/main/resources/application-prod.yaml
  77. 38 0
      src/main/resources/application-test.yaml
  78. 49 0
      src/main/resources/application.yaml
  79. 254 0
      src/main/resources/logback-spring.xml
  80. 5 0
      src/main/resources/mapper/modeling/CameraDetailMapper.xml
  81. 5 0
      src/main/resources/mapper/modeling/CameraInstanceMapper.xml
  82. 5 0
      src/main/resources/mapper/modeling/CompanyMapper.xml
  83. 5 0
      src/main/resources/mapper/modeling/MqEcsMapper.xml
  84. 5 0
      src/main/resources/mapper/modeling/MqScalingMapper.xml
  85. 5 0
      src/main/resources/mapper/modeling/SceneMapper.xml
  86. 5 0
      src/main/resources/mapper/modeling/SceneProEditMapper.xml
  87. 5 0
      src/main/resources/mapper/modeling/SceneProMapper.xml
  88. 5 0
      src/main/resources/mapper/modeling/UserMapper.xml

+ 38 - 0
.gitignore

@@ -0,0 +1,38 @@
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### IntelliJ IDEA ###
+.idea/modules.xml
+.idea/jarRepositories.xml
+.idea/compiler.xml
+.idea/libraries/
+*.iws
+*.iml
+*.ipr
+
+### Eclipse ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
+
+### Mac OS ###
+.DS_Store

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 7 - 0
.idea/encodings.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 13 - 0
.idea/misc.xml

@@ -0,0 +1,13 @@
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 173 - 0
pom.xml

@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.fdkankan</groupId>
+    <artifactId>zfb-modeling</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.3.12.RELEASE</version>
+        <relativePath/>
+    </parent>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>8.0.25</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-boot-starter</artifactId>
+            <scope>compile</scope>
+            <version>3.4.3.4</version>
+        </dependency>
+
+        <!--mybatis-plus代码生成器-->
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <scope>compile</scope>
+            <version>3.5.1</version>
+        </dependency>
+
+        <!--velocity模板-->
+        <dependency>
+            <groupId>org.apache.velocity</groupId>
+            <artifactId>velocity-engine-core</artifactId>
+            <version>2.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-aop</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.83</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.23.4</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.aliyun.oss</groupId>
+            <artifactId>aliyun-sdk-oss</artifactId>
+            <version>3.15.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.8.2</version>
+        </dependency>
+
+        <!-- 钉钉sdk -->
+        <dependency>
+            <groupId>com.dingtalk.open</groupId>
+            <artifactId>taobao-sdk-java-auto</artifactId>
+            <version>1479188381469-20211020</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.codehaus.jackson</groupId>
+            <artifactId>jackson-smile</artifactId>
+            <version>1.9.12</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.3</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>com.aliyun</groupId>
+            <artifactId>ess20220222</artifactId>
+            <version>1.0.5</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-utils-redis</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+
+            <build>
+                <finalName>zfb-modeling</finalName>
+                <plugins>
+                    <plugin>
+                        <groupId>org.springframework.boot</groupId>
+                        <artifactId>spring-boot-maven-plugin</artifactId>
+                    </plugin>
+
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration>
+                            <testFailureIgnore>true</testFailureIgnore>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-compiler-plugin</artifactId>
+                        <configuration>
+                            <source>8</source>
+                            <target>8</target>
+                        </configuration>
+                    </plugin>
+                </plugins>
+
+            </build>
+
+        </project>

+ 32 - 0
src/main/java/com/fdkankan/modeling/ModelingApplication.java

@@ -0,0 +1,32 @@
+package com.fdkankan.modeling;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@SpringBootApplication
+@EnableTransactionManagement//开启事务
+@EnableCaching
+@EnableScheduling
+@EnableAsync
+@ComponentScan(basePackages = {"com.fdkankan.*"})
+@MapperScan("com.fdkankan.**.mapper")
+public class ModelingApplication extends SpringBootServletInitializer {
+
+    @Override
+    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+        return application.sources(ModelingApplication.class);
+    }
+
+    public static void main(String[] args) {
+        SpringApplication.run(ModelingApplication.class, args);
+    }
+
+}

+ 74 - 0
src/main/java/com/fdkankan/modeling/config/RabbitConfig.java

@@ -0,0 +1,74 @@
+package com.fdkankan.modeling.config;
+
+import com.fdkankan.modeling.mq.BuildSceneReceiver;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.amqp.core.Queue;
+import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
+import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
+import org.springframework.amqp.rabbit.connection.ConnectionFactory;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
+
+@Log4j2
+@Configuration
+public class RabbitConfig {
+
+    @Value("${spring.rabbitmq.host}")
+    private String host;
+
+    @Value("${spring.rabbitmq.port}")
+    private int port;
+
+    @Value("${spring.rabbitmq.username}")
+    private String username;
+
+    @Value("${spring.rabbitmq.password}")
+    private String password;
+
+    @Value("${rabbitmq.queue}")
+    private String queue;
+
+
+    @Bean
+    public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory() {
+        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
+        factory.setConnectionFactory(connectionFactory());
+        factory.setPrefetchCount(1);
+        return factory;
+    }
+
+    @Bean
+    public ConnectionFactory connectionFactory() {
+        CachingConnectionFactory connectionFactory = new CachingConnectionFactory(host,port);
+        connectionFactory.setUsername(username);
+        connectionFactory.setPassword(password);
+        connectionFactory.setVirtualHost("/");
+        connectionFactory.setPublisherConfirms(true);
+        return connectionFactory;
+    }
+
+    @Bean
+    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
+    public RabbitTemplate rabbitTemplate() {
+        return new RabbitTemplate(connectionFactory());
+    }
+
+
+    @Bean
+    public Queue workQueue() {
+        return new Queue(queue);
+    }
+
+    @Bean
+    @ConditionalOnProperty(name = "rabbitmq.queue.enable",havingValue = "true")
+    public BuildSceneReceiver buildSceneReceiver1() {
+        return new BuildSceneReceiver();
+    }
+
+
+}

+ 34 - 0
src/main/java/com/fdkankan/modeling/consants/BuildStatusEnum.java

@@ -0,0 +1,34 @@
+package com.fdkankan.modeling.consants;
+
+public enum BuildStatusEnum {
+    OTHER(-10,"其他原因失败"),
+    REPEAT(-3,"重复计算"),
+    FAILED(-2,"计算失败"),
+    OVERTIME(-1,"计算超时"),
+    CALCULATING(0,"计算中"),
+    SUCCESS(1,"计算成功");
+
+    public static final int OTHER_CODE = -10;
+    public static final int REPEAT_CODE = -3;
+    public static final int FAILED_CODE = -2;
+    public static final int OVERTIME_CODE = -1;
+    public static final int CALCULATING_CODE = 0;
+    public static final int SUCCESS_CODE = 1;
+
+    private int status;
+    private String desc;
+
+    BuildStatusEnum(int status, String desc) {
+        this.status = status;
+        this.desc = desc;
+    }
+
+    public int getStatus() {
+        return status;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+}

+ 51 - 0
src/main/java/com/fdkankan/modeling/consants/ConstantCmd.java

@@ -0,0 +1,51 @@
+package com.fdkankan.modeling.consants;
+
+public class ConstantCmd {
+
+	//生成模型的命令
+	public static final String BUILD_MODEL_COMMAND = "bash /home/ubuntu/bin/Launcher.sh ";
+
+	//生成模型的命令
+	public static final String BUILD_MODEL_COMMAND2 = "bash /opt/ossutil/sshoss.sh ";
+
+	public static final String BUILD_MODEL_OLD_COMMAND = "bash /home/ubuntu/bin_old/Launcher.sh ";
+	public static final String BUILD_MODEL_SFM_COMMAND = "bash /home/ubuntu/run_sfm.sh ";
+
+	public static final String OBJ_TO_TXT = "bash /home/ubuntu/bin_old/obj2txt.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 ";
+
+	//将mp4文件转换成flv
+	public static final String MP4_TO_FLV = "bash /monchickey/ffmpeg/bin/ff_mp4TOflv.sh ";
+
+	//删除/mnt/data/下的数据脚本
+	public static final String DELETE_FILE = "bash /monchickey/ffmpeg/bin/delete.sh ";
+
+	public static final String OSS_UTIL_CP ="bash /opt/ossutil/oss.sh ";
+
+	public static final String OSS_FILE_CP = "bash /opt/ossutil/file.sh ";
+
+	public static final String MATTERPRO_CUT_IMG = "node /opt/4dkankan_scene/index.js ";
+
+	public static final String wgetUrlCmd = "wget  -O %s %s";
+
+	public static final String unzipCmd = "unzip -O GBK/GB18030CP936 -o %s -d  %s" ;
+
+}

+ 39 - 0
src/main/java/com/fdkankan/modeling/consants/ConstantFileName.java

@@ -0,0 +1,39 @@
+package com.fdkankan.modeling.consants;
+
+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 APP_VOICE_NAME = "app";
+
+    public static final String TOURLIST_FOLDER = "tour";
+    //public static final String TEMPFILES = "tempFiles";
+
+    public static final String modelUUID = "dacf7dfa24ae47fab8fcebfe4dc41ab9";
+
+    public static final String BUCKET_NAME = "4dkankan";
+}

+ 58 - 0
src/main/java/com/fdkankan/modeling/consants/ConstantFilePath.java

@@ -0,0 +1,58 @@
+package com.fdkankan.modeling.consants;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+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 INVOICE_PATH = "/mnt/4Dkankan/invoice/";
+    // 场景二维码
+    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 String BUILD_MODEL_PATH;
+    //生成模型的路径
+    public static String BUILD_MODEL_LASER_PATH;
+
+    //支付二维码图片存放路径
+    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/";
+
+    @Value("${scene.buildModelPath:/home/ubuntu/data/}")
+    public void setBuildModelPath(String buildModelPath){
+        ConstantFilePath.BUILD_MODEL_PATH = buildModelPath;
+    }
+
+    @Value("${file.route.hardDiskLaser:/home/ubuntu/data/}")
+    public void setHardDiskLaser(String value){
+        ConstantFilePath.BUILD_MODEL_LASER_PATH = value;
+    }
+}

+ 29 - 0
src/main/java/com/fdkankan/modeling/consants/ConstantUrl.java

@@ -0,0 +1,29 @@
+package com.fdkankan.modeling.consants;
+
+public class ConstantUrl {
+
+//	public static final String MAIN_URL = "https://www.4dkankan.com/";
+//	public static final String MAIN_URL = "http://120.79.15.136:8086/";
+//	public static final String MAIN_URL2 = "https://www.4dkankan.com/";
+//	public static final String DEFAULT_USER_HEAD = "https://scene3d.4dage.com/head.png";
+	public static final String DEFAULT_USER_HEAD = "https://4dkk.4dage.com/newHead.png";
+	public static final String BBS_TOUPLOAD = "https://scene3d.4dage.com/model/upload/image/";
+	public static final String DEFAULT_PREFIX_QINIU_PIC = "http://orw69myb5.bkt.clouddn.com/";
+	public static final String DEFAULT_SCENE_PIC="https://4dkk.4dage.com/loading/thumb.jpg";
+//	public static final String SCENE_URL = MAIN_URL + "show.html?m=";
+//	public static final String SCENE_URL2 = MAIN_URL + "showV2.html?m=";
+
+//	public static final String PRO_SCENE_URL = MAIN_URL + "showProMobile.html?m=";
+	public static final String PREFIX_ALI = "https://4dkk.4dage.com/";
+	//亚马逊S3
+	public static final String PREFIX_AWS = "https://eurs3.4dkankan.com/";
+	public static final String PREFIX_QINIU = "https://scene3d.4dage.com/";
+	public static final String PREFIX_QINIU2 = "https://creator.4dkankan.com/";
+	public static final String WEIXIN_PAYURL = "https://www.4dkankan.com/weixinmobilepay/weixinInfo?orderId=";
+	public static final String WEIXIN_TOKEN_URL1 = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=";
+	public static final String WEIXIN_TOKEN_URL2 = "https://api.weixin.qq.com/sns/userinfo?access_token=";
+	public static final String WEIXIN_MOBILE_PAY_URL = "mobile.html#/pay?timeStamp=";
+	public static final String WEIXIN_NOTIFY_URL = "https://www.4dkankan.com/weixinpay/Notify";
+	public static final String WEIXIN_ORDER_URL="https://api.mch.weixin.qq.com/pay/unifiedorder";
+
+}

+ 121 - 0
src/main/java/com/fdkankan/modeling/consants/SysConstants.java

@@ -0,0 +1,121 @@
+package com.fdkankan.modeling.consants;
+
+import com.fdkankan.modeling.entity.MqEcs;
+import com.fdkankan.modeling.mq.QueueNameService;
+import com.fdkankan.modeling.service.IMqEcsService;
+import com.fdkankan.modeling.util.FileUtils;
+import com.fdkankan.redis.util.RedisUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.core.env.MapPropertySource;
+import org.springframework.core.env.StandardEnvironment;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+@Component
+public class SysConstants implements ApplicationContextAware {
+    private static final Logger log = LoggerFactory.getLogger(SysConstants.class);
+
+    public static String hostName;
+    public static int modelTimeOut;
+
+    public static boolean isResidenceService = true;
+
+    public static volatile Boolean SYSTEM_BUILDING = false;
+    public static volatile Boolean SYSTEM_OFFING = false;
+
+    private List<String> residenceServices = null;
+
+
+    @Value("${hostName.filePath:/opt/hosts/hosts.txt}")
+    public void setHostName(String filePath){
+        try {
+            SysConstants.hostName = FileUtils.readFile(filePath);
+            // 去除空格
+            if(!ObjectUtils.isEmpty(SysConstants.hostName)){
+                SysConstants.hostName = SysConstants.hostName.trim().replaceAll("\\s","");
+            }
+            log.error("从文件({})中获取服务器名称:{}", filePath,hostName);
+            initIsResidenceService();
+            initRedisControllerKey();
+        } catch (Exception e) {
+            log.error("从文件中获取服务器名称失败,文件路径{}", filePath);
+            e.printStackTrace();
+        }
+    }
+
+    @Autowired
+    RedisUtil redisUtil;
+    private void initRedisControllerKey() {
+        try {
+            String redisKey = "zfb-modeling:*";
+            Set<String> keys = redisUtil.keys(redisKey);
+            log.info("正在计算的:{}",keys);
+            for (String key : keys) {
+                String value = redisUtil.get(key);
+                if(StringUtils.isNotBlank(value)&& StringUtils.isNotBlank(hostName) && value.equals(hostName)){
+                    redisUtil.del(key);
+                    log.info("删除key:{}",key);
+                }
+                if(StringUtils.isBlank(hostName) && StringUtils.isNotBlank(value)&& "1".equals(value)){
+                    redisUtil.del(key);
+                    log.info("删除key:{}",key);
+                }
+            }
+        }catch (Exception e){
+            log.info("重启清楚本机Redis锁中的数据失败:{}",e);
+        }
+
+    }
+
+    /**
+     * 默认超时时间2天
+     * @param timeOut
+     */
+    @Value("${model.timeOut:172800}")
+    public void setModelTimeOut(int timeOut){
+        SysConstants.modelTimeOut = timeOut;
+    }
+
+
+    @Autowired
+    IMqEcsService mqEcsService;
+    @Autowired
+    QueueNameService queueNameService;
+
+    private void initIsResidenceService() {
+        if(StringUtils.isNotBlank(SysConstants.hostName)){
+
+            MqEcs mqEcs = mqEcsService.getByEcs(SysConstants.hostName);
+            if(mqEcs == null){
+                mqEcs = new MqEcs();
+                mqEcs.setEcsName(SysConstants.hostName);
+                mqEcs.setQueueName(queueNameService.getQueueName());
+                mqEcsService.save(mqEcs);
+            }
+        }
+    }
+
+    @Override
+    public void setApplicationContext(ApplicationContext context) throws BeansException {
+        Map<String,Object> params = new HashMap<>();
+        if (isResidenceService) {
+            params.put("mq.consumerPriority",1);
+
+        } else {
+            params.put("mq.consumerPriority",0);
+        }
+        ((StandardEnvironment)context.getEnvironment()).getPropertySources()
+                .addLast(new MapPropertySource("mq.consumerPriority",params));
+    }
+}

+ 79 - 0
src/main/java/com/fdkankan/modeling/entity/BuildLog.java

@@ -0,0 +1,79 @@
+package com.fdkankan.modeling.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class BuildLog implements Serializable {
+    private Long id;
+    /**
+     * 场景码
+     */
+    private String sceneNum;
+    /**
+     * 资源路径
+     */
+    private String dataSource;
+
+    /**
+     * 消息队列名称
+     */
+    private String queueName;
+
+    /**
+     * 消息队列名称
+     */
+    private String queueMsg;
+
+    /**
+     * CalculateStatusEnum
+     */
+    private int status;
+
+    /**
+     * 计算服务名称
+     */
+    private String hostName;
+
+    /**
+     * 计算类型
+     * 1:标定算法,
+     * 0:场景计算
+     */
+    private int buildType;
+
+    /**
+     * 构建请求来源
+     */
+    private String source;
+
+
+    /**
+     * 日志详情路径
+     */
+    private String logDetailPath;
+
+    /**
+     * 计算时长,单位秒
+     */
+    private Long duration;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 最后一次更新时间
+     */
+    private Date updateTime;
+
+    public BuildLog(String hostName, String queueName, String queueMsg) {
+        this.hostName = hostName;
+        this.queueName = queueName;
+        this.queueMsg = queueMsg;
+        this.createTime = new Date();
+    }
+}

+ 141 - 0
src/main/java/com/fdkankan/modeling/entity/CameraDetail.java

@@ -0,0 +1,141 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 相机子表
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_camera_detail")
+public class CameraDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 余额
+     */
+    @TableField("balance")
+    private String balance;
+
+    /**
+     * 用户表t_user的id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 0表示客户,1表示员工,2表示赠送,3表示其他,4经销商销售
+     */
+    @TableField("own")
+    private Integer own;
+
+    /**
+     * 订单号
+     */
+    @TableField("order_sn")
+    private String orderSn;
+
+    /**
+     * 0表示本国,1表示国外
+     */
+    @TableField("country")
+    private Integer country;
+
+    /**
+     * 经销商
+     */
+    @TableField("agency")
+    private String agency;
+
+    /**
+     * 相机类型,0表示双目,1四维看看pro,2 四维看看lite,3 双目转台,4 激光转台
+     */
+    @TableField("type")
+    private Integer type;
+
+    /**
+     * 总容量
+     */
+    @TableField("total_space")
+    private Long totalSpace;
+
+    /**
+     * 已使用容量
+     */
+    @TableField("used_space")
+    private Long usedSpace;
+
+    /**
+     * 相机主表t_camera的id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 商品表t_goods的id
+     */
+    @TableField("goods_id")
+    private Long goodsId;
+
+    /**
+     * 企业表t_company的id
+     */
+    @TableField("company_id")
+    private Long companyId;
+
+    /**
+     * 代理商架构管理t_agent_framework的id
+     */
+    @TableField("agent_framework_id")
+    private Long agentFrameworkId;
+
+    /**
+     * 相机协作用户id
+     */
+    @TableField("cooperation_user")
+    private Long cooperationUser;
+
+    /**
+     * 设备地址(追溯管理后台)
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 111 - 0
src/main/java/com/fdkankan/modeling/entity/CameraInstance.java

@@ -0,0 +1,111 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_camera_instance")
+public class CameraInstance implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 相机的Mac地址
+     */
+    @TableField("child_name")
+    private String childName;
+
+    /**
+     * 激活时间
+     */
+    @TableField("active_time")
+    private Date activeTime;
+
+    /**
+     * 对应cameraType的Id
+     */
+    @TableField("camera_type_id")
+    private Integer cameraTypeId;
+
+    /**
+     * 相机密码
+     */
+    @TableField("child_password")
+    private String childPassword;
+
+    /**
+     * wifi名称
+     */
+    @TableField("wifi_name")
+    private String wifiName;
+
+    /**
+     * wifi密码
+     */
+    @TableField("wifi_password")
+    private String wifiPassword;
+
+    /**
+     * 余额
+     */
+    @TableField("balance")
+    private String balance;
+
+    /**
+     * 用户账号(企业用户)
+     */
+    @TableField("user_name")
+    private String userName;
+
+    /**
+     * 0表示客户,1表示员工,2表示送的,3表示其他
+     */
+    @TableField("own")
+    private Integer own;
+
+    /**
+     * 0表示本国,1表示国外
+     */
+    @TableField("country")
+    private Integer country;
+
+    /**
+     * 经销商
+     */
+    @TableField("agency")
+    private String agency;
+
+    /**
+     * sn码
+     */
+    @TableField("sn_code")
+    private String snCode;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 213 - 0
src/main/java/com/fdkankan/modeling/entity/Company.java

@@ -0,0 +1,213 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_company")
+public class Company implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 公司名称
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 联系人
+     */
+    @TableField("contacts")
+    private String contacts;
+
+    /**
+     * 电话
+     */
+    @TableField("phone")
+    private String phone;
+
+    /**
+     * 区域
+     */
+    @TableField("area")
+    private String area;
+
+    /**
+     * 地址
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 官网
+     */
+    @TableField("website")
+    private String website;
+
+    /**
+     * logo地址
+     */
+    @TableField("logo")
+    private String logo;
+
+    /**
+     * 场景logo地址
+     */
+    @TableField("scene_logo")
+    private String sceneLogo;
+
+    /**
+     * 场景地面logo
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 场景背景音乐url
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    /**
+     * 微信二维码地址
+     */
+    @TableField("code")
+    private String code;
+
+    /**
+     * 公司资质图片地址
+     */
+    @TableField("qualification")
+    private String qualification;
+
+    /**
+     * 公司介绍
+     */
+    @TableField("introduce")
+    private String introduce;
+
+    /**
+     * 企业拍摄点数
+     */
+    @TableField("point")
+    private Integer point;
+
+    /**
+     * 额外子账号数量
+     */
+    @TableField("sub_num")
+    private Integer subNum;
+
+    /**
+     * 状态,0:审核中,1:审核通过,2:审核失败
+     */
+    @TableField("state")
+    private Integer state;
+
+    /**
+     * 0:正常企业,1:测试企业
+     */
+    @TableField("type")
+    private Integer type;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    @TableField("create_user")
+    private String createUser;
+
+    /**
+     * 修改时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 修改人
+     */
+    @TableField("update_user")
+    private String updateUser;
+
+    /**
+     * 审核通过时间
+     */
+    @TableField("audit_time")
+    private Date auditTime;
+
+    /**
+     * 企业到期时间
+     */
+    @TableField("expiration_time")
+    private Date expirationTime;
+
+    /**
+     * 顶部logo
+     */
+    @TableField("top_logo")
+    private String topLogo;
+
+    /**
+     * 地面点位logo
+     */
+    @TableField("marker_logo")
+    private String markerLogo;
+
+    /**
+     * 是否显示初始logo,0隐藏,1显示
+     */
+    @TableField("show_logo")
+    private String showLogo;
+
+    /**
+     * 二维码logo
+     */
+    @TableField("qr_logo")
+    private String qrLogo;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("look_num")
+    private Integer lookNum;
+
+    @TableField("shot_num")
+    private Integer shotNum;
+
+    @TableField("can_show")
+    private Integer canShow;
+
+    @TableField("live_room_capacities")
+    private Integer liveRoomCapacities;
+
+
+}

+ 57 - 0
src/main/java/com/fdkankan/modeling/entity/MqEcs.java

@@ -0,0 +1,57 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("mq_ecs")
+public class MqEcs implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @TableField("ecs_name")
+    private String ecsName;
+
+    @TableField("queue_name")
+    private String queueName;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("remark")
+    private String remark;
+
+    /**
+     * 0运行中未计算,1运行中计算中,2停止运行
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 是否是弹性伸缩0否1是
+     */
+    @TableField("is_scaling")
+    private Integer isScaling;
+
+}

+ 69 - 0
src/main/java/com/fdkankan/modeling/entity/MqScaling.java

@@ -0,0 +1,69 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("mq_scaling")
+public class MqScaling implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 弹性伸缩Id
+     */
+    @TableField("scaling_group_id")
+    private String scalingGroupId;
+
+    /**
+     * 规则
+     */
+    @TableField("scaling_rule_ari")
+    private String scalingRuleAri;
+
+    @TableField("access_key")
+    private String accessKey;
+
+    @TableField("secret")
+    private String secret;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+    @TableField("endpoint")
+    private String endpoint;
+
+    /**
+     * 开启弹性伸缩阈值
+     */
+    @TableField("threshold")
+    private Integer threshold;
+
+
+}

+ 237 - 0
src/main/java/com/fdkankan/modeling/entity/Scene.java

@@ -0,0 +1,237 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_scene")
+public class Scene implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 公元管道需要的编码
+     */
+    @TableField("work_number")
+    private String workNumber;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("website")
+    private String website;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("homepic")
+    private String homepic;
+
+    /**
+     * 生成场景的时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示私密不要显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("datasource")
+    private String datasource;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 房源id
+     */
+    @TableField("house_id")
+    private Long houseId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费
+     */
+    @TableField("pay")
+    private Integer pay;
+
+    /**
+     * 相机的用户名
+     */
+    @TableField("child_name")
+    private String childName;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scenekey")
+    private String scenekey;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_img")
+    private Integer thumbImg;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hotsids")
+    private String hotsids;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 拍摄数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 风格
+     */
+    @TableField("style")
+    private Integer style;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    @TableField("screencap_music")
+    private String screencapMusic;
+
+    /**
+     * 录屏文件个数
+     */
+    @TableField("screencap_len")
+    private Integer screencapLen;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("is_show")
+    private Boolean isShow;
+
+    @TableField("app_list_pic_url")
+    private String appListPicUrl;
+
+    @TableField("contact_id")
+    private Long contactId;
+
+
+}

+ 251 - 0
src/main/java/com/fdkankan/modeling/entity/ScenePro.java

@@ -0,0 +1,251 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * pro场景表
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_scene_pro")
+public class ScenePro implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("web_site")
+    private String webSite;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("thumb")
+    private String thumb;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 用户表t_user的id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费,-2表示容量不足
+     */
+    @TableField("pay_status")
+    private Integer payStatus;
+
+    /**
+     * 相机主表t_camera的id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 场景logo
+     */
+    @TableField("scene_logo")
+    private String sceneLogo;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居,99一件换装虚拟房源
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 拍摄数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 所有资源文件名
+     */
+    @TableField("files_name")
+    private String filesName;
+
+    /**
+     * 点位视频
+     */
+    @TableField("videos")
+    private String videos;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目,4是八目,10获取4k图,11获取2k,12获取1k
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+    /**
+     * 服务器的服务商
+     */
+    @TableField("ecs")
+    private String ecs;
+
+    /**
+     * 使用容量
+     */
+    @TableField("space")
+    private Long space;
+
+    /**
+     * 固件版本
+     */
+    @TableField("firmware_version")
+    private String firmwareVersion;
+
+    /**
+     * 调用V2还是V3的算法
+     */
+    @TableField("build_type")
+    private String buildType;
+
+    /**
+     * 计算时间(秒为单位)
+     */
+    @TableField("compute_time")
+    private Long computeTime;
+
+    /**
+     * 场景来源,相机拍摄10以内表示,1表示八目,2双目,3转台,其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    @TableField("scene_source")
+    private Integer sceneSource;
+
+    /**
+     * 房屋ID
+     */
+    @TableField("house_id")
+    private Long houseId;
+
+    /**
+     * 公元管道需要的编码
+     */
+    @TableField("work_number")
+    private String workNumber;
+
+    /**
+     * 小程序首页封面图
+     */
+    @TableField("app_list_pic_url")
+    private String appListPicUrl;
+
+    /**
+     * '小程序是否显示'
+     */
+    @TableField("is_show")
+    private Boolean isShow;
+
+    /**
+     * 是否生成了直播间
+     */
+    @TableField("lived")
+    private Boolean lived;
+
+    @TableField("contact_id")
+    private Long contactId;
+
+    @TableField("phone_num")
+    private String phoneNum;
+
+
+    @TableField("del_build_result")
+    private Integer delBuildResult;
+}

+ 273 - 0
src/main/java/com/fdkankan/modeling/entity/SceneProEdit.java

@@ -0,0 +1,273 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * pro场景编辑数据表
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_scene_pro_edit")
+public class SceneProEdit implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * pro场景id
+     */
+    @TableField("pro_id")
+    private Long proId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scene_key")
+    private String sceneKey;
+
+    /**
+     * 展示页面密码,0不需要,1需要
+     */
+    @TableField("need_key")
+    private Integer needKey;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_status")
+    private Integer thumbStatus;
+
+    /**
+     * 地面点位标志
+     */
+    @TableField("marker_logo")
+    private String markerLogo;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hots_ids")
+    private String hotsIds;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 普通录屏文件地址
+     */
+    @TableField("screencap_voice_src")
+    private String screencapVoiceSrc;
+
+    /**
+     * 录音文件地址
+     */
+    @TableField("screencap_voice_sound")
+    private String screencapVoiceSound;
+
+    /**
+     * 同步录音地址
+     */
+    @TableField("screencap_voice_soundsync")
+    private String screencapVoiceSoundsync;
+
+    /**
+     * 选择的类型,sound为screencapVoiceSound,file为screencapVoiceSrc,soundsync为screencap_voice_soundsync
+     */
+    @TableField("screencap_voice_type")
+    private String screencapVoiceType;
+
+    /**
+     * 录屏文件地址
+     */
+    @TableField("play_data")
+    private String playData;
+
+    /**
+     * 重新建模的版本
+     */
+    @TableField("floor_edit_ver")
+    private Integer floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    @TableField("floor_publish_ver")
+    private Integer floorPublishVer;
+
+    /**
+     * 录屏图片存放文件
+     */
+    @TableField("screencap_thumb")
+    private String screencapThumb;
+
+    /**
+     * 分享的logo和生成二维码的logo
+     */
+    @TableField("share_logo")
+    private String shareLogo;
+
+    /**
+     * 小地图浏览
+     */
+    @TableField("map_visi")
+    private Integer mapVisi;
+
+    /**
+     * 自动导览
+     */
+    @TableField("tour_visi")
+    private Integer tourVisi;
+
+    /**
+     * vr模式
+     */
+    @TableField("vr_visi")
+    private Integer vrVisi;
+
+    /**
+     * 展示页面是否显示标尺
+     */
+    @TableField("ruler_visi")
+    private Integer rulerVisi;
+
+    /**
+     * 展示页面cad图在平面图是否显示
+     */
+    @TableField("cad_img_visi")
+    private Integer cadImgVisi;
+
+    /**
+     * cad平面图
+     */
+    @TableField("floor_plan_png")
+    private String floorPlanPng;
+
+    /**
+     * cad平面图参数
+     */
+    @TableField("cad_info")
+    private String cadInfo;
+
+    @TableField("pano_visi")
+    private Integer panoVisi;
+
+    @TableField("m2d_visi")
+    private Integer m2dVisi;
+
+    @TableField("m3d_visi")
+    private Integer m3dVisi;
+
+    @TableField("measure_visi")
+    private Integer measureVisi;
+
+    /**
+     * 肖安需求,场景于场景之间的关联
+     */
+    @TableField("link_scene")
+    private String linkScene;
+
+    @TableField("overlay")
+    private String overlay;
+
+    /**
+     * 是否显示底部logo,1显示,0不显示
+     */
+    @TableField("show_logo_bottom")
+    private Boolean showLogoBottom;
+
+    /**
+     * 全景图版本号
+     */
+    @TableField("images_version")
+    private Integer imagesVersion;
+
+    /**
+     * 上传的背景音乐
+     */
+    @TableField("bg_music_name")
+    private String bgMusicName;
+
+    @TableField("jump_scene")
+    private Boolean jumpScene;
+
+    /**
+     * 旋转角度
+     */
+    @TableField("floor_plan_angle")
+    private String floorPlanAngle;
+
+    /**
+     * 场景下载次数
+     */
+    @TableField("download_num")
+    private Integer downloadNum;
+
+    /**
+     * 绿幕抠图json数据
+     */
+    @TableField("videos_user")
+    private String videosUser;
+
+
+}

+ 135 - 0
src/main/java/com/fdkankan/modeling/entity/User.java

@@ -0,0 +1,135 @@
+package com.fdkankan.modeling.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Getter
+@Setter
+@TableName("tb_user")
+public class User implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户名
+     */
+    @TableField("user_name")
+    private String userName;
+
+    /**
+     * 用户密码
+     */
+    @TableField("user_password")
+    private String userPassword;
+
+    /**
+     * 微信appid
+     */
+    @TableField("appid")
+    private String appid;
+
+    /**
+     * 手机号
+     */
+    @TableField("phone")
+    private String phone;
+
+    /**
+     * 昵称
+     */
+    @TableField("nick_name")
+    private String nickName;
+
+    /**
+     * 企业备注子账号的备注名
+     */
+    @TableField("memo_name")
+    private String memoName;
+
+    @TableField("head")
+    private String head;
+
+    /**
+     * 用户类型,默认0:普通用户1:企业子账号,2:企业,-1:超级用户
+     */
+    @TableField("type")
+    private Integer type;
+
+    /**
+     * 关联tb_company表id,type为0时为空
+     */
+    @TableField("company_id")
+    private Long companyId;
+
+    /**
+     * 状态
+     */
+    @TableField("state")
+    private Integer state;
+
+    /**
+     * 消息描述
+     */
+    @TableField("message")
+    private String message;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 创建人
+     */
+    @TableField("create_user")
+    private String createUser;
+
+    /**
+     * 修改时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 修改人
+     */
+    @TableField("update_user")
+    private String updateUser;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("fdkk_user")
+    private String fdkkUser;
+
+    @TableField("fdkk_password")
+    private String fdkkPassword;
+
+    @TableField("gender")
+    private Integer gender;
+
+
+}

+ 20 - 0
src/main/java/com/fdkankan/modeling/exception/BuildException.java

@@ -0,0 +1,20 @@
+package com.fdkankan.modeling.exception;
+
+
+import com.fdkankan.modeling.consants.BuildStatusEnum;
+
+public class BuildException extends RuntimeException{
+
+    private static final long serialVersionUID = -1518945670203783450L;
+    private BuildStatusEnum buildStatus;
+
+
+    public BuildException(BuildStatusEnum buildStatusEnum){
+        super(buildStatusEnum.getDesc());
+        this.buildStatus = buildStatusEnum;
+    }
+
+    public BuildStatusEnum getBuildStatus() {
+        return buildStatus;
+    }
+}

+ 98 - 0
src/main/java/com/fdkankan/modeling/generate/AutoGenerate.java

@@ -0,0 +1,98 @@
+package com.fdkankan.modeling.generate;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.generator.FastAutoGenerator;
+import com.baomidou.mybatisplus.generator.config.OutputFile;
+import com.baomidou.mybatisplus.generator.config.rules.DateType;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+public class AutoGenerate {
+
+
+    public static void main(String[] args) {
+
+        String path =System.getProperty("user.dir");
+
+        generate(path,"modeling", getTables(new String[]{
+              "tb_scene_pro_edit"
+        }));
+
+//        generate(path,"goods", getTables(new String[]{
+//                        "t_camera","t_camera_detail","t_camera_out","t_camera_space","t_camera_version",
+//                        "t_company","t_goods","t_goods_sku","t_cart","t_goods_spec",
+//                        "t_goods_spec_value","t_goods_spu_spec","t_sn_code"
+//        }));
+//
+//        generate(path,"order", getTables(new String[]{
+//                        "t_increment_order","t_invoice","t_order","t_order_item",
+//                        "t_pre_sale","t_space_sdk","t_trade_log","t_commerce_order","t_download_order","t_expansion_order"
+//        }));
+//        generate(path,"order", getTables(new String[]{
+//                        "t_virtual_order"
+//        }));
+//
+//        generate(path,"user", getTables(new String[]{
+//                        "t_user","t_user_increment","t_manager","t_province","t_increment_type","t_intercom_message","t_receiver_info"
+//        }));
+    }
+
+    public static List<String> getTables(String [] tableNames){
+        return new ArrayList<>(Arrays.asList(tableNames));
+    }
+
+
+    public static void  generate(String path,String moduleName,  List<String> tables){
+        FastAutoGenerator.create("jdbc:mysql://120.24.202.7:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true",
+                "root","zfb@20210727%")
+                .globalConfig(builder -> {
+                    builder.author("")               //作者
+                            .outputDir(path+"\\src\\main\\java")    //输出路径(写到java目录)
+                            //.enableSwagger()           //开启swagger
+                            .commentDate("yyyy-MM-dd")
+                            .dateType(DateType.ONLY_DATE)
+                            .fileOverride();            //开启覆盖之前生成的文件
+
+                })
+                .packageConfig(builder -> {
+                    builder.parent("com.fdkankan")
+                            .moduleName(moduleName)
+                            .entity("entity")
+                            .service("service")
+                            .serviceImpl("service.impl")
+                            .controller("controller")
+                            .mapper("mapper")
+                            .xml("test.mapper")
+                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper\\"+moduleName));
+                })
+                .strategyConfig(builder -> {
+                    builder.addInclude(tables)
+                            .addTablePrefix("tb_")
+
+                            .serviceBuilder()
+                            .formatServiceFileName("I%sService")
+                            .formatServiceImplFileName("%sServiceImpl")
+
+                            .entityBuilder()
+                            .enableLombok()
+                            .logicDeleteColumnName("rec_status")
+                            .enableTableFieldAnnotation()
+                            //.superClass(BaseEntity.class)
+
+                            .controllerBuilder()
+                            .formatFileName("%sController")
+                            .enableRestStyle()
+
+                            .mapperBuilder()
+                            .superClass(BaseMapper.class)
+                            .formatMapperFileName("I%sMapper")
+                            .enableMapperAnnotation()
+                            .formatXmlFileName("%sMapper");
+                })
+                // .templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
+                .execute();
+    }
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ICameraDetailMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.CameraDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 相机子表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ICameraDetailMapper extends BaseMapper<CameraDetail> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ICameraInstanceMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.CameraInstance;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ICameraInstanceMapper extends BaseMapper<CameraInstance> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ICompanyMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.Company;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ICompanyMapper extends BaseMapper<Company> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/IMqEcsMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.MqEcs;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface IMqEcsMapper extends BaseMapper<MqEcs> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/IMqScalingMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.MqScaling;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface IMqScalingMapper extends BaseMapper<MqScaling> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ISceneMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.Scene;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ISceneMapper extends BaseMapper<Scene> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ISceneProEditMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.SceneProEdit;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景编辑数据表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ISceneProEditMapper extends BaseMapper<SceneProEdit> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/ISceneProMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.ScenePro;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface ISceneProMapper extends BaseMapper<ScenePro> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/modeling/mapper/IUserMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.modeling.mapper;
+
+import com.fdkankan.modeling.entity.User;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Mapper
+public interface IUserMapper extends BaseMapper<User> {
+
+}

+ 545 - 0
src/main/java/com/fdkankan/modeling/mq/BuildSceneReceiver.java

@@ -0,0 +1,545 @@
+//
+// Source code recreated from a .class file by IntelliJ IDEA
+// (powered by FernFlower decompiler)
+//
+
+package com.fdkankan.modeling.mq;
+
+import cn.hutool.core.io.FileUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.modeling.consants.BuildStatusEnum;
+import com.fdkankan.modeling.consants.ConstantFilePath;
+import com.fdkankan.modeling.consants.SysConstants;
+import com.fdkankan.modeling.entity.BuildLog;
+import com.fdkankan.modeling.entity.ScenePro;
+import com.fdkankan.modeling.entity.SceneProEdit;
+import com.fdkankan.modeling.entity.User;
+import com.fdkankan.modeling.exception.BuildException;
+import com.fdkankan.modeling.service.IMqEcsService;
+import com.fdkankan.modeling.service.ISceneProEditService;
+import com.fdkankan.modeling.service.ISceneProService;
+import com.fdkankan.modeling.service.ISceneService;
+import com.fdkankan.modeling.service.IUserService;
+import com.fdkankan.modeling.util.ComputerUtil;
+import com.fdkankan.modeling.util.CreateObjUtil;
+import com.fdkankan.modeling.util.DingDingUtils;
+import com.fdkankan.modeling.util.FileUtils;
+import com.fdkankan.modeling.util.GYUploadToOssUtil;
+import com.fdkankan.modeling.util.UploadToOssUtil;
+import com.fdkankan.redis.util.RedisUtil;
+import com.rabbitmq.client.Channel;
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.messaging.handler.annotation.Header;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+
+@Component
+public class BuildSceneReceiver {
+    private static final Logger log = LogManager.getLogger(BuildSceneReceiver.class);
+    @Autowired
+    private ISceneService sceneService;
+    @Autowired
+    private ISceneProService sceneProService;
+    @Autowired
+    private IUserService userService;
+    @Autowired
+    private UploadToOssUtil uploadToOssUtil;
+    @Autowired
+    private GYUploadToOssUtil gYUploadToOssUtil;
+    @Autowired
+    private ISceneProEditService sceneProEditService;
+    @Value("${gy.company.id}")
+    private String gyCompanyId;
+    @Value("${oss.type}")
+    private String ossType;
+    @Value("${prefix.ali}")
+    private String prefixAli;
+    @Autowired
+    QueueNameService queueNameService;
+    @Autowired
+    IMqEcsService mqEcsService;
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    ComputerUtil computerUtil;
+
+    public BuildSceneReceiver() {
+    }
+
+    @RabbitListener(
+            queuesToDeclare = {@Queue("#{queueNameService.getQueueName()}")},
+            containerFactory = "rabbitListenerContainerFactory",
+            priority = "${mq.consumerPriority}"
+    )
+    public void process(String content, @Header("amqp_deliveryTag") long deliveryTag, Channel channel) throws Exception {
+        String redisKey = "zfb-modeling:" + content;
+        if (this.redisUtil.hasKey(redisKey)) {
+            log.info("重复计算退出计算:,{}", content);
+        } else {
+            this.redisUtil.set(redisKey, StringUtils.isBlank(SysConstants.hostName) ? "1" : SysConstants.hostName);
+            SysConstants.SYSTEM_BUILDING = true;
+            if (SysConstants.SYSTEM_OFFING) {
+                SysConstants.SYSTEM_BUILDING = false;
+                channel.basicNack(deliveryTag, true, true);
+                log.error("服务实例:{} 正在关闭,退出构建!", SysConstants.hostName);
+            } else if (ObjectUtils.isEmpty(content)) {
+                SysConstants.SYSTEM_BUILDING = false;
+                log.error("消息内容为空,退出构建,当前服务器id:{}", SysConstants.hostName);
+            } else {
+                long start = System.currentTimeMillis();
+                BuildLog buildLog = new BuildLog(SysConstants.hostName, this.queueNameService.getQueueName(), content);
+                BuildStatusEnum buildStatus = BuildStatusEnum.SUCCESS;
+                ExecutorService executorService = Executors.newFixedThreadPool(1);
+                Future<BuildStatusEnum> future = null;
+
+                try {
+                    this.preBuild(content, buildLog);
+                    future = executorService.submit(() -> {
+                        try {
+                            this.buildScene(content, buildLog);
+                            return BuildStatusEnum.SUCCESS;
+                        } catch (Exception var4) {
+                            log.error("服务实例:{} 构建异常:", SysConstants.hostName, var4);
+                            return BuildStatusEnum.FAILED;
+                        }
+                    });
+                    buildStatus = (BuildStatusEnum)future.get((long)SysConstants.modelTimeOut, TimeUnit.SECONDS);
+                } catch (TimeoutException var18) {
+                    log.error("服务实例:{} 构建异常:", SysConstants.hostName, var18);
+                    buildStatus = BuildStatusEnum.OVERTIME;
+                } catch (BuildException var19) {
+                    buildStatus = var19.getBuildStatus();
+                } catch (Exception var20) {
+                    log.error("服务实例:{} 构建异常:", SysConstants.hostName, var20);
+                    if (var20.getCause() instanceof BuildException) {
+                        buildStatus = ((BuildException)var20.getCause()).getBuildStatus();
+                    } else {
+                        buildStatus = BuildStatusEnum.FAILED;
+                    }
+                } finally {
+                    if (future != null) {
+                        future.cancel(true);
+                    }
+
+                    executorService.shutdown();
+                }
+
+                buildLog.setDuration((System.currentTimeMillis() - start) / 1000L);
+                this.afterBuild(buildStatus, buildLog);
+                this.delNas(buildLog.getSceneNum());
+                SysConstants.SYSTEM_BUILDING = false;
+                this.redisUtil.del(new String[]{redisKey});
+            }
+        }
+    }
+
+    private void delNas(String sceneNum) {
+        try {
+            ScenePro scenePro = this.sceneProService.findBySceneNum(sceneNum);
+            if (scenePro != null && StringUtils.isNotBlank(scenePro.getDataSource())) {
+                String dataSource = scenePro.getDataSource();
+                this.uploadToOssUtil.uploadDirectory(dataSource, "build_result/" + sceneNum + "/");
+                Thread.sleep(2000L);
+                FileUtil.del(dataSource);
+                this.sceneProService.updateDelBuildResult(scenePro.getId(), 1);
+            }
+        } catch (Exception var4) {
+            log.info("del-build-result-error:{}", var4);
+        }
+
+    }
+
+    private void preBuild(String content, BuildLog logRecord) throws Exception {
+        log.info("服务{} 开始处理队列{} 的消息:{}", SysConstants.hostName, this.queueNameService.getQueueName(), content);
+        Thread.sleep(2000L);
+        String[] strs = content.split(":;");
+        logRecord.setSceneNum(strs[4]);
+        String dataSource;
+        if (strs[2].contains("https:")) {
+            dataSource = strs[1];
+        } else {
+            dataSource = strs[1].substring(0, strs[1].lastIndexOf("/") + 1).concat(strs[2]);
+        }
+
+        logRecord.setDataSource(dataSource);
+    }
+
+    private void buildScene(String content, BuildLog logRecord) throws Exception {
+        String[] strs = content.split(":;");
+        String unicode = strs[0];
+        String path = strs[1];
+        String prefix = strs[2];
+        String imgsName = strs[3];
+        String projectNum = strs[4];
+        String userName = strs[6];
+        String cameraType = strs[7];
+        String algorithm = strs[8];
+        String fileId = strs[9];
+        String cameraName = strs[10];
+        String resolution = strs[11];
+        String buildType = "V2";
+        if (strs.length >= 13) {
+            buildType = strs[12];
+        }
+
+        String rebuild = "0";
+        if (strs.length >= 14) {
+            rebuild = strs[13];
+        }
+
+        logRecord.setBuildType(0);
+        logRecord.setSceneNum(projectNum);
+        log.info("用的算法是:" + algorithm);
+        log.info("用的相机是:" + (Integer.parseInt(cameraType) < 4 ? "单球目" : "双球目(八目)"));
+        String isModel = strs[5];
+        Long space = 0L;
+        int payStatus = 0;
+        String data;
+        Map dataMap;
+        if (Integer.parseInt(cameraType) < 3) {
+            int i = 0;
+
+            while(i < 5) {
+                try {
+                    FileUtils.downLoadFromUrl(prefix + imgsName + "?m=" + (new Date()).getTime(), imgsName, path + File.separator + "capture");
+                    FileUtils.decompress(path + File.separator + "capture" + File.separator + imgsName, path + File.separator + "capture");
+                    break;
+                } catch (Exception var54) {
+                    var54.printStackTrace();
+                    StringWriter trace = new StringWriter();
+                    var54.printStackTrace(new PrintWriter(trace));
+                    log.error(trace.toString());
+                    if (i < 4) {
+                        FileUtils.deleteFile(path + File.separator + "capture" + File.separator + imgsName);
+                        FileUtils.delFolder(path + File.separator + "capture" + File.separator + "images");
+                    }
+
+                    Thread.sleep(10000L);
+                    ++i;
+                }
+            }
+
+            FileUtils.deleteFile(path + File.separator + "capture" + File.separator + "zip.Zip");
+            data = FileUtils.readFile(path + File.separator + "capture" + File.separator + "data.fdage");
+            dataMap = this.computerUtil.getTypeString(cameraType, algorithm, resolution, (JSONObject)null);
+            String splitType = (String)dataMap.get("splitType");
+            data = (String)dataMap.get("skyboxType");
+            String dataDescribe = (String)dataMap.get("dataDescribe");
+            JSONObject dataJson = new JSONObject();
+            if (data != null) {
+                dataJson = JSONObject.parseObject(data);
+                if (dataJson.containsKey("imgs")) {
+                    splitType = "SPLIT_V4";
+                }
+            }
+
+            this.computerUtil.createJson(path, splitType, data, dataDescribe, projectNum, path);
+            dataMap = this.computerUtil.computer(projectNum, path, buildType, cameraType, dataJson);
+            this.uploadToOssUtil.uploadMulFiles(dataMap);
+            log.info("双目上完oss结束修改数据:" + projectNum);
+            this.sceneService.updateTime(projectNum, space, payStatus);
+        } else {
+            ScenePro scene = this.sceneProService.findBySceneNum(projectNum);
+            if (scene == null) {
+                log.error("场景不存在:{}", projectNum);
+                return;
+            }
+
+            long start = System.currentTimeMillis();
+            if (Integer.parseInt(cameraType) != 5 && Integer.parseInt(cameraType) != 6) {
+                if (Integer.parseInt(cameraType) == 14) {
+                    CreateObjUtil.ossUtilCpWithZfbBucket("home/" + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode + File.separator, ConstantFilePath.BUILD_MODEL_LASER_PATH + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode + File.separator + "capture");
+                    path = ConstantFilePath.BUILD_MODEL_LASER_PATH + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode;
+                } else if (Integer.parseInt(cameraType) >= 4) {
+                    CreateObjUtil.ossUtilCpWithZfbBucket("home/" + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode + File.separator, ConstantFilePath.BUILD_MODEL_PATH + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode + File.separator + "capture");
+                    path = ConstantFilePath.BUILD_MODEL_PATH + cameraName.replace("4DKKPRO_", "").replace("-fdage", "").toLowerCase() + File.separator + fileId + File.separator + unicode;
+                }
+            } else {
+                path = ConstantFilePath.BUILD_MODEL_PATH + unicode;
+                FileUtils.downLoadFromUrl(prefix + "/" + imgsName + "?m=" + System.currentTimeMillis(), imgsName, path + File.separator + "capture");
+                FileUtils.decompress(path + File.separator + "capture" + File.separator + imgsName, path + File.separator + "capture");
+                FileUtils.delFile(path + File.separator + "capture" + File.separator + imgsName);
+            }
+
+            data = FileUtils.readFile(path + File.separator + "capture" + File.separator + "data.fdage");
+            JSONObject dataJson = new JSONObject();
+            if (data != null) {
+                dataJson = JSONObject.parseObject(data);
+            }
+
+            File caches = new File(path + File.separator + "caches");
+            if (caches.exists()) {
+                File[] var61 = caches.listFiles();
+                int var27 = var61.length;
+
+                for(int var28 = 0; var28 < var27; ++var28) {
+                    File deleteFile = var61[var28];
+                    if ((new File(path + "_images")).exists()) {
+                        if (deleteFile.isDirectory()) {
+                            FileUtils.delAllFile(deleteFile.getAbsolutePath());
+                        } else {
+                            FileUtils.deleteFile(deleteFile.getAbsolutePath());
+                        }
+                    } else if (!deleteFile.getAbsolutePath().contains("images")) {
+                        if (deleteFile.isDirectory()) {
+                            FileUtils.delAllFile(deleteFile.getAbsolutePath());
+                        } else {
+                            FileUtils.deleteFile(deleteFile.getAbsolutePath());
+                        }
+                    }
+                }
+            }
+
+            if ((new File(path + File.separator + "results")).exists()) {
+                FileUtils.delAllFile(path + File.separator + "results");
+            }
+
+            log.info("path:" + path);
+            dataMap = this.computerUtil.getTypeString(cameraType, algorithm, resolution, dataJson);
+            String splitType = (String)dataMap.get("splitType");
+            String skyboxType = (String)dataMap.get("skyboxType");
+            String dataDescribe = (String)dataMap.get("dataDescribe");
+            if (dataJson.containsKey("videoVersion") && StringUtils.isNotEmpty(dataJson.getString("videoVersion")) && Integer.parseInt(dataJson.getString("videoVersion")) < 4) {
+                skyboxType = "SKYBOX_V6";
+            }
+
+            this.computerUtil.createJson(path, splitType, skyboxType, dataDescribe, projectNum, path);
+            Map<String, String> map = this.computerUtil.computer(projectNum, path, buildType, cameraType, dataJson);
+            if (Integer.parseInt(cameraType) == 5 || Integer.parseInt(cameraType) == 6) {
+                map.put(path + File.separator + "capture/stitch_params.txt", "data/data" + projectNum + "/stitch_params.txt");
+            }
+
+            map.put(path + File.separator + "capture/Up.xml", "data/data" + projectNum + "/Up.xml");
+            map.put(path + File.separator + "capture/Up2.xml", "data/data" + projectNum + "/Up2.xml");
+            if (Integer.parseInt(cameraType) == 13) {
+                map.put(path + File.separator + "capture/Up.txt", "data/data" + projectNum + "/Up.txt");
+                map.put(path + File.separator + "capture/Up2.txt", "data/data" + projectNum + "/Up2.txt");
+            }
+
+            this.uploadToOssUtil.uploadMulFiles(map);
+            payStatus = 1;
+            File spaceFile = null;
+            Iterator var32 = map.keySet().iterator();
+
+            while(var32.hasNext()) {
+                String uploadJson = (String)var32.next();
+                spaceFile = new File(uploadJson);
+                if (spaceFile.exists()) {
+                    space = space + spaceFile.length();
+                }
+            }
+
+            log.info("八目上完oss结束修改数据:" + projectNum);
+            String uploadData = FileUtils.readFile(path + File.separator + "results" + File.separator + "upload.json");
+            JSONArray array = null;
+            if (uploadData != null) {
+                JSONObject uploadJson = JSONObject.parseObject(uploadData);
+                array = uploadJson.getJSONArray("upload");
+            }
+
+            JSONObject fileJson = null;
+            String fileName = "";
+            Map<String, Object> videoMap = new HashMap();
+            String videosHdr = FileUtils.readFile(path + File.separator + "results/videos/videos_hdr_param.json");
+            JSONArray videoArray = null;
+            if (StringUtils.isNotEmpty(videosHdr)) {
+                videoArray = JSONObject.parseObject(videosHdr).getJSONArray("hdr_param");
+            }
+
+            if (videoArray != null) {
+                int i = 0;
+
+                for(int len = videoArray.size(); i < len; ++i) {
+                    videoMap.put(videoArray.getJSONObject(i).getString("name"), videoArray.getJSONObject(i).getString("value"));
+                    if (videoArray.getJSONObject(i).containsKey("fov")) {
+                        videoMap.put(videoArray.getJSONObject(i).getString("name") + "_fov", videoArray.getJSONObject(i).getString("fov"));
+                    }
+                }
+            }
+
+            JSONArray jsonArray = new JSONArray();
+            JSONObject videoJson = null;
+            JSONObject videosJson = new JSONObject();
+            long videoSize = 0L;
+            int i = 0;
+
+            for(int len = array.size(); i < len; ++i) {
+                fileJson = array.getJSONObject(i);
+                fileName = fileJson.getString("file");
+                if (fileJson.getIntValue("clazz") == 11 && fileName.contains(".mp4") && !fileName.contains("-ios.mp4")) {
+                    videoJson = new JSONObject();
+                    videoJson.put("id", fileName.substring(0, fileName.lastIndexOf(".")).replace("videos/", ""));
+                    if ((new File(path + File.separator + "results" + File.separator + fileName.replace(".mp4", ".ts"))).exists()) {
+                        videoSize = (new File(path + File.separator + "results" + File.separator + fileName.replace(".mp4", ".ts"))).length();
+                        videoJson.put("tsSize", videoSize);
+                    }
+
+                    if (videoMap.containsKey(videoJson.get("id"))) {
+                        videoJson.put("value", videoMap.get(videoJson.get("id")));
+                    }
+
+                    if (videoMap.containsKey(videoJson.get("id") + "_fov")) {
+                        videoJson.put("blend_fov", videoMap.get(videoJson.get("id") + "_fov"));
+                    } else {
+                        videoJson.put("blend_fov", 7);
+                    }
+
+                    jsonArray.add(videoJson);
+                }
+            }
+
+            videosJson.put("data", jsonArray);
+            if (dataJson.containsKey("videoVersion") && StringUtils.isNotEmpty(dataJson.getString("videoVersion")) && Integer.parseInt(dataJson.getString("videoVersion")) >= 4) {
+                videosJson.put("version", 3);
+                if ("oss".equals(this.ossType)) {
+                    videosJson.put("upPath", this.prefixAli + "data/data" + projectNum + "/Up.xml");
+                }
+
+                if ("s3".equals(this.ossType)) {
+                    videosJson.put("upPath", "https://eurs3.4dkankan.com/data/data" + projectNum + "/Up.xml");
+                }
+
+                if (Integer.parseInt(cameraType) == 13) {
+                    videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
+                }
+            } else {
+                videosJson.put("version", 1);
+                if ("oss".equals(this.ossType)) {
+                    videosJson.put("upPath", this.prefixAli + "data/data" + projectNum + "/Up2.xml");
+                }
+
+                if ("s3".equals(this.ossType)) {
+                    videosJson.put("upPath", "https://eurs3.4dkankan.com/data/data" + projectNum + "/Up2.xml");
+                }
+
+                if (Integer.parseInt(cameraType) == 13) {
+                    videosJson.put("upPath", videosJson.getString("upPath").replace(".xml", ".txt"));
+                }
+            }
+
+            if (Integer.parseInt(cameraType) == 5 || Integer.parseInt(cameraType) == 6) {
+                videosJson.put("version", 1);
+                if ("oss".equals(this.ossType)) {
+                    videosJson.put("upPath", this.prefixAli + "data/data" + projectNum + "/stitch_params.txt");
+                }
+
+                if ("s3".equals(this.ossType)) {
+                    videosJson.put("upPath", "https://eurs3.4dkankan.com/data/data" + projectNum + "/stitch_params.txt");
+                }
+            }
+
+            long computeTime = (System.currentTimeMillis() - start) / 1000L;
+            this.sceneProService.updateTime(projectNum, space, Integer.valueOf(payStatus), videosJson.toJSONString(), computeTime);
+            StringBuffer dataBuf = (new StringBuffer()).append("data").append(File.separator).append("data").append(projectNum).append(File.separator);
+            StringBuffer dataBuffer = (new StringBuffer("/mnt/4Dkankan/scene/")).append(dataBuf.toString());
+            String strsceneInfos = FileUtils.readFile(dataBuffer.toString() + "scene.json");
+            JSONObject scenejson = new JSONObject();
+            if (strsceneInfos != null) {
+                scenejson = JSONObject.parseObject(strsceneInfos);
+            }
+
+            scenejson.put("videos", videosJson.toJSONString());
+            FileUtils.writeFile(dataBuffer.toString() + "scene.json", scenejson.toString());
+            User userEntity = this.userService.findByUserName(userName);
+            if (userEntity == null) {
+                this.userService.updateUserUsedSpaceBySceneNum((Long)null, projectNum);
+            } else {
+                this.userService.updateUserUsedSpaceBySceneNum(userEntity.getId(), projectNum);
+            }
+
+            if (!ObjectUtils.isEmpty(scene.getUserId())) {
+                User sceneUser = (User)this.userService.getById(scene.getUserId());
+                if (!ObjectUtils.isEmpty(sceneUser.getCompanyId()) && this.gyCompanyId.equals(sceneUser.getCompanyId() + "")) {
+                    this.gYUploadToOssUtil.uploadMulFiles(map);
+                    this.gYUploadToOssUtil.upload("/mnt/4Dkankan/scene/data/data" + scene.getNum() + File.separator + "scene.json", "data/data" + scene.getNum() + File.separator + "scene.json");
+                    this.gYUploadToOssUtil.upload("/mnt/4Dkankan/scene/images/images" + scene.getNum() + File.separator + "floorLogoImg.png", "images/images" + scene.getNum() + File.separator + "floorLogoImg.png");
+                    this.gYUploadToOssUtil.upload("/mnt/4Dkankan/scene/images/images" + scene.getNum() + File.separator + "logo-main.png", "images/images" + scene.getNum() + File.separator + "logo-main.png");
+                    this.gYUploadToOssUtil.upload("/mnt/4Dkankan/scene/images/images" + scene.getNum() + File.separator + "logo-main.png", "images/images" + scene.getNum() + File.separator + "logo-main-en.png");
+                    SceneProEdit proEdit = this.sceneProEditService.findByProId(scene.getId());
+                    if (!ObjectUtils.isEmpty(proEdit.getBgMusicName())) {
+                        this.gYUploadToOssUtil.upload("/mnt/4Dkankan/scene/images/images" + scene.getNum() + File.separator + proEdit.getBgMusicName(), "images/images" + scene.getNum() + File.separator + proEdit.getBgMusicName());
+                    }
+                }
+            }
+        }
+
+        CreateObjUtil.deleteFile(path.replace(ConstantFilePath.BUILD_MODEL_PATH, "/") + "/capture");
+    }
+
+    private void afterBuild(BuildStatusEnum buildStatusEnum, BuildLog buildLog) {
+        try {
+            log.info("服务{} 计算结束:{},计算状态:{}", SysConstants.hostName, buildLog.getSceneNum(), buildStatusEnum.getDesc());
+            if (!buildStatusEnum.equals(BuildStatusEnum.REPEAT)) {
+                ScenePro scene = this.sceneProService.findBySceneNum(buildLog.getSceneNum());
+                if (scene != null) {
+                    JSONObject statusJson = new JSONObject();
+                    int status = scene.getStatus();
+                    if (status == -2) {
+                        status = 1;
+                    } else if (status == -1) {
+                        status = 0;
+                    }
+
+                    statusJson.put("status", status);
+                    statusJson.put("webSite", scene.getWebSite());
+                    statusJson.put("sceneNum", scene.getNum());
+                    statusJson.put("thumb", scene.getThumb());
+                    statusJson.put("payStatus", scene.getPayStatus());
+                    FileUtils.writeFile("/mnt/4Dkankan/scene/data/data" + buildLog.getSceneNum() + File.separator + "status.json", statusJson.toString());
+                    this.uploadToOssUtil.upload("/mnt/4Dkankan/scene/data/data" + buildLog.getSceneNum() + File.separator + "status.json", "data/data" + buildLog.getSceneNum() + File.separator + "status.json");
+                    this.uploadToOssUtil.upload(scene.getDataSource() + File.separator + "console.log", "build_log/" + scene.getNum() + File.separator + "console.log");
+                    buildLog.setLogDetailPath(this.prefixAli + "build_log/" + scene.getNum() + File.separator + "console.log");
+                }
+            }
+
+            buildLog.setStatus(buildStatusEnum.getStatus());
+            switch (buildLog.getStatus()) {
+                case -2:
+                case -1:
+                    this.handFail(buildStatusEnum.getDesc(), buildLog);
+                    break;
+                default:
+                    this.handleSuccess(buildLog);
+            }
+        } catch (Exception var6) {
+            var6.printStackTrace();
+        }
+
+    }
+
+    private void handleSuccess(BuildLog buildLog) {
+    }
+
+    private void handFail(String reason, BuildLog buildLog) {
+        this.sceneService.updateStatus(buildLog.getSceneNum(), -1);
+        this.sceneProService.updateStatus(buildLog.getSceneNum(), -1);
+        CompletableFuture.runAsync(() -> {
+            try {
+                DingDingUtils.sendMsgToDingRobot(reason, buildLog);
+            } catch (Exception var3) {
+                log.info("发送钉钉计算失败消息失败:", var3);
+            }
+
+        });
+    }
+}

+ 37 - 0
src/main/java/com/fdkankan/modeling/mq/QueueNameService.java

@@ -0,0 +1,37 @@
+package com.fdkankan.modeling.mq;
+
+import com.fdkankan.modeling.consants.SysConstants;
+import com.fdkankan.modeling.entity.MqEcs;
+import com.fdkankan.modeling.service.IMqEcsService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class QueueNameService {
+
+    @Value("${rabbitmq.queue}")
+    private String queue;
+    @Autowired
+    IMqEcsService mqEcsService;
+
+
+    public String getQueueName(){
+        String queueName = queue;
+        if(StringUtils.isBlank(SysConstants.hostName)){
+            log.info("获取hostName失败,监听队列名为:{}",queueName);
+            return queueName;
+        }
+        MqEcs mqEcs = mqEcsService.getByEcs(SysConstants.hostName);
+        if(mqEcs != null ){
+            queueName = mqEcs.getQueueName();
+            log.info("获取hostNam成功,监听队列名为:{}",queueName);
+            return queueName;
+        }
+        log.info("获取hostName失败,监听队列名为:{}",queueName);
+        return queueName;
+    }
+}

Разница между файлами не показана из-за своего большого размера
+ 7340 - 0
src/main/java/com/fdkankan/modeling/proto/BigSceneProto.java


Разница между файлами не показана из-за своего большого размера
+ 4654 - 0
src/main/java/com/fdkankan/modeling/proto/Common.java


Разница между файлами не показана из-за своего большого размера
+ 4345 - 0
src/main/java/com/fdkankan/modeling/proto/Visionmodeldata.java


+ 156 - 0
src/main/java/com/fdkankan/modeling/proto/format/CouchDBFormat.java

@@ -0,0 +1,156 @@
+package com.fdkankan.modeling.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
src/main/java/com/fdkankan/modeling/proto/format/HtmlFormat.java

@@ -0,0 +1,703 @@
+package com.fdkankan.modeling.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
src/main/java/com/fdkankan/modeling/proto/format/JavaPropsFormat.java


Разница между файлами не показана из-за своего большого размера
+ 1603 - 0
src/main/java/com/fdkankan/modeling/proto/format/JsonFormat.java


+ 602 - 0
src/main/java/com/fdkankan/modeling/proto/format/SmileFormat.java

@@ -0,0 +1,602 @@
+package com.fdkankan.modeling.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
src/main/java/com/fdkankan/modeling/proto/format/XmlFormat.java


+ 19 - 0
src/main/java/com/fdkankan/modeling/service/ICameraDetailService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.CameraDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 相机子表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ICameraDetailService extends IService<CameraDetail> {
+
+    CameraDetail findByCameraId(Long cameraId);
+
+    void addUsedSpace(Long space, Long id);
+}

+ 16 - 0
src/main/java/com/fdkankan/modeling/service/ICameraInstanceService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.CameraInstance;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ICameraInstanceService extends IService<CameraInstance> {
+
+}

+ 16 - 0
src/main/java/com/fdkankan/modeling/service/ICompanyService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.Company;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ICompanyService extends IService<Company> {
+
+}

+ 21 - 0
src/main/java/com/fdkankan/modeling/service/IMqEcsService.java

@@ -0,0 +1,21 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.MqEcs;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface IMqEcsService extends IService<MqEcs> {
+
+    MqEcs getByEcs(String hostName);
+
+    void updateStatus(String hostName, Integer status);
+
+    void updateStatusById(Integer id, Integer i);
+}

+ 16 - 0
src/main/java/com/fdkankan/modeling/service/IMqScalingService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.MqScaling;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface IMqScalingService extends IService<MqScaling> {
+
+}

+ 17 - 0
src/main/java/com/fdkankan/modeling/service/ISceneProEditService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.SceneProEdit;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ISceneProEditService extends IService<SceneProEdit> {
+
+    SceneProEdit findByProId(Long id);
+}

+ 29 - 0
src/main/java/com/fdkankan/modeling/service/ISceneProService.java

@@ -0,0 +1,29 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.ScenePro;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * pro场景表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ISceneProService extends IService<ScenePro> {
+
+    ScenePro findBySceneNum(String projectNum);
+
+    void updateTime(String projectNum, Long space, Integer payStatus, String jsonString, Long computeTime);
+
+    void updateStatus(String sceneNum, Integer status);
+
+    void tempScenes(List<Long> lockedIds, String sceneNum);
+
+    void updatePayStatus(Long id, Integer payStatus);
+
+    void updateDelBuildResult(Long Id, Integer delBuildResult);
+}

+ 19 - 0
src/main/java/com/fdkankan/modeling/service/ISceneService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.Scene;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface ISceneService extends IService<Scene> {
+
+    void updateTime(String projectNum, Long space, int payStatus);
+
+    void updateStatus(String sceneNum, int status);
+}

+ 19 - 0
src/main/java/com/fdkankan/modeling/service/IUserService.java

@@ -0,0 +1,19 @@
+package com.fdkankan.modeling.service;
+
+import com.fdkankan.modeling.entity.User;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+public interface IUserService extends IService<User> {
+
+    User findByUserName(String userName);
+
+    void updateUserUsedSpaceBySceneNum(Long userId, String projectNum);
+}

+ 36 - 0
src/main/java/com/fdkankan/modeling/service/impl/CameraDetailServiceImpl.java

@@ -0,0 +1,36 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.modeling.entity.CameraDetail;
+import com.fdkankan.modeling.mapper.ICameraDetailMapper;
+import com.fdkankan.modeling.service.ICameraDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 相机子表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, CameraDetail> implements ICameraDetailService {
+
+    @Override
+    public CameraDetail findByCameraId(Long cameraId) {
+        LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CameraDetail::getCameraId,cameraId);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public void addUsedSpace(Long space, Long id) {
+        LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CameraDetail::getId,id);
+        wrapper.set(CameraDetail::getUsedSpace,space);
+        this.update(wrapper);
+    }
+}

+ 20 - 0
src/main/java/com/fdkankan/modeling/service/impl/CameraInstanceServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.fdkankan.modeling.entity.CameraInstance;
+import com.fdkankan.modeling.mapper.ICameraInstanceMapper;
+import com.fdkankan.modeling.service.ICameraInstanceService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class CameraInstanceServiceImpl extends ServiceImpl<ICameraInstanceMapper, CameraInstance> implements ICameraInstanceService {
+
+}

+ 20 - 0
src/main/java/com/fdkankan/modeling/service/impl/CompanyServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.fdkankan.modeling.entity.Company;
+import com.fdkankan.modeling.mapper.ICompanyMapper;
+import com.fdkankan.modeling.service.ICompanyService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class CompanyServiceImpl extends ServiceImpl<ICompanyMapper, Company> implements ICompanyService {
+
+}

+ 44 - 0
src/main/java/com/fdkankan/modeling/service/impl/MqEcsServiceImpl.java

@@ -0,0 +1,44 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.modeling.entity.MqEcs;
+import com.fdkankan.modeling.mapper.IMqEcsMapper;
+import com.fdkankan.modeling.service.IMqEcsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class MqEcsServiceImpl extends ServiceImpl<IMqEcsMapper, MqEcs> implements IMqEcsService {
+
+    @Override
+    public MqEcs getByEcs(String hostName) {
+        LambdaQueryWrapper<MqEcs> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(MqEcs::getEcsName,hostName);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public void updateStatus(String hostName, Integer status) {
+        LambdaUpdateWrapper<MqEcs> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(MqEcs::getEcsName,hostName);
+        wrapper.set(MqEcs::getStatus,status);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void updateStatusById(Integer id, Integer status) {
+        LambdaUpdateWrapper<MqEcs> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(MqEcs::getId,id);
+        wrapper.set(MqEcs::getStatus,status);
+        this.update(wrapper);
+    }
+}

+ 20 - 0
src/main/java/com/fdkankan/modeling/service/impl/MqScalingServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.fdkankan.modeling.entity.MqScaling;
+import com.fdkankan.modeling.mapper.IMqScalingMapper;
+import com.fdkankan.modeling.service.IMqScalingService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class MqScalingServiceImpl extends ServiceImpl<IMqScalingMapper, MqScaling> implements IMqScalingService {
+
+}

+ 27 - 0
src/main/java/com/fdkankan/modeling/service/impl/SceneProEditServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.modeling.entity.SceneProEdit;
+import com.fdkankan.modeling.mapper.ISceneProEditMapper;
+import com.fdkankan.modeling.service.ISceneProEditService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class SceneProEditServiceImpl extends ServiceImpl<ISceneProEditMapper, SceneProEdit> implements ISceneProEditService {
+
+    @Override
+    public SceneProEdit findByProId(Long id) {
+        LambdaQueryWrapper<SceneProEdit> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneProEdit::getProId,id);
+        return this.getOne(wrapper);
+    }
+}

+ 90 - 0
src/main/java/com/fdkankan/modeling/service/impl/SceneProServiceImpl.java

@@ -0,0 +1,90 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.modeling.consants.ConstantFilePath;
+import com.fdkankan.modeling.entity.ScenePro;
+import com.fdkankan.modeling.mapper.ISceneProMapper;
+import com.fdkankan.modeling.service.ISceneProService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.modeling.util.FileUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * pro场景表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro> implements ISceneProService {
+
+    @Override
+    public ScenePro findBySceneNum(String projectNum) {
+        LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ScenePro::getNum,projectNum);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public void updateTime(String projectNum, Long space, Integer payStatus, String jsonString, Long computeTime) {
+        LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePro::getNum,projectNum);
+        wrapper.set(ScenePro::getCreateTime,new Date());
+        wrapper.set(ScenePro::getStatus,-2);
+        wrapper.set(ScenePro::getSpace,space);
+        wrapper.set(ScenePro::getPayStatus,payStatus);
+        wrapper.set(ScenePro::getVideos,jsonString);
+        wrapper.set(ScenePro::getComputeTime,computeTime);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void updateStatus(String sceneNum, Integer status) {
+        LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePro::getNum,sceneNum);
+        wrapper.set(ScenePro::getStatus,status);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void tempScenes(List<Long> lockedIds, String sceneNum) {
+        if (lockedIds == null || lockedIds.size() == 0){
+            return;
+        }
+        for (Long id : lockedIds){
+            this.updatePayStatus(id,-2);
+            try{
+                Map<String, Object> map = new HashMap<>();
+                map.put("payStatus", -2);
+                FileUtils.writeJsonFile(ConstantFilePath.SCENE_PATH + "data/data" + sceneNum + "/scene.json", map);
+            }catch (Exception e){
+                e.printStackTrace();
+            }
+
+        }
+    }
+
+    @Override
+    public void updatePayStatus(Long id, Integer payStatus) {
+        LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePro::getId,id);
+        wrapper.set(ScenePro::getPayStatus,payStatus);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void updateDelBuildResult(Long id, Integer delBuildResult) {
+        LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePro::getId,id);
+        wrapper.set(ScenePro::getDelBuildResult,delBuildResult);
+        this.update(wrapper);
+    }
+}

+ 39 - 0
src/main/java/com/fdkankan/modeling/service/impl/SceneServiceImpl.java

@@ -0,0 +1,39 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.modeling.entity.Scene;
+import com.fdkankan.modeling.mapper.ISceneMapper;
+import com.fdkankan.modeling.service.ISceneService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+public class SceneServiceImpl extends ServiceImpl<ISceneMapper, Scene> implements ISceneService {
+
+    @Override
+    public void updateTime(String projectNum, Long space, int payStatus) {
+        LambdaUpdateWrapper<Scene> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(Scene::getNum,projectNum);
+        wrapper.set(Scene::getStatus,-2);
+        wrapper.set(Scene::getCreateTime,new Date());
+        this.update(wrapper);
+    }
+
+    @Override
+    public void updateStatus(String sceneNum, int status) {
+        LambdaUpdateWrapper<Scene> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(Scene::getNum,sceneNum);
+        wrapper.set(Scene::getStatus,status);
+        this.update(wrapper);
+    }
+}

+ 69 - 0
src/main/java/com/fdkankan/modeling/service/impl/UserServiceImpl.java

@@ -0,0 +1,69 @@
+package com.fdkankan.modeling.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.modeling.entity.CameraDetail;
+import com.fdkankan.modeling.entity.ScenePro;
+import com.fdkankan.modeling.entity.User;
+import com.fdkankan.modeling.mapper.IUserMapper;
+import com.fdkankan.modeling.service.ICameraDetailService;
+import com.fdkankan.modeling.service.ISceneProService;
+import com.fdkankan.modeling.service.IUserService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2024-03-28
+ */
+@Service
+@Slf4j
+public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements IUserService {
+
+    @Autowired
+    ISceneProService sceneProService;
+    @Autowired
+    ICameraDetailService cameraDetailService;
+
+
+    @Override
+    public User findByUserName(String userName) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(User::getUserName,userName);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public void updateUserUsedSpaceBySceneNum(Long userId, String sceneNum) {
+        ScenePro sceneProEntity = sceneProService.findBySceneNum(sceneNum);
+        if(sceneProEntity == null){
+            log.info("该场景不存在无法扣除容量,场景码为:" + sceneNum);
+            return;
+        }
+        CameraDetail detailEntity = cameraDetailService.findByCameraId(sceneProEntity.getCameraId());
+
+        Long usedSpace = detailEntity.getUsedSpace() == null ? 0 : detailEntity.getUsedSpace();
+        Long sapce = sceneProEntity.getSpace() == null ? 0 : sceneProEntity.getSpace();
+
+        cameraDetailService.addUsedSpace(usedSpace + sapce,detailEntity.getId());
+        if(ObjectUtils.isEmpty(detailEntity.getTotalSpace())){
+            return;
+        }
+
+        if (detailEntity.getTotalSpace().compareTo(detailEntity.getUsedSpace()) == -1){
+            List<Long> ids = new ArrayList<>();
+            ids.add(sceneProEntity.getId());
+            sceneProService.tempScenes(ids,sceneNum);
+        }
+    }
+}

+ 47 - 0
src/main/java/com/fdkankan/modeling/task/TaskService.java

@@ -0,0 +1,47 @@
+package com.fdkankan.modeling.task;
+
+import com.fdkankan.modeling.consants.SysConstants;
+import com.fdkankan.modeling.entity.MqEcs;
+import com.fdkankan.modeling.entity.MqScaling;
+import com.fdkankan.modeling.service.IMqEcsService;
+import com.fdkankan.modeling.service.IMqScalingService;
+import com.fdkankan.modeling.util.ECSUtils;
+import lombok.extern.java.Log;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class TaskService {
+
+
+    @Autowired
+    IMqEcsService mqEcsService;
+    @Autowired
+    IMqScalingService mqScalingService;
+
+    @Scheduled(initialDelay = 1000 * 60 * 55,fixedDelay = 1000 * 60 * 60 )
+    public void checkEcs(){
+        SysConstants.SYSTEM_OFFING = true;
+        SysConstants.SYSTEM_OFFING = getSystemOffing();
+        log.info("检测是否关闭弹性伸缩:{}",SysConstants.SYSTEM_OFFING);
+    }
+
+    private Boolean getSystemOffing(){
+        if(StringUtils.isNotBlank(SysConstants.hostName) && !SysConstants.SYSTEM_BUILDING){
+            MqEcs mqEcs = mqEcsService.getByEcs(SysConstants.hostName);
+            MqScaling mqScaling = mqScalingService.getById(1);
+            if(mqEcs!= null && mqEcs.getIsScaling() == 1 && mqScaling != null){
+                Boolean flag = ECSUtils.delEcs(mqScaling, mqEcs.getEcsName());
+                if(flag){
+                    mqEcsService.updateStatusById(mqEcs.getId(),2);
+                }
+                return flag;
+            }
+        }
+        return false;
+    }
+}

+ 65 - 0
src/main/java/com/fdkankan/modeling/util/Base64Converter.java

@@ -0,0 +1,65 @@
+package com.fdkankan.modeling.util;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Base64;
+
+public class Base64Converter {
+
+    public final static Base64.Encoder encoder = Base64.getEncoder();
+    final static Base64.Decoder decoder = Base64.getDecoder();
+
+    /**
+     * 给字符串加密
+     * @param text
+     * @return
+     */
+    public static String encode(String text) {
+        byte[] textByte = new byte[0];
+        try {
+            textByte = text.getBytes("UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        String encodedText = encoder.encodeToString(textByte);
+        return encodedText;
+    }
+
+    /**
+     * 给字符串加密
+     * @param textByte
+     * @return
+     */
+    public static String encode(byte[] textByte) {
+        return encoder.encodeToString(textByte);
+    }
+
+    /**
+     * 将加密后的字符串进行解密
+     * @param encodedText
+     * @return
+     */
+    public static String decode(String encodedText) {
+        String text = null;
+        try {
+            text = new String(decoder.decode(encodedText), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        return text;
+    }
+
+    /**
+     * 根据逻辑截取加密后的密码
+     * @param text
+     * @return
+     */
+    public static String subText(String text){
+        //去掉前8位字符串
+        text = text.substring(8);
+        //去掉后8位字符串
+        text = text.substring(0, text.length() - 8);
+        //最后两个字符串换到前面,并且去掉剩下的后8位字符串
+        String result = text.substring(text.length() - 2) + text.substring(0, text.length() - 10);
+        return result;
+    }
+}

+ 387 - 0
src/main/java/com/fdkankan/modeling/util/ComputerUtil.java

@@ -0,0 +1,387 @@
+package com.fdkankan.modeling.util;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.modeling.consants.ConstantFileName;
+import com.fdkankan.modeling.consants.ConstantFilePath;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import java.io.File;
+import java.util.*;
+
+/**
+ * 生成场景和计算场景
+ * Created by Hb_zzZ on 2019/5/8.
+ */
+@Slf4j
+@Component
+public class ComputerUtil {
+
+
+    public  Map<String,String> computer(String projectNum, String path, String buildType, String cameraType,JSONObject fdageData) throws Exception{
+        Map<String,String> map = new HashMap<String,String>();
+        path = path.replace("//", "/");
+
+        log.info("开始建模:"+projectNum);
+        //构建算法isModel去掉,因此改成空字符串
+        if("V2".equals(buildType)){
+            CreateObjUtil.build3dModelOld(path, "");
+        }
+        if("V3".equals(buildType)){
+            CreateObjUtil.build3dModel(path, "");
+//        CreateObjUtil.build3dModel(unicode, "");
+        }
+        log.info("建模完成转换数据:"+projectNum);
+
+        boolean vision2 = false;
+        //读取upload文件,检验需要上传的文件是否存在
+        String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+        JSONObject uploadJson = null;
+        JSONArray array = null;
+        if(uploadData!=null) {
+            uploadJson = JSONObject.parseObject(uploadData);
+            array = uploadJson.getJSONArray("upload");
+        }
+        if(array == null){
+            String instanceId = FileUtils.readFile("/opt/hosts/hosts.txt");
+            FileUtils.writeFile(path + File.separator + "javaErrorNow.log", instanceId + ":计算错误!");
+
+            Thread.sleep(10000L);
+            FileUtils.writeFile(path + File.separator + "javaError.log", instanceId + ":计算错误!");
+            throw new Exception("upload.json数据出错");
+        }
+        JSONObject fileJson = null;
+        String fileName = "";
+        String meshfix = "";  //双模型时候会有改文件路径
+        for(int i = 0, len = array.size(); i < len; i++){
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            //文件不存在抛出异常
+            if(!new File(path + File.separator + "results" +File.separator + fileName).exists()){
+                throw new Exception(path + File.separator + "results" +File.separator + fileName+"文件不存在");
+            }
+
+            //判断是否有vision2.txt
+            if("vision2.txt".equals(fileName)){
+                vision2 = true;
+            }
+
+            //tex文件夹
+            if(fileJson.getIntValue("clazz") == 2 && !fileJson.containsKey("pack-file")){
+                if(fileName.contains("meshfix.txt")){
+                    meshfix = fileName;
+                }else {
+                    map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
+                            projectNum+"/"+ ConstantFileName.modelUUID+"_50k_texture_jpg_high1/"+fileName.replace("tex/", ""));
+                }
+                continue;
+            }
+
+            //high文件夹
+            if(fileJson.getIntValue("clazz") == 3){
+                map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
+                        projectNum+"/pan/high/"+ fileName.replace("high/", ""));
+                continue;
+            }
+            //low文件夹
+            if(fileJson.getIntValue("clazz") == 4){
+                map.put(path + File.separator + "results" +File.separator+ fileName,"images/images"+
+                        projectNum+"/pan/low/"+ fileName.replace("low/", ""));
+                continue;
+            }
+
+            //tiles文件夹,亚马逊没有裁剪图片api,不需要上传4k图
+//            if(fileJson.getIntValue("clazz") == 5 && !"s3".equals(ossType)){
+//                map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
+//                        projectNum+ File.separator + fileName);
+//                continue;
+//            }
+            if(fileJson.getIntValue("clazz") == 5 ){
+                map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
+                        projectNum+ File.separator + fileName);
+                continue;
+            }
+
+            //tiles文件夹,亚马逊瓦片图
+            if(fileJson.getIntValue("clazz") == 7 ){
+                if(fileName.contains("/4k_")){
+                    continue;
+                }
+                map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
+                        projectNum+ File.separator + fileName);
+                continue;
+            }
+
+            //updown文件复制一份到ecs中并去掉换行符
+            if(fileJson.getIntValue("clazz") == 10){
+                String updown = FileUtils.readFile(path + File.separator + "results" +File.separator+ fileName);
+                JSONObject updownJson = JSONObject.parseObject(updown);
+                FileUtils.writeFile(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + projectNum +
+                        File.separator + fileName.replace("updown", "mapping"), updownJson.toString());
+                continue;
+            }
+
+            //video视频文件或封面图
+            if(fileJson.getIntValue("clazz") == 11 || fileJson.getIntValue("clazz") == 12){
+                map.put(path + File.separator + "results" + File.separator+ fileName,"video/video"+
+                        projectNum+ File.separator + fileName.replace("videos/", ""));
+
+                if(fileName.contains(".mp4")){
+//                    CreateObjUtil.mp4ToFlv(path + File.separator + "results" + File.separator+ fileName,
+//                            path + File.separator + "results" + File.separator+ fileName.replace("mp4", "flv"));
+
+                    map.put(path + File.separator + "results" + File.separator+ fileName.replace("mp4", "flv"),"video/video"+
+                            projectNum+ File.separator + fileName.replace("videos/", "").replace("mp4", "flv"));
+                }
+            }
+
+            //2048的模型和贴图
+            if(fileJson.getIntValue("clazz") == 16){
+                map.put(path + File.separator + "results" + File.separator+ fileName,"data/data"+
+                        projectNum+ File.separator + fileName);
+            }
+
+            if(fileJson.getIntValue("clazz") == 18){
+                map.put(path + File.separator + "results" + File.separator+ fileName,"images/images"+
+                        projectNum+ File.separator + fileName);
+            }
+        }
+
+        if(fdageData.containsKey("exportMeshObj") || (!ObjectUtils.isEmpty(cameraType) && (Integer.parseInt(cameraType) != 14))){
+            CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k.dam");
+            CreateObjUtil.convertDamToLzma(path + File.separator + "results");
+            CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+"tex"+File.separator+"modeldata.txt", path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k.dam");
+            map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam.lzma");
+            map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k.dam");
+            File file = new File(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k.dam.lzma");
+            while(!file.exists())
+            {
+                Thread.sleep(60000);
+            }
+        }
+
+        //有meshfix,表示双模型
+        if(!"".equals(meshfix)){
+            CreateObjUtil.convertTxtToDam( path + File.separator + "results" + File.separator+meshfix, path + File.separator + "results" +File.separator+ ConstantFileName.modelUUID+"_50k2.dam");
+            CreateObjUtil.convertDamToLzma2(path + File.separator + "results");
+            CreateObjUtil.convertTxtToDam( path + File.separator + "results" +File.separator+meshfix, path + File.separator + "results" + File.separator+ConstantFileName.modelUUID+"_50k2.dam");
+            map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam.lzma", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam.lzma");
+            map.put(path + File.separator + "results" +File.separator+ConstantFileName.modelUUID+"_50k2.dam", "images/images"+projectNum+"/"+ConstantFileName.modelUUID+"_50k2.dam");
+        }
+
+        //8目相机有两个vision.txt因此第二个叫vision2.txt
+        CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision.txt",path + File.separator + "results" +File.separator+"vision.modeldata");
+        if(vision2){
+            CreateObjUtil.convertTxtToVisionmodeldata(path + File.separator + "results" +File.separator+"vision2.txt",path + File.separator + "results" +File.separator+"vision2.modeldata");
+            map.put(path + File.separator + "results" +File.separator+"vision2.modeldata", "images/images"+projectNum+"/"+"vision2.modeldata");
+        }else {
+            CreateObjUtil.convertTxtToVisionmodeldataCommon(path + File.separator + "results" +File.separator+"vision.txt",path + File.separator + "results" +File.separator+"vision.modeldata");
+        }
+        log.info("数据转换完成:"+projectNum);
+
+        map.put(path + File.separator + "results" +File.separator+"vision.modeldata", "images/images"+projectNum+"/"+"vision.modeldata");
+
+        File file = new File(ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum);
+        if(!file.exists())
+        {
+            file.mkdir();
+        }
+        FileUtils.copyFile(path + File.separator + "results" +File.separator+"floor.json", ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum+File.separator+"floor.json", true);
+        FileUtils.copyFile(path + File.separator + "results" +File.separator+"floorplan.json", ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum+File.separator+"floor.json", true);
+        FileUtils.copyFile(path + File.separator + "results" +File.separator+"floorplan.json", ConstantFilePath.SCENE_PATH+"data"+File.separator+"data"+projectNum+File.separator+"floorplan.json", true);
+        log.info("floor.json路径:"+ path + File.separator + "results" +File.separator+"floor.json");
+        map.put(path + File.separator + "results" +File.separator+"floor.json","data/data"+projectNum+"/floor.json");
+        map.put(path + File.separator + "results" +File.separator+"floorplan.json","data/data"+projectNum+"/floor.json");
+//        map.put(path + File.separator + "results" +File.separator+"floorplan_cad.json","data/data"+projectNum+"/house_floor.json");
+        map.put(path + File.separator + "results" +File.separator+"floorplan_cad.json","data/data"+projectNum+"/floorplan_cad.json");
+        log.info("准备上传文件到oss:"+projectNum);
+        return map;
+    }
+
+
+    public  Map<String,String> computerRebuildVideo(String projectNum, String path) throws Exception{
+        Map<String,String> map = new HashMap<String,String>();
+        path = path.replace("//", "/");
+
+        log.info("开始建模:"+projectNum);
+        //构建算法isModel去掉,因此改成空字符串
+        CreateObjUtil.build3dModel(path, "");
+        log.info("建模完成转换数据:"+projectNum);
+
+        boolean vision2 = false;
+        //读取upload文件,检验需要上传的文件是否存在
+        String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+        JSONObject uploadJson = null;
+        JSONArray array = null;
+        if(uploadData!=null) {
+            uploadJson = JSONObject.parseObject(uploadData);
+            array = uploadJson.getJSONArray("upload");
+        }
+
+        if(array == null){
+            String instanceId = FileUtils.readFile("/opt/hosts/hosts.txt");
+            FileUtils.writeFile(path + File.separator + "javaErrorNow.log", instanceId + ":计算错误!");
+
+            Thread.sleep(10000L);
+            FileUtils.writeFile(path + File.separator + "javaError.log", instanceId + ":计算错误!");
+            throw new Exception("upload.json数据出错");
+        }
+
+        JSONObject fileJson = null;
+        String fileName = "";
+        for(int i = 0, len = array.size(); i < len; i++) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            //文件不存在抛出异常
+            if (!new File(path + File.separator + "results" + File.separator + fileName).exists()) {
+                throw new Exception(path + File.separator + "results" + File.separator + fileName + "文件不存在");
+            }
+
+            //video视频文件或封面图
+            if (fileJson.getIntValue("clazz") == 20) {
+                if (fileName.contains(".mp4")) {
+                    map.put(path + File.separator + "results" + File.separator + fileName.replace("mp4", "flv"), "video/video" +
+                            projectNum + File.separator + fileName.replace("videos/", "").replace("mp4", "flv"));
+                }
+            }
+        }
+
+        log.info("准备上传文件到oss:"+projectNum);
+        return map;
+    }
+
+    /**
+     *  标定算法
+     * @param path
+     * @throws Exception
+     */
+    public  Map<String,String> computerCalibration(String path) throws Exception{
+
+        Map<String,String> map = new HashMap<String,String>();
+
+        log.info("开始标定:" );
+        //构建算法isModel去掉,因此改成空字符串
+        CreateObjUtil.build3dModel(path, "");
+//        CreateObjUtil.build3dModel(unicode, "");
+        log.info("标定完成转换数据:" );
+
+        boolean vision2 = false;
+        //读取upload文件,检验需要上传的文件是否存在
+        String uploadData = FileUtils.readFile(path + File.separator + "results" +File.separator+"upload.json");
+        JSONObject uploadJson = null;
+        JSONArray array = null;
+        if(uploadData!=null) {
+            uploadJson = JSONObject.parseObject(uploadData);
+            array = uploadJson.getJSONArray("upload");
+        }
+        if(array == null){
+            throw new Exception("upload.json数据出错");
+        }
+        JSONObject fileJson = null;
+        String fileName = "";
+        for(int i = 0, len = array.size(); i < len; i++) {
+            fileJson = array.getJSONObject(i);
+            fileName = fileJson.getString("file");
+            //文件不存在抛出异常
+            if (!new File(path + File.separator + "results" + File.separator + fileName).exists()) {
+                throw new Exception(path + File.separator + "results" + File.separator + fileName + "文件不存在");
+            }
+
+            if(fileJson.getIntValue("clazz") == 13 || fileJson.getIntValue("clazz") == 14){
+                map.put(path + File.separator + "results" +File.separator+ fileName,
+                        ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") +
+                                File.separator + fileName);
+            }
+        }
+        return map;
+    }
+
+    public  void createJson(String path, String splitType, String skyboxType, String dataDescribe,
+                                  String sceneNum, String dataSource) throws Exception{
+        JSONObject projectJson = new JSONObject();
+        projectJson.put("version", "201909231830");
+        projectJson.put("protocol", "file api 1.4");
+        projectJson.put("uuid", UUID.randomUUID().toString());
+        projectJson.put("description", "");
+        projectJson.put("time", System.currentTimeMillis());
+        projectJson.put("category", "default");
+        projectJson.put("tag", null);
+        projectJson.put("status", null);
+        projectJson.put("sceneNum", sceneNum);
+        projectJson.put("dataSource", dataSource);
+        FileUtils.writeFile(path + File.separator + "project.json", projectJson.toString());
+
+        JSONObject dataJson = new JSONObject();
+        dataJson.put("split_type", splitType);
+        dataJson.put("skybox_type", skyboxType);
+//        dataJson.put("data_describe", dataDescribe);
+        dataJson.put("extras", null);
+        FileUtils.writeFile(path + File.separator + "data.json", dataJson.toString());
+    }
+
+    public  Map<String, String> getTypeString(String cameraType, String algorithm, String resolution,JSONObject fdageData){
+        Map<String, String> map = new HashMap<>();
+        String splitType = "";
+        String skyboxType = "";
+        String dataDescribe = "";
+        if(Integer.parseInt(cameraType) >= 4){
+            if("0".equals(resolution)){
+//            skyboxType = "SKYBOX_V4";  //tiles
+//            skyboxType = "SKYBOX_V6";    //high,low,4k
+                skyboxType = "SKYBOX_V7";    //high,low,2k
+            }else {
+                skyboxType = "SKYBOX_V1";
+            }
+            splitType = "SPLIT_V1";
+//            skyboxType = "SKYBOX_V4";  //tiles
+            dataDescribe = "double spherical";
+
+            if(Integer.parseInt(cameraType) == 5 ){
+                //新双目相机
+//              skyboxType = "SKYBOX_V9";
+                splitType = "SPLIT_V9";
+                skyboxType = "SKYBOX_V1";
+            }
+            if(Integer.parseInt(cameraType) == 6){
+                //小红屋新双目相机
+//                    skyboxType = "SKYBOX_V9";
+                splitType = "SPLIT_V3";
+                skyboxType = "SKYBOX_V7";
+            }
+
+            if(Integer.parseInt(cameraType) == 13){
+                //转台相机
+                skyboxType = "SKYBOX_V6";
+                splitType = "SPLIT_V12";
+            }
+
+            if(Integer.parseInt(cameraType) == 14){
+                //转台相机
+                log.info("激光转台相机调用算法");
+                skyboxType = "SKYBOX_V6";
+                splitType = "SPLIT_V14";
+                if(!ObjectUtils.isEmpty(fdageData) && fdageData.containsKey("exportMeshObj")){
+                    splitType = "SPLIT_V22";
+                }
+            }
+
+        }else {
+            if("sfm".equals(algorithm)){
+                splitType = "SPLIT_V2";
+                skyboxType = "SKYBOX_V1";
+                dataDescribe = "old sfm";
+            }else {
+                splitType = "SPLIT_V3";
+                skyboxType = "SKYBOX_V1";
+                dataDescribe = "old slam";
+            }
+        }
+        map.put("splitType", splitType);
+        map.put("skyboxType", skyboxType);
+        map.put("dataDescribe", dataDescribe);
+        return map;
+    }
+}

+ 625 - 0
src/main/java/com/fdkankan/modeling/util/CreateObjUtil.java

@@ -0,0 +1,625 @@
+package com.fdkankan.modeling.util;
+
+import com.fdkankan.modeling.consants.ConstantCmd;
+import com.fdkankan.modeling.consants.ConstantFileName;
+import com.fdkankan.modeling.consants.ConstantFilePath;
+import com.fdkankan.modeling.proto.BigSceneProto;
+import com.fdkankan.modeling.proto.Common;
+import com.fdkankan.modeling.proto.Visionmodeldata;
+import com.fdkankan.modeling.proto.format.JsonFormat;
+import com.google.protobuf.TextFormat;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.*;
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+public class CreateObjUtil {
+
+	public void saveuploadImgs(String folderName) throws IOException, Exception
+	{
+		log.info("开始计算");
+		String command = "bash /home/ubuntu/photoscan-pro/build_model.sh "+folderName;
+		callshell(command);
+		boolean flag = false;
+		String sPath =  ConstantFilePath.CREATE_MODEL_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
+		while(!flag)
+		{
+			flag = isModel(sPath,folderName);
+		}
+		log.info("计算完毕");
+	}
+	
+	public void saveuploadImgs2(String folderName) throws IOException, Exception
+	{
+		log.info("开始计算");
+		String command = "bash /home/ubuntu/photoscan-pro/build_bigscene.sh "+folderName;
+		callshell(command);
+		boolean flag = false;
+		String sPath = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"mesh"+File.separator+"mesh.obj";
+		while(!flag)
+		{
+			flag = isModel(sPath,folderName);
+		}
+		log.info("计算完毕");
+		log.info("obj和camera转换成大场景要的格式");
+		convertobjTotxt( folderName);
+		
+	}
+
+	//开始建模
+	public static void unRar(String rarPath,String dataPath) throws Exception{
+		log.info("解压rar开始");
+		String command = "unrar e " + rarPath + " " + dataPath;
+		callshell(command);
+		log.info("解压rar完毕:" + command);
+	}
+
+	public static void unZip(String zipPath,String dataPath) {
+		log.info("解压zip开始");
+		String command = String.format(ConstantCmd.unzipCmd,zipPath,dataPath);
+		callshell(command);
+		log.info("解压zip完毕:" + command);
+	}
+	public static void wget(String url,String savePath) {
+		log.info("下载文件开始");
+		if(!new File(savePath).getParentFile().exists()){
+			new File(savePath).getParentFile().mkdirs();
+		}
+		String command = String.format(ConstantCmd.wgetUrlCmd,savePath,url);
+		callshell(command);
+		log.info("下载文件完毕:" + command);
+	}
+
+	//开始建模
+	public static void build3dModel(String folderName,String isModel) throws Exception{
+		log.info("开始建模");
+		String command = ConstantCmd.BUILD_MODEL_COMMAND+folderName;
+		callshell(command);
+		log.info("计算完毕:" + command);
+	}
+
+	//开始建模
+	public static void build3dModel2(String folderName,String isModel) throws Exception{
+		log.info("开始建模");
+		String command = ConstantCmd.BUILD_MODEL_COMMAND2+folderName;
+		callshell(command);
+		log.info("计算完毕:" + command);
+	}
+
+	//开始建模
+	public static void build3dModelOld(String folderName,String isModel) throws Exception{
+		log.info("开始v2建模");
+		String command = ConstantCmd.BUILD_MODEL_OLD_COMMAND+folderName;
+		callshell(command);
+		log.info("计算v2完毕:" + command);
+	}
+	
+	//开始建模
+	public void build3dModelSFM(String folderName,String isModel) throws Exception{
+		log.info("开始建模");
+		String command = ConstantCmd.BUILD_MODEL_SFM_COMMAND+folderName+" "+isModel;
+		callshell(command);
+		log.info("计算完毕");
+	}
+
+	//obj文件转换问txt
+	public static void objToTxt(String folderName,String isModel) throws Exception{
+		log.info("obj2txt开始转换");
+		String command = ConstantCmd.OBJ_TO_TXT+folderName;
+		callshell(command);
+		log.info("转换完毕:" + command);
+	}
+
+	public void rebuildModelFllor(String folderName, String isModel) {
+		try{
+			log.info("开始建模");
+			String command = ConstantCmd.REBUILD_MODEL_FLLOR+folderName+" "+isModel;
+			callshell(command);
+			log.info("计算完毕");
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+
+	//切图
+	public void cutImgs(String[] imgNames ,String folderName)
+	{
+		try{
+			log.info("开始切图");
+			for(int i=0;i<imgNames.length;++i)
+			{
+				String imgName=imgNames[i].replace(".jpg", "");
+				String command = ConstantCmd.CUT_IMG_COMMAND+folderName+" "+imgName;
+				callshell(command);
+			}
+			log.info("切图完毕");
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+	
+	//调整切图
+	public void adjustImgs(String folderName)
+	{
+		try{
+			String command = ConstantCmd.ADJUST_IMG_COMMAND + folderName;
+			log.info("开始调整图片");
+			callshell(command);
+			log.info("调整图片完毕");
+		}
+		catch(Exception e)
+		{
+			e.printStackTrace();
+		}
+	}
+	
+	//obj和camera转换成大场景要的格式
+	public void convertobjTotxt(String folderName) throws Exception
+	{
+		//obj
+		String command = "/home/ubuntu/photoscan-pro/main/mesh/mesh "+folderName;
+		callshell(command);
+		//camera
+		command = "/home/ubuntu/photoscan-pro/main/read_camera/read_camera "+folderName;
+		callshell(command);
+		
+		String prefix = ConstantFilePath.CREATE_BIG_SCENE_PATH+folderName+File.separator+"data"+File.separator;
+		String srcpath = prefix +"mesh.txt";
+		String despath = prefix +"dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
+				
+		convertTxtToDam( srcpath, despath);
+		//dam转换成lzma
+		command = "lzma /home/ubuntu/photo_data/bigscene/"+folderName+"/data/dacf7dfa24ae47fab8fcebfe4dc41ab9_50k.dam";
+		callshell(command);
+		
+		srcpath = prefix +"vision.txt";
+		despath = prefix +"vision.modeldata";
+		convertTxtToVisionmodeldata( srcpath, despath);
+	}
+
+	public static void convertDamToLzma(String folderName)throws Exception
+	{
+		try
+		{
+			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k.dam";
+			log.info("开始转换lzma");
+			callshell(command);
+			log.info("转换lzma完毕");
+		}
+		catch(Exception e)
+		{
+			StringWriter trace=new StringWriter();
+			e.printStackTrace(new PrintWriter(trace));
+			log.error(trace.toString());
+		}
+
+	}
+
+	public static void convertDamToLzma2(String folderName)throws Exception
+	{
+		try
+		{
+			String command = "lzma "+ folderName+File.separator+ ConstantFileName.modelUUID+"_50k2.dam";
+			log.info("开始转换lzma");
+			callshell(command);
+			log.info("转换lzma完毕");
+		}
+		catch(Exception e)
+		{
+			StringWriter trace=new StringWriter();
+			e.printStackTrace(new PrintWriter(trace));
+			log.error(trace.toString());
+		}
+
+	}
+	
+	public static void convertTxtToDam(String srcpath,String despath)throws Exception
+	{
+			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();
+	}
+	
+	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());
+		}
+	}
+	
+	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 convertVisionmodeldataToTxtCommon(String srcpath,String despath)throws Exception
+	{
+		try
+		{
+			File file = new File(srcpath);
+			FileInputStream fis=new FileInputStream(file);
+
+			Common.NavigationInfo data_NavigationInfo = Common.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());
+		}
+	}
+
+	public static void convertTxtToVisionmodeldataCommon(String srcpath,String despath)throws Exception
+	{
+		try
+		{
+			Common.NavigationInfo.Builder builder = Common.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 callshell(String command)
+	{ 
+        try {  
+        	Process process = Runtime.getRuntime().exec(command);  
+        	//process.waitFor();
+        	/*
+        	 // 注意下面的操作
+        	 String ls_1;
+        	 BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream()));
+        	 while ( (ls_1=bufferedReader.readLine()) != null);
+        	 bufferedReader.close();
+        	 process.waitFor();
+        	 */
+        	//doWaitFor(process) ;
+
+        	 StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), "ERROR");
+             errorGobbler.start();  
+             StreamGobbler outGobbler = new StreamGobbler(process.getInputStream(), "STDOUT");  
+             outGobbler.start();  
+             process.waitFor();  
+        } catch (Exception e) {  
+            log.info("执行命令出错:{}",command,e);
+        }  
+	}
+	
+	public static int doWaitFor(Process process) {
+		  InputStream in = null;
+		  InputStream err = null;
+		  int exitValue = -1; // returned to caller when p is finished
+		  try {
+		    in = process.getInputStream();
+		    err = process.getErrorStream();
+		    boolean finished = false; // Set to true when p is finished
+		    while (!finished) {
+		      try {
+		        while (in.available() > 0) {
+		          // Print the output of our system call
+		          Character c = new Character((char) in.read());
+		          System.out.print(c);
+		        }
+		        while (err.available() > 0) {
+		          // Print the output of our system call
+		          Character c = new Character((char) err.read());
+		          System.out.print(c);
+		        }
+		        // Ask the process for its exitValue. If the process
+		        // is not finished, an IllegalThreadStateException
+		        // is thrown. If it is finished, we fall through and
+		        // the variable finished is set to true.
+		        exitValue = process.exitValue();
+		        finished = true;
+		      } catch (IllegalThreadStateException e) {
+		        // Process is not finished yet;
+		        // Sleep a little to save on CPU cycles
+		        Thread.currentThread().sleep(500);
+		      }
+		    }
+		  } catch (Exception e) {
+		    e.printStackTrace();
+		  } finally {
+		    try {
+		      if (in != null) {
+		        in.close();
+		      }
+		    } catch (IOException e) {
+		      e.printStackTrace();
+		    }
+		    if (err != null) {
+		      try {
+		        err.close();
+		      } catch (IOException e) {
+		        e.printStackTrace();
+		      }
+		    }
+		  }
+		  return exitValue;
+		}
+
+	
+	private boolean isModel(String sPath,String folderName)
+	{
+		boolean flag = false;  
+		File file = new File(sPath);  
+	    if (file.isFile() && file.exists()) {  
+	        flag = true;  
+	    }  
+	    log.info("等待...");
+	    return flag;  
+	}
+	
+	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 Map<String,String> getAllFile(String dPath,String prefix)
+	{
+		File dirFile = new File(dPath);
+	    if (!dirFile.isDirectory()) {
+        }
+	    Map<String,String> map = new HashMap<String,String>();
+	    File[] files = dirFile.listFiles();
+	    for (int i = 0; i < files.length; i++) {
+            if (files[i].isFile()) {
+            	String path = files[i].getPath();
+            	map.put(path, prefix+path.substring(path.lastIndexOf("/")+1));
+            }
+        }
+	    return map;
+	}
+	
+	public Map<String,String> getchildFile(String dPath,String prefix,String childname)
+	{
+		File dirFile = new File(dPath+File.separator+childname);
+	    if (!dirFile.isDirectory()) {
+	    	return null;
+        }
+	    Map<String,String> map = new HashMap<String,String>();
+	    File[] files = dirFile.listFiles();
+	    for (int i = 0; i < files.length; i++) {
+            if (files[i].isFile()) {
+            	String path = files[i].getPath();
+            	map.put(path, prefix+childname+path.substring(path.lastIndexOf("/")));
+            }
+        }
+	    return map;
+	}
+	
+	//转台拼图
+	public void buildPanoramicImgs(String folderName)throws Exception
+	{
+		String command = ConstantCmd.BUILD_PANORAMA + folderName;
+		log.info("开始拼全景图");
+		callshell(command);
+		log.info("全景图拼接完毕");
+	}
+	
+	//六目拼图、切图,计算
+	public void buildForSix(String folderName)throws Exception
+	{
+		String command = ConstantCmd.BUILD_FOR_SIX + folderName;
+		log.info("开始处理数据(六目)");
+		callshell(command);
+		log.info("数据处理完毕(六目)");
+	}
+
+	public static void createSoftConnection(String source, String target) {
+		String command = "ln -s " + source + " " + target;
+		log.info("开始创建文件夹软连接");
+		callshell(command);
+		log.info("数据处理完毕(六目):" + command);
+	}
+
+	//合并音频
+	public static void mergeVideo(String oldVideo , String newVideo, String targetVideo) throws Exception{
+		String command = ConstantCmd.MERGE_VIDEO + " " + oldVideo + " " + newVideo + " " + targetVideo + " -y";
+		log.info("开始合并视频");
+		callshell(command);
+		log.info("合并视频完毕:" + command);
+	}
+
+	//生成一段静音音频
+	public static void createMuteViode(double time , String targetVideo) throws Exception{
+		String command = ConstantCmd.CREATE_MUTE_VIDEO + " " + time + " " + targetVideo + " -y";
+		log.info("开始生成一段静音音频");
+		callshell(command);
+		log.info("生成一段静音音频完毕:" + command);
+	}
+
+	//mp4文件转换成flv文件
+	public static void mp4ToFlv(String oldVideo, String newVideo) throws Exception{
+		String command = ConstantCmd.MP4_TO_FLV + " " + oldVideo + " " + newVideo;
+		log.info("mp4文件转换成flv文件");
+		callshell(command);
+		log.info("mp4文件转换成flv文件完毕:" + command);
+	}
+
+	//删除/mnt/data/下的数据
+	public static void deleteFile(String filePath) throws Exception{
+		String command = ConstantCmd.DELETE_FILE + " " + filePath;
+		log.info("删除/mnt/data/下的数据");
+		callshell(command);
+		log.info("删除/mnt/data/下的数据完毕:" + command);
+	}
+
+	public static void ossUtilCp(String fileUrl , String path) throws Exception{
+		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path;
+		Long start = System.currentTimeMillis();
+		log.info("开始oss下载文件:" + command);
+		callshell(command);
+		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
+	}
+
+	public static void ossUtilCpWithZfbBucket(String fileUrl , String path) throws Exception{
+		String command = ConstantCmd.OSS_UTIL_CP + " " + fileUrl + " " + path+" zfb-4dkankan";
+		Long start = System.currentTimeMillis();
+		log.info("开始oss下载文件:" + command);
+		callshell(command);
+		log.info("oss下载文件完成,时间为:" + (System.currentTimeMillis() - start));
+	}
+
+	public static void ossFileCp(String fileUrl , String path) throws Exception{
+		String command = ConstantCmd.OSS_FILE_CP + " " + fileUrl + " " + path;
+		Long start = System.currentTimeMillis();
+		log.info("开始s3文件下载文件:" + command);
+		callshell(command);
+		log.info("s3文件下载文件完成,时间为:" + (System.currentTimeMillis() - start));
+	}
+
+	/**
+	 * matterpro场景获取阿里云的切图数据
+	 * @param path
+	 * @throws Exception
+     */
+	public static void matterproCutImg(String num , String path) throws Exception{
+		String command = ConstantCmd.MATTERPRO_CUT_IMG + " -s " + num + " -d " + path;
+		Long start = System.currentTimeMillis();
+		log.info("开始matterpro获取阿里云图片方法:" + command);
+		callshell(command);
+		log.info("matterpro获取阿里云图片方法完成,时间为:" + (System.currentTimeMillis() - start));
+	}
+
+	public static void main(String[] args) {
+		try{
+//			File path = new File("F:\\桌面\\vison");
+//			File[] files = path.listFiles();
+//			String src = "";
+//			String des = "";
+//			for(File file : files){
+//				src = file.getAbsolutePath() + File.separator + "vision.modeldata";
+//				des = file.getAbsolutePath() + File.separator + "vision.txt";
+//				System.out.println(src);
+//				convertVisionmodeldataToTxt(src, des);
+//			}
+
+//			convertTxtToVisionmodeldataCommon("F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2020-11\\visions1.json", "F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2020-11\\vision.modeldata");
+			convertTxtToVisionmodeldataCommon("C:\\Users\\hisun\\Downloads\\vision.txt", "C:\\Users\\hisun\\Downloads\\vision.modeldata");
+//			convertTxtToDam("F:\\桌面\\c11m-T11-EA\\results\\tex\\modeldata.txt", "F:\\桌面\\c11m-T11-EA\\results\\"+ ConstantFileName.modelUUID+"_50k.dam");
+//			convertTxtToVisionmodeldata("F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2020-05\\vision.txt", "F:\\文档\\WeChat Files\\Iove-bing\\FileStorage\\File\\2020-05\\vision.modeldata");
+//			convertVisionmodeldataToTxt("G:\\javaProject\\baidu-master\\vision.modeldata","G:\\javaProject\\baidu-master\\vision.txt");
+//			convertVisionmodeldataToTxtCommon("F:\\文档\\下载\\vision (1).modeldata", "F:\\文档\\下载\\vision (1).txt");
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+
+	}
+}

+ 96 - 0
src/main/java/com/fdkankan/modeling/util/DingDingUtils.java

@@ -0,0 +1,96 @@
+package com.fdkankan.modeling.util;
+
+import com.dingtalk.api.DefaultDingTalkClient;
+import com.dingtalk.api.DingTalkClient;
+import com.dingtalk.api.request.OapiRobotSendRequest;
+import com.dingtalk.api.response.OapiRobotSendResponse;
+import com.fdkankan.modeling.consants.SysConstants;
+import com.fdkankan.modeling.entity.BuildLog;
+import com.taobao.api.ApiException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.crypto.Mac;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+
+@Component
+public class DingDingUtils {
+
+    private static final Logger log = LoggerFactory.getLogger(DingDingUtils.class);
+
+    private static String environment;
+
+    private static String token = "6d47644ca903fca9154675f179bde79870e8f8fa243cd447c6e9e1d95b7527f1";
+
+    private static String secret = "SECd7195545b1de281940a16c155638c294f95884ae49160895653c48b1552b14ca";
+
+    @Value("${environment:dev}")
+    public void setEnvironment(String environment){
+        DingDingUtils.environment = environment;
+    }
+
+    @Value("${dingtalk.token:6d47644ca903fca9154675f179bde79870e8f8fa243cd447c6e9e1d95b7527f1}")
+    public void setToken(String token) {
+        DingDingUtils.token = token;
+    }
+
+    @Value("${dingtalk.secret:SECd7195545b1de281940a16c155638c294f95884ae49160895653c48b1552b14ca}")
+    public void setSign(String secret) {
+        DingDingUtils.secret = secret;
+    }
+
+    private static String msgPattern = "**环境**: %s\n\n" +
+            "**服务器名称**: %s\n\n" +
+            "**失败原因**: %s\n\n" +
+            "**num**: %s\n\n" +
+            "**server-path**: %s\n\n" +
+            "**algorithm-log**: [%s](%s)";
+
+
+    public static void sendMsgToDingRobot(String reason, BuildLog buildLog) throws ApiException, UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
+        String content = String.format(msgPattern, environment, SysConstants.hostName, reason, buildLog.getSceneNum(),
+                buildLog.getDataSource(), buildLog.getLogDetailPath(), buildLog.getLogDetailPath());
+        log.info("服务器:{},发送钉钉消息:{}",SysConstants.hostName,content);
+        sendMsgToDingRobot(content);
+    }
+
+    public static void sendMsgToDingRobot(String content) throws ApiException, UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
+        Long timestamp = System.currentTimeMillis();
+        String sign = getSign(timestamp);
+        DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?" +
+                "access_token="+token +
+                "&timestamp=".concat(String.valueOf(timestamp)).concat("&sign=").concat(sign));
+        OapiRobotSendRequest request = new OapiRobotSendRequest();
+        request.setMsgtype("actionCard");
+        OapiRobotSendRequest.Actioncard actioncard = new OapiRobotSendRequest.Actioncard();
+        actioncard.setTitle("场景计算失败");
+        actioncard.setText(content);
+        request.setActionCard(actioncard);
+        OapiRobotSendRequest.At at = new OapiRobotSendRequest.At();
+        at.setAtMobiles( new ArrayList<>());
+        // isAtAll类型如果不为Boolean,请升级至最新SDK
+        at.setIsAtAll(true);
+        request.setAt(at);
+        OapiRobotSendResponse re = client.execute(request);
+        System.out.println(re.getBody());
+    }
+
+    public static String getSign(Long timestamp) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException {
+        String stringToSign = timestamp + "\n" + secret;
+        Mac mac = Mac.getInstance("HmacSHA256");
+        mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256"));
+        byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8"));
+        return URLEncoder.encode(Base64Converter.encode(signData));
+    }
+
+    public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException, ApiException {
+        sendMsgToDingRobot("testtesttesttest");
+    }
+}

+ 81 - 0
src/main/java/com/fdkankan/modeling/util/ECSUtils.java

@@ -0,0 +1,81 @@
+package com.fdkankan.modeling.util;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.aliyun.ess20220222.Client;
+import com.aliyun.ess20220222.models.ExecuteScalingRuleRequest;
+import com.aliyun.ess20220222.models.ExecuteScalingRuleResponse;
+import com.aliyun.ess20220222.models.RemoveInstancesRequest;
+import com.aliyun.ess20220222.models.RemoveInstancesResponse;
+import com.aliyun.teaopenapi.models.Config;
+import com.fdkankan.modeling.entity.MqScaling;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Arrays;
+import java.util.UUID;
+
+
+@Slf4j
+public class ECSUtils {
+
+    public static Client initClient(String accessKey,String accessKeySecret,String endPoint) throws Exception {
+        Config config = new Config();
+        config.setAccessKeyId(accessKey);
+        config.setAccessKeySecret(accessKeySecret);
+        config.setEndpoint(endPoint);
+        return new Client(config);
+    }
+
+    public static Boolean executeScalingActivity(Client client, String scalingRuleAri) throws Exception{
+        ExecuteScalingRuleRequest request = new ExecuteScalingRuleRequest();
+        request.setScalingRuleAri(scalingRuleAri);
+        request.setClientToken(UUID.randomUUID().toString()); // 使用UUID生成唯一标识,避免并发冲突
+        ExecuteScalingRuleResponse response = client.executeScalingRule(request);
+        log.info("executeScalingActivity-resp:{}",JSONObject.toJSONString(response));
+        if(response.getStatusCode() == 200){
+            return true;
+        }
+        return false;
+    }
+    public static Boolean executeScalingStop(Client client, String groupId,String instanceId)  throws Exception{
+        RemoveInstancesRequest removeInstancesRequest = new RemoveInstancesRequest();
+        removeInstancesRequest.setScalingGroupId(groupId);
+        removeInstancesRequest.setInstanceIds(Arrays.asList(instanceId));
+        RemoveInstancesResponse  removeInstancesResponse = client.removeInstances(removeInstancesRequest);
+        log.info("executeScalingStop-resp:{}",JSONObject.toJSONString(removeInstancesResponse));
+        if(removeInstancesResponse.getStatusCode() == 200){
+            return true;
+        }
+        return false;
+    }
+
+    public static boolean createEcs(String accessKey,String secret,String endpoint,String scalingRuleAri){
+        try {
+            Client client = initClient(accessKey,secret,endpoint);
+            return executeScalingActivity(client, scalingRuleAri);
+        }catch (Exception e){
+            log.info("createEcs--error:",e);
+        }
+        return false;
+    }
+
+    public static Boolean delEcs(String accessKey,String secret,String endpoint,String scalingGroupId,String instanceId){
+        try {
+            Client client = initClient(accessKey,secret,endpoint);
+            return executeScalingStop(client, scalingGroupId,instanceId);
+        }catch (Exception e){
+            log.info("delEcs--error:",e);
+        }
+        return false;
+    }
+
+    public static Boolean delEcs(MqScaling mqScaling, String instanceId){
+        return delEcs(mqScaling.getAccessKey(),mqScaling.getSecret(),mqScaling.getEndpoint(),mqScaling.getScalingGroupId(),instanceId);
+    }
+
+    public static Boolean createEcs(MqScaling mqScaling){
+        return createEcs(mqScaling.getAccessKey(),mqScaling.getSecret(),mqScaling.getEndpoint(),mqScaling.getScalingRuleAri());
+    }
+
+
+}

+ 940 - 0
src/main/java/com/fdkankan/modeling/util/FileUtils.java

@@ -0,0 +1,940 @@
+package com.fdkankan.modeling.util;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.tools.zip.ZipEntry;
+import org.apache.tools.zip.ZipFile;
+import org.apache.tools.zip.ZipOutputStream;
+import org.springframework.util.ResourceUtils;
+import sun.misc.BASE64Decoder;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.List;
+import java.util.*;
+
+@Slf4j
+public class FileUtils {
+
+    //文件路径+名称
+    private static String fileNameTemp;
+
+    public static void uploadImg(String path, String base64Data)
+            throws Exception {
+        byte[] bt = null;
+        try {
+            BASE64Decoder decoder = new BASE64Decoder();
+            if (base64Data.startsWith("data:image/png;base64,")) {
+                bt = decoder.decodeBuffer(base64Data.replace("data:image/png;base64,", ""));
+            } else if (base64Data.startsWith("data:image/jpeg;base64,")) {
+                bt = decoder.decodeBuffer(base64Data.replace("data:image/jpeg;base64,", ""));
+            } else if (base64Data.startsWith("data:image/bmp;base64,")) {
+                bt = decoder.decodeBuffer(base64Data.replace("data:image/bmp;base64,", ""));
+            } else {
+                return;
+            }
+            writeBinary(bt, path);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private static void writeBinary(byte[] buf, String filePath) throws Exception {
+        File fout = new File(filePath);
+        if (!fout.getParentFile().exists()) {
+            fout.getParentFile().mkdirs();
+        }
+        FileOutputStream fos = new FileOutputStream(fout);
+        ByteArrayInputStream stream = new ByteArrayInputStream(buf);
+        BufferedOutputStream bos = new BufferedOutputStream(fos);//设置输出路径
+        BufferedInputStream bis = new BufferedInputStream(stream);
+        int b = -1;
+        while ((b = bis.read()) != -1) {
+            bos.write(b);
+        }
+        bis.close();
+        bos.close();
+    }
+	
+	public static boolean createDir(String destDirName) {
+        File dir = new File(destDirName);  
+        if (dir.exists()) {  
+            System.out.println("创建目录" + destDirName + "失败,目标目录已经存在");  
+            return false;  
+        }  
+        if (!destDirName.endsWith(File.separator)) {  
+            destDirName = destDirName + File.separator;  
+        }  
+        //创建目录  
+        if (dir.mkdirs()) {  
+            System.out.println("创建目录" + destDirName + "成功!");  
+            return true;  
+        } else {  
+            System.out.println("创建目录" + destDirName + "失败!");  
+            return false;  
+        }  
+    }
+	
+
+    /**
+     * 创建文件
+     * @param fileName  文件名称
+     * @param fileContent   文件内容
+     * @return  是否创建成功,成功则返回true
+     */
+    public static boolean createFile(String path, String fileName,String fileContent){
+        Boolean bool = false;
+        fileNameTemp = path+fileName+".json";//文件路径+名称+文件类型
+        File file = new File(fileNameTemp);
+        try {
+        	File folder = new File(path);
+        	if (!folder.exists()){
+        		folder.mkdirs();
+        	}
+            //如果文件不存在,则创建新的文件
+            if(!file.exists()){
+                file.createNewFile();
+                bool = true;
+                System.out.println("success create file,the file is "+ fileNameTemp);
+                //创建文件成功后,写入内容到文件里
+                writeFileContent(fileNameTemp, fileContent);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        
+        return bool;
+    }
+    
+    /**
+     * 向文件中写入内容
+     * @param filePath 文件路径与名称
+     * @param newstr  写入的内容
+     * @return
+     * @throws IOException
+     */
+    public static boolean writeFileContent(String filePath, String newstr) throws IOException{
+        Boolean bool = false;
+        String filein = newstr+"\r\n";//新写入的行,换行
+        String temp  = "";
+        
+        FileInputStream fis = null;
+        InputStreamReader isr = null;
+        BufferedReader br = null;
+        FileOutputStream fos  = null;
+        PrintWriter pw = null;
+        try {
+            File file = new File(filePath);//文件路径(包括文件名称)
+            //将文件读入输入流
+            fis = new FileInputStream(file);
+            isr = new InputStreamReader(fis);
+            br = new BufferedReader(isr);
+            StringBuffer buffer = new StringBuffer();
+            
+            //文件原有内容
+            for(int i=0;(temp =br.readLine())!=null;i++){
+                buffer.append(temp);
+                // 行与行之间的分隔符 相当于“\n”
+                buffer = buffer.append(System.getProperty("line.separator"));
+            }
+            buffer.append(filein);
+            
+            fos = new FileOutputStream(file);
+            pw = new PrintWriter(fos);
+            pw.write(buffer.toString().toCharArray());
+            pw.flush();
+            bool = true;
+        } catch (Exception e) {
+            // TODO: handle exception
+            e.printStackTrace();
+        }finally {
+            //不要忘记关闭
+            if (pw != null) {
+                pw.close();
+            }
+            if (fos != null) {
+                fos.close();
+            }
+            if (br != null) {
+                br.close();
+            }
+            if (isr != null) {
+                isr.close();
+            }
+            if (fis != null) {
+                fis.close();
+            }
+        }
+        return bool;
+    }
+    
+    /**
+     * 删除单个文件
+     *
+     * @param fileName
+     *            要删除的文件的文件名
+     * @return 单个文件删除成功返回true,否则返回false
+     */
+    public static boolean deleteFile(String fileName) {
+        File file = new File(fileName);
+        if (file.exists() && file.isFile()) {
+            if (file.delete()) {
+                return true;
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+    
+    /** 
+     *  根据路径删除指定的目录,无论存在与否 
+     *@param sPath  要删除的目录path 
+     *@return 删除成功返回 true,否则返回 false。 
+     */  
+    public static boolean deleteFolder(String sPath) {
+        boolean flag = false;
+        File file = new File(sPath);
+        // 判断目录或文件是否存在
+        if (!file.exists()) {  // 不存在返回 false
+            return flag;
+        } else {
+            // 判断是否为文件
+            if (file.isFile()) {  // 为文件时调用删除文件方法
+                return deleteFile(sPath);
+            } else {  // 为目录时调用删除目录方法
+                return deleteDirectory(sPath);
+            }
+        }
+    }
+    
+    /**
+     * 删除目录以及目录下的文件
+     * @param   sPath 被删除目录的路径
+     * @return  目录删除成功返回true,否则返回false
+     */
+    public static boolean deleteDirectory(String sPath) {
+        //如果sPath不以文件分隔符结尾,自动添加文件分隔符
+        if (!sPath.endsWith(File.separator)) {
+            sPath = sPath + File.separator;
+        }
+        File dirFile = new File(sPath);
+        //如果dir对应的文件不存在,或者不是一个目录,则退出
+        if (!dirFile.exists() || !dirFile.isDirectory()) {
+            return false;
+        }
+        boolean flag = true;
+        //删除文件夹下的所有文件(包括子目录)
+        File[] files = dirFile.listFiles();
+        for (int i = 0; i < files.length; i++) {
+            //删除子文件
+            if (files[i].isFile()) {
+                flag = deleteFile(files[i].getAbsolutePath());
+                if (!flag) break;
+            } //删除子目录
+            else {
+                flag = deleteDirectory(files[i].getAbsolutePath());
+                if (!flag) break;
+            }
+        }
+        if (!flag) return false;
+        //删除当前目录
+        if (dirFile.delete()) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    //按行读文件
+    public static String readFile(String path) throws Exception {
+        File f = new File(path);
+        if (!f.exists()) {
+            return null;
+        }
+
+        ByteArrayOutputStream bos = new ByteArrayOutputStream((int) f.length());
+        BufferedInputStream in = null;
+        try {
+            in = new BufferedInputStream(new FileInputStream(f));
+            int buf_size = 1024;
+            byte[] buffer = new byte[buf_size];
+            int len = 0;
+            while (-1 != (len = in.read(buffer, 0, buf_size))) {
+                bos.write(buffer, 0, len);
+            }
+            return bos.toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw e;
+        } finally {
+            try {
+                in.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            bos.close();
+        }
+    }
+
+    public static boolean copyFile(String srcFileName, String destFileName, boolean overlay) {
+        File srcFile = new File(srcFileName);
+        // 判断源文件是否存在
+        if (!srcFile.exists()) {
+            log.info("源文件不存在");
+            return false;
+        } else if (!srcFile.isFile()) {
+            log.info("源文件不是文件");
+            return false;
+        }
+        // 判断目标文件是否存在
+        File destFile = new File(destFileName);
+        if (destFile.exists()) {
+            // 如果目标文件存在并允许覆盖
+            if (overlay) {
+                // 删除已经存在的目标文件,无论目标文件是目录还是单个文件
+                new File(destFileName).delete();
+            }
+        } else {
+            // 如果目标文件所在目录不存在,则创建目录
+            if (!destFile.getParentFile().exists()) {
+                // 目标文件所在目录不存在
+                if (!destFile.getParentFile().mkdirs()) {
+                    log.info("复制文件失败:创建目标文件所在目录失败");
+                    // 复制文件失败:创建目标文件所在目录失败
+                    return false;
+                }
+            }
+        }
+        // 复制文件
+        int byteread = 0; // 读取的字节数
+        InputStream in = null;
+        OutputStream out = null;
+        try {
+            in = new FileInputStream(srcFile);
+            out = new FileOutputStream(destFile);
+            byte[] buffer = new byte[1024];
+
+            while ((byteread = in.read(buffer)) != -1) {
+                out.write(buffer, 0, byteread);
+            }
+            return true;
+        } catch (IOException e) {
+            log.error("复制文件报错", e);
+            return false;
+        } finally {
+            try {
+                if (out != null)
+                    out.close();
+                if (in != null)
+                    in.close();
+            } catch (IOException e) {
+                log.error("复制文件报错", e);
+            }
+        }
+    }
+
+
+    // 复制文件
+    public static void copyFile(File sourceFile,File targetFile)
+            throws IOException{
+        // 新建文件输入流并对它进行缓冲
+        FileInputStream input = new FileInputStream(sourceFile);
+        BufferedInputStream inBuff=new BufferedInputStream(input);
+
+        // 新建文件输出流并对它进行缓冲
+        FileOutputStream output = new FileOutputStream(targetFile);
+        BufferedOutputStream outBuff=new BufferedOutputStream(output);
+
+        // 缓冲数组
+        byte[] b = new byte[1024 * 5];
+        int len;
+        while ((len =inBuff.read(b)) != -1) {
+            outBuff.write(b, 0, len);
+        }
+        // 刷新此缓冲的输出流
+        outBuff.flush();
+
+        //关闭流
+        inBuff.close();
+        outBuff.close();
+        output.close();
+        input.close();
+    }
+
+    public static void copyFolderAllFiles(String srcFolder, String destFolder, boolean overlay) throws IOException {
+        // 创建目标文件夹
+        (new File(destFolder)).mkdirs();
+        // 获取源文件夹当前下的文件或目录
+        File[] file = (new File(srcFolder)).listFiles();
+        if (file == null || file.length == 0) {
+            log.info("原文件夹为空-{}", srcFolder);
+            return;
+        }
+        for (int i = 0; i < file.length; i++) {
+            if (file[i].isFile()) {
+                // 复制文件
+                copyFile(file[i],new File(destFolder+file[i].getName()));
+            }
+            if (file[i].isDirectory()) {
+                // 复制目录
+                String sourceDir=srcFolder+File.separator+file[i].getName();
+                String targetDir=destFolder+File.separator+file[i].getName();
+                copyDirectiory(sourceDir, targetDir);
+            }
+        }
+    }
+
+
+    // 复制文件夹
+    public static void copyDirectiory(String sourceDir, String targetDir)
+            throws IOException {
+        // 新建目标目录
+        (new File(targetDir)).mkdirs();
+        // 获取源文件夹当前下的文件或目录
+        File[] file = (new File(sourceDir)).listFiles();
+        for (int i = 0; i < file.length; i++) {
+            if (file[i].isFile()) {
+                // 源文件
+                File sourceFile=file[i];
+                // 目标文件
+                File targetFile=new
+                        File(new File(targetDir).getAbsolutePath()
+                        +File.separator+file[i].getName());
+                copyFile(sourceFile,targetFile);
+            }
+            if (file[i].isDirectory()) {
+                // 准备复制的源文件夹
+                String dir1=sourceDir + "/" + file[i].getName();
+                // 准备复制的目标文件夹
+                String dir2=targetDir + "/"+ file[i].getName();
+                copyDirectiory(dir1, dir2);
+            }
+        }
+    }
+
+    /**
+     * 从网络Url中下载文件
+     *
+     * @param urlStr
+     * @param fileName
+     * @param savePath
+     * @return
+     * @throws IOException
+     */
+//    public static boolean downLoadFromUrl(String urlStr, String fileName, String savePath){
+//        FileOutputStream fos = null;
+//        InputStream inputStream = null;
+//        try {
+//            URL url = new URL(urlStr);
+//            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+//            // 设置超时间为3秒
+//            conn.setConnectTimeout(3 * 1000);
+//            // 防止屏蔽程序抓取而返回403错误
+//            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+//
+//            // 得到输入流
+//            inputStream = conn.getInputStream();
+//            // 获取自己数组
+//            byte[] getData = readInputStream(inputStream);
+//
+//            // 文件保存位置
+//            File saveDir = new File(savePath);
+//            if (!saveDir.exists()) {
+//                saveDir.mkdirs();
+//            }
+//            String filePath = saveDir + File.separator + fileName;
+//            String filePathFolder = filePath.substring(0, filePath.lastIndexOf("/") + 1);
+//            FileUtils.createDir(filePathFolder);
+//
+//            File file = new File(filePath);
+//            fos = new FileOutputStream(file);
+//            fos.write(getData);
+//            if (fos != null) {
+//                fos.close();
+//            }
+//            if (inputStream != null) {
+//                inputStream.close();
+//            }
+//            System.out.println("info:" + url + " download success");
+//        } catch(FileNotFoundException e){
+//            e.printStackTrace();
+//            return false;
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//            return false;
+//        }finally {
+//            if (fos != null) {
+//                try {
+//                    fos.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//            if (inputStream != null) {
+//                try {
+//                    inputStream.close();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//            }
+//        }
+//        return true;
+//    }
+
+   public static void downLoadFromUrl(String urlStr, String fileName, String savePath){
+       CreateObjUtil.wget(urlStr,savePath + File.separator + fileName);
+   }
+
+    /**
+     * 从输入流中获取字节数组
+     *
+     * @param inputStream
+     * @return
+     * @throws IOException
+     */
+    private static byte[] readInputStream(InputStream inputStream) throws IOException {
+        byte[] buffer = new byte[1024];
+        int len = 0;
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        while ((len = inputStream.read(buffer)) != -1) {
+            bos.write(buffer, 0, len);
+        }
+        bos.close();
+        return bos.toByteArray();
+    }
+
+    public static void writeFile(String filePath,String str) throws IOException {
+        File fout = new File(filePath);
+        if(!fout.getParentFile().exists()){
+            fout.getParentFile().mkdirs();
+        }
+        if(!fout.exists()){
+            fout.createNewFile();
+        }
+        FileOutputStream fos = new FileOutputStream(fout);
+        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
+        bw.write(str);
+        bw.close();
+    }
+
+    /**
+     * 将byte数组写入文件
+     *
+     * @param path
+     * @param fileName
+     * @param content
+     * @throws IOException
+     */
+    public static void writeFile(String path, String fileName, byte[] content)
+            throws IOException {
+        try {
+            File f = new File(path);
+            if (!f.exists()) {
+                f.mkdirs();
+            }
+            FileOutputStream fos = new FileOutputStream(path + fileName);
+            fos.write(content);
+            fos.close();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * 向json文件写入参数,重复的覆盖,多的新增
+     * @return
+     */
+    public static void writeJsonFile(String path, Map<String, Object> map) throws Exception{
+        String str = readFile(path);
+        JSONObject json = new JSONObject();
+        if(str!=null){
+            json = JSONObject.parseObject(str);
+        }
+        else{
+            File file = new File(path);
+            if(!file.getParentFile().exists())
+            {
+                file.getParentFile().mkdirs();
+            }
+            if(!file.exists())
+            {
+                file.createNewFile();
+            }
+        }
+        Iterator entries = map.entrySet().iterator();
+        while (entries.hasNext()) {
+            Map.Entry entry = (Map.Entry) entries.next();
+            json.put(String.valueOf(entry.getKey()), entry.getValue());
+        }
+
+        writeFile(path, json.toString());
+    }
+
+//    public static void decompress(String srcPath, String dest) throws Exception {
+//
+//        File file = new File(srcPath);
+//
+//        if (!file.exists()) {
+//
+//            throw new RuntimeException(srcPath + "所指文件不存在");
+//
+//        }
+//
+//        ZipFile zf = new ZipFile(file);
+//
+//        Enumeration entries = zf.getEntries();
+//
+//        ZipEntry entry = null;
+//
+//        while (entries.hasMoreElements()) {
+//
+//            entry = (ZipEntry) entries.nextElement();
+//
+//            log.info("解压" + entry.getName());
+//
+//            if (entry.isDirectory()) {
+//
+//                String dirPath = dest + File.separator + entry.getName();
+//
+//                File dir = new File(dirPath);
+//
+//                dir.mkdirs();
+//
+//            } else {
+//
+//                // 表示文件
+//
+//                File f = new File(dest + File.separator + entry.getName());
+//
+//                if (!f.exists()) {
+//
+//                    //String dirs = FileUtils.getParentPath(f);
+//                    String dirs =  f.getParent();
+//
+//                    File parentDir = new File(dirs);
+//
+//                    parentDir.mkdirs();
+//
+//
+//
+//                }
+//
+//                f.createNewFile();
+//
+//                // 将压缩文件内容写入到这个文件中
+//
+//                InputStream is = zf.getInputStream(entry);
+//
+//                FileOutputStream fos = new FileOutputStream(f);
+//
+//
+//
+//                int count;
+//
+//                byte[] buf = new byte[8192];
+//
+//                while ((count = is.read(buf)) != -1) {
+//
+//                    fos.write(buf, 0, count);
+//
+//                }
+//
+//                is.close();
+//
+//                fos.close();
+//
+//            }
+//
+//        }
+//
+//    }
+
+    public static void decompress(String srcPath, String dest) throws Exception {
+        CreateObjUtil.unZip(srcPath,dest);
+    }
+        public static void zipFile(String zipFileName, String inputFileName)
+            throws Exception {
+        ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
+        out.setEncoding("UTF-8");
+        File inputFile = new File(inputFileName);
+        zipIt(out, inputFile, "", true);
+        out.close();
+    }
+
+    /*
+     * 能支持中文的压缩 参数base 开始为"" first 开始为true
+     */
+    public static void zipIt(ZipOutputStream out, File f,
+                             String base, boolean first) throws Exception {
+        if (f.isDirectory()) {
+            File[] fl = f.listFiles();
+            if (first) {
+                first = false;
+            } else {
+                base = base + "/";
+            }
+            for (int i = 0; i < fl.length; i++) {
+                zipIt(out, fl[i], base + fl[i].getName(), first);
+            }
+        } else {
+            if (first) {
+                base = f.getName();
+            }
+            out.putNextEntry(new org.apache.tools.zip.ZipEntry(base));
+            FileInputStream in = new FileInputStream(f);
+            int b;
+            while ((b = in.read()) != -1) {
+                out.write(b);
+            }
+            in.close();
+        }
+    }
+
+    //删除文件夹
+    public static void delFolder(String folderPath) {
+        try {
+            delAllFile(folderPath); //删除完里面所有内容
+            String filePath = folderPath;
+            filePath = filePath.toString();
+            File myFilePath = new File(filePath);
+            myFilePath.delete(); //删除空文件夹
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    //删除指定文件夹下的所有文件
+    public static boolean delAllFile(String path) {
+        boolean flag = false;
+        File file = new File(path);
+        if (!file.exists()) {
+            return flag;
+        }
+        if (!file.isDirectory()) {
+            return flag;
+        }
+        String[] tempList = file.list();
+        File temp = null;
+        if(tempList!=null)
+        {
+            for (int i = 0; i < tempList.length; i++) {
+                if (path.endsWith(File.separator)) {
+                    temp = new File(path + tempList[i]);
+                } else {
+                    temp = new File(path + File.separator + tempList[i]);
+                }
+                if (temp.isFile()) {
+                    temp.delete();
+                }
+                if (temp.isDirectory()) {
+                    delAllFile(path + "/" + tempList[i]);//先删除文件夹里面的文件
+                    delFolder(path + "/" + tempList[i]);//再删除空文件夹
+                    flag = true;
+                }
+            }
+        }
+
+        //再删除当前空文件夹
+        file.delete();
+        return flag;
+    }
+
+    public static List<String> readfileNamesForDirectory(String path, String except)
+    {
+        try{
+            File file = new File(path);
+            if(file.isDirectory())
+            {
+                String[] fileNames = file.list();
+                List<String> list = new ArrayList<String>();
+                if(fileNames!=null)
+                {
+                    for(int i=0;i<fileNames.length;++i)
+                    {
+                        if(fileNames[i].toLowerCase().endsWith(except) )
+                        {
+                            list.add(fileNames[i]);
+                        }
+                    }
+                }
+
+                return list;
+            }
+        }catch(Exception e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    //递归获取文件中所有文件的路径
+    public static List<String> readfilePath(String path, List<String> urlList) {
+        try{
+            File file = new File(path);
+            if(file != null && file.isDirectory()) {
+                File[] files = file.listFiles();
+
+                if(files != null) {
+                    for(int i=0;i<files.length;++i) {
+                        if(files[i].isDirectory()){
+                            readfilePath(files[i].getAbsolutePath(), urlList);
+                        }else {
+                            urlList.add(files[i].getAbsolutePath());
+                        }
+                    }
+                }
+                return urlList;
+            }
+        }catch(Exception e){
+            e.printStackTrace();
+        }
+        return urlList;
+    }
+
+    public static void saveImageToDisk(String accessToken, String mediaId, String picName, String picPath,InputStream inputStream)
+            throws Exception {
+        byte[] data = new byte[10240];
+        int len = 0;
+        FileOutputStream fileOutputStream = null;
+        try {
+            fileOutputStream = new FileOutputStream(picPath+picName+".amr");
+            while ((len = inputStream.read(data)) != -1) {
+                fileOutputStream.write(data, 0, len);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (inputStream != null) {
+                try {
+                    inputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (fileOutputStream != null) {
+                try {
+                    fileOutputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+
+
+    /**
+     *
+     * @param content base64内容
+     * @param path 输出文件路径,需要后缀名
+     * @return
+     */
+    public static  boolean base64ToFileWriter(String content, String path) {
+        if (content == null) {
+            return false;
+        }
+        BASE64Decoder decoder = new BASE64Decoder();
+        try {
+            // decoder
+            byte[] b = decoder.decodeBuffer(content);
+            // processing data
+            for (int i = 0; i < b.length; ++i) {
+                if (b[i] < 0) {
+                    b[i] += 256;
+                }
+            }
+            OutputStream out = new FileOutputStream(path);
+            out.write(b);
+            out.flush();
+            out.close();
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * 获取类路径(classes路径)
+     */
+    public static String getResource(){
+        String path = "";
+        try {
+            path = ResourceUtils.getURL("classpath:").getPath();
+            path = URLDecoder.decode(path,"utf-8");
+        } catch (Exception e) {
+        }
+        return path;
+    }
+
+    /**
+     * 判断文件大小处于限制内
+     *
+     * @param fileLen 文件长度
+     * @param fileSize 限制大小
+     * @param fileUnit 限制的单位(B,K,M,G)
+     * @return
+     */
+    public static boolean checkFileSizeIsLimit(Long fileLen, double fileSize, String fileUnit) {
+//        long len = file.length();
+        double fileSizeCom = 0;
+        if ("B".equals(fileUnit.toUpperCase())) {
+            fileSizeCom = (double) fileLen;
+        } else if ("K".equals(fileUnit.toUpperCase())) {
+            fileSizeCom = (double) fileLen / 1024;
+        } else if ("M".equals(fileUnit.toUpperCase())) {
+            fileSizeCom = (double) fileLen / (1024*1024);
+        } else if ("G".equals(fileUnit.toUpperCase())) {
+            fileSizeCom = (double) fileLen / (1024*1024*1024);
+        }
+        if (fileSizeCom > fileSize) {
+            return false;
+        }
+        return true;
+
+    }
+
+    /**
+     * 删除文件
+     *
+     * @param filePathAndName
+     *            String 文件路径及名称 如c:/fqf.txt
+     * @return boolean
+     */
+    public static void delFile(String filePathAndName) {
+        try {
+            String filePath = filePathAndName;
+            filePath = filePath.toString();
+            File myDelFile = new File(filePath);
+            myDelFile.delete();
+
+        } catch (Exception e) {
+            System.out.println("删除文件操作出错");
+            e.printStackTrace();
+
+        }
+
+    }
+
+    private boolean checkFile(String fileName) {
+        //设置允许上传文件类型
+        String suffixList = ".jpg,.gif,.png,.ico,.bmp,.jpeg,.zip,.zp,.rar,.mp3,.mp4,.avi,.mov";
+        // 获取文件后缀
+        String suffix = fileName.substring(fileName.lastIndexOf(".")
+                + 1, fileName.length());
+        if (suffixList.contains(suffix.trim().toLowerCase())) {
+            System.out.println("无非法参数可以放行!!!");
+            log.info("无非法参数可以放行!!!");
+            return true;
+        }
+        log.info("存在非法参数不能放行!请核对上传文件格式,重新刷新页面再次上传!");
+        return false;
+    }
+
+
+}

+ 96 - 0
src/main/java/com/fdkankan/modeling/util/GYUploadToOssUtil.java

@@ -0,0 +1,96 @@
+package com.fdkankan.modeling.util;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.ObjectMetadata;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.io.File;
+import java.util.Map;
+
+@Slf4j
+@Component
+public class GYUploadToOssUtil {
+
+	@Value("${gy.oss.point:http://oss-cn-shenzhen.aliyuncs.com}")
+	private String point;
+
+	@Value("${gy.oss.key:LTAI64um4wLEwK7q}")
+	private String key;
+
+	@Value("${gy.oss.secrey:jRPX721aKkprhgNIaoYHMG5BXfQ6vw}")
+	private String secrey;
+
+	@Value("${gy.oss.bucket:jiazhuangvr1}")
+	private String bucket;
+
+	@Value("${oss.type}")
+	private String type;
+
+
+	public void upload(String filePath, String key1) {
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+			}
+
+			ObjectMetadata metadata = new ObjectMetadata();
+			if(filePath.contains(".jpg")){
+				metadata.setContentType("image/jpeg");
+			}
+			ossClient.putObject(bucket, key1, new File(filePath), metadata);
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		}finally {
+			ossClient.shutdown();
+		}
+	}
+
+	public void upload2(OSSClient ossClient,String filePath, String key1) {
+		File file = new File(filePath);
+		if(!file.exists()){
+			log.info("要上传的文件不存在:{}",filePath);
+			return;
+		}
+		try {
+			ObjectMetadata metadata = new ObjectMetadata();
+			if(filePath.contains(".jpg")){
+				metadata.setContentType("image/jpeg");
+			}
+			if(filePath.contains(".mp4")){
+				metadata.setContentType("video/mp4");
+			}
+			if(filePath.contains(".mp3")){
+				metadata.setContentType("audio/mp3");
+			}
+			ossClient.putObject(bucket, key1, file, metadata);
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		}
+	}
+
+	//上传的数据是文件夹,参数是文件夹路径,key是上传后的文件名
+	public void uploadMulFiles(Map<String, String> filepaths) {
+		if (filepaths == null) {
+			return;
+		}
+		Long start = System.currentTimeMillis();
+		log.info("开始批量上传到公元阿里云:" + start);
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			for (String filePath : filepaths.keySet()) {
+				upload2(ossClient,filePath, filepaths.get(filePath));
+			}
+		}catch (Exception e){
+			log.info("uploadMulFiles:error",e);
+		}finally {
+			ossClient.shutdown();
+		}
+		log.info("批量上传公元阿里云完毕:" + (System.currentTimeMillis() - start));
+	}
+
+
+}

+ 61 - 0
src/main/java/com/fdkankan/modeling/util/StreamGobbler.java

@@ -0,0 +1,61 @@
+package com.fdkankan.modeling.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();  
+            }  
+        }  
+    }  
+}

+ 208 - 0
src/main/java/com/fdkankan/modeling/util/UploadToOssUtil.java

@@ -0,0 +1,208 @@
+package com.fdkankan.modeling.util;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.*;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.commons.CommonsMultipartFile;
+
+import java.io.*;
+import java.net.FileNameMap;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.*;
+
+@Slf4j
+@Component
+public class UploadToOssUtil {
+
+//    String ACCESS_KEY = "dlPPwgZky_F-iP8CbSbJpiAtAcqw3BYwb9rdHMrS";
+//    String SECRET_KEY = "YEtkLKDsImXB-8m1CT1zV_YwCwwGvrUvo2ktj9KZ";
+//
+//    String bucketname = "scene3d";
+
+//    Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY);
+
+
+	@Value("${oss.point}")
+	private String point;
+
+	@Value("${oss.key}")
+	private String key;
+
+	@Value("${oss.secrey}")
+	private String secrey;
+
+	@Value("${oss.bucket}")
+	private String bucket;
+
+	@Value("${oss.type}")
+	private String type;
+
+
+	public void upload(String filePath, String key1) {
+		if("oss".equals(type)){
+			OSSClient ossClient = new OSSClient(point, key, secrey);
+			try {
+				File file = new File(filePath);
+				if (!file.exists()) {
+					log.error("要上传的文件不存在:" + filePath);
+				}
+				ObjectMetadata metadata = new ObjectMetadata();
+				if(filePath.contains(".jpg")){
+					metadata.setContentType("image/jpeg");
+				}
+				ossClient.putObject(bucket, key1, new File(filePath), metadata);
+
+			} catch (Exception e) {
+				log.error(e.toString() + filePath);
+			}finally {
+				ossClient.shutdown();
+			}
+		}
+
+	}
+	public static void upload(OSSClient ossClient,String bucket,String filePath, String key1) {
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+			}
+			ObjectMetadata metadata = new ObjectMetadata();
+			if(filePath.contains(".jpg")){
+				metadata.setContentType("image/jpeg");
+			}
+			ossClient.putObject(bucket, key1, new File(filePath), metadata);
+
+		} catch (Exception e) {
+			log.error(e.toString() + filePath);
+		}
+
+	}
+
+	public void upload2(OSSClient ossClient,String filePath, String key1) {
+		if("oss".equals(type)){
+			try {
+				ObjectMetadata metadata = new ObjectMetadata();
+				if(filePath.contains(".jpg")){
+					metadata.setContentType("image/jpeg");
+				}
+				if(filePath.contains(".mp4")){
+					metadata.setContentType("video/mp4");
+				}
+				if(filePath.contains(".mp3")){
+					metadata.setContentType("audio/mp3");
+				}
+				ossClient.putObject(bucket, key1, new File(filePath), metadata);
+			} catch (Exception e) {
+				log.error(e.toString() + filePath);
+			}
+		}
+
+	}
+
+	//上传的数据是文件夹,参数是文件夹路径,key是上传后的文件名
+	public void uploadMulFiles(Map<String, String> filepaths) {
+		if (filepaths == null) {
+			return;
+		}
+		Long start = System.currentTimeMillis();
+		log.info("开始批量上传到阿里云:" + start);
+		OSSClient ossClient = new OSSClient(point, key, secrey);
+		try {
+			for (String filePath : filepaths.keySet()) {
+				upload2(ossClient,filePath, filepaths.get(filePath));
+			}
+			log.info("批量上传阿里云完毕:" + (System.currentTimeMillis() - start));
+		}catch (Exception e){
+			log.info("开始批量上传到阿里云-error:" ,e);
+		}finally {
+			ossClient.shutdown();
+		}
+
+
+	}
+	public void uploadDirectory(String filePath, String ossPath) {
+		uploadDirectory(new OSSClient(point, key, secrey),bucket,filePath,ossPath);
+	}
+	public static void uploadDirectoryContents(OSSClient ossClient,String bucket ,String filePath, String ossPath) {
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+				return;
+			}
+			File[] files = file.listFiles();
+			if (files == null || files.length == 0) {
+				log.info("跳过空目录:{}", file.getPath());
+				return;
+			}
+			for (File file1 : files) {
+				if(file1.isDirectory()){
+					uploadDirectoryContents(ossClient,bucket,file1.getPath(),ossPath +"/"+file1.getName());
+				}else {
+					upload(ossClient,bucket,file1.getPath(),ossPath +"/"+file1.getName());
+				}
+			}
+
+		}catch (Exception e){
+			log.info("上传失败:{}",e);
+		}
+
+	}
+
+
+	public static void uploadDirectory(OSSClient ossClient,String bucket,String filePath,String ossPath) {
+		try {
+			File file = new File(filePath);
+			if (!file.exists()) {
+				log.error("要上传的文件不存在:" + filePath);
+				return;
+			}
+			if(file.isDirectory()){
+				uploadDirectoryContents(ossClient,bucket,file.getPath(),ossPath );
+			}else {
+				upload(ossClient,bucket,file.getPath(),ossPath);
+			}
+		}catch (Exception e){
+			log.info("上传失败:{}",e);
+		}finally {
+			ossClient.shutdown();
+		}
+
+	}
+
+	public static void downDirectory(OSSClient ossClient,String bucket,String ossPath,String filePath) {
+		List<String> allFiles = new ArrayList<>();
+		String marker = null;
+		do {
+			ObjectListing list = ossClient.listObjects(bucket, ossPath);
+			for (OSSObjectSummary obj : list.getObjectSummaries()) {
+				if (!obj.getKey().endsWith("/")) {
+					allFiles.add(obj.getKey());
+				}
+			}
+			marker = list.getNextMarker();
+		} while (marker != null);
+
+		for (String fileKey : allFiles) {
+			new File(filePath).getParentFile().mkdirs();
+			ossClient.getObject(new GetObjectRequest(bucket, fileKey), new File(filePath));
+			System.out.println("下载: " + fileKey);
+		}
+
+	}
+
+
+	public static void main(String[] args) {
+		downDirectory(new OSSClient("http://oss-cn-shenzhen.aliyuncs.com", "LTAI5tC5Ema4raGNCZYSNrkN", "BjqU1lSVnNUbJouGkq13JG9DmcpaDx"),
+				"zfb-4dkankan","build_result/c-qn0pPV7","H:\\ffdown\\2");
+
+	}
+}

+ 38 - 0
src/main/resources/application-prod.yaml

@@ -0,0 +1,38 @@
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    url: jdbc:mysql://172.18.159.244:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: zfb@20210727%
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+  rabbitmq:
+    host: 172.18.159.244
+    port: 5672
+    username: admin
+    password: admin123
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /
+  redis:
+    host: 172.18.159.244
+    port: 6379
+    timeout: 6000ms
+    password:
+    jedis:
+      pool:
+        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
+        max-idle: 10 # 连接池中的最大空闲连接
+        min-idle: 5 # 连接池中的最小空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+    lettuce:
+      shutdown-timeout: 0ms
+
+environment: formal

+ 38 - 0
src/main/resources/application-test.yaml

@@ -0,0 +1,38 @@
+spring:
+  datasource:
+    type: com.zaxxer.hikari.HikariDataSource          # 数据源类型:HikariCP
+    driver-class-name: com.mysql.jdbc.Driver          # mysql驱动
+    url: jdbc:mysql://172.18.159.127:3306/zhi_house?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowMultiQueries=true
+    username: root
+    password: zfb20211015G
+    hikari:
+      connection-timeout: 30000         # 等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 默认:30秒
+      minimum-idle: 5                   # 最小连接数
+      maximum-pool-size: 20             # 最大连接数
+      auto-commit: true                 # 事务自动提交
+      idle-timeout: 600000              # 连接超时的最大时长(毫秒),超时则被释放(retired),默认:10分钟
+      pool-name: DateSourceHikariCP     # 连接池名字
+      max-lifetime: 1800000             # 连接的生命时长(毫秒),超时而且没被使用则被释放(retired),默认:30分钟 1800000ms
+      connection-test-query: SELECT 1   # 连接测试语句
+  rabbitmq:
+    host: 172.18.159.127
+    port: 5672
+    username: admin
+    password: zfb1234
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /
+  redis:
+    host: 172.18.159.127
+    port: 6379
+    timeout: 6000ms
+    password: 4dkk2022projectzfb
+    jedis:
+      pool:
+        max-active: 10  #连接池最大连接数(使用负值表示没有限制)
+        max-idle: 10 # 连接池中的最大空闲连接
+        min-idle: 5 # 连接池中的最小空闲连接
+        max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
+    lettuce:
+      shutdown-timeout: 0ms
+
+environment: test

+ 49 - 0
src/main/resources/application.yaml

@@ -0,0 +1,49 @@
+spring:
+  profiles:
+    active: ${activeProfile:local}
+  servlet:
+    multipart:
+      max-file-size: 1000MB
+      maxRequestSize: 1000MB
+
+server:
+  port: 8089
+  servlet:
+    context-path: /zfb-modeling
+  tomcat:
+    max-http-form-post-size: -1
+
+
+logging:
+  config: classpath:logback-spring.xml
+mybatis-plus:
+  configuration:
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #开启sql日志
+
+
+upload:
+  type: oss
+  query-path: https://4dkk.4dage.com/
+oss:
+  type: oss
+  point: http://oss-cn-shenzhen-internal.aliyuncs.com
+  key: LTAI5tC5Ema4raGNCZYSNrkN
+  secrey: BjqU1lSVnNUbJouGkq13JG9DmcpaDx
+  bucket: zfb-4dkankan
+
+gy:
+  oss:
+    point: http://oss-cn-shenzhen-internal.aliyuncs.com
+    key: LTAI64um4wLEwK7q
+    secrey: jRPX721aKkprhgNIaoYHMG5BXfQ6vw
+    bucket: jiazhuangvr1
+  company:
+    id: 1058
+
+prefix:
+  ali: https://zfb.4dage.com/
+
+rabbitmq:
+  queue: QUEUE_MODELING_A
+
+

+ 254 - 0
src/main/resources/logback-spring.xml

@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
+<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
+<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
+<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
+<configuration scan="true" scanPeriod="10 seconds">
+
+	<contextName>logback</contextName>
+	<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
+	<property name="log.path" value="/home/data-zfb/logs/zfb-modeling/logs" />
+
+	<!-- 彩色日志 -->
+	<!-- 彩色日志依赖的渲染类 -->
+	<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+	<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+	<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+	<!-- 彩色日志格式 -->
+	<property name="CONSOLE_LOG_PATTERN"
+			  value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}" />
+
+	<!--输出到控制台 -->
+	<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+		<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息 -->
+		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+			<level>info</level>
+		</filter>
+		<encoder>
+			<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
+			<!-- 设置字符集 -->
+			<charset>UTF-8</charset>
+		</encoder>
+	</appender>
+	<!--输出到文件 -->
+
+	<!-- 时间滚动输出 level为 DEBUG 日志 -->
+	<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_debug.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!-- 日志归档 -->
+			<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录debug级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>debug</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<!-- 时间滚动输出 level为 INFO 日志 -->
+	<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_info.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset>
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<!-- 每天日志归档路径以及格式 -->
+			<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录info级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>info</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<!-- 时间滚动输出 level为 WARN 日志 -->
+	<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_warn.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录warn级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>warn</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+
+	<!-- 时间滚动输出 level为 ERROR 日志 -->
+	<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/log_error.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录ERROR级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<level>ERROR</level>
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+
+	<appender name="PROGRAM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/program/log_program.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/program/log-program-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录ERROR级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+	<logger name="programLog" level="INFO" additivity="true">
+		<appender-ref ref="PROGRAM_FILE"/>
+	</logger>
+
+	<appender name="VISIT_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<!-- 正在记录的日志文件的路径及文件名 -->
+		<file>${log.path}/visit/log_visit.log</file>
+		<!--日志文件输出格式 -->
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+		<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/visit/log-visit-%d{yyyy-MM-dd}.%i.log
+			</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数 -->
+			<maxHistory>15</maxHistory>
+		</rollingPolicy>
+		<!-- 此日志文件只记录ERROR级别的 -->
+		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+			<onMatch>ACCEPT</onMatch>
+			<onMismatch>DENY</onMismatch>
+		</filter>
+	</appender>
+	<logger name="visitLog" level="INFO" additivity="true">
+		<appender-ref ref="VISIT_FILE"/>
+	</logger>
+
+
+	<!--  连接时长  -->
+	<appender name="timeLogger" class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<file>${log.path}/timeLogger.log</file>
+		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+			<level>DEBUG</level>
+		</filter>
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<fileNamePattern>${log.path}/timeLogger/timeLogger-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
+			<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<maxFileSize>100MB</maxFileSize>
+			</timeBasedFileNamingAndTriggeringPolicy>
+			<!--日志文件保留天数-->
+			<maxHistory>10</maxHistory>
+		</rollingPolicy>
+		<encoder>
+			<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+			<charset>UTF-8</charset> <!-- 此处设置字符集 -->
+		</encoder>
+	</appender>
+	<logger name="timeLogger" additivity="false" level="DEBUG">
+		<appender-ref ref="timeLogger"/>
+	</logger>
+
+	<!-- <logger>用来设置某一个包或者具体的某一个类的日志打印级别、 以及指定<appender>。<logger>仅有一个name属性, 一个可选的level和一个可选的addtivity属性。 name:用来指定受此logger约束的某一个包或者具体的某一个类。 level:用来设置打印级别,大小写无关:TRACE,
+		DEBUG, INFO, WARN, ERROR, ALL 和 OFF, 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。 如果未设置此属性,那么当前logger将会继承上级的级别。 addtivity:是否向上级logger传递打印信息。默认是true。 -->
+	<!--<logger name="org.springframework.web" level="info"/> -->
+	<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/> -->
+	<!-- 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作: 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别: -->
+	<!-- root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性 level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF, 不能设置为INHERITED或者同义词NULL。默认是DEBUG 可以包含零个或多个元素,标识这个appender将会添加到这个logger。 -->
+
+	<root level="info">
+		<appender-ref ref="CONSOLE" />
+		<appender-ref ref="DEBUG_FILE" />
+		<appender-ref ref="INFO_FILE" />
+		<appender-ref ref="WARN_FILE" />
+		<appender-ref ref="ERROR_FILE" />
+	</root>
+
+	<!--生产环境:输出到文件 -->
+	<!--<springProfile name="pro"> -->
+	<!--<root level="info"> -->
+	<!--<appender-ref ref="CONSOLE" /> -->
+	<!--<appender-ref ref="DEBUG_FILE" /> -->
+	<!--<appender-ref ref="INFO_FILE" /> -->
+	<!--<appender-ref ref="ERROR_FILE" /> -->
+	<!--<appender-ref ref="WARN_FILE" /> -->
+	<!--</root> -->
+	<!--</springProfile> -->
+
+</configuration>
+
+

+ 5 - 0
src/main/resources/mapper/modeling/CameraDetailMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ICameraDetailMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/CameraInstanceMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ICameraInstanceMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/CompanyMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ICompanyMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/MqEcsMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.IMqEcsMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/MqScalingMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.IMqScalingMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/SceneMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ISceneMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/SceneProEditMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ISceneProEditMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/SceneProMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.ISceneProMapper">
+
+</mapper>

+ 5 - 0
src/main/resources/mapper/modeling/UserMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fdkankan.modeling.mapper.IUserMapper">
+
+</mapper>