Ver código fonte

应急代码提交

wang_xy 3 anos atrás
pai
commit
8efeb6f143
62 arquivos alterados com 6757 adições e 0 exclusões
  1. 151 0
      mybusiness/mybusiness.iml
  2. 124 0
      mybusiness/pom.xml
  3. 107 0
      mybusiness/src/main/java/com/business/domain/SysFileInfo.java
  4. 16 0
      mybusiness/src/main/java/com/business/tools/BasepathUtil.java
  5. 18 0
      mybusiness/src/main/java/com/business/tools/CommonConfig.java
  6. 44 0
      mybusiness/src/main/java/com/business/tools/UUID_Tools.java
  7. 150 0
      mybusiness/src/main/java/com/business/yanbian/camera/controller/CameraController.java
  8. 200 0
      mybusiness/src/main/java/com/business/yanbian/camera/domain/Camera.java
  9. 61 0
      mybusiness/src/main/java/com/business/yanbian/camera/mapper/CameraMapper.java
  10. 61 0
      mybusiness/src/main/java/com/business/yanbian/camera/service/ICameraService.java
  11. 102 0
      mybusiness/src/main/java/com/business/yanbian/camera/service/impl/CameraServiceImpl.java
  12. 64 0
      mybusiness/src/main/java/com/business/yanbian/ksh/controller/KshController.java
  13. 86 0
      mybusiness/src/main/java/com/business/yanbian/video/DhDomainResponseInfo.java
  14. 23 0
      mybusiness/src/main/java/com/business/yanbian/video/DhRealMonitorResponse.java
  15. 44 0
      mybusiness/src/main/java/com/business/yanbian/video/HlsVideoVo.java
  16. 99 0
      mybusiness/src/main/java/com/business/yanbian/video/MTSVideoDemo.java
  17. 40 0
      mybusiness/src/main/java/com/business/yanbian/video/RealTimeVideoVo.java
  18. 212 0
      mybusiness/src/main/java/com/business/yanbian/video/RealTimeVideoXo.java
  19. 91 0
      mybusiness/src/main/java/com/business/yanbian/video/SyWebController.java
  20. 91 0
      mybusiness/src/main/java/com/dahua/sdk/client/DHClientTool.java
  21. 762 0
      mybusiness/src/main/java/com/dahua/sdk/client/DahuaDomainService.java
  22. 36 0
      mybusiness/src/main/java/com/dahua/sdk/client/TestSignature.java
  23. 48 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/RSAPrivateBean.java
  24. 52 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/VersionInfoVo.java
  25. 125 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/alarm/AlarmMessage.java
  26. 38 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/alarm/AlarmMessageObj.java
  27. 95 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/hls/HLSBeanXo.java
  28. 30 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/hls/HLSXo.java
  29. 46 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/request/AuthorizePortInfo.java
  30. 109 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/request/AuthorizeRequest.java
  31. 74 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/request/MyRestTemplate.java
  32. 67 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/request/RequestData.java
  33. 115 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/request/RequestInfo.java
  34. 71 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/APIResponseInfo.java
  35. 59 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/AuthorizeFirstResponse.java
  36. 102 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/AuthorizeResponse.java
  37. 68 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/BaseResponse.java
  38. 83 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/DhDomainResponseInfo.java
  39. 50 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/MqAddressResponseInfo.java
  40. 79 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/ResponseInfo.java
  41. 169 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/response/SuccessResponse.java
  42. 135 0
      mybusiness/src/main/java/com/dahua/sdk/client/bean/xo/AuthorizeXo.java
  43. 34 0
      mybusiness/src/main/java/com/dahua/sdk/client/common/Constants.java
  44. 43 0
      mybusiness/src/main/java/com/dahua/sdk/client/common/DomainOfflineReasonEnum.java
  45. 40 0
      mybusiness/src/main/java/com/dahua/sdk/client/common/EncryptType.java
  46. 14 0
      mybusiness/src/main/java/com/dahua/sdk/client/common/SchemeEnum.java
  47. 8 0
      mybusiness/src/main/java/com/dahua/sdk/client/common/ServiceErrorCode.java
  48. 80 0
      mybusiness/src/main/java/com/dahua/sdk/client/convert/GsonUtils.java
  49. 54 0
      mybusiness/src/main/java/com/dahua/sdk/client/convert/JsonToObjectConvert.java
  50. 36 0
      mybusiness/src/main/java/com/dahua/sdk/client/convert/StringToObjectConvert.java
  51. 14 0
      mybusiness/src/main/java/com/dahua/sdk/client/main/Main.java
  52. 227 0
      mybusiness/src/main/java/com/dahua/sdk/client/util/EncryptionUtils.java
  53. 50 0
      mybusiness/src/main/java/com/dahua/sdk/client/util/HexUtil.java
  54. 135 0
      mybusiness/src/main/java/com/dahua/sdk/client/util/JsonParserUtils.java
  55. 406 0
      mybusiness/src/main/java/com/dahua/sdk/client/util/RsaUtil.java
  56. 65 0
      mybusiness/src/main/java/com/dahua/sdk/client/util/StringUtil.java
  57. 128 0
      mybusiness/src/main/resources/mapper/camera/CameraMapper.xml
  58. 162 0
      mybusiness/src/main/resources/templates/camera/camera/add.html
  59. 149 0
      mybusiness/src/main/resources/templates/camera/camera/camera.html
  60. 166 0
      mybusiness/src/main/resources/templates/camera/camera/edit.html
  61. 274 0
      mybusiness/src/main/resources/templates/ksh/dsq.html
  62. 475 0
      mybusiness/src/main/resources/templates/ksh/ksh.html

+ 151 - 0
mybusiness/mybusiness.iml

@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="Spring" name="Spring">
+      <configuration />
+    </facet>
+    <facet type="web" name="Web">
+      <configuration>
+        <webroots />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
+      <excludeFolder url="file://$MODULE_DIR$/target" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.1" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
+    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.11.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.11.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.5.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.6.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.2.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.5" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
+    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.21" level="project" />
+    <orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.21" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
+    <orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.9.2" level="project" />
+    <orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.13" level="project" />
+    <orderEntry type="module" module-name="leisp-framework" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.7" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.7" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.7" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.13" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.13" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.13" level="project" />
+    <orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.13.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.2" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.14" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:druid:1.1.14" level="project" />
+    <orderEntry type="library" name="Maven: com.github.penggle:kaptcha:2.3.2" level="project" />
+    <orderEntry type="library" name="Maven: com.jhlabs:filters:2.0.235-1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-hash:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-core:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-crypto-cipher:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-core:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-config-ogdl:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.9.4" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-event:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.owasp.encoder:encoder:1.2.2" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.5.3" level="project" />
+    <orderEntry type="library" name="Maven: net.sf.ehcache:ehcache-core:2.6.11" level="project" />
+    <orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
+    <orderEntry type="library" name="Maven: eu.bitwalker:UserAgentUtils:1.19" level="project" />
+    <orderEntry type="library" name="Maven: com.github.oshi:oshi-core:3.9.1" level="project" />
+    <orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.5.2" level="project" />
+    <orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.5.2" level="project" />
+    <orderEntry type="module" module-name="leisp-system" />
+    <orderEntry type="module" module-name="leisp-quartz" />
+    <orderEntry type="library" name="Maven: org.quartz-scheduler:quartz:2.3.0" level="project" />
+    <orderEntry type="library" name="Maven: com.mchange:mchange-commons-java:0.2.11" level="project" />
+    <orderEntry type="module" module-name="leisp-common" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.5" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
+    <orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.5" level="project" />
+    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.4" level="project" />
+    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:1.0" level="project" />
+    <orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.7" level="project" />
+    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.7" level="project" />
+    <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.70" level="project" />
+    <orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
+    <orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.17" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:3.17" level="project" />
+    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.17" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
+    <orderEntry type="library" name="Maven: stax:stax-api:1.0.1" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
+    <orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
+    <orderEntry type="module" module-name="leisp-generator" />
+    <orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
+    <orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
+    <orderEntry type="library" name="Maven: commons-lang:commons-lang:2.4" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.16.16" level="project" />
+    <orderEntry type="library" name="Maven: com.google.code.gson:gson:1.7.1" level="project" />
+    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
+    <orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.61" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-websocket:2.1.1.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-messaging:5.1.3.RELEASE" level="project" />
+    <orderEntry type="library" name="Maven: org.springframework:spring-websocket:5.1.3.RELEASE" level="project" />
+  </component>
+</module>

+ 124 - 0
mybusiness/pom.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>emergencyCommand_yanji</artifactId>
+        <groupId>com.leisp</groupId>
+        <version>1.0.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>mybusiness</artifactId>
+
+    <description>
+        业务模块
+    </description>
+
+    <dependencies>
+
+        <!-- 通用工具-->
+        <!--		<dependency>-->
+        <!--			<groupId>com.leisp</groupId>-->
+        <!--			<artifactId>leisp-common</artifactId>-->
+        <!--		</dependency>-->
+        <!-- SpringBoot集成thymeleaf模板 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+
+        <!-- spring-boot-devtools -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-devtools</artifactId>
+            <optional>true</optional> <!-- 表示依赖不会传递 -->
+        </dependency>
+
+        <!-- swagger2-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+        </dependency>
+
+        <!--防止进入swagger页面报类型转换错误,排除2.9.2中的引用,手动增加1.5.21版本-->
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-annotations</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+        <dependency>
+            <groupId>io.swagger</groupId>
+            <artifactId>swagger-models</artifactId>
+            <version>1.5.21</version>
+        </dependency>
+
+        <!-- swagger2-UI-->
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+        </dependency>
+
+        <!-- Mysql驱动包 -->
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+        </dependency>
+
+        <!-- 核心模块-->
+        <dependency>
+            <groupId>com.leisp</groupId>
+            <artifactId>leisp-framework</artifactId>
+        </dependency>
+
+        <!-- 定时任务-->
+        <dependency>
+            <groupId>com.leisp</groupId>
+            <artifactId>leisp-quartz</artifactId>
+        </dependency>
+
+        <!-- 代码生成-->
+        <dependency>
+            <groupId>com.leisp</groupId>
+            <artifactId>leisp-generator</artifactId>
+        </dependency>
+
+        <!-- 业务依赖 -->
+        <dependency>
+            <groupId>com.leisp</groupId>
+            <artifactId>mybusiness</artifactId>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.16</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>1.7.1</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <version>1.61</version>
+        </dependency>
+        <!--websocket-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-websocket</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>

+ 107 - 0
mybusiness/src/main/java/com/business/domain/SysFileInfo.java

@@ -0,0 +1,107 @@
+package com.business.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.sooka.common.annotation.Excel;
+import com.sooka.common.core.domain.BaseEntity;
+
+/**
+ * 附件操作对象 sys_file_info
+ * 
+ * @author lei_Wang
+ * @date 2020-10-29
+ */
+public class SysFileInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 附件主键 */
+    private Long id;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String fileName;
+
+    /** 存放路径 */
+    @Excel(name = "存放路径")
+    private String filePath;
+
+    /** 附件类型 */
+    @Excel(name = "附件类型")
+    private Integer fileType;
+
+    /** 关联业务主键 */
+    @Excel(name = "关联业务主键")
+    private Long businessId;
+
+    /** 关联业务表名 */
+    @Excel(name = "关联业务表名")
+    private String businessTable;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setFileName(String fileName) 
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName() 
+    {
+        return fileName;
+    }
+    public void setFilePath(String filePath) 
+    {
+        this.filePath = filePath;
+    }
+
+    public String getFilePath() 
+    {
+        return filePath;
+    }
+    public void setFileType(Integer fileType) 
+    {
+        this.fileType = fileType;
+    }
+
+    public Integer getFileType() 
+    {
+        return fileType;
+    }
+    public void setBusinessId(Long businessId) 
+    {
+        this.businessId = businessId;
+    }
+
+    public Long getBusinessId() 
+    {
+        return businessId;
+    }
+    public void setBusinessTable(String businessTable) 
+    {
+        this.businessTable = businessTable;
+    }
+
+    public String getBusinessTable() 
+    {
+        return businessTable;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("fileName", getFileName())
+            .append("filePath", getFilePath())
+            .append("fileType", getFileType())
+            .append("businessId", getBusinessId())
+            .append("businessTable", getBusinessTable())
+            .toString();
+    }
+}

+ 16 - 0
mybusiness/src/main/java/com/business/tools/BasepathUtil.java

@@ -0,0 +1,16 @@
+package com.business.tools;
+
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class BasepathUtil {
+    public static String getBasepath(){
+        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = requestAttributes.getRequest();
+        String localAddr = request.getLocalAddr();
+        int serverPort = request.getServerPort();
+        return "http://"+localAddr +":"+ serverPort;
+    }
+}

+ 18 - 0
mybusiness/src/main/java/com/business/tools/CommonConfig.java

@@ -0,0 +1,18 @@
+package com.business.tools;
+
+public class CommonConfig {
+//    public static String SERVER_IP = "10.38.108.92";
+    public static String SERVER_IP = "222.161.138.120";
+//    public static String SERVER_IP = "10.38.108.123";
+
+    public static int SERVER_PORT_HTTP = 80;
+
+    public static int SERVER_PORT_HTTPS = 4430;
+
+    public static String USERNAME = "system";
+
+    public static String PASSWORD = "system123";
+//    public static String PASSWORD = "admin123";
+
+    public static final String ftpPassword = "Admin@123";
+}

+ 44 - 0
mybusiness/src/main/java/com/business/tools/UUID_Tools.java

@@ -0,0 +1,44 @@
+package com.business.tools;
+
+import java.util.UUID;
+
+public class UUID_Tools {
+
+	public UUID_Tools() {
+	}
+
+	/**
+	 * 获得�?个UUID
+	 *
+	 * @return String UUID
+	 */
+	public static String getUUID() {
+		String s = UUID.randomUUID().toString();
+		// 去掉�?-”符�?
+		return s.substring(0, 8) + s.substring(9, 13) + s.substring(14, 18) + s.substring(19, 23) + s.substring(24);
+	}
+
+	/**
+	 * 获得指定数目的UUID
+	 *
+	 * @param number
+	 *            int �?要获得的UUID数量
+	 * @return String[] UUID数组
+	 */
+	public static String[] getUUID(int number) {
+		if (number < 1) {
+			return null;
+		}
+		String[] ss = new String[number];
+		for (int i = 0; i < number; i++) {
+			ss[i] = getUUID();
+		}
+		return ss;
+	}
+
+	public static void main(String[] args) {
+		String ss = UUID_Tools.getUUID();
+		System.out.println(ss);
+	}
+
+}

+ 150 - 0
mybusiness/src/main/java/com/business/yanbian/camera/controller/CameraController.java

@@ -0,0 +1,150 @@
+package com.business.yanbian.camera.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.dahua.sdk.client.util.StringUtil;
+import com.sooka.common.utils.StringUtils;
+import com.sooka.system.service.ISysDeptService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import com.sooka.common.annotation.Log;
+import com.sooka.common.enums.BusinessType;
+import com.business.yanbian.camera.domain.Camera;
+import com.business.yanbian.camera.service.ICameraService;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.common.core.domain.AjaxResult;
+import com.sooka.common.utils.poi.ExcelUtil;
+import com.sooka.common.core.page.TableDataInfo;
+
+/**
+ * 摄像头Controller
+ *
+ * @author lei
+ * @date 2022-07-21
+ */
+@Controller
+@RequestMapping("/camera/camera")
+public class CameraController extends BaseController
+{
+    private String prefix = "camera/camera";
+
+    @Autowired
+    private ICameraService cameraService;
+    @Autowired
+    private ISysDeptService deptService;
+
+    @RequiresPermissions("camera:camera:view")
+    @GetMapping()
+    public String camera(ModelMap mmap)
+    {
+        mmap.put("citys", deptService.findCitys(Long.valueOf("1")));
+        return prefix + "/camera";
+    }
+
+    /**
+     * 查询摄像头列表
+     */
+    @RequiresPermissions("camera:camera:list")
+    @PostMapping("/list")
+    @ResponseBody
+    public TableDataInfo list(Camera camera)
+    {
+        startPage();
+        List<Camera> list = cameraService.selectCameraList(camera);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出摄像头列表
+     */
+    @RequiresPermissions("camera:camera:export")
+    @Log(title = "摄像头", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    @ResponseBody
+    public AjaxResult export(Camera camera)
+    {
+        List<Camera> list = cameraService.selectCameraList(camera);
+        ExcelUtil<Camera> util = new ExcelUtil<Camera>(Camera.class);
+        return util.exportExcel(list, "camera");
+    }
+
+    /**
+     * 新增摄像头
+     */
+    @GetMapping("/add")
+    public String add(ModelMap mmap)
+    {
+        mmap.put("citys", deptService.findCitys(Long.valueOf("1")));
+        return prefix + "/add";
+    }
+
+    /**
+     * 新增保存摄像头
+     */
+    @RequiresPermissions("camera:camera:add")
+    @Log(title = "摄像头", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(Camera camera)
+    {
+        return toAjax(cameraService.insertCamera(camera));
+    }
+
+    /**
+     * 修改摄像头
+     */
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") String id, ModelMap mmap)
+    {
+        Camera camera = cameraService.selectCameraById(id);
+        mmap.put("camera", camera);
+
+        mmap.put("citys", deptService.findCitys(Long.valueOf("1")));
+        mmap.put("countiess", StringUtils.isNotEmpty(camera.getCity())?deptService.findCitys(Long.valueOf(camera.getCity())):new ArrayList<>());
+        mmap.put("ownships", StringUtils.isNotEmpty(camera.getCounties())?deptService.findCitys(Long.valueOf(camera.getCounties())):new ArrayList<>());
+        mmap.put("villages", StringUtils.isNotEmpty(camera.getOwnship())?deptService.findCitys(Long.valueOf(camera.getOwnship())):new ArrayList<>());
+        return prefix + "/edit";
+    }
+
+    /**
+     * 修改保存摄像头
+     */
+    @RequiresPermissions("camera:camera:edit")
+    @Log(title = "摄像头", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(Camera camera)
+    {
+        return toAjax(cameraService.updateCamera(camera));
+    }
+
+    /**
+     * 删除摄像头
+     */
+    @RequiresPermissions("camera:camera:remove")
+    @Log(title = "摄像头", businessType = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        return toAjax(cameraService.deleteCameraByIds(ids));
+    }
+
+    /**
+     * 根据选择查询下级部门
+     */
+    @GetMapping("/findDeptByParentId/{parentId}")
+    @ResponseBody
+    public AjaxResult findDeptByParentId(@PathVariable("parentId") String parentId){
+        AjaxResult ajax = new AjaxResult();
+        return ajax.success(deptService.findCitys(Long.valueOf(parentId)));
+    }
+}

+ 200 - 0
mybusiness/src/main/java/com/business/yanbian/camera/domain/Camera.java

@@ -0,0 +1,200 @@
+package com.business.yanbian.camera.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.sooka.common.annotation.Excel;
+import com.sooka.common.core.domain.BaseEntity;
+
+/**
+ * 摄像头对象 camera
+ *
+ * @author lei
+ * @date 2022-07-21
+ */
+public class Camera extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** null */
+    private String id;
+
+    /** 摄像头名称 */
+    @Excel(name = "摄像头名称")
+    private String name;
+
+    /** 摄像头设备编号 */
+    @Excel(name = "摄像头设备编号")
+    private String channelId;
+
+    /** 所属市级 */
+    @Excel(name = "所属市级")
+    private String cityName;
+    private String city;
+
+    /** 县区 */
+    @Excel(name = "县区")
+    private String countiesName;
+    private String counties;
+
+    /** 所属乡镇 */
+    @Excel(name = "所属乡镇")
+    private String ownshipName;
+    private String ownship;
+
+    /** 所属村级 */
+    @Excel(name = "所属村级")
+    private String villageName;
+    private String village;
+
+    @Excel(name = "纬度")
+    private String lat;
+    @Excel(name = "经度")
+    private String lng;
+    @Excel(name = "地址")
+    private String address;
+
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+
+    public String getId()
+    {
+        return id;
+    }
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+    public void setChannelId(String channelId)
+    {
+        this.channelId = channelId;
+    }
+
+    public String getChannelId()
+    {
+        return channelId;
+    }
+    public void setCity(String city)
+    {
+        this.city = city;
+    }
+
+    public String getCity()
+    {
+        return city;
+    }
+    public void setCounties(String counties)
+    {
+        this.counties = counties;
+    }
+
+    public String getCounties()
+    {
+        return counties;
+    }
+    public void setOwnship(String ownship)
+    {
+        this.ownship = ownship;
+    }
+
+    public String getOwnship()
+    {
+        return ownship;
+    }
+    public void setVillage(String village)
+    {
+        this.village = village;
+    }
+
+    public String getVillage()
+    {
+        return village;
+    }
+
+    public String getCityName() {
+        return cityName;
+    }
+
+    public void setCityName(String cityName) {
+        this.cityName = cityName;
+    }
+
+    public String getCountiesName() {
+        return countiesName;
+    }
+
+    public void setCountiesName(String countiesName) {
+        this.countiesName = countiesName;
+    }
+
+    public String getOwnshipName() {
+        return ownshipName;
+    }
+
+    public void setOwnshipName(String ownshipName) {
+        this.ownshipName = ownshipName;
+    }
+
+    public String getVillageName() {
+        return villageName;
+    }
+
+    public void setVillageName(String villageName) {
+        this.villageName = villageName;
+    }
+
+    public String getLat() {
+        return lat;
+    }
+
+    public void setLat(String lat) {
+        this.lat = lat;
+    }
+
+    public String getLng() {
+        return lng;
+    }
+
+    public void setLng(String lng) {
+        this.lng = lng;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("channelId", getChannelId())
+            .append("city", getCity())
+            .append("cityName", getCityName())
+            .append("counties", getCounties())
+            .append("countiesName", getCountiesName())
+            .append("ownship", getOwnship())
+            .append("ownshipName", getOwnshipName())
+            .append("village", getVillage())
+            .append("villageName", getVillageName())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .append("lat", getLat())
+            .append("lng", getLng())
+            .append("address", getAddress())
+            .toString();
+    }
+}

+ 61 - 0
mybusiness/src/main/java/com/business/yanbian/camera/mapper/CameraMapper.java

@@ -0,0 +1,61 @@
+package com.business.yanbian.camera.mapper;
+
+import java.util.List;
+import com.business.yanbian.camera.domain.Camera;
+
+/**
+ * 摄像头Mapper接口
+ * 
+ * @author lei
+ * @date 2022-07-21
+ */
+public interface CameraMapper 
+{
+    /**
+     * 查询摄像头
+     * 
+     * @param id 摄像头ID
+     * @return 摄像头
+     */
+    public Camera selectCameraById(String id);
+
+    /**
+     * 查询摄像头列表
+     * 
+     * @param camera 摄像头
+     * @return 摄像头集合
+     */
+    public List<Camera> selectCameraList(Camera camera);
+
+    /**
+     * 新增摄像头
+     * 
+     * @param camera 摄像头
+     * @return 结果
+     */
+    public int insertCamera(Camera camera);
+
+    /**
+     * 修改摄像头
+     * 
+     * @param camera 摄像头
+     * @return 结果
+     */
+    public int updateCamera(Camera camera);
+
+    /**
+     * 删除摄像头
+     * 
+     * @param id 摄像头ID
+     * @return 结果
+     */
+    public int deleteCameraById(String id);
+
+    /**
+     * 批量删除摄像头
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteCameraByIds(String[] ids);
+}

+ 61 - 0
mybusiness/src/main/java/com/business/yanbian/camera/service/ICameraService.java

@@ -0,0 +1,61 @@
+package com.business.yanbian.camera.service;
+
+import java.util.List;
+import com.business.yanbian.camera.domain.Camera;
+
+/**
+ * 摄像头Service接口
+ * 
+ * @author lei
+ * @date 2022-07-21
+ */
+public interface ICameraService 
+{
+    /**
+     * 查询摄像头
+     * 
+     * @param id 摄像头ID
+     * @return 摄像头
+     */
+    public Camera selectCameraById(String id);
+
+    /**
+     * 查询摄像头列表
+     * 
+     * @param camera 摄像头
+     * @return 摄像头集合
+     */
+    public List<Camera> selectCameraList(Camera camera);
+
+    /**
+     * 新增摄像头
+     * 
+     * @param camera 摄像头
+     * @return 结果
+     */
+    public int insertCamera(Camera camera);
+
+    /**
+     * 修改摄像头
+     * 
+     * @param camera 摄像头
+     * @return 结果
+     */
+    public int updateCamera(Camera camera);
+
+    /**
+     * 批量删除摄像头
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteCameraByIds(String ids);
+
+    /**
+     * 删除摄像头信息
+     * 
+     * @param id 摄像头ID
+     * @return 结果
+     */
+    public int deleteCameraById(String id);
+}

+ 102 - 0
mybusiness/src/main/java/com/business/yanbian/camera/service/impl/CameraServiceImpl.java

@@ -0,0 +1,102 @@
+package com.business.yanbian.camera.service.impl;
+
+import java.util.List;
+
+import com.sooka.common.utils.DateUtils;
+import com.sooka.framework.util.ShiroUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.business.yanbian.camera.mapper.CameraMapper;
+import com.business.yanbian.camera.domain.Camera;
+import com.business.yanbian.camera.service.ICameraService;
+import com.sooka.common.core.text.Convert;
+
+/**
+ * 摄像头Service业务层处理
+ *
+ * @author lei
+ * @date 2022-07-21
+ */
+@Service
+public class CameraServiceImpl implements ICameraService
+{
+    @Autowired
+    private CameraMapper cameraMapper;
+
+    /**
+     * 查询摄像头
+     *
+     * @param id 摄像头ID
+     * @return 摄像头
+     */
+    @Override
+    public Camera selectCameraById(String id)
+    {
+        return cameraMapper.selectCameraById(id);
+    }
+
+    /**
+     * 查询摄像头列表
+     *
+     * @param camera 摄像头
+     * @return 摄像头
+     */
+    @Override
+    public List<Camera> selectCameraList(Camera camera)
+    {
+        return cameraMapper.selectCameraList(camera);
+    }
+
+    /**
+     * 新增摄像头
+     *
+     * @param camera 摄像头
+     * @return 结果
+     */
+    @Override
+    public int insertCamera(Camera camera)
+    {
+        camera.setId(ShiroUtils.uuid());
+        camera.setCreateTime(DateUtils.getNowDate());
+        camera.setCreateBy(ShiroUtils.getLoginName());
+        return cameraMapper.insertCamera(camera);
+    }
+
+    /**
+     * 修改摄像头
+     *
+     * @param camera 摄像头
+     * @return 结果
+     */
+    @Override
+    public int updateCamera(Camera camera)
+    {
+        camera.setUpdateTime(DateUtils.getNowDate());
+        camera.setUpdateBy(ShiroUtils.getLoginName());
+        return cameraMapper.updateCamera(camera);
+    }
+
+    /**
+     * 删除摄像头对象
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCameraByIds(String ids)
+    {
+        return cameraMapper.deleteCameraByIds(Convert.toStrArray(ids));
+    }
+
+    /**
+     * 删除摄像头信息
+     *
+     * @param id 摄像头ID
+     * @return 结果
+     */
+    @Override
+    public int deleteCameraById(String id)
+    {
+        return cameraMapper.deleteCameraById(id);
+    }
+}

+ 64 - 0
mybusiness/src/main/java/com/business/yanbian/ksh/controller/KshController.java

@@ -0,0 +1,64 @@
+package com.business.yanbian.ksh.controller;
+
+import com.business.yanbian.camera.domain.Camera;
+import com.business.yanbian.camera.service.ICameraService;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.framework.util.ShiroUtils;
+import com.sooka.system.domain.SysDept;
+import com.sooka.system.domain.SysUser;
+import com.sooka.system.service.ISysDeptService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author wang_xy
+ * @description
+ * @Version 1.0
+ * @params
+ * @return
+ * @since 2022/7/23 15:01
+ */
+@Controller
+@RequestMapping("/ksh")
+public class KshController extends BaseController {
+
+    private String prefix = "ksh";
+    @Autowired
+    private ISysDeptService deptService;
+    @Autowired
+    private ICameraService cameraService;
+
+    @GetMapping("/goKsh")
+    public String goKsh(ModelMap mmap) {
+        SysUser user = ShiroUtils.getSysUser();
+        SysDept dept = deptService.selectDeptById(user.getDeptId());
+        Camera camera = new Camera();
+        if(dept.getPostId()!=null){
+            if(dept.getPostId() == 1){
+                camera.setCity(String.valueOf(user.getDeptId()));
+            }else if(dept.getPostId() == 2){
+                camera.setCounties(String.valueOf(user.getDeptId()));
+            }else if(dept.getPostId() == 3){
+                camera.setOwnship(String.valueOf(user.getDeptId()));
+            }else if(dept.getPostId() == 4){
+                camera.setVillage(String.valueOf(user.getDeptId()));
+            }
+        }
+        List<Camera> cameraList = cameraService.selectCameraList(camera);
+        mmap.put("cameraList",cameraList);
+        return prefix + "/ksh";
+    }
+
+    @GetMapping("/goDsq")
+    public String goDsq(ModelMap mmap) {
+        return prefix + "/dsq";
+    }
+}

+ 86 - 0
mybusiness/src/main/java/com/business/yanbian/video/DhDomainResponseInfo.java

@@ -0,0 +1,86 @@
+package com.business.yanbian.video;
+
+
+import com.dahua.sdk.client.bean.response.ResponseInfo;
+
+public class DhDomainResponseInfo<T> {
+
+    private int code;
+
+    private String desc;
+
+    private T data;
+
+    public ResponseInfo getResponse() {
+        ResponseInfo responseInfo = new ResponseInfo();
+        responseInfo.setCode(code);
+        responseInfo.setDesc(desc);
+        responseInfo.setData(data);
+        return responseInfo;
+    }
+
+    public boolean isError() {
+        if (code == 1000) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @return the code
+     */
+    public int getCode() {
+        return code;
+    }
+
+    /**
+     * @param code the code to set
+     */
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    /**
+     * @return the desc
+     */
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * @param desc the desc to set
+     */
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    /**
+     * @return the data
+     */
+    public T getData() {
+        return data;
+    }
+
+    /**
+     * @param data the data to set
+     */
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("DomainResponseInfo [code=");
+        builder.append(code);
+        builder.append("\n, data=");
+        builder.append(data);
+        builder.append("\n, desc=");
+        builder.append(desc);
+        builder.append("\n]");
+        return builder.toString();
+    }
+}

+ 23 - 0
mybusiness/src/main/java/com/business/yanbian/video/DhRealMonitorResponse.java

@@ -0,0 +1,23 @@
+package com.business.yanbian.video;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * 实时视频的参数
+ * @author 杨健
+ * @date 2018年5月7日
+ * @since 7.02
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class DhRealMonitorResponse extends RealTimeVideoVo {
+
+    private static final long serialVersionUID = -2778870120660414370L;
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return super.toString();
+    }
+}

+ 44 - 0
mybusiness/src/main/java/com/business/yanbian/video/HlsVideoVo.java

@@ -0,0 +1,44 @@
+package com.business.yanbian.video;
+
+import java.io.Serializable;
+
+/**
+ * @author wang_xy
+ * @description
+ * @Version 1.0
+ * @params
+ * @return
+ * @since 2022/7/15 14:23
+ */
+public class HlsVideoVo implements Serializable {
+
+    private String devicecode;//设备编号
+
+    private String chnSeq;//通道序号,如果ipc在nvr中,只需要输入对应的通道号就行
+
+    private String streamType;//码流类型 1-主码流,2-辅码流;3-三码流
+
+    public String getDevicecode() {
+        return devicecode;
+    }
+
+    public void setDevicecode(String devicecode) {
+        this.devicecode = devicecode;
+    }
+
+    public String getChnSeq() {
+        return chnSeq;
+    }
+
+    public void setChnSeq(String chnSeq) {
+        this.chnSeq = chnSeq;
+    }
+
+    public String getStreamType() {
+        return streamType;
+    }
+
+    public void setStreamType(String streamType) {
+        this.streamType = streamType;
+    }
+}

+ 99 - 0
mybusiness/src/main/java/com/business/yanbian/video/MTSVideoDemo.java

@@ -0,0 +1,99 @@
+package com.business.yanbian.video;
+
+import com.alibaba.fastjson.JSONObject;
+import com.business.tools.CommonConfig;
+import com.dahua.sdk.client.DHClientTool;
+import com.dahua.sdk.client.DahuaDomainService;
+import com.dahua.sdk.client.common.SchemeEnum;
+import org.springframework.web.client.RestClientException;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * 实时预览 demo
+ */
+public class MTSVideoDemo {
+
+    static DahuaDomainService service=DHClientTool.createService(SchemeEnum.HTTPS, CommonConfig.SERVER_IP, CommonConfig.SERVER_PORT_HTTPS, CommonConfig.USERNAME, CommonConfig.PASSWORD);
+
+    /**
+     * 获取实时预览流路径
+     * @param xo
+     * @return
+     */
+    public static Object startVideo(JSONObject xo) {
+
+        //TODO 是否已经连接到 平台
+        Map<String, JSONObject> request = new HashMap<String, JSONObject>();
+        request.put("data", xo);
+        System.out.println(xo.toString());
+
+        String responseStr = "";
+
+        try {
+            responseStr = service.postForObject("/admin/API/hls/getLiveUrl", request);
+//            responseStr = service.postForObject("/admin/API/DMS/Ptz/OperateDirect", request);
+        } catch(RestClientException e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        } catch(Exception e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        }
+        return responseStr;
+    }
+
+    /**
+     * 调整摄像头移动
+     * @param xo
+     * @return
+     */
+    public static Object operateDirect(JSONObject xo) {
+
+        //TODO 是否已经连接到 平台
+        Map<String, JSONObject> request = new HashMap<String, JSONObject>();
+        request.put("data", xo);
+        System.out.println(xo.toString());
+
+        String responseStr = "";
+
+        try {
+            responseStr = service.postForObject("/admin/API/DMS/Ptz/OperateDirect", request);
+        } catch(RestClientException e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        } catch(Exception e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        }
+        return responseStr;
+    }
+
+    /**
+     * 调整摄像头变焦
+     * @param xo
+     * @return
+     */
+    public static Object operateCamera(JSONObject xo) {
+
+        //TODO 是否已经连接到 平台
+        Map<String, JSONObject> request = new HashMap<String, JSONObject>();
+        request.put("data", xo);
+        System.out.println(xo.toString());
+
+        String responseStr = "";
+
+        try {
+            responseStr = service.postForObject("/admin/API/DMS/Ptz/OperateCamera", request);
+        } catch(RestClientException e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        } catch(Exception e) {
+            System.out.println("realmonitor failed, error: "+e.getMessage());
+            return null;
+        }
+        return responseStr;
+    }
+}

+ 40 - 0
mybusiness/src/main/java/com/business/yanbian/video/RealTimeVideoVo.java

@@ -0,0 +1,40 @@
+package com.business.yanbian.video;
+
+import java.io.Serializable;
+
+/**
+ * 实时视频信息
+ * RealTimeVideoVo
+ * @author	张定红
+ * @date	2016-12-10
+ */
+public class RealTimeVideoVo implements Serializable {
+
+	/**
+	 * serialVersionUID
+	 */
+	private static final long serialVersionUID = -3317984892221838524L;
+
+	private String urls;		//视频流地址
+
+	public String getUrls() {
+		return urls;
+	}
+
+	public void setUrls(String urls) {
+		this.urls = urls;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("RealTimeVideoVo [urls=");
+		builder.append(urls);
+		builder.append("\n]");
+		return builder.toString();
+	}
+
+}

+ 212 - 0
mybusiness/src/main/java/com/business/yanbian/video/RealTimeVideoXo.java

@@ -0,0 +1,212 @@
+package com.business.yanbian.video;
+
+
+import com.dahua.sdk.client.bean.request.RequestData;
+
+/**
+ * 实时视频信息
+ * RealTimeVideoXo
+ * @author	张定红
+ * @date	2016-12-10
+ */
+public class RealTimeVideoXo extends RequestData {
+
+	/**
+	 * serialVersionUID
+	 */
+	private static final long serialVersionUID = -6809243182640561259L;
+
+	private String channelId;	//视频通道编码
+
+	private String dataType;	//视频类型:1=视频, 2=音频, 3=音视频
+
+	private String streamType;	//码流类型:1=主码流, 2=辅码流
+
+	private String extend;		//扩展数据
+
+	private String planId;		//录像计划ID
+
+	private String trackId;		//轨道ID
+
+	private String session;		//转发会话ID
+
+	private String operateType;	//操作类型:1=锁定, 2=解锁
+
+	private String keyCode;     //键盘码
+
+	private String enableRtsps; //是否启用RTSPS,空或0禁用,1启用
+
+	/**
+	 * @return the channelId
+	 */
+	public String getChannelId() {
+		return channelId;
+	}
+
+	/**
+	 * @param channelId the channelId to set
+	 */
+	public void setChannelId(String channelId) {
+		this.channelId = channelId;
+	}
+
+	/**
+	 * @return the dataType
+	 */
+	public String getDataType() {
+		return dataType;
+	}
+
+	/**
+	 * @param dataType the dataType to set
+	 */
+	public void setDataType(String dataType) {
+		this.dataType = dataType;
+	}
+
+	/**
+	 * @return the streamType
+	 */
+	public String getStreamType() {
+		return streamType;
+	}
+
+	/**
+	 * @param streamType the streamType to set
+	 */
+	public void setStreamType(String streamType) {
+		this.streamType = streamType;
+	}
+
+	/**
+	 * @return the extend
+	 */
+	public String getExtend() {
+		return extend;
+	}
+
+	/**
+	 * @param extend the extend to set
+	 */
+	public void setExtend(String extend) {
+		this.extend = extend;
+	}
+
+	/**
+	 * @return the planId
+	 */
+	public String getPlanId() {
+		return planId;
+	}
+
+	/**
+	 * @param planId the planId to set
+	 */
+	public void setPlanId(String planId) {
+		this.planId = planId;
+	}
+
+	/**
+	 * @return the trackId
+	 */
+	public String getTrackId() {
+		return trackId;
+	}
+
+	/**
+	 * @param trackId the trackId to set
+	 */
+	public void setTrackId(String trackId) {
+		this.trackId = trackId;
+	}
+
+	/**
+	 * @return the session
+	 */
+	@Override
+    public String getSession() {
+		return session;
+	}
+
+	/**
+	 * @param session the session to set
+	 */
+	@Override
+    public void setSession(String session) {
+		this.session = session;
+	}
+
+	/**
+	 * @return the operateType
+	 */
+	public String getOperateType() {
+		return operateType;
+	}
+
+	/**
+	 * @param operateType the operateType to set
+	 */
+	public void setOperateType(String operateType) {
+		this.operateType = operateType;
+	}
+
+	/**
+	 * @return the keyCode
+	 */
+	public String getKeyCode() {
+		return keyCode;
+	}
+
+	/**
+	 * @param keyCode the keyCode to set
+	 */
+	public void setKeyCode(String keyCode) {
+		this.keyCode = keyCode;
+	}
+
+	public String getEnableRtsps() {
+		return enableRtsps;
+	}
+
+	public void setEnableRtsps(String enableRtsps) {
+		this.enableRtsps = enableRtsps;
+	}
+
+	public RealTimeVideoXo setDefault(){
+		this.setKeyCode("");
+		this.setPlanId("");
+		this.setExtend("");
+		this.setTrackId("");
+		return this;
+	}
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("RealTimeVideoXo [channelId=");
+		builder.append(channelId);
+		builder.append("\n, dataType=");
+		builder.append(dataType);
+		builder.append("\n, extend=");
+		builder.append(extend);
+		builder.append("\n, operateType=");
+		builder.append(operateType);
+		builder.append("\n, planId=");
+		builder.append(planId);
+		builder.append("\n, session=");
+		builder.append(session);
+		builder.append("\n, streamType=");
+		builder.append(streamType);
+		builder.append("\n, trackId=");
+		builder.append(trackId);
+		builder.append("\n, keyCode=");
+		builder.append(keyCode);
+		builder.append("\n, enableRtsps=");
+		builder.append(enableRtsps);
+		builder.append("]");
+		return builder.toString();
+	}
+
+}

+ 91 - 0
mybusiness/src/main/java/com/business/yanbian/video/SyWebController.java

@@ -0,0 +1,91 @@
+package com.business.yanbian.video;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.sooka.common.core.controller.BaseController;
+import com.sooka.common.core.domain.AjaxResult;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+
+/**
+ * 摄像头获取、操作controller
+ * @author wang_xy
+ * @description
+ * @Version 1.0
+ * @params
+ * @return
+ * @since 2022/5/10 15:04
+ */
+@Controller
+@RequestMapping("/dahuaVideo")
+public class SyWebController extends BaseController {
+
+    /**
+     * 获取摄像头hls地址
+     */
+    @GetMapping("/findVideo")
+    @ResponseBody
+    public AjaxResult addSave(String channelId){
+        AjaxResult ajaxResult = new AjaxResult();
+        //准备请求参数
+        JSONArray array = new JSONArray();
+        for (int i = 0; i < channelId.split(",").length; i++) {
+            HlsVideoVo hv = new HlsVideoVo();
+            hv.setDevicecode(channelId.split(",")[i]);
+            hv.setChnSeq("0");
+            hv.setStreamType("1");
+            array.add(hv);
+        }
+        JSONObject json = new JSONObject();
+        json.put("hlsBeanXoList",array);
+        Object res = MTSVideoDemo.startVideo(json);
+
+        ajaxResult.put("data",JSONObject.parseObject(res.toString()).getJSONObject("data").getJSONArray("urls"));
+        return ajaxResult;
+    }
+
+
+    /**
+     * 调整摄像头移动
+     */
+    @GetMapping("/operateDirect")
+    @ResponseBody
+    public AjaxResult operateDirect(String channelId,String direct){
+        AjaxResult ajaxResult = new AjaxResult();
+        //准备请求参数
+        JSONObject json = new JSONObject();
+        json.put("stepY","1");
+        json.put("extend","");
+        json.put("direct",direct);
+        json.put("channelId",channelId+"$1$0$0");
+        json.put("stepX","1");
+        json.put("command","1");
+        Object res = MTSVideoDemo.operateDirect(json);
+        ajaxResult.put("data",res);
+        return ajaxResult;
+    }
+
+
+    /**
+     * 调整摄像头移动
+     */
+    @GetMapping("/operateCamera")
+    @ResponseBody
+    public AjaxResult operateCamera(String channelId,String direct,String operateType){
+        AjaxResult ajaxResult = new AjaxResult();
+        //准备请求参数
+        JSONObject json = new JSONObject();
+        json.put("extend","");
+        json.put("direct",direct);
+        json.put("command","1");
+        json.put("channelId",channelId+"$1$0$0");
+        json.put("step","1");
+        json.put("operateType",operateType);
+        Object res = MTSVideoDemo.operateCamera(json);
+        ajaxResult.put("data",res);
+        return ajaxResult;
+    }
+}

+ 91 - 0
mybusiness/src/main/java/com/dahua/sdk/client/DHClientTool.java

@@ -0,0 +1,91 @@
+package com.dahua.sdk.client;
+
+import com.dahua.sdk.client.bean.response.ResponseInfo;
+import com.dahua.sdk.client.common.SchemeEnum;
+import com.dahua.sdk.client.common.ServiceErrorCode;
+import com.dahua.sdk.client.util.HexUtil;
+import org.springframework.stereotype.Component;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
+public class DHClientTool {
+    public static DahuaDomainService createService(SchemeEnum scheme,
+                                     String serverIp,
+                                     int serverPort,
+                                     String username,
+                                     String password){
+
+
+        DahuaDomainService service = new DahuaDomainService(scheme, serverIp, serverPort, username, password);
+
+        int ret = service.init();
+        if (ServiceErrorCode.SUCCESS != ret) {
+            return null;
+        }
+
+        service.start();
+
+        return service;
+    }
+
+//    public static void main(String[] args) {
+//        DahuaDomainService service = createService(SchemeEnum.HTTP, "10.35.183.104",
+//                80, "system", "admin1234567");
+//
+//        while(true) {
+//            try {
+//                Thread.sleep(3 * 1000);
+//            } catch (InterruptedException e) {
+//                e.printStackTrace();
+//            }
+//            ResponseInfo hls = service.getHls();
+//            System.out.println(hls);
+//        }
+//    }
+
+//    public static void main(String[] args) {
+//        String encPwd = "658334a990787d7794102d24f40a2668";
+//        String AES_KEY = "4rfvgy7UJMko0pqa";
+//        String mqPassword = decryptWithAES(encPwd, AES_KEY);
+//        System.out.println(mqPassword);
+//    }
+//
+//    public static String decryptWithAES(String content, String key) {
+//        try {
+//            SecretKey keySpec = new SecretKeySpec(key.getBytes("UTF-8"), EncryptType.AES.getType());
+//            Cipher cipher = Cipher.getInstance(EncryptType.AES_ECB_PKCS5.getType());
+//            cipher.init(Cipher.DECRYPT_MODE, keySpec);
+//            byte[] bytes = cipher.doFinal(HexUtil.hexStringToBytes(content.toUpperCase()));
+//            return new String(bytes, "UTF-8");
+//        } catch (RuntimeException e) {
+//            return content;
+//        } catch (Exception e) {
+//            return content;
+//        }
+//    }
+//
+//    enum EncryptType {
+//
+//        MD5("MD5"),
+//        SSL("SSL"),
+//        TLS("TLS"),
+//        SHA512("SHA-512"),
+//        SHA256("SHA-256"),
+//        AES("AES"),
+//        AES_ECB_PKCS5("AES/ECB/PKCS5Padding");
+//
+//        private String type;
+//
+//        private EncryptType(String type) {
+//            this.type = type;
+//        }
+//
+//        public String getType() {
+//            return type;
+//        }
+//
+//    }
+
+}

+ 762 - 0
mybusiness/src/main/java/com/dahua/sdk/client/DahuaDomainService.java

@@ -0,0 +1,762 @@
+package com.dahua.sdk.client;
+
+import com.dahua.sdk.client.bean.RSAPrivateBean;
+import com.dahua.sdk.client.bean.hls.HLSBeanXo;
+import com.dahua.sdk.client.bean.hls.HLSXo;
+import com.dahua.sdk.client.bean.request.AuthorizeRequest;
+import com.dahua.sdk.client.bean.request.MyRestTemplate;
+import com.dahua.sdk.client.bean.response.*;
+import com.dahua.sdk.client.bean.xo.AuthorizeXo;
+import com.dahua.sdk.client.common.Constants;
+import com.dahua.sdk.client.common.DomainOfflineReasonEnum;
+import com.dahua.sdk.client.common.SchemeEnum;
+import com.dahua.sdk.client.common.ServiceErrorCode;
+import com.dahua.sdk.client.convert.JsonToObjectConvert;
+import com.dahua.sdk.client.util.*;
+import com.google.gson.reflect.TypeToken;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
+import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+import javax.net.ssl.*;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.security.SecureRandom;
+import java.security.cert.CertificateExpiredException;
+import java.security.cert.CertificateNotYetValidException;
+import java.security.cert.X509Certificate;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+
+public class DahuaDomainService {
+//    protected static Logger logger = Logger.getLogger(DahuaDomainService.class);
+
+    protected SchemeEnum scheme;
+    protected String serverIp;
+
+    protected String clientIp;
+
+    protected int serverPort;
+
+    protected String username;
+
+    protected String password;
+
+    protected String passSalt;
+    protected String token;
+
+    protected String userId;
+
+    protected int KEEPALIVE_INTERVAL_TIME = 60;//保活间隔时间
+
+    protected int keepaliveFailedCount = 1;
+
+    protected Date tokenTime = new Date();
+
+    protected int tokenRate = 1800 - 300;  // 默认token更新频率30分钟,平台提早几分钟去更新
+
+    protected ExecutorService bossExecutor = null;
+
+    protected volatile boolean isOnline = false;
+
+    protected volatile boolean isFinished = false;
+
+    protected RestTemplate restTemplate;
+
+    protected HttpHeaders headers;
+
+    protected volatile boolean started =false;
+
+    //mq 相关配置信息
+    private String mqAddress;
+
+    private String mqUserName;
+
+    private String mqPassword;
+
+    protected JsonToObjectConvert jsonConvert = JsonToObjectConvert.getInstance();
+
+    public DahuaDomainService(SchemeEnum scheme, String serverIp, int serverPort, String username, String password) {
+        this.scheme = scheme;
+        this.serverIp = serverIp;
+        this.serverPort = serverPort;
+        this.username = username;
+        this.password = password;
+    }
+
+    public int init() {
+
+        //TODO 参数检查
+
+        //设置请求头
+        headers = new HttpHeaders();
+        headers.setContentType(MediaType.parseMediaType("application/json;charset=utf-8"));
+
+        //初始化 restTemplate
+        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
+        requestFactory.setConnectTimeout(1 * 1000);
+        requestFactory.setReadTimeout(30 * 1000);
+        requestFactory.setOutputStreaming(false);
+        this.restTemplate = new MyRestTemplate(requestFactory);
+
+        //openHttps
+        try {
+            openHttps();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return ServiceErrorCode.SUCCESS;
+    }
+
+    /**
+     * 解决java.security.cert.CertificateException: No subject alternative names present
+     * 系统刚起来打开一次即可,放在init中为了利用domain的ip和port
+     * @throws Exception
+     * @since 7.02
+     */
+    public void openHttps() throws Exception {
+        final String[] VERIFY_HOST_NAME_ARRAY = new String[] {};
+
+        HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
+            @Override
+            public boolean verify(String hostname, SSLSession arg1) {
+                if (StringUtils.isEmpty(hostname)) {
+                    return false;
+                }
+                return !Arrays.asList(VERIFY_HOST_NAME_ARRAY).contains(hostname);
+            }
+        });
+        SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
+        sslContext.init(null, trusTCerts, new SecureRandom());
+        HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());
+        // 以下可以不需要
+        URL url = new URL(buildUrl("admin"));
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("GET");
+        connection.setConnectTimeout(150);
+        connection.setReadTimeout(50);
+    }
+
+    /**
+     * 启动登录和心跳
+     * @return
+     * @since 7.02
+     */
+    public int start() {
+        if (started) {
+//            logger.info("domain service already started"+commonLogInfo());
+            System.out.println("domain service already started"+commonLogInfo());
+            return ServiceErrorCode.SUCCESS;
+        }
+        // 初始化主线程,主要用于登录、重连和心跳
+        bossExecutor = Executors.newSingleThreadExecutor();
+        bossExecutor.submit(new Runnable() {
+            @Override
+            public void run() {
+                while (!Thread.interrupted()) {
+                    if (!isOnline) {
+                        int ret = ServiceErrorCode.SUCCESS;
+                        try {
+                            ret = authorize();
+                        } catch (Exception e) {
+                            System.out.println("authorize error: "+e.getMessage());
+                            ret = ServiceErrorCode.FAIL;
+                        }
+
+                        try {
+                            TimeUnit.SECONDS.sleep(ret == ServiceErrorCode.SUCCESS ? KEEPALIVE_INTERVAL_TIME : 10);
+                        } catch (InterruptedException e) {
+                            System.out.println("sleep interrupted");
+                            Thread.currentThread().interrupt();
+                        }
+                    } else {
+                        int ret;
+                        try {
+                            ret = keepalive();
+                            updateToken();
+                        } catch (Exception e) {
+                            System.out.println("keeplive error: "+e.getMessage());
+                            ret = ServiceErrorCode.FAIL;
+                        }
+
+                        if (ret != ServiceErrorCode.SUCCESS) {
+                            try {
+                                TimeUnit.SECONDS.sleep(10);
+                            } catch (InterruptedException e) {
+                                System.out.println("sleep interrupted");
+                                Thread.currentThread().interrupt();
+                            }
+                            continue;
+                        }
+                        try {
+                            TimeUnit.SECONDS.sleep(KEEPALIVE_INTERVAL_TIME);
+                        } catch (InterruptedException e) {
+                            System.out.println("sleep interrupted");
+                            Thread.currentThread().interrupt();
+                        }
+                    }
+                }
+            }
+        });
+        started = true;
+        return ServiceErrorCode.SUCCESS;
+    }
+
+    /**
+     * 登录
+     * @return 0-成功
+     * @since 7.02
+     */
+    public int authorize() {
+        AuthorizeRequest request = new AuthorizeRequest();
+        request.setUserName(username);
+        request.setClientType("WINPC_V1");
+        request.setIpAddress(serverIp);
+        AuthorizeFirstResponse firstResponse = null;
+        try {
+            restTemplate.postForObject(buildUrl("/admin/API/accounts/authorize"), request, String.class);
+        } catch(RestClientException e) {
+            // 防止登录一个失败的请求导致等待的过程中(连接超时设置10秒)新的域已经登录成功,超时候会将成功的域改成离线
+            if (!started) {
+                System.out.println(String.format("destroy when authorize%s", commonLogInfo()));
+                return ServiceErrorCode.FAIL;
+            }
+            if (e instanceof HttpClientErrorException) {
+                HttpClientErrorException response = (HttpClientErrorException) e;
+                if (401 == response.getStatusCode().value()) {
+                    String body = response.getResponseBodyAsString();
+                    firstResponse = (AuthorizeFirstResponse) jsonConvert.convert(body, AuthorizeFirstResponse.class);
+                } else {
+                    System.out.println("login domain failed, error: "+e.getMessage());
+                    return ServiceErrorCode.FAIL;
+                }
+            } else {
+                System.out.println("login domain failed, error: "+e.getMessage());
+                // 置为离线
+                return ServiceErrorCode.FAIL;
+            }
+        } catch (Exception e) {
+            System.out.println("login domain failed, error: "+e.getMessage());
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        }
+
+        if (null == firstResponse) {
+            System.out.println("login to domain failed, response is null");
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        }
+
+        String pass_temp = "";
+        try {
+            pass_temp = EncryptionUtils.encryptWithMD5(EncryptionUtils.encryptWithMD5(username + EncryptionUtils.encryptWithMD5(password)));
+        }catch (Exception e){
+            System.out.println(e);
+        }
+        String encrypted_passwd = EncryptionUtils.encryptWithMD5(String.format("%s:%s:%s", username, firstResponse.getRealm(), pass_temp));
+        String signature = EncryptionUtils.encryptWithMD5(String.format("%s:%s", encrypted_passwd, firstResponse.getRandomKey()));
+        passSalt = firstResponse.getRealm();
+        if (null == signature) {
+            System.out.println("encrypt password failed, password is null");
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        }
+
+        request.setEncryptType(firstResponse.getEncryptType());
+        request.setRandomKey(firstResponse.getRandomKey());
+        request.setSignature(signature);
+        RSAPublicKey rsaPublicKey = null;
+
+        try {
+            rsaPublicKey = RsaUtil.generateRandomKey();
+        } catch (Exception e) {
+            System.out.println("generate rsa public key error" + e);
+        }
+        RSAPrivateKey rsaPrivateKey = ((RSAPrivateBean) RsaUtil.getKeyPairMap().get(Base64.getEncoder().encodeToString(rsaPublicKey.getEncoded()))).getRsaPrivateKey();
+        request.setPublicKey(Base64.getEncoder().encodeToString(rsaPublicKey.getEncoded()));
+
+        AuthorizeResponse authResponse;
+        try {
+            authResponse = restTemplate.postForObject(buildUrl("/admin/API/accounts/authorize"), request, AuthorizeResponse.class);
+        } catch(RestClientException e) {
+            System.out.println("login domain failed, error: "+e.getMessage());
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        } catch(Exception e) {
+            System.out.println("login domain failed, error: "+e.getMessage());
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        }
+        if (null == authResponse) {
+            System.out.println("login to domain failed, response is null");
+            // 置为离线
+            return ServiceErrorCode.FAIL;
+        }
+        if (null != authResponse.getCode() && !"1000".equals(authResponse.getCode())) {
+            System.out.println(String.format("login to domain failed, code=%s, desc=%s%s", authResponse.getCode(), authResponse.getDesc()));
+            handleOffline(authResponse.getCode());
+            offlineHandle();
+            // 如果是用户名密码错误则无需再登录
+            if ("2001".equals(authResponse.getCode())) {
+                Thread.currentThread().interrupt();
+            }
+            return ServiceErrorCode.FAIL;
+        }
+        token = authResponse.getToken();
+        tokenTime = new Date();
+        userId = authResponse.getUserId();
+        String duration = authResponse.getDuration();
+        if (!StringUtil.isEmpty(duration) && StringUtil.isInteger(duration)) {
+            KEEPALIVE_INTERVAL_TIME = (int) Math.rint(Integer.parseInt(duration) * 3/4);
+        }
+        headers.remove("X-Subject-Token");
+        headers.add("X-Subject-Token", token);
+        keepaliveFailedCount = 1;
+        System.out.println("login to domain successfully");
+
+        // 登录成功之后立即做的事情
+        loginAfterSyncHandle();
+
+        String secretKey = authResponse.getSecretKey();
+        String secretVector = authResponse.getSecretVector();
+        try {
+            byte[] secretKeyBytes = Base64.getDecoder().decode(secretKey);
+            byte[] bytes = Base64.getDecoder().decode(secretVector);
+            secretKey = new String(RsaUtil.decryptByPrivateKey(secretKeyBytes, HexUtil.bytesToHexString(rsaPrivateKey.getEncoded())), Constants.ENCODING);
+            secretVector = new String(RsaUtil.decryptByPrivateKey(bytes, HexUtil.bytesToHexString(rsaPrivateKey.getEncoded())), Constants.ENCODING);
+        } catch (Exception e) {
+            System.out.println("get address failed, RSA decrypt error" + e);
+        }
+        authResponse.setSecretKey(secretKey);
+        authResponse.setSecretVector(secretVector);
+
+        isOnline = true;
+        // 置为在线
+
+        return ServiceErrorCode.SUCCESS;
+    }
+
+    /**
+     * 更新 token
+     */
+    protected void updateToken() {
+        long millis = System.currentTimeMillis() - tokenTime.getTime();
+        if (millis < (long)tokenRate * 1000) {
+            return;
+        }
+
+        Map<String, String> params = new HashMap<String, String>();
+
+        String encryptPass = EncryptionUtils.encryptWithMD5(username +":" + passSalt + ":" +
+                EncryptionUtils.encryptWithMD5( EncryptionUtils.encryptWithMD5(username +  EncryptionUtils.encryptWithMD5(password))));
+
+        params.put("signature", EncryptionUtils.encryptWithMD5(String.format("%s:%s", encryptPass, token)));
+        HttpEntity<Map<String, String>> request = new HttpEntity<Map<String, String>>(params, headers);
+        APIResponseInfo updateTokenResponse;
+        boolean updateTokenSuccess = false;
+        String newToken = null;
+        for (int i = 0; i < 3; i++) {
+            try {
+                updateTokenResponse = restTemplate.postForObject(buildUrl("/admin/API/accounts/updateToken"), request, APIResponseInfo.class);
+                updateTokenSuccess = true;
+                newToken = JsonParserUtils.getPrimitiveField(updateTokenResponse.getData().toString(), "token", String.class);
+                break;
+            } catch(Exception e) {
+                System.out.println("update token failed:" + e.getMessage());
+
+                try {
+                    TimeUnit.SECONDS.sleep(10);
+                } catch (InterruptedException e1) {
+                    System.out.println("sleep interrupted");
+                    Thread.currentThread().interrupt();
+                }
+
+                continue;
+            }
+        }
+
+        if (!updateTokenSuccess) {
+            offlineHandle();
+            System.out.println("updateToken failed");
+            return;
+        }
+
+        //logger.info("newtoken:" + newToken);
+        if (null != newToken) {
+            token = newToken;
+            tokenTime = new Date();
+            headers.remove("X-Subject-Token");
+            headers.add("X-Subject-Token", token);
+        }
+
+        return;
+    }
+
+    /**
+     * 心跳
+     * @return
+     * @since 7.02
+     */
+    protected int keepalive() {
+        Map<String, String> params = new HashMap<String, String>();
+        params.put("signature", "domain");
+        HttpEntity<Map<String, String>> request = new HttpEntity<Map<String, String>>(params, headers);
+        try {
+            //restTemplate.postForObject(buildUrl("/admin/API/accounts/keepalive"), request, String.class);
+            restTemplate.put(buildUrl("/admin/API/accounts/keepalive"), request, String.class);
+        } catch(RestClientException e) {
+            if (keepaliveFailedCount > 3) {
+                offlineHandle();
+                System.out.println("keepalive failed"+commonLogInfo()+", error: "+e.getMessage());
+                // 置为离线
+                return ServiceErrorCode.FAIL;
+            }
+            keepaliveFailedCount++;
+            return ServiceErrorCode.SUCCESS;
+        } catch(Exception e) {
+            if (keepaliveFailedCount > 3) {
+                offlineHandle();
+                System.out.println("keepalive failed"+commonLogInfo()+", error: "+e.getMessage());
+                // 置为离线
+                return ServiceErrorCode.FAIL;
+            }
+            keepaliveFailedCount++;
+            return ServiceErrorCode.SUCCESS;
+        }
+        keepaliveFailedCount = 1;
+        System.out.println("keepalive"+commonLogInfo());
+        return ServiceErrorCode.SUCCESS;
+    }
+
+    /**
+     * 登录成功之后同步处理的方法
+     *
+     * @since 7.02
+     */
+    public void loginAfterSyncHandle() {
+        //获取 mq 连接配置信息
+        getMqAddrInfo();
+    }
+
+    /**
+     * 获取MQ地址
+     *
+     * @since 7.02
+     */
+    @SuppressWarnings("unchecked")
+    public void getMqAddrInfo() {
+        Map<String, Object> params = new HashMap<String, Object>();
+//        params.put("data", null);
+        params.put("clientType", "WINPC_V1");
+        params.put("clientMac", "");
+        params.put("project", "PSDK");
+        params.put("method", "BRM.Config.GetMqConfig");
+        DhDomainResponseInfo<MqAddressResponseInfo> responseInfo = null;
+        DhDomainResponseInfo<SuccessResponse> aesResponseInfo = null;
+        RSAPublicKey rsaPublicKey = null;
+        try {
+            rsaPublicKey = RsaUtil.generateRandomKey();
+        } catch (Exception e) {
+            System.out.println("generate rsa public key error" + e);
+        }
+        if(StringUtil.isBlank(rsaPublicKey)){
+            System.out.println("generate rsa public key error");
+            return;
+        }
+        System.out.println("rsaPublicKey: "+ rsaPublicKey);
+        RSAPrivateKey rsaPrivateKey = ((RSAPrivateBean) RsaUtil.getKeyPairMap().get(Base64.getEncoder().encodeToString(rsaPublicKey.getEncoded()))).getRsaPrivateKey();
+        System.out.println("rsaPrivateKey: "+ rsaPrivateKey);
+        try {
+            String responseStr = restTemplate.postForObject(buildUrl(String.format("/admin/API/BRM/Config/GetMqConfig?token=%s", token)), params, String.class);
+            responseInfo = (DhDomainResponseInfo<MqAddressResponseInfo>) jsonConvert.convert(responseStr, new TypeToken<DhDomainResponseInfo<MqAddressResponseInfo>>(){}.getType());
+            AuthorizeXo authorizeXo = new AuthorizeXo();
+            authorizeXo.setPublicKey(Base64.getEncoder().encodeToString(rsaPublicKey.getEncoded()));
+            String aesResponseStr = restTemplate.postForObject(buildUrl(String.format("/admin/API/config/encrypt/key/generate?token=%s",token)),authorizeXo, String.class);
+            aesResponseInfo = (DhDomainResponseInfo<SuccessResponse>) jsonConvert.convert(aesResponseStr, new TypeToken<DhDomainResponseInfo<SuccessResponse>>(){}.getType());
+
+        } catch(RestClientException e) {
+            System.out.println("get mq address failed"+commonLogInfo()+", error: "+e.getMessage());
+            return;
+        } catch(Exception e) {
+            System.out.println("get mq address failed"+commonLogInfo()+", error: "+e.getMessage());
+            return;
+        }
+        if (1000 != responseInfo.getCode()) {
+            System.out.println(String.format("get mq address failed, code=%s, desc=%s%s", responseInfo.getCode(), responseInfo.getDesc(), commonLogInfo()));
+            return;
+        }
+        MqAddressResponseInfo mqAddressResponse = responseInfo.getData();
+        SuccessResponse aesResponse= aesResponseInfo.getData();
+        if (null == mqAddressResponse) {
+            System.out.println("get mq address failed, mqAddressResponse is null"+commonLogInfo());
+            return;
+        }
+        mqAddress = mqAddressResponse.getAddr();
+        mqUserName = mqAddressResponse.getUserName();
+
+        System.out.println("address: "+ mqAddress+ ";mqUserName: "+ mqUserName);
+        //获取aes秘钥和向量
+        String secretKey = aesResponse.getSecretKey();
+        String secretVector = aesResponse.getSecretVector();
+        System.out.println("secretKey:"+ secretKey+ ";secretVector: "+ secretVector);
+
+        System.out.println("$$$$ mqAddressResponse.getPassword() " + mqAddressResponse.getPassword());
+        try {
+            byte[] secretKeyBytes = Base64.getDecoder().decode(secretKey);
+            byte[] bytes = Base64.getDecoder().decode(secretVector);
+            secretKey = new String(RsaUtil.decryptByPrivateKey(secretKeyBytes,HexUtil.bytesToHexString(rsaPrivateKey.getEncoded())), Constants.ENCODING);
+            secretVector = new String(RsaUtil.decryptByPrivateKey(bytes, HexUtil.bytesToHexString(rsaPrivateKey.getEncoded())), Constants.ENCODING);
+        } catch (Exception e) {
+            System.out.println("get mq address failed, RSA decrypt error" + e);
+            e.printStackTrace();
+//            logger.error("get mq address failed, RSA decrypt error" + e);
+        }
+
+//        mqPassword = EncryptionUtils.decryptByAesCbc(mqAddressResponse.getPassword(), secretKey, secretVector);
+        mqPassword = EncryptionUtils.decryptByAesCbc(mqAddressResponse.getPassword(), secretKey, secretVector);
+        System.out.println(String.format("get mq address: %s", mqAddress));
+
+        System.out.println("$$$$ mq: " + mqAddress + " == " + mqUserName + " == " + mqPassword);
+    }
+
+    private void test1(){
+//        List<String> aesKeys = null;
+//        try {
+//            aesKeys = EncryptionUtils.getAesKey();
+//            String decryptPassWord = "";
+//            for (String aesKey : aesKeys) {
+//                decryptPassWord = EncryptionUtils.decryptByAesCbcGDPR(password, aesKey);
+//                if (StringUtils.isNotEmpty(decryptPassWord)) {
+//                    break;
+//                }
+//            }
+//            if (StringUtils.isNotEmpty(decryptPassWord)) {
+//                password = decryptPassWord;
+//            }
+//            logger.debug("mq用户名,gdpr解密成功:" + decryptPassWord);
+//        } catch (Exception e) {
+//            logger.error(e);
+//        }
+    }
+
+    private void handleOffline(String code) {
+        // 置为离线
+        int status;
+        if ("2001".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_PASS_ERROR.getCode();
+        } else if ("2002".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_LOCKED.getCode();
+        } else if ("2003".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_DISABLED.getCode();
+        } else if ("2004".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_LOGGED_IN.getCode();
+        } else if ("2005".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_DATE_OVER.getCode();
+        } else if ("2006".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_TIME_OVER.getCode();
+        } else if ("2155".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_MAC_ERROR.getCode();
+        } else if ("2156".equals(code)) {
+            status = DomainOfflineReasonEnum.AD_LOGIN_CLOSE.getCode();
+        } else if ("2218".equals(code)) {
+            status = DomainOfflineReasonEnum.USER_LOCKED_SYS_UPGRADE.getCode();
+        } else {
+            status = DomainOfflineReasonEnum.CONNECT_EXCEPTION.getCode();
+        }
+        System.out.println("offline reason code: " + status);
+    }
+
+    /**
+     * 离线之后要做的事情
+     *
+     * @since 7.02
+     */
+    public void offlineHandle(){
+        isOnline = false;
+        isFinished = false;
+    }
+
+    protected String buildUrl(String url) {
+        StringBuilder str = new StringBuilder();
+        str.append(scheme.getScheme());
+        str.append(serverIp);
+        str.append(":");
+        str.append(serverPort);
+        str.append("/");
+        str.append(url);
+        return str.toString();
+    }
+
+    String buildUrlWithToken(String url) {
+        StringBuilder str = new StringBuilder();
+        str.append(scheme.getScheme());
+        str.append(serverIp);
+        str.append(":");
+        str.append(serverPort);
+        str.append("/");
+        str.append(url);
+        str.append("?token=" + token);
+        return str.toString();
+    }
+
+
+
+    /**
+     * 公共日志信息
+     * @return
+     * @since 7.02
+     */
+    protected String commonLogInfo() {
+        StringBuilder str = new StringBuilder();
+        str.append(", ip=");
+        str.append(serverIp);
+        str.append(":");
+        str.append(serverPort);
+        return str.toString();
+    }
+
+    public ResponseInfo getHls(){
+
+        /**
+         * {
+         *
+         * 		"hlsBeanXoList": [
+         *                        {
+         * 				"devicecode": "1000002",
+         * 				"unitSeq": "1",
+         * 				"chnSeq": "0",
+         * 				"recordSource": "2",
+         * 				"recordType": "1",
+         * 				"streamType": "1",
+         * 				"beginTime": "2020-06-19 00:00:00",
+         * 				"endTime": "2020-06-19 23:59:59"
+         *            }
+         * 		]
+         *
+         * }
+         */
+
+        Map<String, Object> params = new HashMap<>();
+        HLSXo hlsXo = new HLSXo();
+
+        HLSBeanXo hlsBeanXo = new HLSBeanXo();
+        hlsBeanXo.setDevicecode("1000000");
+        hlsBeanXo.setUnitSeq("1");
+        hlsBeanXo.setChnSeq("0");
+        hlsBeanXo.setRecordSource("2");
+        hlsBeanXo.setRecordType("1");
+        hlsBeanXo.setStreamType("1");
+        hlsBeanXo.setBeginTime("2020-07-01 00:00:00");
+        hlsBeanXo.setEndTime("2020-07-01 23:59:59");
+
+        List<HLSBeanXo> hlsBeanXoList = new ArrayList<>();
+        hlsBeanXoList.add(hlsBeanXo);
+
+        hlsXo.setHlsBeanXoList(hlsBeanXoList);
+
+        params.put("data", hlsXo);
+        HttpEntity<Map<String, Object>> request = new HttpEntity<>(params, headers);
+
+        ResponseInfo responseInfo = restTemplate.postForObject(buildUrlWithToken("/admin/API/hls/getLiveUrl"), request,
+                ResponseInfo.class);
+
+
+        return responseInfo;
+    }
+
+    /**
+     * HttpEntity 封装参数
+     * @param params
+     * @param <T>
+     * @return
+     */
+    public <T> HttpEntity<T>  getHttpEntity(T params){
+        HttpEntity<T> request = new HttpEntity<>(params, headers);
+        return request;
+    }
+
+    /**
+     *
+     * @param uri /admin/API/tree/devices
+     * @param request
+     * @return
+     */
+    public String postForObject(String uri, HttpEntity request){
+        String responseStr = restTemplate.postForObject(buildUrl(uri), // attach token
+                request,
+                String.class); //表示返回值类型
+        return responseStr;
+    }
+
+    public <T> String postForObject(String uri, Map<String, T> request){
+        String responseStr = restTemplate
+                .postForObject(buildUrlWithToken(uri), request, String.class);
+
+        return responseStr;
+    }
+
+    public JsonToObjectConvert getJsonConvert() {
+        return jsonConvert;
+    }
+
+    public String getMqUserName() {
+        return mqUserName;
+    }
+
+    public String getMqPassword() {
+        return mqPassword;
+    }
+
+    public String getMqAddress() {
+        return mqAddress;
+    }
+
+    /**
+     * 信任证书
+     */
+    static TrustManager[] trusTCerts = new TrustManager[] {
+            new X509TrustManager() {
+                @Override
+                public X509Certificate[] getAcceptedIssuers() {
+                    return new X509Certificate[]{};
+                }
+                @Override
+                public void checkServerTrusted(X509Certificate[] chain, String authType) {
+                    for (X509Certificate certificate : chain) {
+                        try {
+                            certificate.checkValidity();
+                        } catch (CertificateExpiredException e) {
+                            System.out.println("CertificateExpiredException " + e);
+                        } catch (CertificateNotYetValidException e) {
+                            System.out.println("CertificateNotYetValidException " + e);
+                        }
+                    }
+                }
+                @Override
+                public void checkClientTrusted(X509Certificate[] chain, String authType) {
+                    for (X509Certificate certificate : chain) {
+                        try {
+                            certificate.checkValidity();
+                        } catch (CertificateExpiredException e) {
+                            System.out.println("CertificateExpiredException " + e);
+                        } catch (CertificateNotYetValidException e) {
+                            System.out.println("CertificateNotYetValidException " + e);
+                        }
+                    }
+                }
+            }
+    };
+
+}

+ 36 - 0
mybusiness/src/main/java/com/dahua/sdk/client/TestSignature.java

@@ -0,0 +1,36 @@
+package com.dahua.sdk.client;
+
+import com.dahua.sdk.client.util.EncryptionUtils;
+
+/**
+ * 验证下签名
+ */
+public class TestSignature {
+
+    public static void main(String[] args) {
+        method1();
+    }
+
+    private static void method1(){
+        String realm = "f689ed8c43530d68bf7d6e95a62f7f87";
+        String randomKey = "b5069ea0c6834dfc";
+        String userName = "system";
+        String password = "Admin123";
+        String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg9CQU6Ar2kLNvZ2sF5fGKvdUAe/VnTzc8E1JNF0ZCHhYi4BFVv3sY2PpwoSRYtfCIGQl5UbuRcmsCaXXlVIqP2oj3F8sqIOkuaw3TQBrjnTOy3qoXLx6R5VOAZ7BT9uHWm1KfK2ivJOfBrMs2U4w4sSKJsqAWMNK6c187BuIByyBBGpkw5kvEbBz6hUx+oZXVPC+ypnajx5Fb37Q0+YRafyZ6R245dqcT34J1+2/TLChlP+O9d/46rFbtLTYEtOCQewHZ/b/ZA+ZSuUZNEQ6vpsArV0Jcd1FG2fB7BjnsDWKvbyLxW/6I38FtyNhWS6t3PDs0pQeYH7W1nucdUasCwIDAQAB";
+        //第一个tmp: e64b78fc3bc91bcbc7dc232ba8ec59e0
+        String tmp1 = EncryptionUtils.encryptWithMD5(password);
+        System.out.println("tmp1: "+ tmp1);
+        //第二个, 65bdebf33107fb50bacfd25960c3dc28
+        String tmp2 = EncryptionUtils.encryptWithMD5(userName+ tmp1);
+        System.out.println("tmp2: "+ tmp2);
+        //第三个, 929aade29b4fe40290e43148aca9dc4d
+        String tmp3 = EncryptionUtils.encryptWithMD5( tmp2);
+        System.out.println("tmp3: "+ tmp3);
+        //第四个,a168bfb677775befa9140b025216f5dc
+        String tmp4 = EncryptionUtils.encryptWithMD5( userName+":"+realm+":"+tmp3);
+        System.out.println("tmp4: "+ tmp4);
+        String signature = EncryptionUtils.encryptWithMD5(String.format("%s:%s", tmp4, randomKey));
+        //593dfa523846ebc8e5becc6cad981afe
+        System.out.println("signature: "+ signature);
+    }
+}

+ 48 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/RSAPrivateBean.java

@@ -0,0 +1,48 @@
+/**
+ * *********************** 版权声明 ***********************************
+ * <p>
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2018
+ * <p>
+ * *******************************************************************
+ */
+package com.dahua.sdk.client.bean;
+
+import java.security.interfaces.RSAPrivateKey;
+
+public class RSAPrivateBean {
+
+    private RSAPrivateKey rsaPrivateKey;
+
+    private Long timeStamp;
+
+    public RSAPrivateBean(RSAPrivateKey rsaPrivateKey, Long timeStamp) {
+        this.rsaPrivateKey = rsaPrivateKey;
+        this.timeStamp = timeStamp;
+    }
+
+    public RSAPrivateKey getRsaPrivateKey() {
+        return rsaPrivateKey;
+    }
+
+    public void setRsaPrivateKey(RSAPrivateKey rsaPrivateKey) {
+        this.rsaPrivateKey = rsaPrivateKey;
+    }
+
+    public Long getTimeStamp() {
+        return timeStamp;
+    }
+
+    public void setTimeStamp(Long timeStamp) {
+        this.timeStamp = timeStamp;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("RSAPrivateBean{");
+        sb.append("rsaPrivateKey=").append(rsaPrivateKey);
+        sb.append(", timeStamp=").append(timeStamp);
+        sb.append('}');
+        return sb.toString();
+    }
+}

+ 52 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/VersionInfoVo.java

@@ -0,0 +1,52 @@
+/**
+ * *********************** 版权声明 ***********************************
+ * <p>
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2017
+ * <p>
+ * *******************************************************************
+ */
+package com.dahua.sdk.client.bean;
+
+import java.io.Serializable;
+
+/**
+ * @author 26803
+ * @version Ver 7.0
+ * @since Ver 7.0
+ * @Date 2017/12/25
+ *
+ */
+public class VersionInfoVo implements Serializable {
+    
+    private static final long serialVersionUID = 6881581586473047763L;
+    
+    private String lastVersion;
+    
+    private String updateUrl;
+    
+    public String getLastVersion() {
+        return lastVersion;
+    }
+    
+    public void setLastVersion(String lastVersion) {
+        this.lastVersion = lastVersion;
+    }
+    
+    public String getUpdateUrl() {
+        return updateUrl;
+    }
+    
+    public void setUpdateUrl(String updateUrl) {
+        this.updateUrl = updateUrl;
+    }
+    
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("VersionInfoVo{");
+        sb.append("lastVersion='").append(lastVersion).append('\'');
+        sb.append(", updateUrl='").append(updateUrl).append('\'');
+        sb.append('}');
+        return sb.toString();
+    }
+}

+ 125 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/alarm/AlarmMessage.java

@@ -0,0 +1,125 @@
+package com.dahua.sdk.client.bean.alarm;
+
+public class AlarmMessage {
+
+    private String deviceCode;
+
+    private Integer channelSeq;
+
+    private Integer unitType;
+
+    private Integer unitSeq;
+
+    private String nodeType;
+
+    private String nodeCode;
+
+    private String alarmCode;
+
+    private String alarmType;
+
+    private String alarmPicture;
+
+    private String alarmSourceName;
+
+    private String gpsX;
+
+    private String gpsY;
+
+
+    public String getDeviceCode() {
+        return deviceCode;
+    }
+
+    public void setDeviceCode(String deviceCode) {
+        this.deviceCode = deviceCode;
+    }
+
+    public Integer getChannelSeq() {
+        return channelSeq;
+    }
+
+    public void setChannelSeq(Integer channelSeq) {
+        this.channelSeq = channelSeq;
+    }
+
+    public Integer getUnitType() {
+        return unitType;
+    }
+
+    public void setUnitType(Integer unitType) {
+        this.unitType = unitType;
+    }
+
+    public Integer getUnitSeq() {
+        return unitSeq;
+    }
+
+    public void setUnitSeq(Integer unitSeq) {
+        this.unitSeq = unitSeq;
+    }
+
+    public String getNodeType() {
+        return nodeType;
+    }
+
+    public void setNodeType(String nodeType) {
+        this.nodeType = nodeType;
+    }
+
+    public String getNodeCode() {
+        return nodeCode;
+    }
+
+    public void setNodeCode(String nodeCode) {
+        this.nodeCode = nodeCode;
+    }
+
+    public String getAlarmCode() {
+        return alarmCode;
+    }
+
+    public void setAlarmCode(String alarmCode) {
+        this.alarmCode = alarmCode;
+    }
+
+    public String getAlarmType() {
+        return alarmType;
+    }
+
+    public void setAlarmType(String alarmType) {
+        this.alarmType = alarmType;
+    }
+
+    public String getAlarmPicture() {
+        return alarmPicture;
+    }
+
+    public void setAlarmPicture(String alarmPicture) {
+        this.alarmPicture = alarmPicture;
+    }
+
+    public String getAlarmSourceName() {
+        return alarmSourceName;
+    }
+
+    public void setAlarmSourceName(String alarmSourceName) {
+        this.alarmSourceName = alarmSourceName;
+    }
+
+    public String getGpsX() {
+        return gpsX;
+    }
+
+    public void setGpsX(String gpsX) {
+        this.gpsX = gpsX;
+    }
+
+    public String getGpsY() {
+        return gpsY;
+    }
+
+    public void setGpsY(String gpsY) {
+        this.gpsY = gpsY;
+    }
+}

+ 38 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/alarm/AlarmMessageObj.java

@@ -0,0 +1,38 @@
+package com.dahua.sdk.client.bean.alarm;
+
+/**
+ * 报警消息
+ */
+public class AlarmMessageObj {
+
+    private String method ;
+    /**
+     * 报警消息体, 比如秸秆
+     */
+    private AlarmMessage info;
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public AlarmMessage getInfo() {
+        return info;
+    }
+
+    public void setInfo(AlarmMessage info) {
+        this.info = info;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuffer sb = new StringBuffer("AlarmMessageObj{");
+        sb.append("method='").append(method).append('\'');
+        sb.append(", info=").append(info);
+        sb.append('}');
+        return sb.toString();
+    }
+}

+ 95 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/hls/HLSBeanXo.java

@@ -0,0 +1,95 @@
+package com.dahua.sdk.client.bean.hls;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class HLSBeanXo implements Serializable{
+
+	private static final long serialVersionUID = 1L;
+    
+	private  String devicecode;
+	
+    private String unitSeq;
+	
+	private String chnSeq;
+	
+	private String streamType;//码流类型
+	
+	private String beginTime;
+	
+	private String endTime;
+	
+	private String recordSource;
+	
+	private String recordType;
+	
+	public String getRecordSource() {
+		return recordSource;
+	}
+
+	public void setRecordSource(String recordSource) {
+		this.recordSource = recordSource;
+	}
+
+	public String getRecordType() {
+		return recordType;
+	}
+
+	public void setRecordType(String recordType) {
+		this.recordType = recordType;
+	}
+	
+	public String getBeginTime() {
+		return beginTime;
+	}
+
+	public void setBeginTime(String beginTime) {
+		this.beginTime = beginTime;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+	
+	public String getDevicecode() {
+		return devicecode;
+	}
+
+	public void setDevicecode(String devicecode) {
+		this.devicecode = devicecode;
+	}
+
+	public String getUnitSeq() {
+		return unitSeq;
+	}
+
+	public void setUnitSeq(String unitSeq) {
+		this.unitSeq = unitSeq;
+	}
+
+	public String getChnSeq() {
+		return chnSeq;
+	}
+
+	public void setChnSeq(String chnSeq) {
+		this.chnSeq = chnSeq;
+	}
+
+	public String getStreamType() {
+		return streamType;
+	}
+
+	public void setStreamType(String streamType) {
+		this.streamType = streamType;
+	}
+
+	
+	
+	
+}

+ 30 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/hls/HLSXo.java

@@ -0,0 +1,30 @@
+package com.dahua.sdk.client.bean.hls;
+
+import com.dahua.sdk.client.bean.request.RequestData;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class HLSXo extends RequestData implements Serializable{
+
+    private static final long serialVersionUID = 8200877999414014456L;
+
+    private List<HLSBeanXo> hlsBeanXoList ;
+
+    @Override
+    public String toString() {
+        return "HLSXo [hlsBeanXoList=" + hlsBeanXoList + "]";
+    }
+
+    public List<HLSBeanXo> getHlsBeanXoList() {
+        return hlsBeanXoList;
+    }
+
+    public void setHlsBeanXoList(List<HLSBeanXo> hlsBeanXoList) {
+        this.hlsBeanXoList = hlsBeanXoList;
+    }
+
+
+}

+ 46 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/request/AuthorizePortInfo.java

@@ -0,0 +1,46 @@
+package com.dahua.sdk.client.bean.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * 认证响应的端口信息
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class AuthorizePortInfo {
+
+    // HTTP端口
+    private String httpPort;
+    
+    // HTTPS端口
+    private String httpsPort;
+    
+    public String getHttpPort() {
+        return httpPort;
+    }
+
+    public void setHttpPort(String httpPort) {
+        this.httpPort = httpPort;
+    }
+
+    public String getHttpsPort() {
+        return httpsPort;
+    }
+
+    public void setHttpsPort(String httpsPort) {
+        this.httpsPort = httpsPort;
+    }
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("AuthorizePortInfo [httpPort=");
+        builder.append(httpPort);
+        builder.append(", httpsPort=");
+        builder.append(httpsPort);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 109 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/request/AuthorizeRequest.java

@@ -0,0 +1,109 @@
+package com.dahua.sdk.client.bean.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * 登录域的参数
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class AuthorizeRequest {
+
+    // 用户名
+    private String userName;
+    
+    // 签名
+    private String signature;
+    
+    // 随机秘钥种子
+    private String randomKey;
+    
+    // 加密算法,MD5
+    private String encryptType;
+    
+    // 客户端类型,web
+    private String clientType;
+    
+    // 客户端IP
+    private String ipAddress;
+
+    //用于加密aes的秘钥向量
+    private String publicKey;
+
+    public String getPublicKey() {
+        return publicKey;
+    }
+
+    public void setPublicKey(String publicKey) {
+        this.publicKey = publicKey;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getSignature() {
+        return signature;
+    }
+
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+
+    public String getRandomKey() {
+        return randomKey;
+    }
+
+    public void setRandomKey(String randomKey) {
+        this.randomKey = randomKey;
+    }
+
+    public String getEncryptType() {
+        return encryptType;
+    }
+
+    public void setEncryptType(String encryptType) {
+        this.encryptType = encryptType;
+    }
+
+    public String getClientType() {
+        return clientType;
+    }
+
+    public void setClientType(String clientType) {
+        this.clientType = clientType;
+    }
+
+    public String getIpAddress() {
+        return ipAddress;
+    }
+
+    public void setIpAddress(String ipAddress) {
+        this.ipAddress = ipAddress;
+    }
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("AuthorizeRequest [userName=");
+        builder.append(userName);
+        builder.append(", signature=");
+        builder.append(signature);
+        builder.append(", randomKey=");
+        builder.append(randomKey);
+        builder.append(", encryptType=");
+        builder.append(encryptType);
+        builder.append(", clientType=");
+        builder.append(clientType);
+        builder.append(", ipAddress=");
+        builder.append(ipAddress);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 74 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/request/MyRestTemplate.java

@@ -0,0 +1,74 @@
+package com.dahua.sdk.client.bean.request;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.http.client.ClientHttpRequest;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.ClientHttpResponse;
+import org.springframework.util.Assert;
+import org.springframework.web.client.*;
+
+import java.io.IOException;
+import java.net.SocketTimeoutException;
+import java.net.URI;
+
+/**
+ * 重写RestTemplate的doExecute方法,增加请求超时3次重试功能
+ */
+public class MyRestTemplate extends RestTemplate {
+
+    public MyRestTemplate() {
+        super();
+    }
+    
+    public MyRestTemplate(ClientHttpRequestFactory requestFactory) {
+        super(requestFactory);
+    }
+    
+    @Override
+    protected <T> T doExecute(URI url, HttpMethod method,
+            RequestCallback requestCallback,
+            ResponseExtractor<T> responseExtractor) throws RestClientException {
+        return doExecuteInner(url, method, requestCallback, responseExtractor, 1);
+    }
+    
+    private <T> T doExecuteInner(URI url, HttpMethod method,
+            RequestCallback requestCallback,
+            ResponseExtractor<T> responseExtractor, int tryCount) throws RestClientException {
+        Assert.notNull(url, "'url' must not be null");
+        Assert.notNull(method, "'method' must not be null");
+        ClientHttpResponse response = null;
+        try {
+            ClientHttpRequest request = createRequest(url, method);
+            if (requestCallback != null) {
+                requestCallback.doWithRequest(request);
+            }
+            response = request.execute();
+            if (!getErrorHandler().hasError(response)) {
+                //logResponseStatus(method, url, response);
+            }
+            else {
+                getErrorHandler().handleError(response);
+            }
+            if (responseExtractor != null) {
+                return responseExtractor.extractData(response);
+            }
+            else {
+                return null;
+            }
+        }
+        catch (IOException ex) {
+            if (ex instanceof SocketTimeoutException) {
+                if (tryCount < 3) {
+                    return doExecuteInner(url, method, requestCallback, responseExtractor, ++tryCount);
+                }
+            }
+            throw new ResourceAccessException("I/O error on " + method.name() +
+                    " request for \"" + url + "\":" + ex.getMessage(), ex);
+        }
+        finally {
+            if (response != null) {
+                response.close();
+            }
+        }
+    }
+}

+ 67 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/request/RequestData.java

@@ -0,0 +1,67 @@
+package com.dahua.sdk.client.bean.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * 请求数据基类(所有接口的请求对象都必须继承该类)
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class RequestData implements Serializable {
+	
+	private static final long serialVersionUID = -556564542030056996L;
+
+	protected String optional;
+	
+	protected String locale;	//语言环境
+	
+	protected String session;	//会话标识
+	
+	/**
+	 * @return the optional
+	 */
+	protected String getOptional() {
+		return optional;
+	}
+
+	/**
+	 * @param optional the optional to set
+	 */
+	protected void setOptional(String optional) {
+		this.optional = optional;
+	}
+
+	public String getLocale() {
+		return locale;
+	}
+
+	public void setLocale(String locale) {
+		this.locale = locale;
+	}
+
+	public String getSession() {
+		return session;
+	}
+
+	public void setSession(String session) {
+		this.session = session;
+	}
+
+	/* (non-Jsdoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("RequestData [optional=");
+		builder.append(optional);
+		builder.append(", locale=");
+		builder.append(locale);
+		builder.append(", session=");
+		builder.append(session);
+		builder.append("]");
+		return builder.toString();
+	}
+
+}

+ 115 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/request/RequestInfo.java

@@ -0,0 +1,115 @@
+package com.dahua.sdk.client.bean.request;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * 接口请求对象(使用时必须指定泛型T的具体类型)
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class RequestInfo<T> implements Serializable {
+
+	private static final long serialVersionUID = -3551447239704640657L;
+	
+	private String clientType;
+	
+	private String clientMac;
+	
+	private String clientPushId;
+	
+	private String project;
+	
+	private T data;
+
+	/**
+	 * @return the clientType
+	 */
+	public String getClientType() {
+		return clientType;
+	}
+
+	/**
+	 * @param clientType the clientType to set
+	 */
+	public void setClientType(String clientType) {
+		this.clientType = clientType;
+	}
+
+	/**
+	 * @return the clientMac
+	 */
+	public String getClientMac() {
+		return clientMac;
+	}
+
+	/**
+	 * @param clientMac the clientMac to set
+	 */
+	public void setClientMac(String clientMac) {
+		this.clientMac = clientMac;
+	}
+
+	/**
+	 * @return the clientPushId
+	 */
+	public String getClientPushId() {
+		return clientPushId;
+	}
+
+	/**
+	 * @param clientPushId the clientPushId to set
+	 */
+	public void setClientPushId(String clientPushId) {
+		this.clientPushId = clientPushId;
+	}
+
+	/**
+	 * @return the project
+	 */
+	public String getProject() {
+		return project;
+	}
+
+	/**
+	 * @param project the project to set
+	 */
+	public void setProject(String project) {
+		this.project = project;
+	}
+
+	/**
+	 * @return the data
+	 */
+	public T getData() {
+		return data;
+	}
+
+	/**
+	 * @param data the data to set
+	 */
+	public void setData(T data) {
+		this.data = data;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("RequestInfo [clientMac=");
+		builder.append(clientMac);
+		builder.append(", clientPushId=");
+		builder.append(clientPushId);
+		builder.append(", clientType=");
+		builder.append(clientType);
+		builder.append(", data=");
+		builder.append(data);
+		builder.append(", project=");
+		builder.append(project);
+		builder.append("]");
+		return builder.toString();
+	}
+
+}

+ 71 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/APIResponseInfo.java

@@ -0,0 +1,71 @@
+package com.dahua.sdk.client.bean.response;
+
+/**
+ * 登录域的参数
+ */
+public class APIResponseInfo {
+
+	private int code;
+	
+	private String desc;
+
+	private Object data;
+
+	/**
+	 * @return the code
+	 */
+	public int getCode() {
+		return code;
+	}
+
+	/**
+	 * @param code the code to set
+	 */
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	/**
+	 * @return the desc
+	 */
+	public String getDesc() {
+		return desc;
+	}
+
+	/**
+	 * @param desc the desc to set
+	 */
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	/**
+	 * @return the data
+	 */
+	public Object getData() {
+		return data;
+	}
+
+	/**
+	 * @param data the data to set
+	 */
+	public void setData(Object data) {
+		this.data = data;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("ResponseInfo [code=");
+		builder.append(code);
+		builder.append(", data=");
+		builder.append(data);
+		builder.append(", desc=");
+		builder.append(desc);
+		builder.append("]");
+		return builder.toString();
+	}
+}

+ 59 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/AuthorizeFirstResponse.java

@@ -0,0 +1,59 @@
+package com.dahua.sdk.client.bean.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * 登录域的参数
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class AuthorizeFirstResponse {
+
+    // 域信息
+    private String realm;
+    
+    // 随机秘钥种子
+    private String randomKey;
+    
+    // 加密算法,MD5
+    private String encryptType;
+    
+    public String getRealm() {
+        return realm;
+    }
+
+    public void setRealm(String realm) {
+        this.realm = realm;
+    }
+
+    public String getRandomKey() {
+        return randomKey;
+    }
+
+    public void setRandomKey(String randomKey) {
+        this.randomKey = randomKey;
+    }
+
+    public String getEncryptType() {
+        return encryptType;
+    }
+
+    public void setEncryptType(String encryptType) {
+        this.encryptType = encryptType;
+    }
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("AuthorizeFirstResponse [realm=");
+        builder.append(realm);
+        builder.append(", randomKey=");
+        builder.append(randomKey);
+        builder.append(", encryptType=");
+        builder.append(encryptType);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 102 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/AuthorizeResponse.java

@@ -0,0 +1,102 @@
+package com.dahua.sdk.client.bean.response;
+
+import com.dahua.sdk.client.bean.request.AuthorizePortInfo;
+
+import java.util.List;
+
+/**
+ * 登录域的参数
+ */
+public class AuthorizeResponse extends BaseResponse {
+
+    // 有效时间,心跳间隔时间
+    private String duration;
+    
+    private String token;
+    
+    private String userId;
+    
+    private List<String> serviceAbilty;
+    
+    private AuthorizePortInfo portInfo;
+
+    private String secretKey;
+
+    private String secretVector;
+
+    public String getSecretKey() {
+        return secretKey;
+    }
+
+    public void setSecretKey(String secretKey) {
+        this.secretKey = secretKey;
+    }
+
+    public String getSecretVector() {
+        return secretVector;
+    }
+
+    public void setSecretVector(String secretVector) {
+        this.secretVector = secretVector;
+    }
+
+    public String getDuration() {
+        return duration;
+    }
+
+    public void setDuration(String duration) {
+        this.duration = duration;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    public List<String> getServiceAbilty() {
+        return serviceAbilty;
+    }
+
+    public void setServiceAbilty(List<String> serviceAbilty) {
+        this.serviceAbilty = serviceAbilty;
+    }
+
+    public AuthorizePortInfo getPortInfo() {
+        return portInfo;
+    }
+
+    public void setPortInfo(AuthorizePortInfo portInfo) {
+        this.portInfo = portInfo;
+    }
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("AuthorizeResponse [duration=");
+        builder.append(duration);
+        builder.append(", token=");
+        builder.append(token);
+        builder.append(", userId=");
+        builder.append(userId);
+        builder.append(", serviceAbilty=");
+        builder.append(serviceAbilty);
+        builder.append(", portInfo=");
+        builder.append(portInfo);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 68 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/BaseResponse.java

@@ -0,0 +1,68 @@
+package com.dahua.sdk.client.bean.response;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+/**
+ * BaseResponse
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class BaseResponse {
+
+    private String code;
+    
+    private String message;
+    
+    private String desc;
+    
+    private String randomKey;
+    
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public String getRandomKey() {
+        return randomKey;
+    }
+
+    public void setRandomKey(String randomKey) {
+        this.randomKey = randomKey;
+    }
+
+    /* (non-Jsdoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("BaseResponse [code=");
+        builder.append(code);
+        builder.append(", message=");
+        builder.append(message);
+        builder.append(", desc=");
+        builder.append(desc);
+        builder.append(", randomKey=");
+        builder.append(randomKey);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 83 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/DhDomainResponseInfo.java

@@ -0,0 +1,83 @@
+package com.dahua.sdk.client.bean.response;
+
+public class DhDomainResponseInfo<T> {
+
+    private int code;
+    
+    private String desc;
+    
+    private T data;
+    
+    public ResponseInfo getResponse() {
+        ResponseInfo responseInfo = new ResponseInfo();
+        responseInfo.setCode(code);
+        responseInfo.setDesc(desc);
+        responseInfo.setData(data);
+        return responseInfo;
+    }
+    
+    public boolean isError() {
+        if (code == 1000) {
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * @return the code
+     */
+    public int getCode() {
+        return code;
+    }
+
+    /**
+     * @param code the code to set
+     */
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    /**
+     * @return the desc
+     */
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * @param desc the desc to set
+     */
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    /**
+     * @return the data
+     */
+    public T getData() {
+        return data;
+    }
+
+    /**
+     * @param data the data to set
+     */
+    public void setData(T data) {
+        this.data = data;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("DomainResponseInfo [code=");
+        builder.append(code);
+        builder.append(", data=");
+        builder.append(data);
+        builder.append(", desc=");
+        builder.append(desc);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 50 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/MqAddressResponseInfo.java

@@ -0,0 +1,50 @@
+package com.dahua.sdk.client.bean.response;
+
+public class MqAddressResponseInfo {
+
+    private String userName;
+    
+    private String password;
+    
+    private String addr;
+    
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getAddr() {
+        return addr;
+    }
+
+    public void setAddr(String addr) {
+        this.addr = addr;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("MqAddressResponseInfo [userName=");
+        builder.append(userName);
+        builder.append(", password=");
+        builder.append(password);
+        builder.append(", addr=");
+        builder.append(addr);
+        builder.append("]");
+        return builder.toString();
+    }
+}

+ 79 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/ResponseInfo.java

@@ -0,0 +1,79 @@
+package com.dahua.sdk.client.bean.response;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+import java.io.Serializable;
+
+/**
+ * 接口输出对象
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ResponseInfo implements Serializable {
+
+	private static final long serialVersionUID = -8638593562772051758L;
+
+	private int code;
+	
+	private String desc;
+
+	private Object data;
+
+	/**
+	 * @return the code
+	 */
+	public int getCode() {
+		return code;
+	}
+
+	/**
+	 * @param code the code to set
+	 */
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	/**
+	 * @return the desc
+	 */
+	public String getDesc() {
+		return desc;
+	}
+
+	/**
+	 * @param desc the desc to set
+	 */
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+
+	/**
+	 * @return the data
+	 */
+	public Object getData() {
+		return data;
+	}
+
+	/**
+	 * @param data the data to set
+	 */
+	public void setData(Object data) {
+		this.data = data;
+	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("ResponseInfo [code=");
+		builder.append(code);
+		builder.append(", data=");
+		builder.append(data);
+		builder.append(", desc=");
+		builder.append(desc);
+		builder.append("]");
+		return builder.toString();
+	}
+	
+}

+ 169 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/response/SuccessResponse.java

@@ -0,0 +1,169 @@
+/**
+ * *********************** 版权声明 ***********************************
+ *
+ * 版权所有:浙江大华技术股份有限公司
+ * CopyRight DahuaTech 2017   
+ *  
+ * *******************************************************************
+*/
+
+package com.dahua.sdk.client.bean.response;
+
+import com.dahua.sdk.client.bean.VersionInfoVo;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+/**
+ * TODO
+ *
+ * @author    范玉宪
+ * @version   Express Ver 1.0
+ * @since     Express Ver 1.0
+ * @Date      2017年9月13日
+ *
+ */
+public class SuccessResponse implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5195126361045006378L;
+	
+	 private int duration  ;  // 300,	有效时间,由服务端指定,单位秒,建议3/4 duration时就进行会话更新
+	 
+	 private String token  ;     //	返回登陆令牌,令牌字符串由服务端发布
+	 
+	 private String userId;     // “用户id”,	用户Id
+	 
+	 private String [] serviceAbilty ;
+	
+	 private VersionInfoVo versionInfo ;     //客户端版本号、下载路径
+	
+	 private String emapUrl ;     //电子地图路径
+	 
+	 private String sipNum;		//呼叫号码
+	 
+	 private int tokenRate;  // token更新时间
+
+	 private String secretKey;
+
+	 private String secretVector;
+
+	 private String reused;
+
+	public String getReused() {
+		return reused;
+	}
+
+	public void setReused(String reused) {
+		this.reused = reused;
+	}
+
+	public String getSecretKey() {
+		return secretKey;
+	}
+
+	public void setSecretKey(String secretKey) {
+		this.secretKey = secretKey;
+	}
+
+	public String getSecretVector() {
+		return secretVector;
+	}
+
+	public void setSecretVector(String secretVector) {
+		this.secretVector = secretVector;
+	}
+
+	public int getDuration() {
+		return duration;
+	}
+
+	public void setDuration(int duration) {
+		this.duration = duration;
+	}
+
+	public String getToken() {
+		return token;
+	}
+
+	public void setToken(String token) {
+		this.token = token;
+	}
+
+	public String getUserId() {
+		return userId;
+	}
+
+	public void setUserId(String userId) {
+		this.userId = userId;
+	}
+
+	public String[] getServiceAbilty() {
+		return serviceAbilty;
+	}
+
+	public void setServiceAbilty(String[] serviceAbilty) {
+		this.serviceAbilty = serviceAbilty;
+	}
+	
+	public VersionInfoVo getVersionInfo() {
+		return versionInfo;
+	}
+	
+	public void setVersionInfo(VersionInfoVo versionInfo) {
+		this.versionInfo = versionInfo;
+	}
+	
+	public String getEmapUrl() {
+		return emapUrl;
+	}
+	
+	public void setEmapUrl(String emapUrl) {
+		this.emapUrl = emapUrl;
+	}
+	
+	
+	public String getSipNum() {
+		return sipNum;
+	}
+
+	public void setSipNum(String sipNum) {
+		this.sipNum = sipNum;
+	}
+
+	@Override
+	public String toString() {
+		StringBuilder builder = new StringBuilder();
+		builder.append("SuccessResponse [duration=");
+		builder.append(duration);
+		builder.append(", token=");
+		builder.append(token);
+		builder.append(", userId=");
+		builder.append(userId);
+		builder.append(", serviceAbilty=");
+		builder.append(Arrays.toString(serviceAbilty));
+		builder.append(", versionInfo=");
+		builder.append(versionInfo);
+		builder.append(", emapUrl=");
+		builder.append(emapUrl);
+		builder.append(", sipNum=");
+		builder.append(sipNum);
+		builder.append(", reused=");
+		builder.append(reused);
+		builder.append("]");
+		return  builder.toString();
+	}
+
+	public int getTokenRate() {
+		return tokenRate;
+	}
+
+	public void setTokenRate(int tokenRate) {
+		this.tokenRate = tokenRate;
+	}
+
+	
+}
+ 

+ 135 - 0
mybusiness/src/main/java/com/dahua/sdk/client/bean/xo/AuthorizeXo.java

@@ -0,0 +1,135 @@
+/**
+ * *********************** 版权声明 ***********************************
+ * <p>
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2017
+ * <p>
+ * *******************************************************************
+ */
+package com.dahua.sdk.client.bean.xo;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * com.dahua.admin.restapi.xo
+ *
+ * @author 26803
+ * @version Ver 7.0
+ * @since Ver 7.0
+ * @Date 2017/12/25
+ *
+ */
+@JsonIgnoreProperties(ignoreUnknown=true)
+public class AuthorizeXo implements Serializable {
+    
+    private static final long serialVersionUID = 297561054494560506L;
+    
+    private String userName;
+    
+    private String signature;
+    
+    private String randomKey;
+    
+    private String encryptType;
+
+    /**
+     * "Android"||"IOS".
+     */
+    private String clientType;
+    
+    private String ipAddress;
+    
+    private String mac;
+
+    private String userType;
+
+    private String publicKey;
+
+    public String getPublicKey() {
+        return publicKey;
+    }
+
+    public void setPublicKey(String publicKey) {
+        this.publicKey = publicKey;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+    
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+    
+    public String getSignature() {
+        return signature;
+    }
+    
+    public void setSignature(String signature) {
+        this.signature = signature;
+    }
+    
+    public String getRandomKey() {
+        return randomKey;
+    }
+    
+    public void setRandomKey(String randomKey) {
+        this.randomKey = randomKey;
+    }
+    
+    public String getEncryptType() {
+        return encryptType;
+    }
+    
+    public void setEncryptType(String encryptType) {
+        this.encryptType = encryptType;
+    }
+    
+    public String getClientType() {
+        return clientType;
+    }
+    
+    public void setClientType(String clientType) {
+        this.clientType = clientType;
+    }
+    
+    public String getIpAddress() {
+        return ipAddress;
+    }
+    
+    public void setIpAddress(String ipAddress) {
+        this.ipAddress = ipAddress;
+    }
+    
+    public String getMac() {
+        return mac;
+    }
+    
+    public void setMac(String mac) {
+        this.mac = mac;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    @Override
+    public String toString() {
+        return "AuthorizeXo{" +
+                "userName='" + userName + '\'' +
+                ", signature='" + signature + '\'' +
+                ", randomKey='" + randomKey + '\'' +
+                ", encryptType='" + encryptType + '\'' +
+                ", clientType='" + clientType + '\'' +
+                ", ipAddress='" + ipAddress + '\'' +
+                ", mac='" + mac + '\'' +
+                ", userType='" + userType + '\'' +
+                '}';
+    }
+}

+ 34 - 0
mybusiness/src/main/java/com/dahua/sdk/client/common/Constants.java

@@ -0,0 +1,34 @@
+package com.dahua.sdk.client.common;
+
+/** 类描述 	: 系统全局静态变量类
+ *
+ * @author    maoxn
+ * @version   V 3.0
+ * @since     V 3.0
+ * @Date      2012-7-25  下午01:57:04
+ */
+
+public class Constants {
+    
+    /** 编码 */
+    public static String ENCODING = "UTF-8";
+
+	/**
+	 * 发送心跳包时间间隔,单位毫秒
+	 */
+	public static int SENT_HEARTBEAT_TIME = 30000;
+    
+    /** 数据字典,域服务,CMS*/
+    public static String DICT_DOMAIN_SERVICE_TYPE_CMS = "1";
+    
+    /** 数据字典,域服务,PCS*/
+    public static String DICT_DOMAIN_SERVICE_TYPE_PCS = "2";
+    
+    /** 数据字典,域服务,WEB*/
+    public static String DICT_DOMAIN_SERVICE_TYPE_WEB = "3";
+
+    public static final String PUBLIC_KEY = "RSAPublicKey";
+
+    public static final String PRIVATE_KEY = "RSAPrivateKey";
+
+}

+ 43 - 0
mybusiness/src/main/java/com/dahua/sdk/client/common/DomainOfflineReasonEnum.java

@@ -0,0 +1,43 @@
+package com.dahua.sdk.client.common;
+
+public enum DomainOfflineReasonEnum {
+    NORMAL(0, ""),
+    CONNECT_EXCEPTION(1, "error.domain.login.connect.exception"),
+    AD_LOGIN_CLOSE(2, "error.domain.login.domain.forbidden"),
+    USER_PASS_ERROR(3, "error.domain.login.user.pass.error"),
+    USER_LOCKED(4, "error.domain.login.user.locked"),
+    USER_LOCKED_SYS_UPGRADE(5, "error.domain.login.user.locked"),
+    USER_MAC_ERROR(6, "error.domain.login.user.mac.error"),
+    USER_DISABLED(7, "error.domain.login.user.disabled"),
+    USER_LOGGED_IN(8, "error.domain.login.user.loggedin"),
+    USER_DATE_OVER(9, "error.domain.login.user.date.over"),
+    USER_TIME_OVER(10, "error.domain.login.user.time.over");
+    
+    private DomainOfflineReasonEnum(int code, String i18nCode) {
+        this.code = code;
+        this.i18nCode = i18nCode;
+    }
+    
+    private int code;
+    
+    private String i18nCode;
+    
+    public static String getI18nCode(int code) {
+        DomainOfflineReasonEnum[] elements = DomainOfflineReasonEnum.values();
+        for (DomainOfflineReasonEnum offlineStatus : elements) {
+            if (offlineStatus.getCode() == code) {
+                return offlineStatus.getI18nCode();
+            }
+        }
+        return "";
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public String getI18nCode() {
+        return i18nCode;
+    }
+
+}

+ 40 - 0
mybusiness/src/main/java/com/dahua/sdk/client/common/EncryptType.java

@@ -0,0 +1,40 @@
+/**
+ * *********************** 版权声明 ***********************************
+ *
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2017   
+ *  
+ * *******************************************************************
+*/
+
+package com.dahua.sdk.client.common;
+
+/**
+ * @author    周海青
+ * @version   Ver 3.20
+ * @since     Ver 3.20
+ * @Date      2017年9月22日
+ *
+ */
+public enum EncryptType {
+    
+    MD5("MD5"),
+    SSL("SSL"),
+    TLS("TLS"),
+    SHA512("SHA-512"),
+    SHA256("SHA-256"),
+    AES("AES"),
+    AES_CBC_PKCS7("AES/CBC/PKCS7Padding");
+
+    private String type;
+
+    private EncryptType(String type) {
+        this.type = type;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+}
+

+ 14 - 0
mybusiness/src/main/java/com/dahua/sdk/client/common/SchemeEnum.java

@@ -0,0 +1,14 @@
+package com.dahua.sdk.client.common;
+
+public enum SchemeEnum {
+    HTTP("http://"), HTTPS("https://");
+
+    String scheme;
+    SchemeEnum(String scheme) {
+        this.scheme = scheme;
+    }
+
+    public String getScheme() {
+        return scheme;
+    }
+}

+ 8 - 0
mybusiness/src/main/java/com/dahua/sdk/client/common/ServiceErrorCode.java

@@ -0,0 +1,8 @@
+package com.dahua.sdk.client.common;
+
+public class ServiceErrorCode {
+
+    public static int SUCCESS = 0;
+    
+    public static int FAIL = -1;
+}

+ 80 - 0
mybusiness/src/main/java/com/dahua/sdk/client/convert/GsonUtils.java

@@ -0,0 +1,80 @@
+/**
+ * *********************** 版权声明 ***********************************
+ *
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2012   
+ *  
+ * *******************************************************************
+*/
+
+package com.dahua.sdk.client.convert;
+
+import com.google.gson.ExclusionStrategy;
+import com.google.gson.FieldAttributes;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+/**
+ * 用于生成 Gson对象,从而可以进行 对象 和 json字符串之间的转化
+ */
+public class GsonUtils {
+    
+    private static Gson exposeFieldsGson;
+    private static Gson allFieldsGson;
+    private static Gson multipleGson;
+    
+    public static Gson getGson() {
+        if (exposeFieldsGson == null) {
+            GsonBuilder gsonBuilder = new GsonBuilder();
+            gsonBuilder.excludeFieldsWithoutExposeAnnotation();
+            exposeFieldsGson = gsonBuilder.create();
+        }
+        return exposeFieldsGson;
+    }
+    
+    public static Gson getAllFieldsGson(){
+        if (allFieldsGson == null) {
+            GsonBuilder gsonBuilder = new GsonBuilder();
+            allFieldsGson = gsonBuilder.create();
+        }
+        return allFieldsGson;
+    }
+    
+    public static Gson getGson(boolean multipleParam){
+        if (multipleGson == null) {
+            GsonBuilder gsonBuilder = new GsonBuilder();
+            // 支持null
+           // gsonBuilder.serializeNulls();
+            // 支持转义字符
+            gsonBuilder.disableHtmlEscaping();
+            multipleGson = gsonBuilder.create();
+        }
+        return multipleGson;
+    }
+    
+    public static Gson getSkipFiledsGson(final String... filedNames) {
+        ExclusionStrategy myExclusionStrategy = new ExclusionStrategy() {
+
+            @Override
+            public boolean shouldSkipField(FieldAttributes filed) {
+                for (String filedName : filedNames) {
+                    if (filed.getName().equals(filedName)) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+
+            // 先不做操作
+            @Override
+            public boolean shouldSkipClass(Class<?> arg0) {
+                return false;
+            }
+        };
+
+        GsonBuilder gsonBuilder = new GsonBuilder();
+        gsonBuilder.setExclusionStrategies(myExclusionStrategy);
+        return gsonBuilder.create();
+    }
+}
+

+ 54 - 0
mybusiness/src/main/java/com/dahua/sdk/client/convert/JsonToObjectConvert.java

@@ -0,0 +1,54 @@
+/**
+ * *********************** 版权声明 ***********************************
+ *
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2016   
+ *  
+ * *******************************************************************
+*/
+
+package com.dahua.sdk.client.convert;
+
+import com.google.gson.Gson;
+
+import java.lang.reflect.Type;
+
+/**
+ * Json和对象之间进行转换
+ *
+ */
+public class JsonToObjectConvert implements StringToObjectConvert {
+
+    private static JsonToObjectConvert instance = new JsonToObjectConvert();
+    
+    private JsonToObjectConvert() {
+        
+    }
+    
+    public static JsonToObjectConvert getInstance() {
+        return instance;
+    }
+    
+	@Override
+	public Object convert(String body, Class<?> clazz) {
+		return new Gson().fromJson(body, clazz);
+	}
+	
+	public Object convert(String body, Type type) {
+		return new Gson().fromJson(body, type);
+	}
+
+	@Override
+	public String convert(Object object) {
+		return new Gson().toJson(object);
+	}
+	
+	public String convert(Object object, Type type) {
+		return new Gson().toJson(object, type);
+	}
+	
+	public String convert(Object object, boolean multipleParam) {
+	    Gson gson = GsonUtils.getGson(multipleParam); 
+        return gson.toJson(object);
+    }
+}

+ 36 - 0
mybusiness/src/main/java/com/dahua/sdk/client/convert/StringToObjectConvert.java

@@ -0,0 +1,36 @@
+/**
+ * *********************** 版权声明 ***********************************
+ *
+ * 版权所有:浙江大华技术股份有限公司
+ * ©CopyRight DahuaTech 2016   
+ *  
+ * *******************************************************************
+*/
+
+package com.dahua.sdk.client.convert;
+
+/**
+ * 字符串和对象转换器
+ *
+ */
+public interface StringToObjectConvert {
+	
+	/**
+	 * 把指定的字符串转换成对象
+	 *
+	 * @param body
+	 * @param clazz
+	 * @return      
+	 * @since  Ver 6.07
+	 */
+	Object convert(String body, Class<?> clazz);
+	
+	/**
+	 * 把指定对象转换成字符串
+	 *
+	 * @param object
+	 * @return      
+	 * @since  Ver 6.07
+	 */
+	String convert(Object object);
+}

+ 14 - 0
mybusiness/src/main/java/com/dahua/sdk/client/main/Main.java

@@ -0,0 +1,14 @@
+package com.dahua.sdk.client.main;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Main {
+    public static void main(String[] args) {
+
+        List<String> list = new ArrayList<>();
+        list.add("11");
+        list.add("22");
+        System.out.println(list);
+    }
+}

+ 227 - 0
mybusiness/src/main/java/com/dahua/sdk/client/util/EncryptionUtils.java

@@ -0,0 +1,227 @@
+package com.dahua.sdk.client.util;
+
+
+import com.dahua.sdk.client.common.Constants;
+import com.dahua.sdk.client.common.EncryptType;
+import org.apache.log4j.Logger;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.springframework.util.StringUtils;
+
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+import java.io.File;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+import java.security.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 加密
+ */
+public class EncryptionUtils {
+
+    protected static Logger logger = Logger.getLogger(EncryptionUtils.class);
+
+    public  static String AES_CBC_IV = null;
+
+    public static String encryptWithMD5(String text) {
+        return encrypt(text, "MD5");
+    }
+
+
+    private static String encrypt(String text, String algorithm) {
+        String password = null;
+        try {
+            MessageDigest md = MessageDigest.getInstance( algorithm );
+            try {
+                md.update(text.getBytes("utf-8"));
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            byte b[] = md.digest();
+            StringBuilder sb = new StringBuilder();
+            for (int offset = 0; offset < b.length; offset++) {
+                int i = b[offset];
+                if (i < 0) {
+                    i += 256;
+                }
+                if (i < 16) {
+                    sb.append("0");
+                }
+                sb.append(Integer.toHexString(i));
+            }
+            password = sb.toString();
+        } catch (NoSuchAlgorithmException e) {
+            e.printStackTrace();
+        }
+        return password;
+    }
+
+
+    /**
+     * 普通AES-CBC模式解密
+     * @param encryPassword
+     * @param aesKey
+     * @return
+     */
+    public static String decryptByAesCbc(String encryPassword, String aesKey,String ivKey) {
+        Security.addProvider(new BouncyCastleProvider());
+        if (StringUtils.isEmpty(encryPassword)) {
+//            logger.info("the encryPassword is null,will return null");
+            System.out.println("the encryPassword is null,will return null");
+            return null;
+        }
+        if (StringUtils.isEmpty(aesKey)) {
+            System.out.println("decrypt pass error by AES-CBC: aesKey is null ");
+            return null;
+        }
+        try {
+            byte[] raw = aesKey.getBytes(Constants.ENCODING);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, EncryptType.AES.getType());
+            Cipher cipher = Cipher.getInstance(EncryptType.AES_CBC_PKCS7.getType());
+            //Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+            //IvParameterSpec iv = new IvParameterSpec(AES_CBC_IV.getBytes(Constants.ENCODING));
+            IvParameterSpec iv = new IvParameterSpec(ivKey.getBytes(Constants.ENCODING));
+            cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+            byte[] encrypted = parseHexStr2Byte(encryPassword);
+            byte[] originalPassByte = cipher.doFinal(encrypted);
+            return new String(originalPassByte, Constants.ENCODING);
+        } catch (UnsupportedEncodingException e1) {
+            logger.error("decrypt pass error by AES-CBC: " + e1.toString());
+        } catch (NoSuchAlgorithmException e2) {
+            logger.error("decrypt pass error by AES-CBC: " + e2.toString());
+        } catch (NoSuchPaddingException e3) {
+            logger.error("decrypt pass error by AES-CBC: " + e3.toString());
+        } catch (InvalidKeyException e4) {
+            logger.error("decrypt pass error by AES-CBC: " + e4.toString());
+        } catch (InvalidAlgorithmParameterException e5) {
+            logger.error("decrypt pass error by AES-CBC: " + e5.toString());
+        } catch (IllegalBlockSizeException e6) {
+            logger.error("decrypt pass error by AES-CBC: " + e6.toString());
+        } catch (BadPaddingException e7) {
+            logger.error("decrypt pass error by AES-CBC: " + e7.toString());
+        } catch (Exception e) {
+            logger.error("decrypt pass error by AES-CBC: " + e.toString());
+        }
+        return null;
+    }
+
+    /**将16进制转换为二进制
+     * @param hexStr
+     * @return
+     */
+    private static byte[] parseHexStr2Byte(String hexStr) {
+        if (hexStr.length() < 1)  {
+            return null;
+        }
+        byte[] result = new byte[hexStr.length()/2];
+        for (int i = 0;i< hexStr.length()/2; i++) {
+            int high = Integer.parseInt(hexStr.substring(i*2, i*2+1), 16);
+            int low = Integer.parseInt(hexStr.substring(i*2+1, i*2+2), 16);
+            result[i] = (byte) (high * 16 + low);
+        }
+        return result;
+    }
+
+    /**
+     * GDPR特性的AES-CBC模式解密
+     * @param value
+     * @param aesKey
+     * @return
+     */
+    public static String decryptByAesCbcGDPR(final String value, final String aesKey) {
+        if (StringUtils.isEmpty(value)) {
+            logger.info("the value is null,will return null");
+            return null;
+        }
+        if (StringUtils.isEmpty(aesKey)) {
+            logger.info("the aesKey is null,will return null");
+            return null;
+        }
+        try {
+            byte[] raw = aesKey.getBytes(StandardCharsets.UTF_8);
+            Security.addProvider(new BouncyCastleProvider());
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, EncryptType.AES.getType());
+            Cipher cipher = Cipher.getInstance(EncryptType.AES_CBC_PKCS7.getType());
+            IvParameterSpec iv = new IvParameterSpec(AES_CBC_IV().getBytes(StandardCharsets.UTF_8));
+            cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+            byte[] encrypted = parseHexStr2Byte(value);
+            byte[] originalPassByte = cipher.doFinal(encrypted);
+            return new String(originalPassByte,StandardCharsets.UTF_8);
+        } catch (Exception e) {
+            logger.error("decrypt GDPR value error by AES-CBC" + e.getMessage());
+        }
+        return null;
+    }
+
+    //数据库密码 加密 向量 生成规则
+    public static String AES_CBC_IV(){
+        StringBuffer iv = new StringBuffer();
+        for (int i = 0; i < 10; i++) {
+            iv.append(i);
+        }
+        iv.append("abc");
+        iv.append("def");
+        return iv.toString();
+    }
+
+    public static String encryptByAesCbc(String encryPassword, String aesKey) {
+        if (StringUtils.isEmpty(encryPassword)) {
+            logger.info("the encryPassword is null,will return null");
+            return null;
+        }
+        if (StringUtils.isEmpty(aesKey)) {
+            logger.error("ecrypt pass error by AES-CBC: aesKey is null ");
+            return null;
+        }
+        try {
+            Cipher cipher = Cipher.getInstance(EncryptType.AES_CBC_PKCS7.getType());
+            byte[] raw = aesKey.getBytes(Constants.ENCODING);
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+            IvParameterSpec iv = new IvParameterSpec(AES_CBC_IV.getBytes(Constants.ENCODING));//使用CBC模式,需要一个向量iv,可增加加密算法的强度
+            cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
+            byte[] encrypted = cipher.doFinal(encryPassword.getBytes(Constants.ENCODING));
+            return parseByte2HexStr(encrypted);
+        } catch (NoSuchAlgorithmException e1) {
+            logger.error("ecrypt pass error by AES-CBC: " + e1.toString());
+        } catch(NoSuchPaddingException e2) {
+            logger.error("ecrypt pass error by AES-CBC: " + e2.toString());
+        } catch (UnsupportedEncodingException e3) {
+            logger.error("ecrypt pass error by AES-CBC: " + e3.toString());
+        } catch (InvalidKeyException e4) {
+            logger.error("ecrypt pass error by AES-CBC: " + e4.toString());
+        } catch(InvalidAlgorithmParameterException e5) {
+            logger.error("ecrypt pass error by AES-CBC: " + e5.toString());
+        } catch (IllegalBlockSizeException e6) {
+            logger.error("ecrypt pass error by AES-CBC: " + e6.toString());
+        } catch (BadPaddingException e7) {
+            logger.error("ecrypt pass error by AES-CBC: " + e7.toString());
+        } catch (Exception e) {
+            logger.error("ecrypt pass error by AES-CBC: " + e.toString());
+        }
+        return null;
+    }
+
+    /**
+     * 将二进制转换成16进制
+     * @param buf
+     * @return
+     */
+    private static String parseByte2HexStr(byte buf[]) {
+        StringBuffer sb = new StringBuffer();
+        for (int i = 0; i < buf.length; i++) {
+            String hex = Integer.toHexString(buf[i] & 0xFF);
+            if (hex.length() == 1) {
+                hex = '0' + hex;
+            }
+            sb.append(hex.toLowerCase());
+        }
+        return sb.toString();
+    }
+}

+ 50 - 0
mybusiness/src/main/java/com/dahua/sdk/client/util/HexUtil.java

@@ -0,0 +1,50 @@
+package com.dahua.sdk.client.util;
+
+public class HexUtil {
+	
+	private static final String HEX_VALUE = "0123456789ABCDEF";
+	
+	/**
+	 * Bytes to Hex String
+	 * 
+	 * @param bytes bytes
+	 * @return hex string
+	 */
+	public static String bytesToHexString(byte[] bytes) {
+		StringBuilder sb = new StringBuilder();
+		if (null == bytes || bytes.length <= 0) {
+			return null;
+		}
+		for (int i = 0; i < bytes.length; i++) {
+			int v = bytes[i] & 0xFF;
+			String hv = Integer.toHexString(v);
+			if (hv.length() < 2) {
+				sb.append(0);
+			}
+			sb.append(hv);
+		}
+		return sb.toString().toUpperCase();
+	}
+
+	/**
+	 * Hex String to Bytes
+	 * 
+	 * @param str string
+	 * @return Bytes
+	 */
+	public static byte[] hexStringToBytes(String str) {
+		int len = str.length() / 2;
+		byte[] result = new byte[len];
+		char[] achar = str.toCharArray();
+		for (int i = 0; i < len; i++) {
+			int pos = i * 2;
+			result[i] = (byte) ((byte) toByte(achar[pos]) << 4 | toByte(achar[pos + 1]));
+		}
+		return result;
+	}
+
+	private static byte toByte(char c) {
+		return (byte) HEX_VALUE.indexOf(c);
+	}
+	
+}

+ 135 - 0
mybusiness/src/main/java/com/dahua/sdk/client/util/JsonParserUtils.java

@@ -0,0 +1,135 @@
+package com.dahua.sdk.client.util;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+
+import java.lang.reflect.Constructor;
+import java.util.Iterator;
+import java.util.Map.Entry;
+import java.util.Set;
+
+/**
+ * JSON字符串基本数据类型(String 、Integer、Float等)
+ * 属性值提取工具,支持深层查找
+ *
+ * 例如
+ * {
+ *   "name":"dahuatech",
+ *   "members":13000,
+ *   "depart":{
+ *       "name":"it",
+ *       "num":120
+ *   }
+ * }
+ * 可提取深层的num属性
+ * 如果提取name属性,则提取先找到的 "dahuatech" ,不提取 "it"
+ * @author 37374
+ * Date 2019-1-18
+ */
+public abstract class JsonParserUtils {
+
+
+	private static final JsonParser jsonParser = new JsonParser();
+
+	private static JsonElement getJsonField(String jsonStr,String field){
+		if(null ==jsonStr || "".equals(jsonStr)){
+			return null;
+		}
+
+		JsonElement ele = null;
+		JsonElement jsonTree = jsonParser.parse(jsonStr);
+		ele = recursiveJsonField(jsonTree,field);
+		return ele;
+	}
+
+	/**
+	 * 获取json字符串中基本类型属性
+	 * 例如 String 、Integer、Float
+	 * @param jsonStr JSON字符串
+	 * @param field 属性名
+	 * @param clazz JAVA基本类型包装类
+	 * @return
+	 */
+	public static <T> T getPrimitiveField(String jsonStr,String field,Class<T> clazz) {
+		T result = null;
+
+		JsonElement ele = getJsonField(jsonStr, field);
+		result = recursiveField(ele,field,clazz);
+		return result;
+	}
+
+	/**
+	 * 递归查找属性
+	 * @param jsonElement
+	 * @param field
+	 * @param clazz
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private static <T> T recursiveField(JsonElement jsonElement,String field,Class<T> clazz) {
+		T result = null;
+		if(jsonElement == null){
+			return null;
+		}
+		if(jsonElement.isJsonPrimitive()){
+			String raw = jsonElement.getAsString();
+			Constructor<String> constructor;
+			try {
+				clazz.getConstructor(String.class);
+				constructor = (Constructor<String>) clazz.getConstructor(String.class);
+				result = (T) constructor.newInstance(raw);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}else if(jsonElement.isJsonObject()){
+			JsonObject obj = jsonElement.getAsJsonObject();
+			JsonElement ele2 = obj.get(field);
+			result = recursiveField(ele2,field,clazz);
+		}
+		return result;
+	}
+
+	/**
+	 * 递归查找指定JSON节点
+	 * @param jsonTree JSON树
+	 * @param field 节点名称
+	 * @return
+	 */
+	private static JsonElement recursiveJsonField(JsonElement jsonTree, String field){
+		JsonElement result = null;
+		if(jsonTree.isJsonObject()){
+			JsonObject jsonObject = jsonTree.getAsJsonObject();
+			Set<Entry<String, JsonElement>> set = jsonObject.entrySet();
+			JsonElement currentEle = null;
+			for(Entry<String, JsonElement> entry : set){
+				if(field.equals(entry.getKey())){
+					result = entry.getValue();
+					break;
+				}else{
+					currentEle = entry.getValue();
+					result = recursiveJsonField(currentEle,field);
+					if(result != null){
+						break;
+					}
+				}
+
+			}
+		}else if(jsonTree.isJsonArray()){
+			JsonArray jsonArray = jsonTree.getAsJsonArray();
+			Iterator<JsonElement> ite = jsonArray.iterator();
+			JsonElement currentEle2 = null;
+			while(ite.hasNext()){
+				currentEle2 = ite.next();
+				result = recursiveJsonField(currentEle2,field);
+				if(result != null){
+					break;
+				}
+			}
+
+		}
+
+		return result;
+	}
+}

+ 406 - 0
mybusiness/src/main/java/com/dahua/sdk/client/util/RsaUtil.java

@@ -0,0 +1,406 @@
+package com.dahua.sdk.client.util;
+
+import com.dahua.sdk.client.bean.RSAPrivateBean;
+import com.dahua.sdk.client.common.Constants;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.crypto.Cipher;
+import java.io.ByteArrayOutputStream;
+import java.security.*;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.security.spec.PKCS8EncodedKeySpec;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.locks.ReentrantLock;
+
+public class RsaUtil {
+	private static final String KEY_ALGORITHM = "RSA";
+
+	private static final int BYTES_LEN_DECRYPT = 256;
+
+	private static final int BYTES_LEN_ENCRYPT = 245;
+
+	private static final int KEY_SIZE = 2048;  //  秘钥长度2048,最长加密245字节明文    一体机的license 用1024 且采用数据库写死的私钥解密 308....
+    
+    private static Map<String, Object> keyMap = null;
+
+    private static Map<Object, Object> keyPairMap = new ConcurrentHashMap<Object, Object>();
+
+	private static ReentrantLock lock = new ReentrantLock();
+
+	private static void removeKeyPairMap(String pubicKey) {
+		if (null != keyPairMap && null != pubicKey) {
+			keyPairMap.remove(pubicKey);
+		}
+	}
+
+    /**
+	 * 用私钥解密
+	 * 
+	 * @param data encrypt data
+	 * @param key key(hex format)
+	 * @return decrypt data
+	 * @throws Exception
+	 */
+	public static byte[] decryptByPrivateKey(byte[] data, String key) throws Exception {
+		// 对密钥解密
+		byte[] keyBytes = HexUtil.hexStringToBytes(key);
+
+		// 取得私钥
+		PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+		KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+		Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
+
+		// 对数据解密
+		Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+		cipher.init(Cipher.DECRYPT_MODE, privateKey);
+		
+		byte[] result = null;
+		try {
+		    for (int i = 0; i < data.length; i += BYTES_LEN_DECRYPT) {
+	            int to = (i + BYTES_LEN_DECRYPT) < data.length ? (i + BYTES_LEN_DECRYPT) : data.length;
+	            byte[] temp = cipher.doFinal(Arrays.copyOfRange(data, i, to));
+	            result = sumBytes(result, temp);
+	        } 
+		}catch(Exception e) {
+		    result =  decryptByPrivateKey128(data,key);
+		    e.printStackTrace();
+		}
+		return result;
+	}
+	/**
+	 * 解密长度采用128进行解密
+	 * @description 
+	 * @author 46424
+	 * @date 2020-01-02 09:22:21
+	 * @param data
+	 * @param key
+	 * @return
+	 * @throws Exception
+	 *
+	 */
+	public static byte[] decryptByPrivateKey128(byte[] data,String key)throws Exception {
+	 // 对密钥解密
+        byte[] keyBytes = HexUtil.hexStringToBytes(key);
+
+        // 取得私钥
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
+
+        // 对数据解密
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.DECRYPT_MODE, privateKey);
+        int inputLen = data.length;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        int offSet = 0;
+        byte[] cache;
+        int i = 0;
+        while (inputLen - offSet > 0) {
+            if (inputLen - offSet > 128) {
+                cache = cipher.doFinal(data, offSet, 128);
+            } else {
+                cache = cipher.doFinal(data, offSet, inputLen - offSet);
+            }
+            out.write(cache, 0, cache.length);
+            i++;
+            offSet = i * 128;
+        }
+        byte[] result = out.toByteArray();
+        out.close();
+        
+        return result;
+	}
+	
+	   /**
+     * 用私钥解密
+     * 
+     * @param data encrypt data
+     * @param keyBytes key(hex format)
+     * @return decrypt data
+     * @throws Exception
+     */
+    public static byte[] decryptByPrivateKey(byte[] data,  byte[] keyBytes) throws Exception {
+
+        // 取得私钥
+        PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+        KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+        Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
+
+        // 对数据解密
+        Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+        cipher.init(Cipher.DECRYPT_MODE, privateKey);
+        
+        byte[] result = null;
+        for (int i = 0; i < data.length; i += BYTES_LEN_DECRYPT) {
+            int to = (i + BYTES_LEN_DECRYPT) < data.length ? (i + BYTES_LEN_DECRYPT) : data.length;
+            byte[] temp = cipher.doFinal(Arrays.copyOfRange(data, i, to));
+            result = sumBytes(result, temp);
+        }
+
+        return result;
+    }
+
+	/**
+	 * 用公钥解密
+	 * 
+	 * @param data encrypt data
+	 * @param key key(hex format)
+	 * @return decrypt data
+	 * @throws Exception
+	 */
+	public static byte[] decryptByPublicKey(byte[] data, String key) throws Exception {
+		// 对密钥解密
+		byte[] keyBytes = HexUtil.hexStringToBytes(key);
+
+		// 取得公钥
+		X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
+		KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+		Key publicKey = keyFactory.generatePublic(x509KeySpec);
+
+		// 对数据解密
+		Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+		cipher.init(Cipher.DECRYPT_MODE, publicKey);
+
+		byte[] result = null;
+		for (int i = 0; i < data.length; i += BYTES_LEN_DECRYPT) {
+			int to = (i + BYTES_LEN_DECRYPT) < data.length ? (i + BYTES_LEN_DECRYPT) : data.length;
+			byte[] temp = cipher.doFinal(Arrays.copyOfRange(data, i, to));
+			result = sumBytes(result, temp);
+		}
+
+		return result;
+	}
+
+	/**
+	 * 用公钥加密
+	 * 
+	 * @param data decrypt data
+	 * @param key key(hex format)
+	 * @return encrypt data
+	 * @throws Exception
+	 */
+	public static byte[] encryptByPublicKey(byte[] data, String key) throws Exception {
+		// 对公钥解密
+		byte[] keyBytes = HexUtil.hexStringToBytes(key);
+
+		// 取得公钥
+		X509EncodedKeySpec x509KeySpec = new X509EncodedKeySpec(keyBytes);
+		KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+		Key publicKey = keyFactory.generatePublic(x509KeySpec);
+
+		// 对数据加密
+		Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+		cipher.init(Cipher.ENCRYPT_MODE, publicKey);
+		
+		byte[] result = null;
+		for (int i = 0; i < data.length; i += BYTES_LEN_ENCRYPT) {
+			int to = (i + BYTES_LEN_ENCRYPT) < data.length ? (i + BYTES_LEN_ENCRYPT) : data.length;
+			byte[] temp = cipher.doFinal(Arrays.copyOfRange(data, i, to));
+			result = sumBytes(result, temp);
+		}
+
+		return result;
+	}
+
+	/**
+	 * 用私钥加密
+	 * 
+	 * @param data decrypt data
+	 * @param key key(hex format)
+	 * @return encrypt data
+	 * @throws Exception
+	 */
+	public static byte[] encryptByPrivateKey(byte[] data, String key) throws Exception {
+		// 对密钥解密
+		byte[] keyBytes = HexUtil.hexStringToBytes(key);
+
+		// 取得私钥
+		PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
+		KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
+		Key privateKey = keyFactory.generatePrivate(pkcs8KeySpec);
+
+		// 对数据加密
+		Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
+		cipher.init(Cipher.ENCRYPT_MODE, privateKey);
+
+		byte[] result = null;
+		for (int i = 0; i < data.length; i += BYTES_LEN_ENCRYPT) {
+			int to = (i + BYTES_LEN_ENCRYPT) < data.length ? (i + BYTES_LEN_ENCRYPT) : data.length;
+			byte[] temp = cipher.doFinal(Arrays.copyOfRange(data, i, to));
+			result = sumBytes(result, temp);
+		}
+
+		return result;
+	}
+	
+	private static byte[] sumBytes(byte[] bytes1, byte[] bytes2) {
+		byte[] result = null;
+		int len1 = 0;
+		int len2 = 0;
+		if (null != bytes1) {
+			len1 = bytes1.length;
+		}
+		if (null != bytes2) {
+			len2 = bytes2.length;
+		}
+		if (len1 + len2 > 0) {
+			result = new byte[len1+len2];
+		}
+		if (len1 > 0) {
+			System.arraycopy(bytes1, 0, result, 0, len1);
+		}
+		if (len2 > 0) {
+			System.arraycopy(bytes2, 0, result, len1, len2);
+		}
+		return result;
+	}
+	
+	   /**
+     * 初始化密钥
+     * 
+     * @return
+     * @throws Exception
+     */
+    public static void initKey() throws Exception {
+    	ReentrantLock lock=new ReentrantLock();
+    	lock.lock();
+    	try {
+    		if(keyMap == null) {
+                Provider provider = Security.getProvider("SunRsaSign");
+                KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM , provider);
+                keyPairGen.initialize(KEY_SIZE , new SecureRandom());
+        
+                KeyPair keyPair = keyPairGen.generateKeyPair();
+        
+                // 公钥
+                RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
+        
+                // 私钥
+                RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
+               
+                keyMap = new HashMap<String, Object>(2);
+        
+                keyMap.put(Constants.PUBLIC_KEY, publicKey);
+                keyMap.put(Constants.PRIVATE_KEY, privateKey);
+                
+            }
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally{
+			lock.unlock();
+		}
+    }
+
+	/**
+	 * 随机生成公钥私钥对
+	 *
+	 * @return
+	 * @throws Exception
+	 */
+	public static RSAPublicKey generateRandomKey() throws Exception {
+		lock.lock();
+        RSAPublicKey publicKey = null;
+        RSAPrivateKey privateKey = null;
+		try {
+            Provider provider = Security.getProvider("SunRsaSign");
+            KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(KEY_ALGORITHM , provider);
+            keyPairGen.initialize(KEY_SIZE , new SecureRandom());
+
+            KeyPair keyPair = keyPairGen.generateKeyPair();
+
+            // 公钥
+            publicKey = (RSAPublicKey) keyPair.getPublic();
+
+            // 私钥
+            privateKey = (RSAPrivateKey) keyPair.getPrivate();
+
+            keyPairMap.put(Base64.getEncoder().encodeToString(publicKey.getEncoded()), new RSAPrivateBean(privateKey, System.currentTimeMillis()));
+		} catch (Exception e) {
+			e.printStackTrace();
+		}finally{
+			lock.unlock();
+		}
+		return publicKey;
+	}
+
+    public static Map<String, Object> getKeyMap() {
+        if(keyMap == null){
+            try {
+                initKey();
+            } catch (Exception e) {
+
+            }
+        }
+        return keyMap;
+    }
+
+    public static void removeKeyMap() {
+        keyMap = null;
+    }
+
+    public static Map<Object, Object> getKeyPairMap() {
+        return keyPairMap;
+    }
+
+    public static String decryptRSA(String encrypt) {
+        String pureText = "";
+        if (StringUtils.isEmpty(encrypt)) {
+            return pureText;
+        }
+        RSAPrivateKey privateKey = (RSAPrivateKey) RsaUtil.getKeyMap().get(Constants.PRIVATE_KEY);
+		try {
+			byte[] encryBytes = Base64.getDecoder().decode(encrypt);
+			byte[] decryBytes = RsaUtil.decryptByPrivateKey(encryBytes, privateKey.getEncoded());
+			if(decryBytes != null){
+				pureText = new String(decryBytes, Constants.ENCODING);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return pureText;
+	}
+
+	public static String encryptByPublicKey(String data, String publicKey) {
+		String pureText = data;
+		if (StringUtils.isBlank(data) || StringUtils.isBlank(publicKey)) {
+			return pureText;
+		}
+		try {
+			byte[] dataBytes = data.getBytes("UTF-8");
+			byte[] encryBytes = RsaUtil.encryptByPublicKey(dataBytes, publicKey);
+			if(encryBytes != null){
+				pureText = HexUtil.bytesToHexString(encryBytes);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return pureText;
+	}
+
+	public static String decryptRSAByPublicKey(String encrypt, String publicKey) {
+        String pureText = "";
+        if (StringUtils.isEmpty(encrypt)) {
+            return pureText;
+        }
+		RSAPrivateKey privateKey = ((RSAPrivateBean) RsaUtil.getKeyPairMap().get(publicKey)).getRsaPrivateKey();
+		try {
+			byte[] encryBytes = Base64.getDecoder().decode(encrypt);
+			byte[] decryBytes = RsaUtil.decryptByPrivateKey(encryBytes, privateKey.getEncoded());
+			if(decryBytes != null){
+				pureText = new String(decryBytes, Constants.ENCODING);
+			}
+			removeKeyPairMap(publicKey);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return pureText;
+	}
+
+
+}

+ 65 - 0
mybusiness/src/main/java/com/dahua/sdk/client/util/StringUtil.java

@@ -0,0 +1,65 @@
+package com.dahua.sdk.client.util;
+
+public class StringUtil {
+
+    /**
+     *
+     * isEmpty:(判断对象是否为空)
+     *
+     * @param obj
+     * @return
+     * @throws
+     * @since Ver 1.1
+     */
+    public static boolean isEmpty(Object obj) {
+        if (obj == null) {
+            return true;
+        }
+        if (obj.equals("")) {
+            return true;
+        }
+        if (obj.toString().equalsIgnoreCase("null")) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 是否整数
+     * @param s 检测对象
+     * @return 是/否
+     */
+    public static boolean isInteger(String s) {
+        try {
+            Integer.parseInt(s);
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     *
+     * isBlank:(判断对象是否为空,排除半角空格)
+     *
+     * @param obj
+     * @return
+     * @throws
+     * @since Ver 1.1
+     */
+    public static boolean isBlank(Object obj) {
+        if (obj == null) {
+            return true;
+        }
+        if (obj.equals("")) {
+            return true;
+        }
+        if (obj.toString().trim().equals("")) {
+            return true;
+        }
+        if (obj.toString().equalsIgnoreCase("null")) {
+            return true;
+        }
+        return false;
+    }
+}

+ 128 - 0
mybusiness/src/main/resources/mapper/camera/CameraMapper.xml

@@ -0,0 +1,128 @@
+<?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.business.yanbian.camera.mapper.CameraMapper">
+
+    <resultMap type="Camera" id="CameraResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="channelId"    column="channel_id"    />
+        <result property="city"    column="city"    />
+        <result property="cityName"    column="city_name"    />
+        <result property="counties"    column="counties"    />
+        <result property="countiesName"    column="counties_name"    />
+        <result property="ownship"    column="ownship"    />
+        <result property="ownshipName"    column="ownship_name"    />
+        <result property="village"    column="village"    />
+        <result property="villageName"    column="village_name"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+        <result property="lat"    column="lat"    />
+        <result property="lng"    column="lng"    />
+        <result property="address"    column="address"    />
+    </resultMap>
+
+    <sql id="selectCameraVo">
+        select id, name, channel_id, city, counties, ownship, village, create_by, create_time, update_by, update_time, remark
+         ,lat,lng,address from camera
+    </sql>
+    <sql id="selectCameraVoDept">
+        select id, name, channel_id,
+        city,(select dept_name from sys_dept where dept_id=city) as city_name,
+        counties,(select dept_name from sys_dept where dept_id=counties) as counties_name,
+        ownship,(select dept_name from sys_dept where dept_id=ownship) as ownship_name,
+        village,(select dept_name from sys_dept where dept_id=village) as village_name,
+        create_by, create_time, update_by, update_time, remark,lat,lng,address from camera
+    </sql>
+
+    <select id="selectCameraList" parameterType="Camera" resultMap="CameraResult">
+        <include refid="selectCameraVoDept"/>
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="channelId != null  and channelId != ''"> and channel_id = #{channelId}</if>
+            <if test="city != null  and city != ''"> and city = #{city}</if>
+            <if test="counties != null  and counties != ''"> and counties = #{counties}</if>
+            <if test="ownship != null  and ownship != ''"> and ownship = #{ownship}</if>
+            <if test="village != null  and village != ''"> and village = #{village}</if>
+        </where>
+    </select>
+
+    <select id="selectCameraById" parameterType="String" resultMap="CameraResult">
+        <include refid="selectCameraVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertCamera" parameterType="Camera">
+        insert into camera
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="name != null">name,</if>
+            <if test="channelId != null">channel_id,</if>
+            <if test="city != null">city,</if>
+            <if test="counties != null">counties,</if>
+            <if test="ownship != null">ownship,</if>
+            <if test="village != null">village,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            <if test="lat != null">lat,</if>
+            <if test="lng != null">lng,</if>
+            <if test="address != null">address,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="name != null">#{name},</if>
+            <if test="channelId != null">#{channelId},</if>
+            <if test="city != null">#{city},</if>
+            <if test="counties != null">#{counties},</if>
+            <if test="ownship != null">#{ownship},</if>
+            <if test="village != null">#{village},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="lat != null">#{lat},</if>
+            <if test="lng != null">#{lng},</if>
+            <if test="address != null">#{address},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCamera" parameterType="Camera">
+        update camera
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="channelId != null">channel_id = #{channelId},</if>
+            <if test="city != null">city = #{city},</if>
+            <if test="counties != null">counties = #{counties},</if>
+            <if test="ownship != null">ownship = #{ownship},</if>
+            <if test="village != null">village = #{village},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="lat != null">lat = #{lat},</if>
+            <if test="lng != null">lng = #{lng},</if>
+            <if test="address != null">address = #{address},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCameraById" parameterType="String">
+        delete from camera where id = #{id}
+    </delete>
+
+    <delete id="deleteCameraByIds" parameterType="String">
+        delete from camera where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 162 - 0
mybusiness/src/main/resources/templates/camera/camera/add.html

@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增摄像头')" />
+    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=nKLaDv0nFSjlHTSYGiKaOTMnMMwCCEzN"></script>
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-camera-add">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">摄像头名称:</label>
+                <div class="col-sm-8">
+                    <input name="name" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">摄像头设备编号:</label>
+                <div class="col-sm-8">
+                    <input name="channelId" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属市级:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="city" onchange="findCounties(this.value,'counties')">
+                        <option value="">---请选择---</option>
+                        <option th:each="city : ${citys}" th:value="${city.deptId}" th:text="${city.deptName}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">县区:</label>
+                <div class="col-sm-8">
+                    <select id="counties" class='form-control' name="counties" onchange="findCounties(this.value,'ownship')">
+                        <option value="">---请选择---</option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属乡镇:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="ownship" id="ownship" onchange="findCounties(this.value,'village')">
+                        <option value="">---请选择---</option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属村级:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="village" id="village">
+                        <option value="">---请选择---</option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">经度:</label>
+                <div class="col-sm-8">
+                    <input name="lng" class="form-control" id="lng" type="text" readonly>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">纬度:</label>
+                <div class="col-sm-8">
+                    <input name="lat" class="form-control" id="lat" type="text" readonly>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">地址:</label>
+                <div class="col-sm-8">
+                    <input name="address" class="form-control" id="address" type="text" readonly>
+                </div>
+            </div>
+            <button type="button" id="open">
+                点击显示地图获取地址经纬度
+            </button>
+            <div id='allmap' style='width: 60%; height: 60%; position: absolute; display: none'></div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "camera/camera"
+        $("#form-camera-add").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/add", $('#form-camera-add').serialize());
+            }
+        }
+
+        function findCounties(depeId,selectId) {
+            $.get(prefix + "/findDeptByParentId/"+depeId,{},function (res) {
+                var html = "<option value=\"\">---请选择---</option>";
+                for (var i=0;i<res.data.length;i++){
+                    html+="<option value=\""+res.data[i].deptId+"\">"+res.data[i].deptName+"</option>";
+                }
+                $("#"+selectId).html(html);
+            });
+        }
+    </script>
+    <script type="text/javascript">
+        document.getElementById('open').onclick = function () {
+            if (document.getElementById('allmap').style.display == 'none') {
+                document.getElementById('allmap').style.display = 'block';
+            } else {
+                document.getElementById('allmap').style.display = 'none';
+            }
+        }
+
+        var map = new BMap.Map("allmap");
+        var geoc = new BMap.Geocoder();   //地址解析对象
+        var markersArray = [];
+        var geolocation = new BMap.Geolocation();
+
+
+        var point = new BMap.Point(116.404412, 39.914714);
+        map.centerAndZoom(point, 12); // 中心点
+        geolocation.getCurrentPosition(function (r) {
+            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
+                var mk = new BMap.Marker(r.point);
+                map.addOverlay(mk);
+                map.panTo(r.point);
+                map.enableScrollWheelZoom(true);
+            }
+            else {
+                alert('failed' + this.getStatus());
+            }
+        }, {enableHighAccuracy: true})
+        map.addEventListener("click", showInfo);
+
+
+        //清除标识
+        function clearOverlays() {
+            if (markersArray) {
+                for (i in markersArray) {
+                    map.removeOverlay(markersArray[i])
+                }
+            }
+        }
+        //地图上标注
+        function addMarker(point) {
+            var marker = new BMap.Marker(point);
+            markersArray.push(marker);
+            clearOverlays();
+            map.addOverlay(marker);
+        }
+        //点击地图时间处理
+        function showInfo(e) {
+            document.getElementById('lng').value = e.point.lng;
+            document.getElementById('lat').value =  e.point.lat;
+            geoc.getLocation(e.point, function (rs) {
+                var addComp = rs.addressComponents;
+                var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
+                document.getElementById('allmap').style.display = 'none';
+                document.getElementById('address').value = address;
+            });
+            addMarker(e.point);
+        }
+    </script>
+</body>
+</html>

+ 149 - 0
mybusiness/src/main/resources/templates/camera/camera/camera.html

@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <th:block th:include="include :: header('摄像头列表')" />
+</head>
+<body class="gray-bg">
+     <div class="container-div">
+        <div class="row">
+            <div class="col-sm-12 search-collapse">
+                <form id="formId">
+                    <div class="select-list">
+                        <ul>
+                            <li>
+                                <label>摄像头名称:</label>
+                                <input type="text" name="name"/>
+                            </li>
+                            <li>
+                                <label>摄像头设备编号:</label>
+                                <input type="text" name="channelId"/>
+                            </li>
+                            <li>
+                                <label>所属市级:</label>
+                                <select class='form-control' name="city" onchange="findCounties(this.value,'counties')">
+                                    <option value="">---请选择---</option>
+                                    <option th:each="city : ${citys}" th:value="${city.deptId}" th:text="${city.deptName}"></option>
+                                </select>
+                            </li>
+                            <li>
+                                <label>县区:</label>
+                                <select class='form-control' name="counties" id="counties" onchange="findCounties(this.value,'ownship')">
+                                    <option value="">---请选择---</option>
+                                </select>
+                            </li>
+                            <li>
+                                <label>所属乡镇:</label>
+                                <select class='form-control' name="ownship" id="ownship" onchange="findCounties(this.value,'village')">
+                                    <option value="">---请选择---</option>
+                                </select>
+                            </li>
+                            <li>
+                                <label>所属村级:</label>
+                                <select class='form-control' name="village" id="village">
+                                    <option value="">---请选择---</option>
+                                </select>
+                            </li>
+                            <li>
+                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
+                            </li>
+                        </ul>
+                    </div>
+                </form>
+            </div>
+
+            <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="camera:camera:add">
+                    <i class="fa fa-plus"></i> 添加
+                </a>
+                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="camera:camera:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="camera:camera:remove">
+                    <i class="fa fa-remove"></i> 删除
+                </a>
+                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="camera:camera:export">
+                    <i class="fa fa-download"></i> 导出
+                </a>
+            </div>
+            <div class="col-sm-12 select-table table-striped">
+                <table id="bootstrap-table"></table>
+            </div>
+        </div>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var editFlag = [[${@permission.hasPermi('camera:camera:edit')}]];
+        var removeFlag = [[${@permission.hasPermi('camera:camera:remove')}]];
+        var prefix = ctx + "camera/camera";
+
+        $(function() {
+            var options = {
+                url: prefix + "/list",
+                createUrl: prefix + "/add",
+                updateUrl: prefix + "/edit/{id}",
+                removeUrl: prefix + "/remove",
+                exportUrl: prefix + "/export",
+                modalName: "摄像头",
+                columns: [{
+                    checkbox: true
+                },
+                {
+                    field: 'id',
+                    title: 'null',
+                    visible: false
+                },
+                {
+                    field: 'name',
+                    title: '摄像头名称'
+                },
+                {
+                    field: 'channelId',
+                    title: '摄像头设备编号'
+                },
+                {
+                    field: 'cityName',
+                    title: '所属市级'
+                },
+                {
+                    field: 'countiesName',
+                    title: '县区'
+                },
+                {
+                    field: 'ownshipName',
+                    title: '所属乡镇'
+                },
+                {
+                    field: 'villageName',
+                    title: '所属村级'
+                },
+                {
+                    field: 'remark',
+                    title: '备注'
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    formatter: function(value, row, index) {
+                        var actions = [];
+                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        return actions.join('');
+                    }
+                }]
+            };
+            $.table.init(options);
+        });
+
+        function findCounties(depeId,selectId) {
+            $.get(prefix + "/findDeptByParentId/"+depeId,{},function (res) {
+                var html = "<option value=\"\">---请选择---</option>";
+                for (var i=0;i<res.data.length;i++){
+                    html+="<option value=\""+res.data[i].deptId+"\">"+res.data[i].deptName+"</option>";
+                }
+                $("#"+selectId).html(html);
+            });
+        }
+    </script>
+</body>
+</html>

+ 166 - 0
mybusiness/src/main/resources/templates/camera/camera/edit.html

@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('修改摄像头')" />
+    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=nKLaDv0nFSjlHTSYGiKaOTMnMMwCCEzN"></script>
+</head>
+<body class="white-bg">
+    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
+        <form class="form-horizontal m" id="form-camera-edit" th:object="${camera}">
+            <input name="id" th:field="*{id}" type="hidden">
+            <div class="form-group">
+                <label class="col-sm-3 control-label">摄像头名称:</label>
+                <div class="col-sm-8">
+                    <input name="name" th:field="*{name}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">摄像头设备编号:</label>
+                <div class="col-sm-8">
+                    <input name="channelId" th:field="*{channelId}" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属市级:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="city" onchange="findCounties(this.value,'counties')">
+                        <option value="">---请选择---</option>
+                        <option th:each="city : ${citys}" th:value="${city.deptId}" th:text="${city.deptName}" th:field="*{city}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">县区:</label>
+                <div class="col-sm-8">
+                    <select id="counties" class='form-control' name="counties" onchange="findCounties(this.value,'ownship')">
+                        <option value="">---请选择---</option>
+                        <option th:each="counties : ${countiess}" th:value="${counties.deptId}" th:text="${counties.deptName}" th:field="*{counties}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属乡镇:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="ownship" id="ownship" onchange="findCounties(this.value,'village')">
+                        <option value="">---请选择---</option>
+                        <option th:each="ownship : ${ownships}" th:value="${ownship.deptId}" th:text="${ownship.deptName}" th:field="*{ownship}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">所属村级:</label>
+                <div class="col-sm-8">
+                    <select class='form-control' name="village" id="village">
+                        <option value="">---请选择---</option>
+                        <option th:each="village : ${villages}" th:value="${village.deptId}" th:text="${village.deptName}" th:field="*{village}"></option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">经度:</label>
+                <div class="col-sm-8">
+                    <input name="lng" class="form-control" id="lng" type="text" th:field="*{lng}" readonly>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">纬度:</label>
+                <div class="col-sm-8">
+                    <input name="lat" class="form-control" id="lat" type="text" th:field="*{lat}" readonly>
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">地址:</label>
+                <div class="col-sm-8">
+                    <input name="address" class="form-control" id="address" type="text" th:field="*{address}" readonly>
+                </div>
+            </div>
+            <button type="button" id="open">
+                点击显示地图获取地址经纬度
+            </button>
+            <div id='allmap' style='width: 60%; height: 60%; position: absolute; display: none'></div>
+        </form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <script th:inline="javascript">
+        var prefix = ctx + "camera/camera";
+        $("#form-camera-edit").validate({
+            focusCleanup: true
+        });
+
+        function submitHandler() {
+            if ($.validate.form()) {
+                $.operate.save(prefix + "/edit", $('#form-camera-edit').serialize());
+            }
+        }
+
+        function findCounties(depeId,selectId) {
+            $.get(prefix + "/findDeptByParentId/"+depeId,{},function (res) {
+                var html = "<option value=\"\">---请选择---</option>";
+                for (var i=0;i<res.data.length;i++){
+                    html+="<option value=\""+res.data[i].deptId+"\">"+res.data[i].deptName+"</option>";
+                }
+                $("#"+selectId).html(html);
+            });
+        }
+    </script>
+    <script type="text/javascript">
+        document.getElementById('open').onclick = function () {
+            if (document.getElementById('allmap').style.display == 'none') {
+                document.getElementById('allmap').style.display = 'block';
+            } else {
+                document.getElementById('allmap').style.display = 'none';
+            }
+        }
+
+        var map = new BMap.Map("allmap");
+        var geoc = new BMap.Geocoder();   //地址解析对象
+        var markersArray = [];
+        var geolocation = new BMap.Geolocation();
+
+
+        var point = new BMap.Point(116.404412, 39.914714);
+        map.centerAndZoom(point, 12); // 中心点
+        geolocation.getCurrentPosition(function (r) {
+            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
+                var mk = new BMap.Marker(r.point);
+                map.addOverlay(mk);
+                map.panTo(r.point);
+                map.enableScrollWheelZoom(true);
+            }
+            else {
+                alert('failed' + this.getStatus());
+            }
+        }, {enableHighAccuracy: true})
+        map.addEventListener("click", showInfo);
+
+
+        //清除标识
+        function clearOverlays() {
+            if (markersArray) {
+                for (i in markersArray) {
+                    map.removeOverlay(markersArray[i])
+                }
+            }
+        }
+        //地图上标注
+        function addMarker(point) {
+            var marker = new BMap.Marker(point);
+            markersArray.push(marker);
+            clearOverlays();
+            map.addOverlay(marker);
+        }
+        //点击地图时间处理
+        function showInfo(e) {
+            document.getElementById('lng').value = e.point.lng;
+            document.getElementById('lat').value =  e.point.lat;
+            geoc.getLocation(e.point, function (rs) {
+                var addComp = rs.addressComponents;
+                var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
+                document.getElementById('allmap').style.display = 'none';
+                document.getElementById('address').value = address;
+            });
+            addMarker(e.point);
+        }
+    </script>
+</body>
+</html>

+ 274 - 0
mybusiness/src/main/resources/templates/ksh/dsq.html

@@ -0,0 +1,274 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+    <title>延吉市应急指挥平台</title>
+    <link th:href="@{/yanji/css/yjyj.css}" rel="stylesheet"/>
+    <script th:src="@{/yanji/js/jquery-1.11.0.min.js}" type="text/javascript"></script>
+    <script th:inline="javascript">
+        var ctx = [[@{/}]];
+    </script>
+    <script th:src="@{/yanji/js/jquery.min.js}"></script>
+    <script th:src="@{/yanji/js/bootstrap.min.js}"></script>
+    <script th:src="@{/yanji/js/highlight.js}"></script>
+    <script th:src="@{/yanji/js/bootstrap-switch.js}"></script>
+    <script th:src="@{/yanji/js/main.js}"></script>
+</head>
+<body>
+
+<!-- 头部开始 -->
+<div class="header" >
+    <div class="time"></div>
+    <div class="logo">延吉市应急指挥平台</div>
+    <div class="nav_right clearfix">
+        <a class="ksh" title="可视化" target="_blank" th:href="@{/ksh/goKsh}"><i></i> 可视化</a>
+        <a class="dsq on" title="可视化" target="_blank" th:href="@{/ksh/goDsq}"><i></i> 电视墙</a>
+    </div>
+</div>
+<!-- 头部结束 -->
+
+<!-- 中间内容  开始 -->
+<div class="dsq_con clearfix">
+    <div class="dsq_sp fl" >
+        <!--<img th:src="@{/yanji/images/dsq.png}"/>-->
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo1" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo2" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo3" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo4" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo5" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo6" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo7" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo8" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+        <iframe src="http://localhost:8082/DaHuaVideoDemo20220317/cn/video.html" id="iframeVideo9" style="width: 30%;height: 30%;overflow:hidden;"></iframe>
+    </div>
+    <div class="con_left dsq_right fl">
+        <div class="yjyj_tit">摄像头列表</div>
+        <div class="scroll_ball hei1">
+            <ul class="yjyj_list">
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+                <li>
+                    <i></i>
+                    <a>延吉市摄像头1</a>
+                    <span>经纬度:115.356.23,562.363.11</span>
+                    <span>地址:延吉市延吉村东二头山</span>
+                </li>
+            </ul>
+        </div>
+    </div>
+</div>
+
+<!-- 中间内容  结束 -->
+
+</body>
+
+<script type="text/javascript">
+    var iframeVideo1 = document.getElementById("iframeVideo1");
+    var iframeVideo2 = document.getElementById("iframeVideo2");
+    var iframeVideo3 = document.getElementById("iframeVideo3");
+    var iframeVideo4 = document.getElementById("iframeVideo4");
+    var iframeVideo5 = document.getElementById("iframeVideo5");
+    var iframeVideo6 = document.getElementById("iframeVideo6");
+    var iframeVideo7 = document.getElementById("iframeVideo7");
+    var iframeVideo8 = document.getElementById("iframeVideo8");
+    var iframeVideo9 = document.getElementById("iframeVideo9");
+    function sendMessage() {
+        var FormObj1 = iframeVideo1.contentWindow;
+        FormObj1.postMessage({
+            left: 20,
+            top: 98,
+            key: true,
+            ip: "111.26.169.125",
+            port: "8015",
+            account: "admin",
+            password: "admin123"
+        },'*');
+        setTimeout(function(){
+            var FormObj2 = iframeVideo2.contentWindow;
+            FormObj2.postMessage({
+                left: 520,
+                top: 98,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 3000);
+        setTimeout(function(){
+            var FormObj3 = iframeVideo3.contentWindow;
+            FormObj3.postMessage({
+                left: 1020,
+                top: 98,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 6000);
+        setTimeout(function(){
+            var FormObj4 = iframeVideo4.contentWindow;
+            FormObj4.postMessage({
+                left: 20,
+                top: 338,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 9000);
+
+        setTimeout(function(){
+            var FormObj5 = iframeVideo5.contentWindow;
+            FormObj5.postMessage({
+                left: 520,
+                top: 338,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 12000);
+
+        setTimeout(function(){
+            var FormObj6 = iframeVideo6.contentWindow;
+            FormObj6.postMessage({
+                left: 1020,
+                top: 338,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 15000);
+
+        setTimeout(function(){
+            var FormObj7 = iframeVideo7.contentWindow;
+            FormObj7.postMessage({
+                left: 20,
+                top: 578,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 18000);
+
+        setTimeout(function(){
+            var FormObj8 = iframeVideo8.contentWindow;
+            FormObj8.postMessage({
+                left: 520,
+                top: 578,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 22000);
+
+        setTimeout(function(){
+            var FormObj9 = iframeVideo9.contentWindow;
+            FormObj9.postMessage({
+                left: 1020,
+                top: 578,
+                key: true,
+                ip: "111.26.169.125",
+                port: "8015",
+                account: "admin",
+                password: "admin123"
+            },'*');
+        }, 25000);
+
+    }
+</script>
+<script type="text/javascript">
+    // 时间
+    myformatter(new Date());
+    function myformatter(date){
+        var y = date.getFullYear();
+        var m = date.getMonth()+1;
+        var d = date.getDate();
+        var h = date.getHours();
+        var min = date.getMinutes();
+        var s = date.getSeconds();
+        var str=y+'/'+(m<10?('0'+m):m)+'/'+(d<10?('0'+d):d)+'/  '+(h<10?('0'+h):h)+':'+(min<10?('0'+min):min)+':'+(s<10?('0'+s):s);
+        jQuery(".time").html(str);
+        setTimeout("myformatter(new Date());", 1000);
+        return str;
+    }
+
+    $(function(){
+        setTimeout("sendMessage()", 1000);
+        // 地图点 显示隐藏
+        $(".map_ld1").hover(function(){
+            $(this).children(".xs_div").show();
+        },function(){
+            $(this).children(".xs_div").hide();
+        });
+        $(".map_ld3").hover(function(){
+            $(this).children(".xs_div").show();
+        },function(){
+            $(this).children(".xs_div").hide();
+        });
+
+
+
+    })
+
+
+</script>
+
+</html>

+ 475 - 0
mybusiness/src/main/resources/templates/ksh/ksh.html

@@ -0,0 +1,475 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+    <title>延吉市应急指挥平台</title>
+    <link th:href="@{/yanji/css/yjyj.css}" rel="stylesheet"/>
+    <script th:src="@{/yanji/js/jquery-1.11.0.min.js}" type="text/javascript"></script>
+    <!--<script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=PlhFWpA02aoURjAOpnWcRGqw7AI8EEyO"></script>-->
+    <script th:inline="javascript">
+        var ctx = [[@{/}]];
+        var cameraList = [[${cameraList}]];
+    </script>
+    <script type="text/javascript"
+            src="http://api.map.baidu.com/api?type=webgl&v=1.0&ak=nKLaDv0nFSjlHTSYGiKaOTMnMMwCCEzN"></script>
+</head>
+<style>
+    body, html,#allmap {
+        width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";
+    }
+    /*地图标题*/
+    .BMap_bubble_title {
+        color:#fff;
+        font-size:14px;
+        font-weight:bold;
+        text-align:left;
+        padding-left:5px;
+        padding-top:5px;
+        /* border-bottom:1px solid gray; */
+        background-color:rgba(1,1,33,0.88);
+    }
+    /* 消息内容 */
+    .BMap_bubble_content {
+        background-color:rgba(1,1,33,0.88);
+        padding-left:5px;
+        padding-top:5px;
+        padding-bottom:10px;
+        text-align:center;
+    }
+    /* 内容 */
+    .BMap_pop div:nth-child(9) {
+        top:35px !important;
+        border-radius:7px;
+    }
+    /* 左上角删除按键 */
+    .BMap_pop img {
+        top:43px !important;
+        left:215px !important;
+    }
+    .BMap_bubble_content p{
+        color:#fff;
+        font-size:14px;
+        line-height: 28px;
+    }
+    .BMap_top {
+        display:none;
+    }
+    .BMap_bottom {
+        display:none;
+    }
+    .BMap_center {
+        display:none;
+    }
+    /* 隐藏边角 */
+    .BMap_pop div:nth-child(1) div {
+        display:none;
+    }
+    .BMap_pop div:nth-child(3) {
+        display:none;
+    }
+    .BMap_pop div:nth-child(5) {
+        display:none;
+    }
+    .BMap_pop div:nth-child(7) {
+        display:none;
+    }
+    .BMap_pop div:nth-child(8) {
+        display:none;
+    }
+    .anchorBL{
+        display: none;
+    }
+    .map{
+        width: 100%;
+        height: 94%;
+        position: fixed;
+        z-index: 0;
+    }
+</style>
+<body>
+
+<!-- 头部开始 -->
+<div class="header" >
+    <div class="time"></div>
+    <div class="logo">延吉市应急指挥平台</div>
+    <div class="nav_right clearfix">
+        <a class="ksh on" title="可视化" target="_blank" th:href="@{/ksh/goKsh}"><i></i> 可视化</a>
+        <a class="dsq" title="可视化" target="_blank" th:href="@{/ksh/goDsq}"><i></i> 电视墙</a>
+    </div>
+</div>
+<!-- 头部结束 -->
+
+<!-- 中间内容  开始 -->
+<div class="map" id="allmap"></div>
+
+<!-- 左侧开始 -->
+<div class="con_left">
+    <div class="yjyj_tit">摄像头列表</div>
+    <div class="scroll_ball hei1">
+        <ul class="yjyj_list">
+            <li th:each="camera : ${cameraList}">
+                <i></i>
+                <a th:text="${camera.name}"></a>
+                <span th:text=" ${'经纬度:'+camera.lng+'——'+camera.lat}"></span>
+                <span th:text="${'地址:'+camera.address}"></span>
+            </li>
+        </ul>
+    </div>
+</div>
+<!-- 左侧结束 -->
+<!-- 右侧 开始 -->
+<div class="con_right">
+    <div class="yjyj_btn">
+        <div class="yjyj_bjzs yjyj_div">
+            <img th:src="@{/yanji/images/yjyj_bjzs.png}"/>
+            <span>报警总数</span>
+            <i>56</i>
+        </div>
+        <div class="yjyj_ycl yjyj_div">
+            <img th:src="@{/yanji/images/yjyj_ycl.png}"/>
+            <span>已处理</span>
+            <i>56</i>
+        </div>
+        <div class="yjyj_clz yjyj_div">
+            <img th:src="@{/yanji/images/yjyj_clz.png}"/>
+            <span>处理中</span>
+            <i>56</i>
+        </div>
+    </div>
+    <div class="yjyj_jjsj clearfix">
+        <div class="txt_div fl">紧急事件</div>
+        <div class="txt_div2 fl">
+            <h4>延吉市XXXX地火灾预警</h4>
+            <p>摄像头:延吉市摄像头</p>
+            <p>上报人:王东海</p>
+            <p>上报时间:07-20 10:19:22</p>
+            <p>地址:延吉市延吉村二头村</p>
+        </div>
+    </div>
+    <input type="button" class="spdd" value="视频调度">
+    <div class="scroll_ball hei2">
+        <ul class="yjyj_list">
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+            <li>
+                <i></i>
+                <a>延吉市XXXX火灾预警</a>
+                <span>摄像头:延吉市摄像头1</span>
+                <span>地址:延吉市延吉村东二头山</span>
+            </li>
+        </ul>
+    </div>
+</div>
+
+<!-- 头部开始 -->
+<div class="tk_div" id="tk_div" style="display: none;">
+    <h1 class="tk_tit">&gt;&nbsp;延吉市延吉摄像头</h1>
+    <div class="tk_con clearfix">
+        <!-- 左侧 开始 -->
+        <div class="tk_left fl">
+            <div class="tk_txt">
+                <ul>
+                    <li>
+                        <h2>延吉市延吉村某地火情预警</h2>
+                        <p>上报时间:2022年07月20日 14:14:52</p>
+                        <p>事件详情:延吉市延吉村某某某地发现有火警预
+                            报,刘海东及时发现火情并及时上报,现已有救
+                            援队伍赶往火灾现场。</p>
+                    </li>
+                    <li>
+                        <h2>延吉市延吉村某地火情预警</h2>
+                        <p>上报时间:2022年07月20日 14:14:52</p>
+                        <p>事件详情:延吉市延吉村某某某地发现有火警预
+                            报,刘海东及时发现火情并及时上报,现已有救
+                            援队伍赶往火灾现场。</p>
+                    </li>
+                </ul>
+
+            </div>
+            <dl class="tk_dl">
+                <dt>
+                    <span>事件名称</span>
+                    <span>上报时间</span>
+                    <span>事件类型</span>
+                </dt>
+            </dl>
+            <div class="maquee">
+                <ul>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                    <li><a>
+                        <div>延吉市延吉村火灾预警</div>
+                        <div>07-20 14:10:33</div>
+                        <div>火情事件</div></a>
+                    </li>
+                </ul>
+            </div>
+        </div>
+        <!-- 左侧 结束 -->
+        <!-- 右侧 开始 -->
+        <div class="tk_right fl">
+            <div class="sp_div">
+                <iframe src="http://localhost:9090/dahua/cn/video.html" id="iframeVideo" style="width: 120%;height: 100%;overflow:hidden;"></iframe>
+            </div>
+        </div>
+        <!-- 右侧 结束 -->
+        <!-- 底部 横条按钮 开始 -->
+        <div class="tk_hbtn">
+            <input type="button" value="确定" class="btn_qd fr">
+            <input type="button" value="取消" class="btn_qx fr">
+        </div>
+        <!-- 底部 横条按钮 结束 -->
+
+    </div>
+</div>
+
+
+
+</div>
+<!-- 右侧 结束  -->
+
+<!-- 中间内容  结束 -->
+
+</body>
+
+<script type="text/javascript">
+    var map = new BMapGL.Map('allmap');
+    map.centerAndZoom(new BMapGL.Point(129.514529,42.897749), 12);
+    map.enableScrollWheelZoom(true);
+    //地球模式
+    map.setMapType(BMAP_EARTH_MAP);
+
+    var icon0 = ctx + "yanji/images/yjyj_yjwz.png";
+    var icon1 = ctx + "yanji/images/yjyj_sxt1.png";
+    var icon2 = ctx + "yanji/images/yjyj_sxt2.png";
+
+    for (var i = 0; i < cameraList.length; i++) {
+        var icon;
+        if (i==0) {
+            icon = new BMapGL.Icon(icon0, new BMapGL.Size(50, 55));
+        } else if (i==1) {
+            icon = new BMapGL.Icon(icon1, new BMapGL.Size(50, 55));
+        } else if (i==2) {
+            icon = new BMapGL.Icon(icon2, new BMapGL.Size(50, 55));
+        } else {
+            icon = new BMapGL.Icon(icon0, new BMapGL.Size(50, 55));
+        }
+
+        var P = new BMapGL.Point(cameraList[i].lng, cameraList[i].lat);
+        var MP = new BMapGL.Marker(P, {icon: icon});
+        map.addOverlay(MP);
+        var sContent =
+            "<span><b>名称:</b><u>"+cameraList[i].name+"</u></span><br>\n" +
+            "<span><b>编号:</b><u>"+cameraList[i].name+"</u></span><br>\n" +
+            "<span><b>地址:</b><u>"+cameraList[i].address+"</u></span>";
+
+        addClickHandler(sContent, MP);
+    }
+
+    function addClickHandler(content, marker) {
+        // 创建信息窗口属性
+        var infoWindow = new BMapGL.InfoWindow(content);
+        marker.addEventListener('click', function () {
+            sendMessage();
+        });
+        // marker添加鼠标悬停事件
+        marker.addEventListener('mouseover', function () {
+            this.openInfoWindow(infoWindow);
+        });
+        // marker添加鼠标移除事件
+        marker.addEventListener('mouseout', function () {
+            this.closeInfoWindow();
+        });
+    }
+
+    var iframeVideo = document.getElementById("iframeVideo");
+    function sendMessage() {
+        $("#tk_div").show();
+        var FormObj = iframeVideo.contentWindow;
+        FormObj.postMessage({
+            left: 570,
+            top: 180,
+            key: true,
+            ip: "111.26.169.125",
+            port: "8015",
+            account: "admin",
+            password: "admin123"
+        }, '*');
+    }
+
+</script>
+<script type="text/javascript">
+    // 时间
+    myformatter(new Date());
+    function myformatter(date){
+        var y = date.getFullYear();
+        var m = date.getMonth()+1;
+        var d = date.getDate();
+        var h = date.getHours();
+        var min = date.getMinutes();
+        var s = date.getSeconds();
+        var str=y+'/'+(m<10?('0'+m):m)+'/'+(d<10?('0'+d):d)+'/  '+(h<10?('0'+h):h)+':'+(min<10?('0'+min):min)+':'+(s<10?('0'+s):s);
+        jQuery(".time").html(str);
+        setTimeout("myformatter(new Date());", 1000);
+        return str;
+    }
+
+    $(function(){
+        // 地图点 显示隐藏
+        $(".map_ld1").hover(function(){
+            $(this).children(".xs_div").show();
+        },function(){
+            $(this).children(".xs_div").hide();
+        });
+        $(".map_ld3").hover(function(){
+            $(this).children(".xs_div").show();
+        },function(){
+            $(this).children(".xs_div").hide();
+        });
+
+        $(".fr").on('click', function () {
+            $("#tk_div").hide();
+            $("#iframeVideo").attr('src','http://localhost:9090/dahua/cn/video.html');
+        })
+        setInterval('autoScroll(".maquee")',3000);
+        setInterval('autoScroll2(".tk_txt")',5000);
+    })
+    //文字向上
+    function autoScroll(obj){
+        $(obj).find("ul").animate({
+            marginTop : "-31px"
+        },500,function(){
+            $(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
+        })
+    }
+    function autoScroll2(obj){
+        $(obj).find("ul").animate({
+            marginTop : "-113px"
+        },500,function(){
+            $(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
+        })
+    }
+
+</script>
+
+</html>