guanzi пре 4 година
комит
a335a760ae
40 измењених фајлова са 2077 додато и 0 уклоњено
  1. 8 0
      .idea/.gitignore
  2. 14 0
      .idea/artifacts/divingcommon_jar.xml
  3. 8 0
      .idea/compiler.xml
  4. 6 0
      .idea/misc.xml
  5. 8 0
      .idea/modules.xml
  6. 124 0
      .idea/uiDesigner.xml
  7. 6 0
      .idea/vcs.xml
  8. 110 0
      divingcommon.iml
  9. 1 0
      out/artifacts/divingcommon_jar/diving
  10. BIN
      out/artifacts/divingcommon_jar/divingcommon.jar
  11. BIN
      out/production/divingcommon/com/example/demo/Common/CommonIT.class
  12. BIN
      out/production/divingcommon/com/example/demo/Common/UuidUtil.class
  13. BIN
      out/production/divingcommon/com/example/demo/Common/constants/Constants.class
  14. BIN
      out/production/divingcommon/com/example/demo/Common/utils/DateUtils.class
  15. BIN
      out/production/divingcommon/com/example/demo/Common/utils/GeneralUtils.class
  16. BIN
      out/production/divingcommon/com/example/demo/TestJava.class
  17. BIN
      out/production/divingcommon/com/example/demo/entity/Action$ActionBuilder.class
  18. BIN
      out/production/divingcommon/com/example/demo/entity/Action.class
  19. BIN
      out/production/divingcommon/com/example/demo/entity/Frame$FrameBuilder.class
  20. BIN
      out/production/divingcommon/com/example/demo/entity/Frame.class
  21. BIN
      out/production/divingcommon/com/example/demo/entity/Spgl.class
  22. BIN
      out/production/divingcommon/com/example/demo/entity/User$UserBuilder.class
  23. BIN
      out/production/divingcommon/com/example/demo/entity/User.class
  24. BIN
      out/production/divingcommon/com/example/demo/form/CamParam$CamParamBuilder.class
  25. BIN
      out/production/divingcommon/com/example/demo/form/CamParam.class
  26. BIN
      out/production/divingcommon/com/example/demo/sony/SonyUtils.class
  27. BIN
      out/production/divingcommon/com/example/demo/sony/testdivingcommon.jar
  28. 25 0
      src/com/example/demo/Common/CommonIT.java
  29. 15 0
      src/com/example/demo/Common/UuidUtil.java
  30. 109 0
      src/com/example/demo/Common/constants/Constants.java
  31. 176 0
      src/com/example/demo/Common/utils/DateUtils.java
  32. 392 0
      src/com/example/demo/Common/utils/GeneralUtils.java
  33. 13 0
      src/com/example/demo/TestJava.java
  34. 45 0
      src/com/example/demo/entity/Action.java
  35. 35 0
      src/com/example/demo/entity/Frame.java
  36. 115 0
      src/com/example/demo/entity/Spgl.java
  37. 102 0
      src/com/example/demo/entity/User.java
  38. 24 0
      src/com/example/demo/form/CamParam.java
  39. 741 0
      src/com/example/demo/sony/SonyUtils.java
  40. BIN
      src/com/example/demo/sony/testdivingcommon.jar

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 14 - 0
.idea/artifacts/divingcommon_jar.xml

@@ -0,0 +1,14 @@
+<component name="ArtifactManager">
+  <artifact type="jar" name="divingcommon:jar">
+    <output-path>$PROJECT_DIR$/out/artifacts/divingcommon_jar</output-path>
+    <root id="archive" name="divingcommon.jar">
+      <element id="module-output" name="divingcommon" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/commons-lang3-3.11.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/slf4j-api-1.7.31.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/slf4j-log4j12-1.7.30.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/fastjson-1.2.75.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/log4j-1.2.17.jar" path-in-jar="/" />
+      <element id="extracted-dir" path="$PROJECT_DIR$/../diving/0809/jar/lombok-1.18.20.jar" path-in-jar="/" />
+    </root>
+  </artifact>
+</component>

+ 8 - 0
.idea/compiler.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+    </annotationProcessing>
+  </component>
+</project>

+ 6 - 0
.idea/misc.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <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>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/divingcommon.iml" filepath="$PROJECT_DIR$/divingcommon.iml" />
+    </modules>
+  </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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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.png" 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>

+ 110 - 0
divingcommon.iml

@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/slf4j-log4j12-1.7.30.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/lombok-1.18.20.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/commons-lang3-3.11.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/fastjson-1.2.75.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/log4j-1.2.17.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/jar/slf4j-api-1.7.31.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/util/common/spring-web.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/util/common/spring-core-5.2.8.RELEASE.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/util/common/spring-web-5.3.8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/util/common/spring-core-5.3.8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../diving/0809/util/common/commons-fileupload-1.4.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 1 - 0
out/artifacts/divingcommon_jar/diving

@@ -0,0 +1 @@
+Subproject commit 16a84ec56124cd3b6075bda40dd95628b2634a63

BIN
out/artifacts/divingcommon_jar/divingcommon.jar


BIN
out/production/divingcommon/com/example/demo/Common/CommonIT.class


BIN
out/production/divingcommon/com/example/demo/Common/UuidUtil.class


BIN
out/production/divingcommon/com/example/demo/Common/constants/Constants.class


BIN
out/production/divingcommon/com/example/demo/Common/utils/DateUtils.class


BIN
out/production/divingcommon/com/example/demo/Common/utils/GeneralUtils.class


BIN
out/production/divingcommon/com/example/demo/TestJava.class


BIN
out/production/divingcommon/com/example/demo/entity/Action$ActionBuilder.class


BIN
out/production/divingcommon/com/example/demo/entity/Action.class


BIN
out/production/divingcommon/com/example/demo/entity/Frame$FrameBuilder.class


BIN
out/production/divingcommon/com/example/demo/entity/Frame.class


BIN
out/production/divingcommon/com/example/demo/entity/Spgl.class


BIN
out/production/divingcommon/com/example/demo/entity/User$UserBuilder.class


BIN
out/production/divingcommon/com/example/demo/entity/User.class


BIN
out/production/divingcommon/com/example/demo/form/CamParam$CamParamBuilder.class


BIN
out/production/divingcommon/com/example/demo/form/CamParam.class


BIN
out/production/divingcommon/com/example/demo/sony/SonyUtils.class


BIN
out/production/divingcommon/com/example/demo/sony/testdivingcommon.jar


+ 25 - 0
src/com/example/demo/Common/CommonIT.java

@@ -0,0 +1,25 @@
+package com.example.demo.Common;
+
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class CommonIT {
+    public String findId() {
+        UuidUtil uuidUtil = new UuidUtil();
+        String id = uuidUtil.getId();
+        return id;
+    }
+
+    public String findTime() {
+        Date date = new Date();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        return dateFormat.format(date);
+    }
+
+    public String findDate(){
+        Date date = new Date();
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        return dateFormat.format(date);
+    }
+}

+ 15 - 0
src/com/example/demo/Common/UuidUtil.java

@@ -0,0 +1,15 @@
+package com.example.demo.Common;
+
+import java.util.UUID;
+
+public class UuidUtil {
+    String id=UUID.randomUUID().toString().replace("-", "");
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+}

+ 109 - 0
src/com/example/demo/Common/constants/Constants.java

@@ -0,0 +1,109 @@
+package com.example.demo.Common.constants;
+
+/**
+ * 通用常量
+ */
+public class Constants {
+
+    public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+    public static final String DATE_FORMAT_1 = "yyyy-MM-dd";
+    public static final String DATE_FORMAT_2 = "yyyyMMdd";
+
+    /**
+     * 用户的Access Key ID
+     */
+    public static final String ACCESS_KEY_ID = "e694a8586df044f2b8a70614b90d51de";
+    /**
+     * 用户的Secret Access Key
+     */
+    public static final String SECRET_ACCESS_KEY = "5db8f93c38f94df1a99e752cd5215f49";
+
+    /**
+     * 链接过期时间(s)
+     */
+    public static final int EXPIRATION_IN_SECONDS = 5*60*60;
+    /**
+     * 用户自己指定的域名,参考说明文档
+     */
+    public static final String ENDPOINT = "bj.bcebos.com";
+    public static final String BUCKET_NAME = "tiaoshuidui";
+    public static final String FOLDER_NAME = "video/";
+    public static final String OTHER_FOLDER_NAME = "人脸数据/";
+    public static final String FACE_FOLDER_NAME = "face/";
+    public static final String HEAD_FOLDER_NAME ="head/";
+    public static final String PHOTO_FOLDER_NAME = "photo/";
+    public static final String FRAME_FOLDER_NAME = "frame/";
+    public static final String ACTION_FOLDER_NAME = "action/";
+    public static final String FEEDBACK_NAME = "feedback/";
+
+
+    /**
+     * 十米跳台
+     */
+    public static final String HEIGHT_TEN = "10";
+    /**
+     * 3米跳台
+     */
+    public static final String HEIGHT_THREE = "3";
+
+    /**
+     * 10米 摄像头开始信号捕捉。
+     */
+    public static final String CAM_0 = "100";
+    public static final String CAM_1 = "101";
+    /**
+     * 10米 摄像头结束信号捕捉。
+     */
+    public static final String CAM_2 = "102";
+    public static final String CAM_3 = "103";
+    public static final String CAM_4 = "104";
+    /**
+     * 3米 摄像头开始信号捕捉。
+     */
+    public static final String CAM_5 = "105";
+    public static final String CAM_6 = "106";
+    /**
+     * 3米 摄像头结束信号捕捉。
+     */
+    public static final String CAM_7 = "107";
+    public static final String CAM_8 = "108";
+    public static final String CAM_9 = "109";
+
+    public static final String CAM_IP_0 = "192.168.1.140";
+    public static final String CAM_IP_1 = "192.168.1.141";
+    public static final String CAM_IP_3 = "192.168.1.143";
+    public static final String CAM_IP_4 = "192.168.1.144";
+    public static final String CAM_IP_6 = "192.168.1.146";
+    public static final String CAM_IP_7 = "192.168.1.147";
+    public static final String CAM_IP_151 = "192.168.1.151";
+    public static final String CAM_IP_152 = "192.168.1.152";
+
+    /**
+     * role id
+     */
+    public static final String ATHLETE = "3312ccfa00724f07b3d75edcef280575";
+    public static final String COACH = "ece9ff4c572b4d1ba099d94650a206ca";
+
+    /**
+     * 头像相关
+     */
+    public static final String MALE = "男";
+    public static final String FEMALE = "女";
+    public static final String MALE_DEFAULT_HEAD = "male.jpg";
+    public static final String FEMALE_DEFAULT_HEAD = "female.jpg";
+    public static final String MALE_BOS_DEFAULT_HEAD = "head/male.jpg";
+    public static final String FEMALE_BOS_DEFAULT_HEAD = "head/female.jpg";
+
+    /**
+     * 照片相关
+     */
+    public static final String FEMALE_DEFAULT_PHOTO = "female.jpg";
+    public static final String MALE_DEFAULT_PHOTO = "male.jpg";
+    public static final String FEMALE_BOS_DEFAULT_PHOTO = "photo/female.jpg";
+    public static final String MALE_BOS_DEFAULT_PHOTO = "photo/male.jpg";
+
+    /**
+     * 默认密码
+     */
+    public static final String DEFAULT_PASSWORD = "123456";
+}

+ 176 - 0
src/com/example/demo/Common/utils/DateUtils.java

@@ -0,0 +1,176 @@
+package com.example.demo.Common.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static java.time.temporal.TemporalAdjusters.firstDayOfYear;
+
+public class DateUtils {
+    private static SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
+     * 根据当天日期创建文件夹。
+     *
+     * @return
+     */
+    public static String createFilesByDate() {
+        LocalDate today = LocalDate.now();
+        LocalTime time = LocalTime.now();
+        LocalDateTime now = LocalDateTime.of(today, time);
+        return now.format(DateTimeFormatter.BASIC_ISO_DATE);
+    }
+
+    /**
+     * 获取当前时间并格式化。
+     *
+     * @return
+     */
+    public static String getCurrentTime() {
+        LocalDate today = LocalDate.now();
+        LocalTime time = LocalTime.now();
+        LocalDateTime now = LocalDateTime.of(today, time);
+        return now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+    }
+
+    /**
+     * 获取当前时间并格式化2。
+     *
+     * @return
+     */
+    public static String getCurrentDate() {
+        LocalDate today = LocalDate.now();
+        LocalTime time = LocalTime.now();
+        LocalDateTime now = LocalDateTime.of(today, time);
+        return now.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+    }
+
+    /**
+     * 获取某段时间内的所有天数。
+     * @param start
+     * @param end
+     * @return
+     */
+    public static List<String> getBetweenDate(String start, String end) {
+        List<String> list = new ArrayList<>();
+        LocalDate startDate = LocalDate.parse(start);
+        LocalDate endDate = LocalDate.parse(end);
+        long distance = ChronoUnit.DAYS.between(startDate, endDate);
+        if (distance < 1) {
+            return list;
+        }
+        Stream.iterate(startDate, d -> d.plusDays(1)).limit(distance + 1).forEach(f -> list.add(f.toString()));
+        return list;
+    }
+
+    /**
+     * 构造时间戳,精确到秒。
+     *
+     * @return
+     */
+    public static String fileDateTime() {
+        String str = getCurrentTime();
+        String changeStr = StringUtils.remove(str, "-");
+        changeStr = StringUtils.remove(changeStr, ":");
+        changeStr = StringUtils.remove(changeStr, " ");
+        return changeStr;
+    }
+
+    /**
+     * 获取程序执行时间。
+     *
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+    public static String getExcTime(Long startTime, Long endTime) {
+        float excTime = (float) (endTime - startTime);
+        excTime = excTime / 1000;
+        return excTime + "s";
+    }
+
+    public static String toDate(String date) {
+        String d = StringUtils.substring(date, 0, 10);
+        String dt = StringUtils.remove(d, "-");
+        return dt;
+    }
+
+    /**
+     * 比较时间
+     *
+     * @param starttime
+     * @param getVttTime
+     * @return
+     * @throws ParseException
+     */
+    public static boolean compare(String starttime, String getVttTime) throws ParseException {
+        //如果想比较日期则写成"yyyy-MM-dd"就可以了
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
+        //将字符串形式的时间转化为Date类型的时间
+        Date a = sdf.parse(starttime);
+        Date b = sdf.parse(getVttTime);
+        // 如果starttime早于vtt返回true,否则返回false
+        if (a.getTime() - b.getTime() < 0)
+            return true;
+        else
+            return false;
+    }
+
+    /**
+     * 获取昨日日期。
+     * @return
+     */
+    public static String getLastDay(){
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+        // 获取当前年份第一天
+        String firstDayOfYear = today.with(firstDayOfYear()).toString();
+        // 获取当前日期的前一天
+        String yesterday = today.plusDays(-1).toString();
+        return yesterday;
+    }
+
+    /**
+     * 获取昨日日期。
+     * @return
+     */
+    public static String getDelDay(long modNum){
+        // 获取当前日期
+        LocalDate today = LocalDate.now();
+        // 获取当前年份第一天
+        String firstDayOfYear = today.with(firstDayOfYear()).toString();
+        // 获取当前日期的前一天
+        String yesterday = today.plusDays(-modNum).toString();
+        return yesterday;
+    }
+
+    public static void main(String[] args) {
+        System.err.println(getDelDay(3));
+    }
+
+
+    public static String dayToWeek(String day) {
+        try {
+            Date date = dayFormat.parse(day);
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(date);
+            calendar.setFirstDayOfWeek(Calendar.MONDAY);
+            String year =  (new SimpleDateFormat("yyyy")).format(calendar.getTime());
+            String week = String.valueOf(calendar.get(Calendar.WEEK_OF_YEAR));
+            return year + "-" + week;
+        } catch (ParseException pe) {
+            return "";
+        }
+    }
+}

+ 392 - 0
src/com/example/demo/Common/utils/GeneralUtils.java

@@ -0,0 +1,392 @@
+package com.example.demo.Common.utils;
+
+import com.alibaba.fastjson.JSON;
+import lombok.extern.slf4j.Slf4j;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @program: tiaoshui
+ * @description: GpuServerController
+ * @author: Guanzi
+ * @created: 2021/04/03 09:49
+ */
+@Slf4j
+public class GeneralUtils {
+
+    /**
+     * 获取系统类型
+     */
+    private static final String OS_NAME = System.getProperty("os.name");
+    /**
+     * 获取文件分割符号
+     */
+    private static final String FILE_SEPERATOR = System.getProperty("file.separator");
+    /**
+     * 获取当前日期
+     */
+    private static final String CURRENT_DATE_FILE = DateUtils.createFilesByDate();
+
+    /**
+     * 图片格式。
+     */
+    public static final String IMAGE_TYPE_JPG = "jpg";
+
+    /**
+     * 文件大小单位。
+     */
+    public static final String UNIT_B = "B";
+    public static final String UNIT_K = "K";
+    public static final String UNIT_M = "M";
+    public static final String UNIT_G = "G";
+
+    /**
+     * json格式判定。
+     * @param str
+     * @return
+     */
+    public static boolean checkJson(String str) {
+        boolean result = false;
+        try {
+            Object obj = JSON.parse(str);
+            result = true;
+        } catch (Exception e) {
+            result = false;
+        }
+        return result;
+    }
+
+    /**
+     * 构造返回信息
+     * @param code
+     * @param mes
+     * @param data
+     * @return
+     */
+    public static Map<String,Object> resMap(String code, String mes, Object data){
+        Map<String,Object> map = new HashMap<>();
+        map.put("code",code);
+        map.put("mes",mes);
+        map.put("data",data);
+        return map;
+    }
+
+    /**
+     * 判断文件夹是否存在,存在则返回,不存在则创建文件夹后返回。
+     * @param path
+     * @param type
+     * @return
+     */
+    public static String checkedFileIsExisted(String path,String type,String userid,String fileDate){
+        path = getDynamicPath(path,type,userid,fileDate);
+        File destDir = new File(path);
+        boolean flagWin = OS_NAME.contains("Windows") ? true : false;
+
+        // 创建文件
+        if (!destDir.exists()){
+            log.info("file: ["+ path +"] is not exist,creating...");
+            // linux写入权限。
+            if(!flagWin){
+                destDir.setWritable(true, false);
+            }
+            boolean mkdirs = destDir.mkdirs();
+            if (mkdirs){
+                log.info("file create succ !");
+                return path;
+            }else {
+                log.info("file create failed !");
+                return path;
+            }
+        }else {
+            log.info("file: ["+ path +"] is exist,just return!");
+            return path;
+        }
+    }
+
+    /**
+     * 判断头像文件是否存在。
+     * @param dynamicPath
+     * @param writeTmpFileName
+     * @return
+     */
+    public static Boolean checkHeadFileIsExisted(String dynamicPath, String writeTmpFileName){
+        // 获取文件目录列表。
+        File headFileLists = new File(dynamicPath);
+        File[] checkHeadFiles = headFileLists.listFiles();
+        Boolean fileIsExists = false;
+        if (checkHeadFiles.length > 0){
+            for (File headFile : checkHeadFiles) {
+                if (writeTmpFileName.equals(headFile.getName())){
+                    log.info("headname:{}",headFile.getName());
+                    log.info("file name eq...");
+                    // 说明文件存在。
+                    fileIsExists = true;
+                }
+            }
+        }
+        return fileIsExists;
+    }
+
+    /**
+     * 判断冠军墙文件夹是否存在。
+     * @param path
+     * @param type
+     * @param userid
+     * @return
+     */
+    public static String checkedChampionFileIsExisted(String path,String type,String userid){
+        path = getDynamicPath(path,type,userid,"");
+        File destDir = new File(path);
+        boolean flagWin = OS_NAME.contains("Windows") ? true : false;
+
+        // 创建文件
+        if (!destDir.exists()){
+            log.info("file: ["+ path +"] is not exist,creating...");
+            // linux写入权限。
+            if(!flagWin){
+                destDir.setWritable(true, false);
+            }
+            boolean mkdirs = destDir.mkdirs();
+            if (mkdirs){
+                log.info("file create succ !");
+                return path;
+            }else {
+                log.info("file create failed !");
+                return path;
+            }
+        }else {
+            log.info("file: ["+ path +"] is exist,just return!");
+            return path;
+        }
+    }
+
+    /**
+     * 根据时间判断是否存在文件
+     * @param path
+     * @param date
+     * @param type
+     * @param userid
+     * @return
+     */
+    public static String checkedFileIsExistedByDate(String path,String date,String type,String userid){
+        path = getDynamicPathByDate(path,date,type,userid);
+        File destDir = new File(path);
+        boolean flagWin = OS_NAME.contains("Windows") ? true : false;
+
+        // 创建文件
+        if (!destDir.exists()){
+            log.info("file: ["+ path +"] is not exist,creating...");
+            // linux写入权限。
+            if(!flagWin){
+                destDir.setWritable(true, false);
+            }
+            boolean mkdirs = destDir.mkdirs();
+            if (mkdirs){
+                log.info("file create succ !");
+                return path;
+            }else {
+                log.info("file create failed !");
+                return path;
+            }
+        }else {
+            log.info("file: ["+ path +"] is exist,just return!");
+            return path;
+        }
+    }
+
+    public static String getDynamicPathByDate(String path,String date,String type,String userid){
+        // 获取操作系统。
+        if (OS_NAME.contains("Windows")) {
+            // win
+            log.info("win os");
+            if (type.equals("-1") && userid.equals("-1")){
+                path = path;
+            }else if (type.equals("-1") && !userid.equals("-1")){
+                path = path + FILE_SEPERATOR + userid + FILE_SEPERATOR + "champion" + FILE_SEPERATOR;
+            }else {
+                path = path + type + FILE_SEPERATOR + userid + FILE_SEPERATOR + date + FILE_SEPERATOR;
+            }
+            // path = path + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+        }else {
+            // linux
+            log.info("linux os");
+            if (type.equals("-1") && userid.equals("-1")){
+                path = path;
+            }else if (type.equals("-1") && !userid.equals("-1")){
+                path = path + FILE_SEPERATOR + userid + FILE_SEPERATOR + "champion" + FILE_SEPERATOR;
+            }else {
+                path = path + type + FILE_SEPERATOR + userid + FILE_SEPERATOR + date + FILE_SEPERATOR;
+            }
+            // path = path + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+        }
+        return path;
+    }
+    /**
+     * 获取文件存储路径,根据当前操作系统动态创建文件夹路径。
+     * @param path
+     * @param type
+     * @return
+     */
+    public static String getDynamicPath(String path,String type,String userid,String fileDate){
+        // 获取操作系统。
+        if (OS_NAME.contains("Windows")) {
+            // win
+            log.info("win os");
+            if (type.equals("-1") && userid.equals("-1")){
+                path = path;
+            }else if (userid.equals("-2")){
+                path = path + type + FILE_SEPERATOR + fileDate + FILE_SEPERATOR;
+            }else {
+                path = path + type + FILE_SEPERATOR + userid + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+            }
+            // path = path + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+        }else {
+            // linux
+            log.info("linux os");
+            if (type.equals("-1") && userid.equals("-1")){
+                path = path;
+            }else if (userid.equals("-2")){
+                path = path + type + FILE_SEPERATOR + fileDate + FILE_SEPERATOR;
+            }else {
+                path = path + type + FILE_SEPERATOR + userid + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+            }
+            // path = path + FILE_SEPERATOR + DateUtils.createFilesByDate() + FILE_SEPERATOR;
+        }
+        return path;
+    }
+
+
+    /**
+     * 判断文件夹是否存在。
+     * @param path
+     * @return
+     */
+    public static Boolean checkFileIsExist(String path){
+        File destDir = new File(path);
+        boolean flagWin = OS_NAME.contains("Windows") ? true : false;
+        // 创建文件
+        if (!destDir.exists())
+            return false;
+        return true;
+    }
+
+    /**
+     * 文件大小获取转换。
+     * @param size
+     * @return
+     */
+    public static String getFileSize(Long size) {
+        if (size >= 1024 * 1024 * 1024) {
+            return new Long(size / 1073741824L) + "G";
+
+        } else if (size >= 1024 * 1024) {
+
+            return new Long(size / 1048576L) + "M";
+
+        } else if (size >= 1024) {
+
+            return new Long(size / 1024) + "K";
+
+        } else {
+            return size + "B";
+        }
+    }
+
+    /**
+     * 检查文件大小
+     * @param fileSize
+     * @return
+     */
+    public static Boolean checkFileSize(String fileSize){
+        // Boolean fileFlag = false;
+        // if (fileSize.contains("M")){
+        //     fileSize = StringUtils.remove(fileSize,"M");
+        //     if (fileSize > "13")
+        // }
+        return false;
+    }
+
+    /**
+     * 拷贝文件
+     * @param source
+     * @param dest
+     * @throws IOException
+     */
+    public static void copyFileUsingFileChannels(File source, File dest) throws IOException {
+        FileChannel inputChannel = null;
+        FileChannel outputChannel = null;
+        FileInputStream fis = null;
+        FileOutputStream fos = null;
+        FileChannel inChannel = null;
+        FileChannel outChannel = null;
+        try {
+            fis = new FileInputStream(source);
+            fos = new FileOutputStream(dest);
+
+            //获取通道
+            inChannel = fis.getChannel();
+            outChannel = fos.getChannel();
+
+            inChannel.transferTo(0,inChannel.size(),outChannel);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }finally {
+            //关闭流
+            try {
+                if (outChannel != null) {
+                    outChannel.close();
+                }
+                if (inChannel != null) {
+                    inChannel.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * 根据开始时间排序。
+     * @param changedList
+     * @return
+     */
+    public static List<Map<String,Object>> sortMap(List<Map<String, Object>> changedList){
+        List<Map<String, Object>> collects = changedList.stream().sorted(Comparator
+                .comparing(GeneralUtils::comparingByStartTime)
+                .reversed())
+                .collect(Collectors.toList());
+        return collects;
+    }
+    private static String comparingByStartTime(Map<String, Object> map){
+        return (String) map.get("starttime");
+    }
+
+
+
+    /**
+     * 根据排序字段排序。
+     * @param changedList
+     * @return
+     */
+    public static List<Map<String,Object>> sortMapByOrderNum(List<Map<String, Object>> changedList){
+        List<Map<String, Object>> collects = changedList.stream().sorted(Comparator
+                .comparing(GeneralUtils::comparingByOrderNum)
+                // .reversed())
+        )
+                .collect(Collectors.toList());
+        return collects;
+    }
+    private static Integer comparingByOrderNum(Map<String, Object> map){
+        return (Integer) map.get("ordernumber");
+    }
+
+}

+ 13 - 0
src/com/example/demo/TestJava.java

@@ -0,0 +1,13 @@
+package com.example.demo;
+
+/**
+ * @program: divingcommon
+ * @description: Test
+ * @author: Guanzi
+ * @created: 2021/08/10 08:44
+ */
+public class TestJava {
+    public static void main(String[] args) {
+        System.out.println("hello...");
+    }
+}

+ 45 - 0
src/com/example/demo/entity/Action.java

@@ -0,0 +1,45 @@
+package com.example.demo.entity;
+
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * @program: tiaoshui
+ * @description: 关键动作
+ * @author: WangHao
+ * @create: 2021-5-12 10:09:11
+ */
+@Builder
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class Action implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+
+    private String videoId;
+
+    private String videoName;
+
+    private Integer height;
+
+    private String actionCode;
+
+    private Integer actionNumber;
+
+    private String vertex3d;
+
+    private String objPath;
+
+    private String objBos;
+
+    private String createTime;
+
+    private String offset;
+
+
+}

+ 35 - 0
src/com/example/demo/entity/Frame.java

@@ -0,0 +1,35 @@
+package com.example.demo.entity;
+
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * @program: tiaoshui
+ * @description: 视频帧信息表
+ * @author: Lyon
+ * @create: 2021-04-19 16:13
+ */
+@Builder
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class Frame implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private Integer id;
+    private String videoId;
+    private String videoName;
+    private Integer height;
+    private Integer frameName;
+    private Integer frameNum;
+    private String vertex3d;
+    private String objPath;
+    private String objBos;
+    private String createTime;
+    private String offset;
+    private String vertex2d;
+
+}

+ 115 - 0
src/com/example/demo/entity/Spgl.java

@@ -0,0 +1,115 @@
+package com.example.demo.entity;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @program: divingcommon
+ * @description: Spgl
+ * @author: Guanzi
+ * @created: 2021/08/10 08:49
+ */
+
+@Getter
+@Setter
+public class Spgl {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    private String id;
+    /**
+     * 运动员编号
+     */
+    private String ydyid;
+    /**
+     * 运动员姓名
+     */
+    private String ydyname;
+    /**
+     * 标题
+     */
+    private String title;
+    /**
+     * 时间
+     */
+    private String shijian;
+    /**
+     * 图片
+     */
+    private String photo;
+    /**
+     * 视频
+     */
+    private String video;
+    private String createtime;
+    private String updatetime;
+    private String yl1;
+    private String yl2;
+
+    private String starttime;
+
+    private String endtime;
+
+    private String singleflag;
+
+    private String type;
+
+    private String height;
+
+    private String localpath;
+
+    private String cam;
+
+    private String bosphoto;
+
+    private String lhpgpath;
+
+    private String lhpgkey;
+
+    private String ztgjpath;
+
+    private String ztgjkey;
+
+    private String rtcjpath;
+
+    private String rtcjkey;
+
+    private String actioncode;
+
+    private String difficultyfactor;
+
+    private String completequality;
+
+    private String localfrontphoto;
+
+    private String bosfrontphoto;
+
+    private String localfrontvideo;
+
+    private String bosfrontvideo;
+
+    private String localptvideo;
+
+    private String ptkey;
+
+    private String completequalitytwo;
+
+    private String syncscore;
+
+    private String isscored;
+
+    private String localczvideo;
+
+    private String czkey;
+
+    private String localsidevideo;
+
+    private String sidekey;
+
+    private String rtcjstatus;
+
+    private String gjdzstatus;
+
+}

+ 102 - 0
src/com/example/demo/entity/User.java

@@ -0,0 +1,102 @@
+package com.example.demo.entity;
+
+import lombok.*;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author hanfei
+ * @since 2020-04-08
+ */
+@Builder
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public class User implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 用户id
+     */
+    private String user_id;
+    /**
+     * 用户名
+     */
+    private String user_name;
+
+    /**
+     * 昵称,即用户登录系统时使用的登录用户名
+     */
+    private String nickname;
+
+    /**
+     * 名字
+     */
+    private String name;
+    /**
+     * 拼音首字母
+     */
+    private String first_alphabet;
+    /**
+     * 拼音
+     */
+    private String alphabet;
+    /**
+     * 性别
+     */
+    private String gender;
+    /**
+     * 手机号
+     */
+    private String mobile;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 职位
+     */
+    private String duty;
+    /**
+     * 办公室电话
+     */
+    private String office_tel;
+    /**
+     * 编号
+     */
+    private Integer order_num;
+    /**
+     * 密码
+     */
+    private String password;
+    /**
+     * 角色id
+     */
+    private String roleid;
+    private Integer flag;
+
+    private String headsculpture;
+
+    private String createtime;
+
+    private String bosHead;
+
+    private String photo;
+
+    private String bosPhoto;
+
+    private String yvideoname;
+
+    private String isavailable;
+
+    private String islost;
+
+    private int ordernumber;
+
+}

+ 24 - 0
src/com/example/demo/form/CamParam.java

@@ -0,0 +1,24 @@
+package com.example.demo.form;
+
+import lombok.Builder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @program: divingcommon
+ * @description: CamParam
+ * @author: Guanzi
+ * @created: 2021/08/10 09:00
+ */
+@Builder
+@Getter
+@Setter
+public class CamParam {
+    private String cam;
+
+    private String getTime;
+
+    private String psbName;
+
+    private String psb;
+}

+ 741 - 0
src/com/example/demo/sony/SonyUtils.java

@@ -0,0 +1,741 @@
+package com.example.demo.sony;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.example.demo.Common.CommonIT;
+import com.example.demo.Common.constants.Constants;
+import com.example.demo.Common.utils.DateUtils;
+import com.example.demo.Common.utils.GeneralUtils;
+import com.example.demo.entity.Action;
+import com.example.demo.entity.Frame;
+import com.example.demo.entity.Spgl;
+import com.example.demo.entity.User;
+import com.example.demo.form.CamParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @program: divingcommon
+ * @description: SonyUtils
+ * @author: Guanzi
+ * @created: 2021/08/10 08:51
+ */
+@Slf4j
+public class SonyUtils {
+
+    /**
+     * 判断是入场还是出场
+     *
+     * @return
+     */
+    public String checkInOrOut(String cam) {
+        if (Constants.CAM_0.equals(cam) || Constants.CAM_1.equals(cam)) {
+            // 10米入场,直接入库一条数据。
+            return "in-10";
+        } else if (Constants.CAM_4.equals(cam) || Constants.CAM_5.equals(cam)) {
+            // 3米入场,直接入库一条数据。
+            return "in-3";
+
+        } else if (Constants.CAM_2.equals(cam) || Constants.CAM_3.equals(cam)) {
+            // 10米出场,去数据库根据用户id、height、cam、开始时间查询,update。
+            return "out-10";
+        } else if (Constants.CAM_6.equals(cam) || Constants.CAM_7.equals(cam)) {
+            // 3米出场,去数据库根据用户id、height、cam、开始时间查询,update。
+            return "out-3";
+        }
+        return "1";
+    }
+
+    /**
+     * 海康摄像头10米入场、3米入场初始化一条视频数据通用方法。
+     *
+     * @param camParam
+     * @param starttime
+     * @param height
+     * @param userId
+     * @return
+     */
+    public Spgl inCamSignal(CamParam camParam, String starttime, String height, String userId) {
+        String cam = camParam.getCam();
+        if (Constants.CAM_0.equals(cam) || Constants.CAM_1.equals(cam)) {
+            // 10米入场,直接入库一条数据。
+            Spgl spgl = initSpgl(camParam, camParam.getGetTime(), Constants.HEIGHT_TEN, userId);
+            return spgl;
+        } else if (Constants.CAM_4.equals(cam) || Constants.CAM_5.equals(cam)) {
+            // 3米入场,直接入库一条数据。
+            Spgl spgl = initSpgl(camParam, camParam.getGetTime(), Constants.HEIGHT_THREE, userId);
+            return spgl;
+        }
+        return null;
+    }
+
+    /**
+     * 海康摄像头10米入场、3米出场初始化一条视频数据通用方法。
+     *
+     * @param camParam
+     * @return
+     */
+    public Map<String, Object> outCamSignal(CamParam camParam, List<User> users) {
+        String cam = camParam.getCam();
+        if (Constants.CAM_2.equals(cam) || Constants.CAM_3.equals(cam)) {
+            // 10米出场,去数据库根据用户id、height、cam、开始时间查询,update。
+            Map<String, Object> mapOne = initSelMap(camParam, Constants.CAM_0, Constants.CAM_1, Constants.HEIGHT_TEN, users);
+            Map<String, Object> mapTwo = initSelMap(camParam, Constants.CAM_1, Constants.CAM_1, Constants.HEIGHT_TEN, users);
+            Map<String, Object> resMap = new HashMap<>();
+            resMap.put("mapOne", mapOne);
+            resMap.put("mapTwo", mapTwo);
+            return resMap;
+
+        } else if (Constants.CAM_6.equals(cam) || Constants.CAM_7.equals(cam)) {
+            // 3米出场,去数据库根据用户id、height、cam、开始时间查询,update。
+            Map<String, Object> mapOne = initSelMap(camParam, Constants.CAM_4, Constants.CAM_5, Constants.HEIGHT_THREE, users);
+            Map<String, Object> mapTwo = initSelMap(camParam, Constants.CAM_5, Constants.CAM_5, Constants.HEIGHT_THREE, users);
+            Map<String, Object> resMap = new HashMap<>();
+            resMap.put("mapOne", mapOne);
+            resMap.put("mapTwo", mapTwo);
+            return resMap;
+        }
+        return null;
+    }
+
+    /**
+     * 初始化视频数据。
+     *
+     * @param camparam
+     * @param starttime
+     * @param height
+     * @param userId
+     * @return
+     */
+    public Spgl initSpgl(CamParam camparam, String starttime, String height, String userId) {
+        log.info("jar camparam:{}", JSON.toJSONString(camparam));
+        log.info("jar starttime:{}", starttime);
+        log.info("jar height:{}", height);
+        String id = new CommonIT().findId();
+        String title = "跳水";
+        String shijian = new CommonIT().findDate();
+
+        Spgl spgl = new Spgl();
+        spgl.setId(id);
+        spgl.setTitle(title);
+        spgl.setShijian(shijian);
+        // 高度
+        spgl.setHeight(height);
+        spgl.setCam(camparam.getCam());
+        // spgl.setCreatetime(DateUtils.getCurrentTime());
+
+        // User user = userService.findByUsername(vt.getPsbName());
+        Map<String, Object> map = new HashMap<>();
+        // todo 20210508 涉及单双人视频,故此处做修改。若是双人跳水视频,则默认取第一个人先存储,后期更新时再新增第二个人。
+        String psbName = camparam.getPsbName().contains(",") ?
+                StringUtils.substringBefore(camparam.getPsbName(), ",") : camparam.getPsbName();
+        map.put("user_name", psbName);
+        // List<User> users = userMapper.selectByMap(map);
+        // log.info(JSON.toJSONString(users));
+        if (!"0".equals(userId)) {
+            spgl.setYdyid(userId);
+            //     // spgl.setYdyname(users.get(0).getName());
+            //     // todo 20210508 设计但双人视频,故此处做修改。若是双人跳水视频,则默认取第一个人先存储,后期更新时再新增第二个人。
+            spgl.setYdyname(camparam.getPsbName());
+        }else {
+
+        }
+        // 此处未识别出人,默认是Unknow即国家跳水队。
+        spgl.setYdyname(camparam.getPsbName().equals("Unknow") ? "国家跳水队" : camparam.getPsbName());
+        if (starttime.equals("-1")) {
+            spgl.setEndtime(camparam.getGetTime());
+        } else {
+            spgl.setStarttime(camparam.getGetTime());
+        }
+        spgl.setSingleflag(camparam.getPsbName().contains(",") ? "1" : "0");
+        // int insertId = mapper.insert(spgl);
+        // if (insertId > 0) {
+        //     return spgl;
+        // } else {
+        //     return null;
+        // }
+        log.info("jarcontroller spgl:{}", JSON.toJSONString(spgl));
+        return spgl;
+    }
+
+    /**
+     * 初始化查询条件,camTwo在此逻辑暂时不用。
+     *
+     * @param camParam
+     * @param camOne
+     * @param camTwo
+     * @param height
+     * @return
+     */
+    public Map<String, Object> initSelMap(CamParam camParam, String camOne, String camTwo, String height, List<User> users) {
+        Map<String, Object> map = new HashMap<>();
+        if (users.size() > 0 && users.get(0) != null && StringUtils.isNotEmpty(users.get(0).getUser_id())) {
+            map.put("ydyid", users.get(0).getUser_id());
+        } else {
+            map.put("ydyname", camParam.getPsbName());
+        }
+        map.put("camone", camOne);
+        // 或者1,暂时弃用,xml中此条件已注释,不影响语句。
+        map.put("camtwo", camTwo);
+        map.put("height", height);
+        log.info("sel map:{}", JSON.toJSONString(map));
+        return map;
+    }
+
+    /**
+     * 获取人体辅助训练数据
+     *
+     * @param frameList
+     * @param vtime
+     * @param height
+     * @param redisResThree
+     * @param redisResTen
+     * @param spgls
+     * @param map
+     * @return
+     */
+    public Map<String, Object> getTrainingInfos(List<Frame> frameList, String vtime, String height, JSONObject redisResThree, JSONObject redisResTen, List<Spgl> spgls, Map<String, String> map) {
+        // 计算帧数
+        String frameNum = calFrames(vtime);
+        Map<String, Object> resMap = new HashMap<>();
+        if (ObjectUtils.isNotEmpty(frameList)) {
+            /**
+             * 3f2169c186414a0c8bd08d540bc6a21d
+             * c5162cdc3dc5417994b762a3ceca4d1b
+             * 这2个都是昨天说的新方法,6300个float变成了索引 全部是10米的
+             */
+            // JSONObject redisResThree = JSON.parseObject(redisService.get("three-json").toString());
+            // JSONObject redisResTen = JSON.parseObject(redisService.get("ten-json").toString());
+            log.info("redisResThree size:{}", redisResThree.size());
+            log.info("redisResTen size:{}", redisResTen.size());
+            // 区分3米和10米
+            List<List<Float>> verTexs = new ArrayList<>();
+            List<List<Float>> verTexSecs = new ArrayList<>();
+            if ("3".equals(height)) {
+                verTexs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    // redisService.get(frame.getVertex3d()).toString()
+                                    // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                    redisResThree.get(frame.getVertex3d()).toString()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+                verTexSecs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    frame.getVertex2d()
+                                            // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                            // redisResThree.get(frame.getVertex2d()).toString()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+            } else {
+                verTexs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    // redisService.get(frame.getVertex3d()).toString()
+                                    // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                    redisResTen.get(frame.getVertex3d()).toString()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+                verTexSecs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    // redisService.get(frame.getVertex3d()).toString()
+                                    // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                    // redisResTen.get(frame.getVertex2d()).toString()
+                                    frame.getVertex2d()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+            }
+
+            log.info("verTexs size:{}", verTexs.size());
+            // 偏移量
+            List<List<Float>> offsets = frameList.stream()
+                    .sorted(Comparator.comparing(Frame::getFrameName))
+                    .map(frame -> {
+                        return Arrays.stream(frame.getOffset()
+                                .replace("[", "")
+                                .replace("]", "")
+                                .split(","))
+                                .map(s -> Float.parseFloat(s.trim()))
+                                .collect(Collectors.toList());
+                    })
+                    .collect(Collectors.toList());
+            log.info("offsets size:{}", offsets.size());
+            resMap.put("verTexs", verTexs);
+            log.info("vertexsercs:{}", verTexSecs.size());
+            resMap.put("verTexSecs", verTexSecs);
+            // if (resMap.containsKey("verTexSecs")){
+            //     log.info("contains...");
+            // }else {
+            //     log.info("dont contains...");
+            // }
+            resMap.put("offsets", offsets);
+            // 根据视频id和高度查询视频列表。
+            // List<Spgl> spgls = spglMapper.selectList(new EntityWrapper<Spgl>()
+            //         .eq("id",videoId)
+            //         .eq("height",height));
+            log.info("sel action source spgl:{}", JSON.toJSONString(spgls));
+            // 新增视频本地链接和bos链接。
+            String localvideo = spgls.size() > 0 ? spgls.get(0).getLocalpath() : null;
+            String bosvideo = spgls.size() > 0 ? spgls.get(0).getVideo() : null;
+            // Map<String,String> map = spglService.getActionSourceBosVideo(bosvideo);
+            String standbybosvideo = map.containsKey("url") ? map.get("url") : null;
+            resMap.put("localvideo", localvideo);
+            resMap.put("bosvideo", standbybosvideo);
+            resMap.put("standbybosvideo", bosvideo);
+            return resMap;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 帧数、秒数计算。
+     *
+     * @param vtime
+     * @return
+     */
+    public String calFrames(String vtime) {
+        Float frameFloat = (Float.valueOf(vtime) * 60) / 1000;
+        int floorNum = (int) Math.floor(frameFloat);
+        return String.valueOf(floorNum);
+    }
+
+    /**
+     * 获取关键动作数据。
+     *
+     * @param actionList
+     * @param redisResThree
+     * @param redisResTen
+     * @param spgls
+     * @param map
+     * @param height
+     * @return
+     */
+    public Map<String, Object> getActionInfos(List<Action> actionList, JSONObject redisResThree, JSONObject redisResTen, List<Spgl> spgls, Map<String, String> map, String height) {
+        Map<String, Object> resMap = new HashMap<>();
+        if (ObjectUtils.isNotEmpty(actionList)) {
+            log.info("redisResThree size:{}", redisResThree.size());
+            log.info("redisResTen size:{}", redisResTen.size());
+            List<List<Float>> verTexs = new ArrayList<>();
+            if ("3".equals(height)) {
+                verTexs = actionList.stream()
+                        .sorted(Comparator.comparing(Action::getActionCode))
+                        .map(action -> Arrays.stream(
+                                // action.getVertex3d()
+                                redisResThree.get(action.getVertex3d()).toString()
+                                        .replace("[", "")
+                                        .replace("]", "")
+                                        .split(","))
+                                .map(s -> Float.parseFloat(s.trim()))
+                                .collect(Collectors.toList()))
+                        .collect(Collectors.toList());
+            } else {
+                verTexs = actionList.stream()
+                        .sorted(Comparator.comparing(Action::getActionCode))
+                        .map(action -> Arrays.stream(
+                                // action.getVertex3d()
+                                redisResTen.get(action.getVertex3d()).toString()
+                                        .replace("[", "")
+                                        .replace("]", "")
+                                        .split(","))
+                                .map(s -> Float.parseFloat(s.trim()))
+                                .collect(Collectors.toList()))
+                        .collect(Collectors.toList());
+            }
+
+            log.info("verTexs size:{}", verTexs.size());
+            // 偏移量
+            List<List<Float>> offsets = actionList.stream()
+                    .sorted(Comparator.comparing(Action::getActionCode))
+                    .map(action -> Arrays.stream(action.getOffset()
+                            .replace("[", "")
+                            .replace("]", "")
+                            .split(","))
+                            .map(s -> Float.parseFloat(s.trim()))
+                            .collect(Collectors.toList()))
+                    .collect(Collectors.toList());
+            List<String> localpaths = actionList.stream()
+                    .sorted(Comparator.comparing(Action::getActionCode))
+                    .map(action -> action.getObjPath())
+                    .collect(Collectors.toList());
+            // bos图片路径
+            List<String> bospaths = actionList.stream()
+                    .sorted(Comparator.comparing(Action::getActionCode))
+                    .map(action -> action.getObjBos())
+                    .collect(Collectors.toList());
+
+            log.info("offsets size:{}", offsets.size());
+            resMap.put("verTexs", verTexs);
+            resMap.put("offsets", offsets);
+            resMap.put("localpaths", localpaths);
+            resMap.put("bospaths", bospaths);
+            log.info("sel action source spgl:{}", JSON.toJSONString(spgls));
+            // 新增视频本地链接和bos链接。
+            String localvideo = spgls.size() > 0 ? spgls.get(0).getLocalpath() : null;
+            String bosvideo = spgls.size() > 0 ? spgls.get(0).getVideo() : null;
+            String standbybosvideo = map.containsKey("url") ? map.get("url") : null;
+            resMap.put("localvideo", localvideo);
+            resMap.put("bosvideo", standbybosvideo);
+            resMap.put("standbybosvideo", bosvideo);
+            return resMap;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 人体重建数据。
+     *
+     * @param frameList
+     * @param redisResThree
+     * @param redisResTen
+     * @param spgls
+     * @param map
+     * @param height
+     * @return
+     */
+    public Map<String, Object> getVideoFrameInfos(List<Frame> frameList, JSONObject redisResThree, JSONObject redisResTen, List<Spgl> spgls, Map<String, String> map, String height) {
+        Map<String, Object> resMap = new HashMap<>();
+        if (ObjectUtils.isNotEmpty(frameList)) {
+            log.info("redisResThree size:{}", redisResThree.size());
+            log.info("redisResTen size:{}", redisResTen.size());
+
+            List<List<Float>> verTexs = new ArrayList<>();
+            if ("3".equals(height)) {
+                verTexs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    // redisService.get(frame.getVertex3d()).toString()
+                                    // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                    redisResThree.get(frame.getVertex3d()).toString()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+
+            } else {
+                verTexs = frameList.stream()
+                        .sorted(Comparator.comparing(Frame::getFrameName))
+                        .map(frame -> {
+                            return Arrays.stream(
+                                    // redisService.get(frame.getVertex3d()).toString()
+                                    // JSON.parseObject(redisService.get("test-json").toString()).get(frame.getVertex3d()).toString()
+                                    redisResTen.get(frame.getVertex3d()).toString()
+                                            .replace("[", "")
+                                            .replace("]", "")
+                                            .split(",")
+                            )
+                                    .map(s -> Float.parseFloat(s.trim()))
+                                    .collect(Collectors.toList());
+                        })
+                        .collect(Collectors.toList());
+
+            }
+
+            log.info("verTexs size:{}", verTexs.size());
+            // 偏移量
+            List<List<Float>> offsets = frameList.stream()
+                    .sorted(Comparator.comparing(Frame::getFrameName))
+                    .map(frame -> {
+                        return Arrays.stream(frame.getOffset()
+                                .replace("[", "")
+                                .replace("]", "")
+                                .split(","))
+                                .map(s -> Float.parseFloat(s.trim()))
+                                .collect(Collectors.toList());
+                    })
+                    .collect(Collectors.toList());
+            log.info("offsets size:{}", offsets.size());
+            resMap.put("verTexs", verTexs);
+            resMap.put("offsets", offsets);
+            // 根据视频id和高度查询视频列表。
+            log.info("sel action source spgl:{}", JSON.toJSONString(spgls));
+            // 新增视频本地链接和bos链接。
+            String localvideo = spgls.size() > 0 ? spgls.get(0).getLocalpath() : null;
+            String bosvideo = spgls.size() > 0 ? spgls.get(0).getVideo() : null;
+            String standbybosvideo = map.containsKey("url") ? map.get("url") : null;
+            resMap.put("localvideo", localvideo);
+            resMap.put("bosvideo", standbybosvideo);
+            resMap.put("standbybosvideo", bosvideo);
+            return resMap;
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * 关键动作数据处理。
+     *
+     * @param tmpSpgl
+     * @param bosPath
+     * @param height
+     * @param fileName
+     * @param skeletons
+     * @param files
+     * @param offset
+     * @return
+     * @throws IOException
+     */
+    public Action insertActionInfos(Spgl tmpSpgl,MultipartFile file, String name,long startTime,String height, String bosPath, String fileDate, String fileName, String skeletons, MultipartFile[] files, String offset) throws IOException {
+        //解析skeletons
+        JSONObject jsonObj = JSON.parseObject(skeletons);
+        Map jsonSet = jsonObj.toJavaObject(Map.class);
+
+        JSONObject jsonObjOffset = JSON.parseObject(offset);
+        Map jsonSetOffset = jsonObjOffset.toJavaObject(Map.class);
+
+        //获取动作总数
+        int actionNumber = jsonSet.size();
+
+        //存储关键动作到BOS
+        log.info("fileName:{}", name);
+        log.info("bospath:{}", bosPath);
+        long endTime = System.currentTimeMillis();
+        String fileSize = GeneralUtils.getFileSize(file.getSize());
+        log.info("当前文件大小:{}", fileSize);
+        log.info("关键动作上传至BOS云服务器耗时:{}", DateUtils.getExcTime(startTime, endTime));
+
+        Object frameInfo = jsonSet.get(name);
+        Action action = new Action();
+        String vertex3d = frameInfo.toString();
+        String insertOffset = jsonObjOffset.get(name).toString();
+
+
+        //自增id,设为0实现自增
+        action.setId(0);
+        action.setVideoId(tmpSpgl.getId());
+        action.setVideoName(tmpSpgl.getVideo().substring(tmpSpgl.getVideo().lastIndexOf("/") + 1));
+        action.setHeight(Integer.parseInt(height));
+        action.setActionCode(name);
+        action.setActionNumber(actionNumber);
+        action.setVertex3d(vertex3d);
+        action.setOffset(insertOffset);
+
+
+        //保存关键动作相关信息
+        // String date = DateUtils.createFilesByDate();
+        action.setCreateTime(DateUtils.getCurrentTime());
+        action.setObjBos(bosPath);
+        // action.setObjPath(path);
+        // action.setObjPath(height + "/" + DateUtils.createFilesByDate() + "/" + fileName);
+        action.setObjPath(height + "/" + fileDate + "/" + name);
+        // cnt = actionMapper.insert(action);
+        // todo 20210705 新增关键动作视频数据是否存在逻辑。
+        // log.info("before tmpspgl gjdzstatus:{}",tmpSpgl.getGjdzstatus());
+        // tmpSpgl.setGjdzstatus("1");
+        // log.info("after tmpspgl gjdzstatus:{}",tmpSpgl.getGjdzstatus());
+        // spglMapper.updateById(tmpSpgl);
+        return action;
+    }
+
+    /**
+     * 人体重建数据处理。
+     * @param tmpSpgl
+     * @param i
+     * @param height
+     * @param fileName
+     * @param skeletons
+     * @param files
+     * @param offset
+     * @param vertex
+     * @return
+     * @throws IOException
+     */
+    public Frame insertVideoFrameInfos(Spgl tmpSpgl,int i,String height,JSONObject jsonObj, String fileName, String skeletons, MultipartFile[] files,String offset,String vertex) throws IOException {
+        /*
+        skeletons = "{
+            "1":[x11, y11, z11, x12, y12, z12, ...],
+            "2":[x21, y21, z21, x22, y22, z22, ...],
+            ...
+        }"
+         */
+        // 解析72个float数据。
+        JSONObject jsonObjVerx = JSON.parseObject(vertex);
+
+        // 骨架信息处理。
+        int forNum = jsonObj.size();
+        // 偏移量处理
+        JSONObject jsonObjOffset = JSON.parseObject(offset);
+        Frame frame = new Frame();
+        String vertex3d = jsonObj.get(String.valueOf(i)).toString();
+        log.info("vertex3d:{}",vertex3d);
+
+        //自增id,设为0实现自增
+        frame.setId(0);
+        frame.setVideoId(tmpSpgl.getId());
+        frame.setVideoName(tmpSpgl.getVideo().substring(tmpSpgl.getVideo().lastIndexOf("/")+1));
+        frame.setHeight(Integer.parseInt(height));
+        frame.setFrameName(i);
+        frame.setVertex3d(vertex3d);
+        frame.setFrameNum(forNum);
+        frame.setCreateTime(DateUtils.getCurrentTime());
+        String tmpOffset = jsonObjOffset.get(String.valueOf(i)).toString();
+        frame.setOffset(tmpOffset);
+        // 骨架信息
+        String verTex2d = jsonObjVerx.get(String.valueOf(i)).toString();
+        frame.setVertex2d(verTex2d);
+
+        //todo 保存关键帧3D模型相关信息
+        // frame.setObjBos(bosPath);
+        // frame.setObjPath(path);
+
+        log.info("frame:{}",JSON.toJSONString(frame));
+        return frame;
+    }
+
+    /**
+     * 初始化3D视频查询语句。
+     * @param filename
+     * @param sStart
+     * @param sEnd
+     * @param eStart
+     * @param eEnd
+     * @return
+     */
+    public Map<String,Object> sel3DMap(String filename,int sStart,int sEnd,int eStart,int eEnd){
+        String starttime = StringUtils.substring(filename, sStart, sEnd).replace("_", " ");
+        String endtime = StringUtils.substring(filename, eStart, eEnd).replace("_", " ");
+        String type = StringUtils.substringAfterLast(filename, "-");
+        Map<String,Object> map = new HashMap<>();
+        map.put("starttime",starttime);
+        map.put("endtime",endtime);
+        map.put("type",type);
+        return map;
+    }
+
+    /**
+     * 初始化更新spgl。
+     * @param type
+     * @param localPath
+     * @param bosKey
+     * @return
+     */
+    public Spgl init3DSpgls(Spgl sp,String type,String localPath,String bosKey){
+            // 更新表数据
+            if ("3dlhpg.mp4".equals(type)) {
+                sp.setLhpgpath(localPath);
+                sp.setLhpgkey(bosKey);
+            }
+            if ("3dztgj.mp4".equals(type)) {
+                sp.setZtgjpath(localPath);
+                sp.setZtgjkey(bosKey);
+            }
+            if ("3drtcj.mp4".equals(type)) {
+                sp.setRtcjpath(localPath);
+                sp.setRtcjkey(bosKey);
+            }
+        return sp;
+    }
+
+    // public Map<String, Object> getVideo(MultipartFile file, MultipartFile photo, String cam, String getTime, String psbName, String psb,List<User> userOnes,List<User> userTwos) throws IOException {
+    //     String height = "";
+    //     if (Constants.CAM_0.equals(cam) || Constants.CAM_1.equals(cam) || Constants.CAM_2.equals(cam) || Constants.CAM_3.equals(cam)) {
+    //         // 10米跳台: 100 101 入场;102 103 出场。
+    //         height = Constants.HEIGHT_TEN;
+    //     } else if (Constants.CAM_4.equals(cam) || Constants.CAM_5.equals(cam) || Constants.CAM_6.equals(cam) || Constants.CAM_7.equals(cam)) {
+    //         // 3米跳台:104 105 入场;106 107出场。
+    //         height = Constants.HEIGHT_THREE;
+    //     }
+    //     // todo 0508 单双视频区分,故逻辑调整: psbName 是否包含","。
+    //     int saved = 0;
+    //     if (psbName.contains(",")) {
+    //         // 双人视频 todo source
+    //         String beforePsbName = StringUtils.substringBefore(psbName, ",");
+    //         String afterPsbName = StringUtils.substringAfter(psbName, ",");
+    //         String userOneId = "";
+    //         String userTwoId = "";
+    //
+    //         // Map<String, Object> userOneMap = new HashMap<>();
+    //         // userOneMap.put("user_name", beforePsbName);
+    //         // List<User> userOnes = userMapper.selectByMap(userOneMap);
+    //
+    //         // Map<String, Object> userTwoMap = new HashMap<>();
+    //         // userTwoMap.put("user_name", afterPsbName);
+    //         // List<User> userTwos = userMapper.selectByMap(userTwoMap);
+    //
+    //         if (userOnes.size() > 0 && null != userOnes.get(0) && StringUtils.isNotEmpty(userOnes.get(0).getUser_id())) {
+    //             userOneId = userOnes.get(0).getUser_id();
+    //         } else {
+    //             // 若未识别出运动员,则默认运动员姓名
+    //             userOneId = psbName.contains(",") ? "Unknow" : psbName;
+    //         }
+    //         // saved = commonCollectVideo(file,photo,cam,getTime,psbName,userOneId,height,beforePsbName);
+    //         if ((userTwos.size() > 0 && null != userTwos.get(0) && StringUtils.isNotEmpty(userTwos.get(0).getUser_id()))) {
+    //             userTwoId = userTwos.get(0).getUser_id();
+    //         } else {
+    //             userTwoId = psbName.contains(",") ? "Unknow" : psbName;
+    //         }
+    //
+    //         // 根据psbname、
+    //         // saved = commonCollectVideo(file2,file3,cam,getTime,psbName,userTwoId,height,afterPsbName);
+    //         saved = commonDoubleCollectVideos(file, photo, cam, getTime, psbName, userOneId, userTwoId, height, beforePsbName, afterPsbName);
+    //     } else {
+    //         // 单人视频
+    //         // 根据psbName获取运动员id
+    //         String userid = "";
+    //         // todo source
+    //         // Map<String, Object> userMap = new HashMap<>();
+    //         // 20210419 弃用。
+    //         // userMap.put("name", psbName);
+    //         // userMap.put("user_name", psbName);
+    //         // List<User> users = userMapper.selectByMap(userMap);
+    //         if (userOnes.size() > 0 && userOnes.get(0) != null && StringUtils.isNotEmpty(userOnes.get(0).getUser_id())) {
+    //             userid = userOnes.get(0).getUser_id();
+    //         } else {
+    //             // 若未识别出运动员,则默认运动员姓名
+    //             userid = psbName;
+    //         }
+    //         saved = commonSingleCollectVideo(file, photo, cam, getTime, psbName, userid, height);
+    //     }
+    //
+    //     Map<String, Object> resMap = new HashMap<>();
+    //     resMap.put("code", saved > 0 ? "1" : "0");
+    //     resMap.put("mes", "SUCC");
+    //     resMap.put("data", saved);
+    //     return resMap;
+    // }
+
+}

BIN
src/com/example/demo/sony/testdivingcommon.jar