zhuoning 3 lat temu
rodzic
commit
fd315be997
100 zmienionych plików z 7180 dodań i 0 usunięć
  1. 93 0
      huimv-farm-datacenter-egg/huimv-farm-video/pom.xml
  2. 26 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/HuimvVideoApplication.java
  3. 62 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/SysTelecomController.java
  4. 229 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/SysTelecomEventController.java
  5. 103 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/VideoRecorController.java
  6. 147 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllEventController.java
  7. 155 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllVideoPlayBack.java
  8. 367 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientCarManageController.java
  9. 157 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientDoorController.java
  10. 114 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientMaiZhuController.java
  11. 300 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientPersonManageController.java
  12. 114 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientWeiQiangController.java
  13. 68 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientXixiaoController.java
  14. 118 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientXunZhengController.java
  15. 109 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/GetPicture.java
  16. 26 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/GetToken.java
  17. 135 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/FaceAIController/AiFaceController.java
  18. 77 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenAlarmCountByDay.java
  19. 133 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenCarController.java
  20. 78 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenIndexDataController.java
  21. 153 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenPersonController.java
  22. 196 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenSiZhuController.java
  23. 34 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseTelecomRoom.java
  24. 47 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseWarningInfoEntity.java
  25. 35 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccChannel.java
  26. 100 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccEventRecord.java
  27. 45 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecom.java
  28. 38 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecomEvent.java
  29. 102 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysThreshold.java
  30. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomDto.java
  31. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomVo.java
  32. 88 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java
  33. 21 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccDemo.java
  34. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccUtil.java
  35. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseTelecomRoomMapper.java
  36. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseWarningInfoRepo.java
  37. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccChannelMapper.java
  38. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccEventRecordMapper.java
  39. 10 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomEventMapper.java
  40. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomMapper.java
  41. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysThresholdMapper.java
  42. 54 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/R.java
  43. 48 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRException.java
  44. 117 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRExceptionHandler.java
  45. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseTelecomRoomService.java
  46. 5 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseWarningInfoService.java
  47. 11 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IClientAllEventService.java
  48. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccChannelService.java
  49. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccEventRecordService.java
  50. 13 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomEventService.java
  51. 20 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomService.java
  52. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysThresholdService.java
  53. 20 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseTelecomRoomServiceImpl.java
  54. 40 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseWarningInfoServiceImpl.java
  55. 463 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java
  56. 21 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccChannelServiceImpl.java
  57. 21 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccEventRecordServiceImpl.java
  58. 26 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomEventServiceImpl.java
  59. 33 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomServiceImpl.java
  60. 20 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysThresholdServiceImpl.java
  61. 220 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/GetRecordFromIcc.java
  62. 160 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/SysTelcomEnentTimmer.java
  63. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetPastTime.java
  64. 385 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetResponse.java
  65. 385 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/HttpClient.java
  66. 104 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ImageByteUtil.java
  67. 95 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ImageUploadUtils.java
  68. 68 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/Result.java
  69. 41 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ResultCode.java
  70. 25 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/config/MybatisPlusConfig.java
  71. 63 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/BaseFaceController.java
  72. 68 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/BaseSpecificVideoController.java
  73. 102 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraAreaController.java
  74. 77 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraBrandController.java
  75. 116 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraController.java
  76. 38 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseFace.java
  77. 34 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseRoom.java
  78. 35 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseScreenCameraAccount.java
  79. 38 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseSpecificVideo.java
  80. 94 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/Camera.java
  81. 40 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/CameraArea.java
  82. 53 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/CameraBrand.java
  83. 36 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/PublicNetwork.java
  84. 15 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraListVo.java
  85. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraListsVo.java
  86. 22 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraVo.java
  87. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseFaceMapper.java
  88. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseRoomMapper.java
  89. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseScreenCameraAccountMapper.java
  90. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseSpecificVideoMapper.java
  91. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraAreaMapper.java
  92. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraBrandMapper.java
  93. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraMapper.java
  94. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/PublicNetworkMapper.java
  95. 0 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/readme
  96. 16 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseFaceService.java
  97. 18 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseRoomService.java
  98. 17 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseScreenCameraAccountService.java
  99. 19 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseSpecificVideoService.java
  100. 0 0
      huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/ICameraAreaService.java

+ 93 - 0
huimv-farm-datacenter-egg/huimv-farm-video/pom.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+	<parent>
+		<artifactId>huimv-farm-datacenter</artifactId>
+		<groupId>com.huimv</groupId>
+		<version>0.0.1-SNAPSHOT</version>
+	</parent>
+    <modelVersion>4.0.0</modelVersion>
+<!--	<groupId>com.huimv</groupId>-->
+	<artifactId>huimv-farm-video</artifactId>
+<!--	<version>0.0.1-SNAPSHOT</version>-->
+<!--	<name>demo</name>-->
+	<description>Demo project for Spring Boot</description>
+	<properties>
+		<java.version>8</java.version>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.dahuatech.icc</groupId>
+			<artifactId>java-sdk-common</artifactId>
+			<version>1.0.8</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.dahuatech.icc</groupId>
+			<artifactId>java-sdk-oauth</artifactId>
+			<version>1.0.8</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.huimv</groupId>
+			<artifactId>huimv-common</artifactId>
+			<version>0.0.1-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-httpclient</groupId>
+			<artifactId>commons-httpclient</artifactId>
+			<version>3.1</version>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpcore</artifactId>
+			<version>4.4.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpmime</artifactId>
+			<version>4.5.12</version>
+		</dependency>
+
+		<dependency>
+			<groupId>commons-io</groupId>
+			<artifactId>commons-io</artifactId>
+			<version>2.8.0</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-lang3</artifactId>
+			<version>3.7</version>
+		</dependency>
+		<!-- huimv.com -->
+		<dependency>
+			<groupId>com.huimv</groupId>
+			<artifactId>huimv-common</artifactId>
+			<version>0.0.1</version>
+		</dependency>
+		<!-- JPA -->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-data-jpa</artifactId>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<configuration>
+					<includeSystemScope>true</includeSystemScope>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

+ 26 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/HuimvVideoApplication.java

@@ -0,0 +1,26 @@
+package com.huimv.video;
+
+import com.huimv.common.config.InterceptorConfig;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Import;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@EnableScheduling
+@SpringBootApplication
+@MapperScan("com.huimv.video.*.mapper")
+@Import(InterceptorConfig.class)
+public class HuimvVideoApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(HuimvVideoApplication.class, args);
+    }
+}

+ 62 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/SysTelecomController.java

@@ -0,0 +1,62 @@
+package com.huimv.video.dhicc.controller.BaseController;
+
+
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.entity.TelecomDto;
+import com.huimv.video.dhicc.service.ISysTelecomService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.DecimalFormat;
+import java.util.Map;
+
+/**
+ * <p>
+ * 前端控制器   牧场文件不同  配置文件不同 麻烦啊  不能通过简单配置来处理
+ * 理论上来说可以通过复写多个tokenSingle来实现文件的选择
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@RestController
+@RequestMapping("/device")
+public class SysTelecomController {
+    @Autowired
+    private ISysTelecomService telecomService;
+
+    @PostMapping("/deviceResponse")
+    public String deviceResponse(@RequestBody TelecomDto telecomDto) {
+        Map<String, Integer> payload = telecomDto.getPayload();
+
+        SysTelecom telecom = new SysTelecom();
+        telecom.setDeviceId(telecomDto.getDeviceId());
+        telecom.setFarmId(1);
+        telecom.setTimestamp(telecomDto.getTimestamp());
+        Integer rssi = payload.get("RSSI");
+        Integer STC = payload.get("STC");
+        Integer HUMI = payload.get("HUMI");
+        Integer TEMP = payload.get("TEMP");
+        telecom.setRssi(rssi);
+        telecom.setStc(STC);
+
+        telecom.setHumi(HUMI);
+        DecimalFormat df = new DecimalFormat("0.0");
+        telecom.setTemp(df.format(TEMP * 0.1));
+
+        telecomService.save(telecom);
+        return "200";
+    }
+
+
+    @PostMapping("/listByRoom")
+    public Result listByRoom(@RequestBody Map map) {
+        return telecomService.listByRoom(map);
+    }
+
+
+}

+ 229 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/SysTelecomEventController.java

@@ -0,0 +1,229 @@
+package com.huimv.video.dhicc.controller.BaseController;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.entity.TelecomVo;
+import com.huimv.video.dhicc.mapper.BaseTelecomRoomMapper;
+import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/telecom")
+public class SysTelecomEventController {
+
+    @Autowired
+    private BaseTelecomRoomMapper baseTelecomRoomMapper;
+
+    @Autowired
+    private SysTelecomMapper sysTelecomMapper;
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+
+    //传入机器编码  返回这个机器下的所有事件 带分页
+    @GetMapping("/listevent")
+    public Result list(@RequestParam(name = "deviceId", required = false) String deviceId,
+                       @RequestParam(name = "startTimeString", required = false) String startTimeString,
+                       @RequestParam(name = "endTimeString", required = false) String endTimeString,
+                       @RequestParam(name = "current", required = false) Integer current,//当前页
+                       @RequestParam(name = "size", required = false) Long size,
+                       @RequestParam(name = "farmId") Integer farmId  //分页大小
+
+    ) throws ParseException {
+        //如果传入的开始时间是默认的今天的 就返回最近三天的 --前端说改起来比较麻烦
+        if (farmId != 1) {
+            return new Result(10000, "当前牧场无设备", true);
+        }
+
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date startTime = fmt.parse(startTimeString);
+        Date endTime = fmt.parse(endTimeString);
+        QueryWrapper<SysTelecomEvent> wrapper = new QueryWrapper<>();
+        wrapper.eq("farm_id", farmId);
+        if (StringUtilsWork.isNotBlank(deviceId)) {
+            wrapper.eq("device_id", deviceId);
+        }
+        wrapper.between("event_time", startTime, endTime);
+        wrapper.orderByDesc("event_time");
+        Page<SysTelecomEvent> page = sysTelecomEventService.page(new Page<>(current, size), wrapper);
+        //本要写SQL 现在没时间  这样处理一下问题不大
+        List<SysTelecomEvent> records = page.getRecords();
+        List<TelecomVo> TelecomVoRecords = new ArrayList<>();
+        Page<TelecomVo> page1 = new Page<>(current, size);
+        page1.setTotal(page.getTotal());
+        for (SysTelecomEvent record : records) {
+            TelecomVo telecomVo = new TelecomVo();
+            telecomVo.setDeviceId(record.getDeviceId());
+            telecomVo.setEventTime(record.getEventTime());
+            //效率很低  暂且这样
+            LambdaQueryWrapper<BaseTelecomRoom> wrapper3 = Wrappers.lambdaQuery();
+            wrapper3.eq(BaseTelecomRoom::getDeviceId, record.getDeviceId());
+            BaseTelecomRoom baseTelecomRoom = baseTelecomRoomMapper.selectOne(wrapper3);
+            //位置
+            telecomVo.setLocation(baseTelecomRoom.getDeviceRoom());
+            telecomVo.setChekOk(record.getRemark());
+            TelecomVoRecords.add(telecomVo);
+        }
+        return new Result(ResultCode.SUCCESS, page1.setRecords(TelecomVoRecords));
+    }
+    //判断时间   有传时间返回时间范围  没有时间
+
+    @GetMapping("/listeventdetail")
+    public Result listeventdetail(@RequestParam(name = "deviceId", required = false) String deviceId,
+                                  @RequestParam(name = "farmId") Integer farmId,  //分页大小
+                                  @RequestParam(name = "eventTimeString", required = false) String eventTimeString
+    ) throws ParseException {
+        if (farmId != 1) {
+            return new Result(10000, "当前牧场无设备", true);
+        }
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Date eventTime = fmt.parse(eventTimeString);
+        Calendar c1 = Calendar.getInstance();
+        c1.setTime(eventTime);
+        c1.add(Calendar.MINUTE, -60);
+        Date began = c1.getTime();
+        String startTime = format.format(began);
+        c1.add(Calendar.MINUTE, +150);
+        Date endTime11 = c1.getTime();
+        String endTime = format.format(endTime11);
+        //这儿就直接拿温度了----还是不行的  温度和时间都是需要的
+        Map map1 = new HashMap();
+        List<String> timeList = new ArrayList<>();
+        List<String> tempList = new ArrayList<>();
+        LambdaQueryWrapper<SysTelecom> lambdaQueryWrapper =
+                new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(SysTelecom::getDeviceId, deviceId).between(SysTelecom::getTimestamp, startTime, endTime);
+        List<SysTelecom> sysTelecoms = sysTelecomMapper.selectList(lambdaQueryWrapper);
+        for (SysTelecom sysTelecom : sysTelecoms) {
+            timeList.add(fmt.format(sysTelecom.getTimestamp()));
+            tempList.add(sysTelecom.getTemp());
+        }
+        map1.put("timeList", timeList);
+        map1.put("tempList", tempList);
+        return new Result(ResultCode.SUCCESS, map1);
+    }
+
+    //过去几个小时的车辆烘干次数的----后面可以做成定时任务存表  防止断网就没数据
+    @GetMapping("/listeventByHoure")
+    public Result listeventByHoure(@RequestParam(name = "farmId") Integer farmId) throws ParseException {
+        if (farmId != 1) {
+            return new Result(10000, "当前牧场无设备", true);
+        }
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.DATE, -1);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.DATE, -1);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.DATE, -1);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.DATE, -1);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.DATE, -1);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.DATE, -1);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+
+        Map map1 = new HashMap();
+        map1.put("time", splitTime(B));
+        map1.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatB, formatA)));
+
+        Map map2 = new HashMap();
+        map2.put("time", splitTime(C));
+        map2.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatC, formatB)));
+
+        Map map3 = new HashMap();
+        map3.put("time", splitTime(D));
+        map3.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatD, formatC)));
+
+        Map map4 = new HashMap();
+        map4.put("time", splitTime(E));
+        map4.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatE, formatD)));
+
+
+        Map map5 = new HashMap();
+        map5.put("time", splitTime(F));
+        map5.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatF, formatE)));
+
+
+        Map map6 = new HashMap();
+        map6.put("time", splitTime(G));
+        map6.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatG, formatF)));
+
+        Map map7 = new HashMap();
+        map7.put("time", splitTime(H));
+        map7.put("value", sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                .between(SysTelecomEvent::getEventTime, formatH, formatG)));
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return new Result(ResultCode.SUCCESS, result);
+    }
+
+    public String splitTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        String date1 = calendar.get(Calendar.MONTH) + 1 + "/" + calendar.get(Calendar.DATE);
+        return date1;
+    }
+
+}

+ 103 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/BaseController/VideoRecorController.java

@@ -0,0 +1,103 @@
+package com.huimv.video.dhicc.controller.BaseController;
+
+//拿视频回放
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.video.dhicc.entity.IccChannel;
+import com.huimv.video.dhicc.mapper.IccChannelMapper;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IIccChannelService;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+//方便前端操作   传入的是  事件时间  还有通道编号就可以播放了
+@RestController
+@RequestMapping("/video")
+
+public class VideoRecorController {
+
+    @Autowired
+    private IIccChannelService iIccChannelService;
+
+    @Autowired
+    private IccChannelMapper iccChannelMapper;
+
+    @RequestMapping("/getVideoRecord")
+    public R getVideoRecord(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        String happendTime = (String) params1.get("happendTime");
+        String channelNmae = (String) params1.get("channelName");
+        Integer farmId = (int) params1.get("farmId");
+
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("URL", null);
+        }
+
+        LambdaQueryWrapper<IccChannel> wrapper3 = Wrappers.lambdaQuery();
+        wrapper3.eq(IccChannel::getChannelName, channelNmae);
+        IccChannel iccChannel = iccChannelMapper.selectOne(wrapper3);
+        System.out.println(iccChannel);
+        String URL = "/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        Map<String, Object> params = new HashMap<>();
+        Map<String, Object> value = new HashMap<>();
+        value.put("nvrId", "");
+        value.put("optional", "/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime");
+        value.put("recordType", "1");
+        value.put("streamType", "1");
+        value.put("recordSource", "2");
+        value.put("channelId", iccChannel.getChannelId());
+        System.out.println(iccChannel.toString());
+        //开始结束时间代为处理
+        DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        //格式化传入的时间---拿传入时间前后五分钟的视频
+        Date Time = fmt.parse(happendTime);   //事件时间
+        Date GapTimeBefor_gap = new Date(Time.getTime() - 1000 * 10);//star   事件十秒之前
+        Date GapAfter = new Date(Time.getTime() + 1000 * 60 * 5);// end   事件五分钟之后
+        String befor = String.valueOf(GapTimeBefor_gap.getTime() / 1000);
+        String after = String.valueOf(GapAfter.getTime() / 1000);
+        value.put("endTime", after);
+        value.put("startTime", befor);
+        params.put("clientMac", "30:9c:23:79:40:08");
+        params.put("clientPushId", "");
+        params.put("project", "PSDK");
+        params.put("method", "SS.Playback.StartPlaybackByTime");
+        params.put("data", value);
+        generalRequest.body(JSON.toJSONString(params));
+        System.out.println(JSON.toJSONString(params));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        System.out.println(jsonObject.toString());
+        Object data = jsonObject.get("data");
+        String url = (String) JSONObject.fromObject(data).get("url");
+        String token = (String) JSONObject.fromObject(data).get("token");
+        // "|"  特殊字符需要加转义字符
+        String[] sourceStrArray = url.split("\\|");
+        String recordUrl = sourceStrArray[1] + "?token=" + token + "&trackID=701";
+        return R.ok("请求成功").put("URL", recordUrl);
+    }
+
+
+}

+ 147 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllEventController.java

@@ -0,0 +1,147 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IClientAllEventService;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+@RestController
+@RequestMapping("/client/event")
+public class ClientAllEventController {
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+    @Autowired
+    private IClientAllEventService iClientAllEventService;
+
+    //所有的事件接口
+    @RequestMapping("/ListAllEvent")
+    public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+        return R.ok("请求成功").put("data", getEventList(params1)).put("total", CountTimes(params1));
+    }
+
+
+    //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数
+    public GeneralResponse getEventList(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.AllChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.AllChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+        return jsonObject.get("value").toString();
+    }
+
+    /**
+     * @Method : getEventBySort
+     * @Description : 分类查看事件
+     * @Params : [farmId, sort, startDateText, endDateText, pageNum, pageSize, request]
+     * @Return : com.huimv.video.dhicc.result.R
+     * @Author : ZhuoNing
+     * @Date : 2021/12/24
+     * @Time : 13:34
+     */
+    @RequestMapping(value = "/listEventBySort", method = RequestMethod.GET)
+    public R getEventBySort(@RequestParam(value = "farmId", required = true) Integer farmId, @RequestParam(value = "sort", required = true) Integer sort,
+                            @RequestParam(value = "alarmStartDateString", required = true) String startDateText, @RequestParam(value = "alarmEndDateString", required = true) String endDateText,
+                            @RequestParam(value = "pageNum", required = true) Integer pageNum, @RequestParam(value = "pageSize", required = true) Integer pageSize, HttpServletRequest request) throws ClientException {
+        //牧场id
+        if (farmId != 1) {
+            return R.ok("当前牧场无数据。").put("data", null);
+        }
+        //事件分类
+        if (sort == null) {
+            return R.ok("请选择事件分类。").put("data", null);
+        }
+        //
+        return iClientAllEventService.getEventBySort(farmId, sort, startDateText, endDateText, pageNum, pageSize, request);
+    }
+
+
+}
+

Plik diff jest za duży
+ 155 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientAllVideoPlayBack.java


+ 367 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientCarManageController.java

@@ -0,0 +1,367 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+
+@RestController
+@RequestMapping("car")
+public class ClientCarManageController {
+
+    //列表车辆
+    @RequestMapping("/geCarList")
+    public GeneralResponse geCarList(@RequestParam(name = "farmId") Integer farmId,
+                                     @RequestParam(name = "pageNum") Integer pageNum,
+                                     @RequestParam(name = "pageSize") Integer pageSize
+    ) throws ClientException {
+        if (farmId != 1) {
+            //返回为空数据
+            return null;
+        }
+        Long aLong = Long.valueOf(String.valueOf((new Date()).getTime()));
+
+        String URL = "/evo-apigw/ipms/car/list?";  // 人员列表的接口
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        GeneralRequest generalRequest = new GeneralRequest(URL + "pageNum=" + pageNum + "&pageSize=" + pageSize + "&_=" + aLong, Method.GET);
+        generalRequest.header("Content-Type", " application/json");
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+    //添加基础车辆
+    @RequestMapping("/addCarBase")
+    public GeneralResponse addCarBase(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId,
+                                      // @RequestParam(name = "carCode") String carCode,//车辆编号
+                                      @RequestParam(name = "carNum") String carNum //车牌号
+    ) throws ClientException {
+        if (farmId != 1) {
+            return null;
+        }
+
+        String URL = "/evo-apigw/ipms/car/add";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        Map<String, Object> value = new HashMap<>();
+        value.put("carCode", (int) ((Math.random() * 9 + 1) * 10000));
+        value.put("carNum", carNum);
+        value.put("carNumColor", 0);
+        value.put("carType", 1);
+        value.put("carBrand", -1);
+        value.put("carColor", 0);
+        value.put("listType", 0);
+        value.put("parkType", 1);
+        value.put("owner", null);
+        value.put("ownerId", null);
+        value.put("parkinglot", null);
+        value.put("memo", null);
+        value.put("deptName", "技术部门");
+        value.put("deptId", "2");
+        value.put("parkinglotCode", "1");
+        value.put("noAllowEditParkingLot", new ArrayList<>());
+        List<Map> a = new ArrayList<>();
+        Map<String, Object> value1 = new HashMap<>();
+        value1.put("code", "0");
+        value1.put("name", "未使用");
+        Map<String, Object> value2 = new HashMap<>();
+        value2.put("code", "1");
+        value2.put("name", "使用");
+        a.add(value1);
+        a.add(value2);
+        value.put("carStatusList", a);
+        generalRequest.body(JSON.toJSONString(value));
+        System.out.println(JSON.toJSONString(value));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //删除基础车辆
+    @RequestMapping("/deleteFromCarBase")
+    public GeneralResponse deleteFromCarBase(@RequestBody Map<String, Object> params
+    ) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        System.out.println(carIdList);
+
+        String URL = "/evo-apigw/ipms/car/delete/batch";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        generalRequest.body(JSON.toJSONString(carIdList));
+        System.out.println(JSON.toJSONString(carIdList));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //白名单列表
+    @RequestMapping("/ShowCarWhiteList")
+    public GeneralResponse ShowCarWhiteList(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId,
+                                            @RequestParam(name = "pageNum") String pageNum,//车辆编号
+                                            @RequestParam(name = "pageSize") String pageSize //车牌号
+    ) throws ClientException {
+        if (farmId != 1) {
+            return null;
+        }
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String Url = "/evo-apigw/ipms/carWhiteList/sendCars?pageNum=" + pageNum + "&pageSize=" + pageSize + "&_=" + aLong;
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(Url, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //黑名单列表
+    @RequestMapping("/ShowCarBlackList")
+    public GeneralResponse ShowCarBlackList(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId,
+                                            @RequestParam(name = "pageNum") String pageNum,//车辆编号
+                                            @RequestParam(name = "pageSize") String pageSize //车牌号
+    ) throws ClientException {
+        if (farmId != 1) {
+            return null;
+        }
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String Url = "/evo-apigw/ipms/carBlackList/sendCars?pageNum=" + pageNum + "&pageSize=" + pageSize + "&_=" + aLong;
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(Url, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //为添加到任何名单  //draw=4是白名单    draw=5是黑名单
+    @RequestMapping("/ShowUnSendCar")
+    public GeneralResponse ShowUnSendCar(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId,
+                                         @RequestParam(name = "pageNum") String pageNum,//车辆编号
+                                         @RequestParam(name = "draw") Integer draw,//车辆编号
+                                         @RequestParam(name = "pageSize") String pageSize //车牌号
+    ) throws ClientException {
+        if (farmId != 1) {
+            return null;
+        }
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String Url = "/evo-apigw/ipms/carBlackList/unSendCars?pageNum=" + pageNum + "&draw=" + draw + "&pageSize=" + pageSize + "&pageSize=" + pageSize + "&_=" + aLong;
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(Url, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //添加车辆进黑名单列表
+    @RequestMapping("/addCarBlackList")
+    public GeneralResponse addCarBlackList(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        String URL = "/evo-apigw/ipms/carBlackList/update";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+
+        List<Object> a = new ArrayList<>();
+        for (String s : carIdList) {
+            Map<String, Object> value = new HashMap<>();
+            value.put("carId", s);
+            value.put("validStartDay", "2021-12-22");
+            value.put("validEndDay", "2036-12-22");
+            value.put("deviceCodes", "1002931,1002928");
+            a.add(value);
+        }
+        generalRequest.body(JSON.toJSONString(a));
+        System.out.println(JSON.toJSONString(a));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+    public static void main(String[] args) {
+        System.out.println((int) ((Math.random() * 9 + 1) * 10000));
+    }
+
+
+    //添加车辆进白名单列表
+    @RequestMapping("/addCarWhiteList")
+    public GeneralResponse addCarWhiteList(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        String URL = "/evo-apigw/ipms/carWhiteList/update";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        List<Object> a = new ArrayList<>();
+
+        for (String s : carIdList) {
+            Map<String, Object> value = new HashMap<>();
+            value.put("carId", s);
+            value.put("validStartDay", "2021-12-22");
+            value.put("validEndDay", "2036-12-22");
+            value.put("deviceCodes", "1002931,1002928");
+            a.add(value);
+        }
+
+        generalRequest.body(JSON.toJSONString(a));
+        System.out.println(JSON.toJSONString(a));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", "application/json;charset=UTF-8");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //从白名单删除
+    @RequestMapping("/deleteFromCarWhiteList")
+    public GeneralResponse deleteFromCarWhiteList(@RequestBody Map<String, Object> params
+    ) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        System.out.println(carIdList);
+
+        String URL = "/evo-apigw/ipms/carWhiteList/delete/batch";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        generalRequest.body(JSON.toJSONString(carIdList));
+        System.out.println(JSON.toJSONString(carIdList));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+    //从黑名单删除
+    @RequestMapping("/deleteFromCarBlackList")
+    public GeneralResponse deleteFromCarBlackList(@RequestBody Map<String, Object> params
+    ) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        System.out.println(carIdList);
+        String URL = "/evo-apigw/ipms/carBlackList/delete/batch";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        generalRequest.body(JSON.toJSONString(carIdList));
+        System.out.println(JSON.toJSONString(carIdList));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //从基础表中删除
+    @RequestMapping("/deleteFromBaseCarList")
+    public GeneralResponse deleteFromBaseCarList(@RequestBody Map<String, Object> params
+    ) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            return null;
+        }
+        List<String> carIdList = (List<String>) params.get("carIdList");
+        String URL = "/evo-apigw/ipms/car/delete/batch";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        System.out.println("开始执行");
+        generalRequest.body(JSON.toJSONString(carIdList));
+        System.out.println(JSON.toJSONString(carIdList));
+        //这种已经在配置文件里面安排了账号ip以及密码
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    //过车的数据
+
+    /**
+     * 保存ntamade
+     */
+    @RequestMapping("/get_car_record")
+    public GeneralResponse getCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        System.out.println(request.getRequestURL());
+        System.out.println(request.getQueryString());
+        String queryString = request.getQueryString();
+        String URL = "/evo-apigw/ipms/carcapture/find/conditions?";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = URL + queryString;
+        System.out.println(newUrl);
+        //这种已经在配置文件里面安排了账号ip以及密码    现在变了
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+    @RequestMapping("/get_person_detail")
+    public GeneralResponse getPersonDetail(@RequestBody Map<String, Object> params) throws ClientException {
+
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-accesscontrol/${version}/card/accessControl/swingCardRecord/19241";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String URL_id = URL + params.get("id");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL_id, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+}

+ 157 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientDoorController.java

@@ -0,0 +1,157 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 开门事件  以及看回放
+ */
+@RestController
+@RequestMapping("door")
+public class ClientDoorController {
+
+    public static void main(String[] args) {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        System.out.println(formatA + formatD);
+    }
+
+
+    //大门事件
+    @RequestMapping("/ListDoorEvent")
+    public R ListDoorEvent(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        System.out.println("yuyuyuyuyuyu");
+        return R.ok("请求成功").put("data", getDoorEvent(params1)).put("total", CountTimes(params1));
+    }
+
+
+
+
+    //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数
+    public GeneralResponse getDoorEvent(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR_OF_DAY, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.DoorChannle;
+        System.out.println("liebiaodamememememmee"+nodeCodeList);
+        params.put("nodeCodeList", nodeCodeList);
+        // String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("damen");
+        return generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR_OF_DAY, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.DoorChannle;
+        System.out.println(nodeCodeList+"大门                     列表");
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+}

+ 114 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientMaiZhuController.java

@@ -0,0 +1,114 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+//其实可以整合到一起去了
+@RestController
+@RequestMapping("/event")
+public class ClientMaiZhuController {
+
+    //所有的事件接口
+    @RequestMapping("/maiZhuEvent")
+    public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+        return R.ok("请求成功").put("data", getEventList(params1)).put("total", CountTimes(params1));
+    }
+
+
+    //卖猪事件
+    public GeneralResponse getEventList(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.MaiZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.MaiZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+        return jsonObject.get("value").toString();
+    }
+}
+

+ 300 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientPersonManageController.java

@@ -0,0 +1,300 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+//门禁是不一样的
+@RestController
+@RequestMapping("person")
+public class ClientPersonManageController {
+
+    //添加图片
+    @RequestMapping("/addPersonPicture")
+    public R addPersonPicture(@RequestParam(name = "file") MultipartFile multipartFile) throws ClientException, IOException {
+
+        //文件上传前的名称
+        long s = System.currentTimeMillis();
+        String fileName = multipartFile.getOriginalFilename();
+        File file = new File(fileName);
+        OutputStream out = null;
+        try {
+            //获取文件流,以文件流的方式输出到新文件
+            out = new FileOutputStream(file);
+            byte[] ss = multipartFile.getBytes();
+            for (int i = 0; i < ss.length; i++) {
+                out.write(ss[i]);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        long e = System.currentTimeMillis();
+        System.out.println(e - s);
+        String URL = "/evo-apigw/evo-brm/1.0.0/person/upload/img";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        //generalRequest.header("Content-Type", "multipart/form-data");
+        HashMap<String, Object> formMap = new HashMap<>();
+        // formMap.put("enctype","multipart/form-data");
+        formMap.put("file", file);
+        generalRequest.form(formMap);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+
+        // 操作完上的文件 需要删除在根目录下生成的文件
+        File f = new File(file.toURI());
+        if (f.delete()) {
+            System.out.println("删除成功");
+        } else {
+            System.out.println("删除失败");
+        }
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        Object fileUrl = jsonObject1.get("fileUrl");
+        return R.ok("请求成功").put("data", fileUrl.toString());
+
+
+
+
+
+
+/*
+
+        Map map  = new HashMap();
+        HttpClient httpClient = new HttpClient(URL);
+        httpClient.setHttps(true);
+        Map<String ,String> header = new HashMap();
+        //header.put("Authorization","bearer 1:7bdc436b-e68c-4d78-aae0-fcf0bdf92f1e");
+        String content = httpClient.httpClientUploadFilePost(URL, file, header,map);
+*/
+
+
+    }
+
+
+    //删除人员
+    @RequestMapping("/deletePercon")
+    public R deletePercon(@RequestBody Map<String, Object> params1) throws ClientException {
+        List<Integer> ids = (List<Integer>) params1.get("ids");
+        String URL = "/evo-apigw/evo-brm/1.2.0/person/delete";
+        Map map = new HashMap();
+        map.put("departmentId", 1);
+        map.put("ids", ids);
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", "application/json");
+        generalRequest.body(JSON.toJSONString(map));
+        System.out.println(JSON.toJSONString(map));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        return R.ok("请求成功").put("data", jsonObject);
+    }
+
+
+    //人员管理--添加用户
+    @RequestMapping("/addPerson")
+    public R addPerson(@RequestBody Map<String, Object> params1) throws ClientException {
+        params1.put("paperType", 111);
+        params1.put("code", (int) ((Math.random() * 9 + 1) * 10000));
+        params1.put("departmentId", (int) params1.get("departmentId"));
+        params1.put("name", (String) params1.get("name"));
+        params1.put("paperNumber", "1101011990d3d" + (int) ((Math.random() * 9 + 1) * 10000));
+        params1.put("phone", 15171709858L + (int) ((Math.random() * 9 + 1) * 10000));
+        params1.put("id", (int) ((Math.random() * 9 + 1) * 10000));
+
+        String URL = "/evo-apigw/evo-brm/1.0.0/person/subsystem/add";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", "application/json");
+        generalRequest.body(JSON.toJSONString(params1));
+        System.out.println(JSON.toJSONString(params1));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        return R.ok("请求成功").put("data", jsonObject);
+    }
+
+
+    //人员管理--添加绑定用户的图片
+    @RequestMapping("/addPictureToPerson")
+    public GeneralResponse addPicture(@RequestBody Map<String, Object> params1) throws ClientException {
+
+        Map<String, Object> params = new HashMap<>();
+
+        Map<String, Object> value1 = new HashMap<>();
+        value1.put("personId", (int) params1.get("personId"));
+        value1.put("type", 3);
+        value1.put("index", 1);
+        value1.put("path", (String) params1.get("path"));
+
+        List mapList = new ArrayList();
+        System.out.println(mapList);
+        mapList.add(value1);
+        params.put("personBiosignatures", mapList);
+        String URL = "/evo-apigw/evo-brm/1.0.0/person/subsystem/update-biosignature-face";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.PUT);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        System.out.println(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        return generalResponse;
+    }
+
+
+    //刷脸失败记录
+    @RequestMapping("/getPersonOpenDoorFail")
+    public R getAccidentRecord(@RequestBody Map<String, Object> params1) throws ClientException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return null;
+        }
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        if (!StringUtilsWork.isNotEmpty((String) params1.get("startSwingTime"))) {
+            params1.put("startSwingTime", formatA);
+            params1.put("endSwingTime", formatD);
+        }
+        params1.put("containDomain", "1");
+        params1.put("openResult", 0); //刷脸失败
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?systime=";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params1));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        GetResponse getResponse = new GetResponse();
+        return R.ok("请求成功").put("data", jsonObject).put("total", getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime")));
+    }
+
+
+    /*
+         * @param params
+         *   下面是前端提交的参数 直接让她写死了   这个是查不同部门的人的接口
+         *{searchKey: "", pageNum: 1, pageSize: 10, departmentId: 4, isContain: true, statusList: [1, 2]}      维修部门
+          {searchKey: "", pageNum: 1, pageSize: 10, departmentId: 2, isContain: true, statusList: [1, 2]}      技术部门
+          {searchKey: "", pageNum: 1, pageSize: 10, departmentId: 5, isContain: true, statusList: [1, 2]}      基层部门
+         * @return
+         * @throws ClientException
+         */
+    @RequestMapping("/ge_person_list")
+    public GeneralResponse ge_person_list(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return null;
+        }
+
+
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest("/evo-apigw/evo-brm/1.2.0/person/page", Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+    @RequestMapping("/get_person_record")
+    public GeneralResponse getAccidentRecord1(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+
+    //总页数
+    @RequestMapping("/get_person_record_totalpage")
+    public GeneralResponse get_person_record_totalpage(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        GeneralRequest generalRequest = new GeneralRequest(URL + aLong, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    @RequestMapping("/get_person_detail")
+    public GeneralResponse getPersonDetail(@RequestBody Map<String, Object> params) throws ClientException {
+
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-accesscontrol/${version}/card/accessControl/swingCardRecord/19241";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String URL_id = URL + params.get("id");
+        GeneralRequest generalRequest = new GeneralRequest(URL_id, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+}

+ 114 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientWeiQiangController.java

@@ -0,0 +1,114 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+//其实可以整合到一起去了
+@RestController
+@RequestMapping("/event")
+public class ClientWeiQiangController {
+
+    //所有的事件接口
+    @RequestMapping("/weiQiang")
+    public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+        return R.ok("请求成功").put("data", getEventList(params1)).put("total", CountTimes(params1));
+    }
+
+
+    //围墙事件
+    public GeneralResponse getEventList(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.EggWeiQiang;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.EggWeiQiang;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+        return jsonObject.get("value").toString();
+    }
+}
+

+ 68 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientXixiaoController.java

@@ -0,0 +1,68 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+//其实可以整合到一起去了
+@RestController
+@RequestMapping("/accident")
+public class ClientXixiaoController {
+
+    /**
+     * 洗消数据查询的接口,三个洗消的摄像头是固定的
+     *
+     * @param params
+     * @return   183.148.150.65
+     * @throws ClientException
+     */
+    @RequestMapping("/accident_record_xixiao")
+    public GeneralResponse getAccidentRecord(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return null;
+        }
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+
+        return generalResponse;
+
+    }
+
+    /**
+     * 洗消数据查询的接口,三个洗消的摄像头是固定的--页数接口
+     *
+     * @param params
+     * @return
+     * @throws ClientException
+     */
+    @RequestMapping("/accident_record_xixiao_totalpage")
+    public GeneralResponse getAccidentRecordTotalPage(@RequestBody Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+}

+ 118 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientXunZhengController.java

@@ -0,0 +1,118 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import net.sf.json.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/event")
+public class ClientXunZhengController {
+
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+
+    //所有的事件接口
+    @RequestMapping("/xunZhengEvent")
+    public R SiZhuList(@RequestBody Map<String, Object> params1) throws ClientException, ParseException {
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+        return R.ok("请求成功").put("data", getEventList(params1)).put("total", CountTimes(params1));
+    }
+
+
+    //熏蒸事件
+    public GeneralResponse getEventList(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.XunZhengChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+
+    public String CountTimes(Map<String, Object> params1) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        String[] nodeCodeList = CommonConstant.XunZhengChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        JSONObject jsonObject = JSONObject.fromObject(JSONObject.fromObject(iClient.doAction(generalRequest, generalRequest.getResponseClass()).getResult()).get("data"));
+        return jsonObject.get("value").toString();
+    }
+}
+

+ 109 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/GetPicture.java

@@ -0,0 +1,109 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.IccProfile;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.net.ssl.SSLContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import static com.huimv.video.dhicc.icc.CommonConstant.IPAndPort;
+
+
+@RestController
+@RequestMapping("/picture")
+public class GetPicture {
+    @RequestMapping("/get")
+    public void getCarRecord(HttpServletRequest request, HttpServletResponse response,
+                             @RequestParam(name = "fileUrl", required = false) String fileUrl,
+                             @RequestParam(name = "alarmPicture", required = false) String alarmPicture,
+                             @RequestParam(name = "path", required = false) String path
+    ) throws IOException, ClientException {
+        String url;
+        IClient iClient = new DefaultClient();
+        //如果 fileURL不为空  就认为是拿摄像头抓拍图片
+        if (StringUtilsWork.isNotEmpty(fileUrl)) {
+            url = IPAndPort + "/evo-apigw/" + fileUrl;
+        } else if (StringUtilsWork.isNotEmpty(path)) {
+            //档案的图片
+            IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
+            url = IPAndPort + "/evo-pic/" + path + "?token=" + token.getAccess_token() + "&oss_addr=" + CommonConstant.Document_oss_addr;
+        } else {
+            //事件的图片
+            IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
+            url = IPAndPort + "/evo-pic/" + alarmPicture + "?token=" + token.getAccess_token() + "&oss_addr=" + CommonConstant.shijian_oss_addr;
+        }
+        HttpResponse httpResponse = null;
+        try {
+            CloseableHttpClient buildSSLCloseableHttpClient = buildSSLCloseableHttpClient();
+            System.setProperty("jsse.enableSNIExtension", "false");
+            HttpGet httpGet = new HttpGet(url);
+            httpResponse = buildSSLCloseableHttpClient.execute(httpGet);
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+//        System.out.println("返回图片");
+        //response.setContentLength(285390);
+        response.setHeader("Content-Type", " image/jpeg");
+        response.setHeader("Accept-Ranges", "bytes");
+        InputStream content = httpResponse.getEntity().getContent();
+        OutputStream out = null;
+        try {
+            out = response.getOutputStream();
+            int len = 0;
+            byte[] b = new byte[1024];
+            while ((len = content.read(b)) != -1) {
+                out.write(b, 0, len);
+            }
+            out.flush();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                if (out != null) {
+                    out.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private static CloseableHttpClient buildSSLCloseableHttpClient()
+            throws Exception {
+        SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null,
+                new TrustStrategy() {
+                    // 信任所有
+                    public boolean isTrusted(X509Certificate[] chain,
+                                             String authType) throws CertificateException {
+                        return true;
+                    }
+                }).build();
+        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+                sslContext, new String[]{"TLSv1.2"}, null,
+                SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+        return HttpClients.custom().setSSLSocketFactory(sslsf).build();
+    }
+
+}

+ 26 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/GetToken.java

@@ -0,0 +1,26 @@
+package com.huimv.video.dhicc.controller.ClientController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.icc.IccUtil;
+import com.huimv.video.dhicc.result.R;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 事件信息的最终端口
+ */
+@RestController
+@RequestMapping("token")
+public class GetToken {
+    @RequestMapping("/getToken")
+    public R getAccidentRecordPicture(HttpServletRequest request
+    ) throws ClientException {
+        String token = new IccUtil().getToken();
+        return R.ok("请求成功").put("token", token);
+    }
+}
+
+

+ 135 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/FaceAIController/AiFaceController.java

@@ -0,0 +1,135 @@
+package com.huimv.video.dhicc.controller.FaceAIController;
+
+
+//金铭的人脸识别数据的接口  放这个里面
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import com.huimv.video.dhicc.util.HttpClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/AiFaceCount")
+public class AiFaceController {
+
+    //这个接口里面的条件还是后端来写死吧  后端写比前端写简单一点
+    @RequestMapping("/groups")
+    public R addgroupspeople(HttpServletRequest request,
+                             @RequestParam(name = "farmId") Integer farmId
+    ) throws Exception {
+
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.HOUR, +2);
+        Date A = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date B = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date C = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date D = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date E = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date F = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date G = c.getTime();
+
+        c.add(Calendar.HOUR, -2);
+        Date H = c.getTime();
+
+
+        List result = new ArrayList();
+
+        Map map1 = new HashMap();
+        map1.put("time", splitTimeByHoure(B));
+        map1.put("value", getCountByHoure(B, A));
+
+        Map map2 = new HashMap();
+        map2.put("time", splitTimeByHoure(C));
+        map2.put("value", getCountByHoure(C, B));
+
+        Map map3 = new HashMap();
+        map3.put("time", splitTimeByHoure(D));
+        map3.put("value", getCountByHoure(D, C));
+
+        Map map4 = new HashMap();
+        map4.put("time", splitTimeByHoure(E));
+        map4.put("value", getCountByHoure(E, D));
+
+
+        Map map5 = new HashMap();
+        map5.put("time", splitTimeByHoure(F));
+        map5.put("value", getCountByHoure(F, E));
+
+
+        Map map6 = new HashMap();
+        map6.put("time", splitTimeByHoure(G));
+        map6.put("value", getCountByHoure(G, F));
+
+        Map map7 = new HashMap();
+        map7.put("time", splitTimeByHoure(H));
+        map7.put("value", getCountByHoure(H, G));
+
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return R.ok("请求成功").put("data", result).put("namalCount", 12).put("alarmCount", 45);
+    }
+
+    public String getCountByHoure(Date startTime, Date EndTime) throws IOException {
+        long startTimes = startTime.getTime();
+        long endTimes = EndTime.getTime();
+        String URL = "http://36.26.62.70:10080/api/pass_records?_t=1640069918983&start_page=1&page_count=3000&begin_time=" + startTimes + "&end_time=" + endTimes + "&camera_id=5";
+        HttpClient httpClient = new HttpClient(URL);
+        httpClient.setHttps(false);
+        httpClient.get();
+        String content = httpClient.getContent();
+        System.out.println(content);
+        JSONObject jsonObject = JSONObject.parseObject(content);
+        JSONObject data1 = JSONObject.parseObject(jsonObject.get("data").toString());
+        return data1.get("total").toString();
+
+    }
+
+    public String splitTimeByHoure(Date date) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat("HH:mm");//设置日期格式,这里只取出小时和分钟
+        String format = df.format(date);
+        return format;
+    }
+
+
+}

+ 77 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenAlarmCountByDay.java

@@ -0,0 +1,77 @@
+package com.huimv.video.dhicc.controller.ScreenController;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IBaseWarningInfoService;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+
+@RestController
+@RequestMapping("/screen/alarmCount")
+
+public class ScreenAlarmCountByDay {
+
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+    @Autowired
+    private IBaseWarningInfoService iBaseWarningInfoService;
+
+    //四种事件统计
+    @RequestMapping("/CountByDay")
+    public R AlarmCountByDay(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.add(Calendar.DATE, -7);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+        List result = new ArrayList();
+
+        //洗消 一周
+        Map map1 = new HashMap();
+        map1.put("name", "环控报警");
+        map1.put("value", iBaseWarningInfoService.getSevenDayWarningTotal(formatB, formatA));
+        //人员通过一周---异常
+        Map map2 = new HashMap();
+        map2.put("name", "人员违规");
+        map2.put("value", 0);
+        //车辆一周
+        Map map3 = new HashMap();
+        map3.put("name", "车辆进出");
+        map3.put("value", 0);
+        //烘干事件一周
+        Map map4 = new HashMap();
+        map4.put("name", "死鸡运输");
+        map4.put("value", getResponse.SendMassageSiZhuRecord(formatB, formatA));
+
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map1);
+        //翻转
+        Collections.reverse(result);
+        return R.ok("请求成功").put("data", result);
+
+
+    }
+}

+ 133 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenCarController.java

@@ -0,0 +1,133 @@
+package com.huimv.video.dhicc.controller.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/car")
+
+//没有连接ICC的数据库 所以操作比较麻烦
+public class ScreenCarController {
+
+
+    //过车的数据//这个是车辆闸机的过车数据
+
+    /**
+     * 应该优化一下放到表里面去  不然的话这样请求一整页的数据会很慢
+     * 保存ntamade
+     * 通过开始结束时间来查页数
+     * &queryTimeBegin=2021-12-01+00%3A00%3A00&
+     * queryTimeEnd=2021-12-01+23%3A59%3A59&
+     */
+    // https://36.26.62.70:447/evo-apigw/ipms/carcapture/find/conditions?pageNum=1&pageSize=10&queryTimeBegin=2021-12-01+00%3A00%3A00&queryTimeEnd=2021-12-01+23%3A59%3A59&_=1638356246174
+    @RequestMapping("/count_car_record")
+    public R ddgetCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
+
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.DATE, -1);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.DATE, -1);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.DATE, -1);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.DATE, -1);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.DATE, -1);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.DATE, -1);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+        Map map1 = new HashMap();
+        map1.put("time", splitTime(B));
+        map1.put("value", getResponse.SendMassageGetPage(formatB, formatA));
+
+        Map map2 = new HashMap();
+        map2.put("time", splitTime(C));
+        map2.put("value", getResponse.SendMassageGetPage(formatC, formatB));
+
+        Map map3 = new HashMap();
+        map3.put("time", splitTime(D));
+        map3.put("value", getResponse.SendMassageGetPage(formatD, formatC));
+
+        Map map4 = new HashMap();
+        map4.put("time", splitTime(E));
+        map4.put("value", getResponse.SendMassageGetPage(formatE, formatD));
+
+
+        Map map5 = new HashMap();
+        map5.put("time", splitTime(F));
+        map5.put("value", getResponse.SendMassageGetPage(formatF, formatE));
+
+
+        Map map6 = new HashMap();
+        map6.put("time", splitTime(G));
+        map6.put("value", getResponse.SendMassageGetPage(formatG, formatF));
+
+        Map map7 = new HashMap();
+        map7.put("time", splitTime(H));
+        map7.put("value", getResponse.SendMassageGetPage(formatH, formatG));
+
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return R.ok("请求成功").put("data", result);
+    }
+
+    public String splitTime(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        String date1 = calendar.get(Calendar.MONTH) + 1 + "/" + calendar.get(Calendar.DATE);
+        return date1;
+    }
+
+
+}

+ 78 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenIndexDataController.java

@@ -0,0 +1,78 @@
+package com.huimv.video.dhicc.controller.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/screen/index")
+public class ScreenIndexDataController {
+
+    //返回大屏首页的数据
+    @RequestMapping("/dataList")
+    public R indexDataList(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Map map = new HashMap<>();
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.DATE, -6);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        System.out.println(formatA + formatB);
+        //人员刷脸成功
+        map.put("personPassSuccess", getResponse.SendMassageGetPagePerson(formatB, formatA));
+        //人员刷脸失败
+        map.put("personPassFail", getResponse.SendMassageGetPagePersonAlarm(formatB, formatA));
+        //车辆出数量统计
+        map.put("carPassOut", getResponse.SendMassageCarOut(formatB, formatA));
+        //车辆进
+        map.put("carPassIn", getResponse.SendMassageCarIn(formatB, formatA));
+        //死猪
+        map.put("tadaySiZhu", getResponse.SendCountSiZhu(formatB, formatA));
+        //七日死猪事件
+        map.put("SevenDaySiZhu", getResponse.SendCountSiZhu(formatC, formatA));
+        //今日洗消
+        map.put("tadayXiXiao", getResponse.SendMassageXixiaoPerson(formatB, formatA));
+        //七日洗消事件
+        map.put("SevenDayXIxiao", getResponse.SendMassageXixiaoPerson(formatC, formatA));
+        //大门七日记录数
+        map.put("SevenDayGate", getResponse.SendMassageGateCount(formatC, formatA));
+        //大门今日记录数
+        map.put("tadayGate", getResponse.SendMassageGateCount(formatB, formatA));
+
+        return R.ok("请求成功").put("data", map);
+
+    }
+}

+ 153 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenPersonController.java

@@ -0,0 +1,153 @@
+package com.huimv.video.dhicc.controller.ScreenController;
+
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/person")
+public class ScreenPersonController {
+
+    //成功通行记录
+    @RequestMapping("/count_person_record")
+    public R ddgetCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
+
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.HOUR_OF_DAY, +2);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date C = c.getTime();
+        String formatC = format.format(C);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date D = c.getTime();
+        String formatD = format.format(D);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date E = c.getTime();
+        String formatE = format.format(E);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date F = c.getTime();
+        String formatF = format.format(F);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date G = c.getTime();
+        String formatG = format.format(G);
+
+        c.add(Calendar.HOUR_OF_DAY, -2);
+        Date H = c.getTime();
+        String formatH = format.format(H);
+
+        List result = new ArrayList();
+
+        Map map1 = new HashMap();
+        map1.put("time", splitTimeByHoure(B));
+        map1.put("value", getResponse.SendMassageGetPage(formatB, formatA));
+
+        Map map2 = new HashMap();
+        map2.put("time", splitTimeByHoure(C));
+        map2.put("value", getResponse.SendMassageGetPage(formatC, formatB));
+
+        Map map3 = new HashMap();
+        map3.put("time", splitTimeByHoure(D));
+        map3.put("value", getResponse.SendMassageGetPage(formatD, formatC));
+
+        Map map4 = new HashMap();
+        map4.put("time", splitTimeByHoure(E));
+        map4.put("value", getResponse.SendMassageGetPage(formatE, formatD));
+
+        Map map5 = new HashMap();
+        map5.put("time", splitTimeByHoure(F));
+        map5.put("value", getResponse.SendMassageGetPage(formatF, formatE));
+
+
+        Map map6 = new HashMap();
+        map6.put("time", splitTimeByHoure(G));
+        map6.put("value", getResponse.SendMassageGetPage(formatG, formatF));
+
+        Map map7 = new HashMap();
+        map7.put("time", splitTimeByHoure(H));
+        map7.put("value", getResponse.SendMassageGetPage(formatH, formatG));
+
+        result.add(map1);
+        result.add(map2);
+        result.add(map3);
+        result.add(map4);
+        result.add(map5);
+        result.add(map6);
+        result.add(map7);
+        //翻转
+        Collections.reverse(result);
+        return R.ok("请求成功").put("data", result);
+    }
+
+
+    //人员正常通行与异常通行的数据
+    @RequestMapping("/count_person_record_fail_success")
+    public R count_person_record_fail_success(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
+
+        if (farmId != 1) {
+            //返回为空数据
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, +1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+
+        Map map1 = new HashMap();
+        map1.put("value1", getResponse.SendMassageGetPagePerson(formatB, formatA));
+        map1.put("value2", getResponse.SendMassageGetPagePersonAlarm(formatB, formatA));
+
+        System.out.println();
+        return R.ok("请求成功").put("data", map1);
+
+    }
+
+    public String splitTimeByHoure(Date date) throws ParseException {
+        SimpleDateFormat df = new SimpleDateFormat("HH:mm");//设置日期格式,这里只取出小时和分钟
+        String format = df.format(date);
+        return format;
+    }
+
+}

+ 196 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ScreenController/ScreenSiZhuController.java

@@ -0,0 +1,196 @@
+package com.huimv.video.dhicc.controller.ScreenController;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.util.GetResponse;
+import net.sf.json.JSONObject;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/screen/sizhu")
+public class ScreenSiZhuController {
+    /**
+     * xuyao   直接都写在这里了
+     *
+     * @param request
+     * @return
+     * @throws ClientException
+     * @throws ParseException
+     */
+    @RequestMapping("/count_sizhu_record")
+    public R count_sizhu_record(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+
+        List result = new ArrayList();
+        Map map1 = new HashMap();
+        map1.put("value1", getPastSevenDay());
+        map1.put("value2", getDay());
+        map1.put("value3", getLatestOne());
+        return R.ok("请求成功").put("data", map1);
+    }
+
+
+    /**
+     * xuyao   直接都写在这里了
+     *
+     * @param request
+     * @return 查询事件
+     * @throws ClientException
+     * @throws ParseException  写一个查左右的  事件都拿过来 存起来 建新的表来处理
+     */
+    @RequestMapping("/SiZhuList")
+    public R SiZhuList(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException, ParseException {
+
+        if (farmId != 1) {
+            return R.ok("当前牧场无设备").put("data", null);
+        }
+
+        return R.ok("请求成功").put("data", getSiZhuList());
+    }
+
+
+    //过去七天的值
+    public String getPastSevenDay() throws ClientException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.add(Calendar.DATE, -7);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+        return getResponse.SendCountSiZhu(formatB, formatA);
+    }
+
+
+    //今天的数据
+    public String getDay() throws ClientException {
+        GetResponse getResponse = new GetResponse();
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.add(Calendar.DATE, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.add(Calendar.DATE, -1);
+        Date B = c.getTime();
+        String formatB = format.format(B);
+        return getResponse.SendCountSiZhu(formatB, formatA);
+    }
+
+
+    //最新一条的数据
+    public String getLatestOne() throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR_OF_DAY, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        params.put("pageNum", 1);
+        params.put("pageSize", 1);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        //死猪通道
+        String[] nodeCodeList = CommonConstant.SIZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+
+
+        JSONObject jsondata = (JSONObject) JSONObject.fromObject(generalResponse.getResult()).get("data");
+        String substring = jsondata.get("pageData").toString().substring(1, jsondata.get("pageData").toString().length() - 1);
+        if (ObjectUtil.isNotEmpty(substring)){
+            JSONObject jsonObject1 = JSONObject.fromObject(substring);
+            Object alarmDate = jsonObject1.get("alarmDate");
+
+            return alarmDate.toString();
+        }
+        return null;
+
+    }
+
+
+    //返回所有的死猪事件
+    public GeneralResponse getSiZhuList() throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        params.put("pageNum", 1);
+        params.put("pageSize", 10);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        //死猪通道
+        String[] nodeCodeList = CommonConstant.SIZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+}
+
+
+

+ 34 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseTelecomRoom.java

@@ -0,0 +1,34 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class BaseTelecomRoom extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "device_id")
+    private String deviceId;
+
+    private String deviceName;
+
+    private String deviceRoom;
+
+    private Integer farmId;
+
+
+}

+ 47 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/BaseWarningInfoEntity.java

@@ -0,0 +1,47 @@
+package com.huimv.video.dhicc.entity;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+import javax.persistence.*;
+@Entity
+@Table(name = "base_warning_info")
+@Data
+@Accessors(chain = true)
+public class BaseWarningInfoEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Column(name = "id", nullable = false)
+    private Integer id;
+
+    @Column(name = "farm_id")
+    private Integer farmId;
+
+    @Column(name = "level")
+    private Integer level;
+
+    @Column(name = "msg")
+    private String msg;
+
+    @Column(name = "level_name")
+    private String levelName;
+
+    @Column(name = "warning_name")
+    private String warningName;
+
+    @Column(name = "warning_time")
+    private Timestamp warningTime;
+
+    @Column(name = "upload_time")
+    private Timestamp uploadTime;
+
+    @Column(name = "alarm_type")
+    private Integer alarmType;
+
+}

+ 35 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccChannel.java

@@ -0,0 +1,35 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class IccChannel extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String channelName;
+
+    private String channelId;
+
+    private String remark;
+
+
+}

+ 100 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/IccEventRecord.java

@@ -0,0 +1,100 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ *
+ * </p>
+ * 这个实体类里面存三种信息   ICC抓拍的周界事件    ICC抓拍的过车照片和信息   ICC抓拍的
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class IccEventRecord extends Model {
+
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+    //事件的ID
+    private Integer eventId;
+
+    @TableField("alarmStat")
+    private Integer alarmStat;
+
+    //类型要的
+    @TableField("alarmTypeName")
+    private String alarmTypeName;
+
+    //日期用这个
+    @TableField("alarmDate")
+    private LocalDateTime alarmDate;
+
+    @TableField("handleStat")
+    private Integer handleStat;
+
+    @TableField("alarmCode")
+    private String alarmCode;
+
+    @TableField("orgName")
+    private String orgName;
+
+    @TableField("alarmPosition")
+    private Integer alarmPosition;
+
+    @TableField("linkNames")
+    private String linkNames;
+
+    @TableField("alarmGrade")
+    private Integer alarmGrade;
+
+    @TableField("nodeCode")
+    private String nodeCode;
+
+    @TableField("alarmType")
+    private Integer alarmType;
+
+    @TableField("isEvent")
+    private Integer isEvent;
+
+    @TableField("alarmPicture")
+    private String alarmPicture;
+
+    @TableField("deviceCategory")
+    private Integer deviceCategory;
+
+    @TableField("orgCode")
+    private String orgCode;
+
+    @TableField("taskWebName")
+    private String taskWebName;
+
+    @TableField("alarmWebUrl")
+    private String alarmWebUrl;
+
+    @TableField("alarmAppUrl")
+    private String alarmAppUrl;
+
+    @TableField("taskWebUrl")
+    private String taskWebUrl;
+
+    @TableField("taskAppUrl")
+    private String taskAppUrl;
+
+    private Integer handel;
+
+
+}

+ 45 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecom.java

@@ -0,0 +1,45 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class SysTelecom extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer farmId;
+
+    private Date timestamp;
+
+    private String temp;
+
+    private Integer stc;
+
+    private Integer rssi;
+
+    private Integer humi;
+
+    private String deviceId;
+
+
+}

+ 38 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysTelecomEvent.java

@@ -0,0 +1,38 @@
+package com.huimv.video.dhicc.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+
+//烘干事件生成的地方
+@Data
+@EqualsAndHashCode()
+@Accessors(chain = true)
+public class SysTelecomEvent {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer farmId;
+
+    private Integer eventId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date eventTime;
+
+
+    private String deviceId;
+
+    private String remark;
+
+
+}

+ 102 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/SysThreshold.java

@@ -0,0 +1,102 @@
+package com.huimv.video.dhicc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class SysThreshold extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "farm_id")
+    private Integer farmId;
+
+    /**
+     * 高温
+     */
+    private String maxTem;
+
+    /**
+     * 低温
+     */
+    private String minTem;
+
+    /**
+     * 高湿度
+     */
+    private String maxHum;
+
+    /**
+     * 低湿度
+     */
+    private String minHum;
+
+    /**
+     * 累计流量
+     */
+    private String totalFlow;
+
+    /**
+     * 化学需氧量
+     */
+    @TableField("COD")
+    private String COD;
+
+    /**
+     * 氨氮
+     */
+    private String ammonia;
+
+    /**
+     * 氮
+     */
+    private String nitrogen;
+
+    /**
+     * 磷
+     */
+    private String phosphorus;
+
+
+    /**
+     * ph
+     */
+    private String ph;
+
+
+    /**
+     * 瞬时流量
+     */
+    private String flow;
+
+    /**
+     * 天气高温阈值
+     */
+    private String weatherMaxTem;
+
+
+    /**
+     * 天气低温阈值
+     */
+    private String weatherMinTem;
+
+    private String benconValue;
+
+    private String benconTime;
+
+
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomDto.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.entity;
+
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+
+@Data
+public class TelecomDto {
+
+
+    private Date timestamp;
+
+    private String deviceId;
+
+    private Map<String, Integer> payload;
+
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/entity/TelecomVo.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class TelecomVo {
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date eventTime;
+
+    private String location;
+
+    private String deviceId;
+
+    private String chekOk;
+
+}

Plik diff jest za duży
+ 88 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/CommonConstant.java


+ 21 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccDemo.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.icc;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.GrantType;
+
+//测试拿token的接口
+public class IccDemo {
+
+    public static void main(String[] args) {
+        try {
+            IClient client = new DefaultClient("36.26.62.70:447", "huimv", "1653d6c9-c611-4827-ac87-0bfd48deadd4");
+            IccTokenResponse.IccToken clientToken = client.getAccessToken(GrantType.client_credentials);
+            System.out.println(clientToken);
+        } catch (ClientException e) {
+            e.printStackTrace();
+        }
+    }
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/icc/IccUtil.java

@@ -0,0 +1,19 @@
+package com.huimv.video.dhicc.icc;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.http.IccTokenResponse;
+import com.dahuatech.icc.oauth.profile.IccProfile;
+
+public class IccUtil {
+    //获取token
+    public static  String getToken() throws ClientException {
+        IClient iClient = new DefaultClient();
+        //IccProfile 授权类型,根据你的初始化使用的password,client_credentials
+        IccTokenResponse.IccToken token = iClient.getAccessToken(IccProfile.grantType);
+        System.out.println(token);
+        System.out.println("获取到的Token为:" + token.getAccess_token());
+        return token.getAccess_token();
+    }
+}

+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseTelecomRoomMapper.java

@@ -0,0 +1,16 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+public interface BaseTelecomRoomMapper extends BaseMapper<BaseTelecomRoom> {
+
+}

+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/BaseWarningInfoRepo.java

@@ -0,0 +1,16 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.huimv.video.dhicc.entity.BaseWarningInfoEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.List;
+
+public interface BaseWarningInfoRepo extends JpaRepository<BaseWarningInfoEntity, Integer>, JpaSpecificationExecutor<BaseWarningInfoEntity> {
+
+    //
+//    @Query(nativeQuery = true,value = "SELECT COUNT(*) AS total FROM base_warning_info WHERE farm_id=?1 AND DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN DATE_FORMAT(?1,'%Y-%m-%d') AND DATE_FORMAT(?2,'%Y-%m-%d')")
+    @Query(nativeQuery = true,value = "SELECT COUNT(*) AS total FROM base_warning_info WHERE DATE_FORMAT(warning_time,'%Y-%m-%d') BETWEEN DATE_FORMAT(?1,'%Y-%m-%d') AND DATE_FORMAT(?2,'%Y-%m-%d')")
+    List<Object[]> findAllByStartDateAndEndDate(String startDate, String endDate);
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccChannelMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.dhicc.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.IccChannel;
+
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IccChannelMapper extends BaseMapper<IccChannel> {
+
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/IccEventRecordMapper.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.IccEventRecord;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IccEventRecordMapper extends BaseMapper<IccEventRecord> {
+
+}

+ 10 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomEventMapper.java

@@ -0,0 +1,10 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+
+
+public interface SysTelecomEventMapper extends BaseMapper<SysTelecomEvent> {
+
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysTelecomMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Repository
+public interface SysTelecomMapper extends BaseMapper<SysTelecom> {
+
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/mapper/SysThresholdMapper.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.dhicc.entity.SysThreshold;
+
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-30
+ */
+public interface SysThresholdMapper extends BaseMapper<SysThreshold> {
+
+}

+ 54 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/R.java

@@ -0,0 +1,54 @@
+package com.huimv.video.dhicc.result;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class R extends HashMap<String, Object> {
+
+    private static final long serialVersionUID = 1L;
+
+    public R() {
+        put("code", 0);
+        put("msg", "success");
+    }
+
+    public static R error() {
+        return error(500, "未知异常,请联系管理员");
+    }
+
+    public static R error(String msg) {
+        return error(500, msg);
+    }
+
+    public static R error(int code, String msg) {
+        R r = new R();
+        r.put("code", code);
+        r.put("msg", msg);
+        return r;
+    }
+
+    public static R ok(String msg) {
+        R r = new R();
+        r.put("msg", msg);
+        return r;
+    }
+
+    public static R ok(Map<String, Object> map) {
+        R r = new R();
+        r.putAll(map);
+        return r;
+    }
+
+    public static R ok() {
+        return new R();
+    }
+
+    @Override
+    public R put(String key, Object value) {
+        super.put(key, value);
+        return this;
+    }
+
+
+}

+ 48 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRException.java

@@ -0,0 +1,48 @@
+package com.huimv.video.dhicc.result;
+
+public class RRException extends RuntimeException {
+    private static final long serialVersionUID = 1L;
+
+    private String msg;
+    private int code = 500;
+
+    public RRException(String msg) {
+        super(msg);
+        this.msg = msg;
+    }
+
+    public RRException(String msg, Throwable e) {
+        super(msg, e);
+        this.msg = msg;
+    }
+
+    public RRException(String msg, int code) {
+        super(msg);
+        this.msg = msg;
+        this.code = code;
+    }
+
+    public RRException(String msg, int code, Throwable e) {
+        super(msg, e);
+        this.msg = msg;
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+
+}

+ 117 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/result/RRExceptionHandler.java

@@ -0,0 +1,117 @@
+/**
+ * Copyright (c) 2016-2019 人人开源 All rights reserved.
+ * <p>
+ * https://www.renren.io
+ * <p>
+ * 版权所有,侵权必究!
+ */
+
+package com.huimv.video.dhicc.result;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.validation.FieldError;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.servlet.NoHandlerFoundException;
+
+/**
+ * 异常处理器
+ *
+ * @author Mark sunlightcs@gmail.com
+ */
+@RestControllerAdvice
+public class RRExceptionHandler {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    /**
+     * 处理自定义异常
+     */
+    @ExceptionHandler(RRException.class)
+    public R handleRRException(RRException e) {
+        R r = new R();
+        r.put("code", e.getCode());
+        r.put("msg", e.getMessage());
+        logger.error(e.getMsg(), e);
+        return r;
+    }
+
+    @ExceptionHandler(NoHandlerFoundException.class)
+    public R handlerNoFoundException(Exception e) {
+        logger.error(e.getMessage(), e);
+        return R.error(404, "路径不存在,请检查路径是否正确");
+    }
+
+    @ExceptionHandler(DuplicateKeyException.class)
+    public R handleDuplicateKeyException(DuplicateKeyException e) {
+        logger.error(e.toString());
+        String message = e.getCause().getMessage();
+        String[] s = message.split(" ");
+        return R.error(600, s[2].replace("'", "") + " 已经存在!");
+    }
+
+//	@ExceptionHandler(AuthorizationException.class)
+//	public R handleAuthorizationException(AuthorizationException e){
+//		logger.error(e.getMessage(), e);
+//		return R.error("没有权限,请联系管理员授权");
+//	}
+//
+//	@ExceptionHandler(value = LimitAccessException.class)
+//	public R handleLimitAccessException(LimitAccessException e) {
+//		logger.error("LimitAccessException", e);
+//		return  R.error(429,e.getMessage());
+//	}
+
+    //当校验失败时,会抛出MethodArgumentNotValidException
+    //输出错误原因到前端
+    @ExceptionHandler(MethodArgumentNotValidException.class)
+    public R handleMethodArgumentNotValidException(MethodArgumentNotValidException ex) {
+        logger.error(ex.getMessage(), ex);
+        StringBuilder sb = new StringBuilder();
+        for (ObjectError error : ex.getBindingResult().getAllErrors()) {
+            if (error instanceof FieldError) {
+                FieldError e = (FieldError) error;
+                sb.append(e.getField()).append(e.getDefaultMessage()).append(" ");
+            }
+        }
+        return R.error(1001, sb.toString());
+    }
+
+//	@ExceptionHandler(ConstraintViolationException.class)
+//	public R handleConstraintViolationException(ConstraintViolationException e) {
+//		logger.error(e.getMessage(),e);
+//		StringBuilder sb = new StringBuilder();
+//		e.getConstraintViolations().forEach(constraintViolation -> sb.append(constraintViolation.getMessage()).append(" "));
+//		return R.error(1001,sb.toString().substring(0,sb.length() - 1));
+//	}
+
+    @ExceptionHandler(MissingServletRequestParameterException.class)
+    public R handMissingServletRequestParameterException(MissingServletRequestParameterException e) {
+        logger.error(e.getMessage(), e);
+        return R.error(1001, e.getMessage());
+    }
+
+    @ExceptionHandler(DataIntegrityViolationException.class)
+    public R handDataIntegrityViolationException(DataIntegrityViolationException e) {
+        logger.error(e.getMessage(), e);
+        return R.error(1001, e.getCause().getMessage());
+    }
+
+    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+    public R handHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) {
+        logger.error(e.getMessage(), e);
+        return R.error(1001, e.getMessage());
+    }
+
+    @ExceptionHandler(Exception.class)
+    public R handleException(Exception e) {
+        logger.error(e.getMessage(), e);
+        return R.error();
+    }
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseTelecomRoomService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+public interface IBaseTelecomRoomService extends IService<BaseTelecomRoom> {
+
+}

+ 5 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IBaseWarningInfoService.java

@@ -0,0 +1,5 @@
+package com.huimv.video.dhicc.service;
+
+public interface IBaseWarningInfoService {
+    Integer getSevenDayWarningTotal(String startDate, String endDate);
+}

+ 11 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IClientAllEventService.java

@@ -0,0 +1,11 @@
+package com.huimv.video.dhicc.service;
+
+import com.dahuatech.icc.exception.ClientException;
+import com.huimv.video.dhicc.result.R;
+
+import javax.servlet.http.HttpServletRequest;
+
+public interface IClientAllEventService {
+    //
+    R getEventBySort(Integer farmId, Integer sort, String startDateText, String endDateText, Integer pageNum, Integer pageSize, HttpServletRequest request) throws ClientException;
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccChannelService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.IccChannel;
+
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IIccChannelService extends IService<IccChannel> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/IIccEventRecordService.java

@@ -0,0 +1,18 @@
+package com.huimv.video.dhicc.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.IccEventRecord;
+
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+public interface IIccEventRecordService extends IService<IccEventRecord> {
+
+}

+ 13 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomEventService.java

@@ -0,0 +1,13 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+
+import java.util.Map;
+
+
+public interface ISysTelecomEventService extends IService<SysTelecomEvent> {
+    Result listByRoom(Map map);
+
+}

+ 20 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysTelecomService.java

@@ -0,0 +1,20 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.common.utils.Result;
+import com.huimv.video.dhicc.entity.SysTelecom;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+public interface ISysTelecomService extends IService<SysTelecom> {
+
+    Result listByRoom(Map map);
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/ISysThresholdService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.dhicc.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.dhicc.entity.SysThreshold;
+
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-30
+ */
+public interface ISysThresholdService extends IService<SysThreshold> {
+
+}

+ 20 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseTelecomRoomServiceImpl.java

@@ -0,0 +1,20 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.video.dhicc.entity.BaseTelecomRoom;
+import com.huimv.video.dhicc.mapper.BaseTelecomRoomMapper;
+import com.huimv.video.dhicc.service.IBaseTelecomRoomService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-23
+ */
+@Service
+public class BaseTelecomRoomServiceImpl extends ServiceImpl<BaseTelecomRoomMapper, BaseTelecomRoom> implements IBaseTelecomRoomService {
+
+}

+ 40 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/BaseWarningInfoServiceImpl.java

@@ -0,0 +1,40 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.huimv.video.dhicc.mapper.BaseWarningInfoRepo;
+import com.huimv.video.dhicc.service.IBaseWarningInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Service
+public class BaseWarningInfoServiceImpl implements IBaseWarningInfoService {
+    @Autowired
+    private BaseWarningInfoRepo baseWarningInfoRepo;
+
+    /**
+     * @Method      : getSaven
+     * @Description : 
+     * @Params      : [startDate, endDate]
+     * @Return      : java.lang.Integer
+     * 
+     * @Author      : ZhuoNing
+     * @Date        : 2022/7/6       
+     * @Time        : 16:54
+     */
+    @Override
+    public Integer getSevenDayWarningTotal(String startDate, String endDate){
+        //获取设备总数
+        List<Object[]> objList = baseWarningInfoRepo.findAllByStartDateAndEndDate(startDate,endDate);
+        Object[] totalObj = (Object[]) objList.get(0);
+        return Integer.parseInt(totalObj[0].toString());
+    }
+}

+ 463 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/ClientAllEventServiceImpl.java

@@ -0,0 +1,463 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.common.utils.StringUtilsWork;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import com.huimv.video.dhicc.service.IClientAllEventService;
+import com.huimv.video.dhicc.util.GetResponse;
+import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSONObject;
+import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+@Service
+@Slf4j
+public class ClientAllEventServiceImpl implements IClientAllEventService {
+
+    @Override
+    public R getEventBySort(Integer farmId, Integer sort, String startDateText, String endDateText, Integer pageNum, Integer pageSize, HttpServletRequest request) throws ClientException {
+        Map paramsMap = new HashMap();
+        paramsMap.put("farmId", farmId);
+        paramsMap.put("pageNum", pageNum);
+        paramsMap.put("pageSize", pageSize);
+        //
+        switch (sort) {
+            case 1:
+                //大门事件
+                paramsMap.put("alarmStartDateString", startDateText);
+                paramsMap.put("alarmEndDateString", endDateText);
+                log.info("大门事件输入参数>>" + paramsMap.toString());
+                return getGateEvent(paramsMap);
+            case 2:
+                //洗消事件
+                paramsMap.put("alarmStartDateString", startDateText);
+                paramsMap.put("alarmEndDateString", endDateText);
+                log.info("洗消事件输入参数>>" + paramsMap.toString());
+                return getWashEvent(paramsMap);
+            case 3:
+                //死猪通道事件
+                paramsMap.put("alarmStartDateString", startDateText);
+                paramsMap.put("alarmEndDateString", endDateText);
+                log.info("死猪通道事件输入参数>>" + paramsMap.toString());
+                return getDeadPigChannel(paramsMap);
+            case 4:
+                //熏蒸事件
+                paramsMap.put("alarmStartDateString", startDateText);
+                paramsMap.put("alarmEndDateString", endDateText);
+                log.info("熏蒸事件输入参数>>" + paramsMap.toString());
+                return getFumigateChannel(paramsMap);
+            case 5:
+                //卖猪事件
+                paramsMap.put("alarmStartDateString", startDateText);
+                paramsMap.put("alarmEndDateString", endDateText);
+                log.info("卖猪事件输入参数>>" + paramsMap.toString());
+                return getSellPigsChannel(paramsMap);
+            case 6:
+                //人员门禁事件
+//                paramsMap.put("startSwingTime",startDateText);
+//                paramsMap.put("endSwingTime",endDateText);
+//                paramsMap.put("openType",61);
+                log.info("人员门禁事件输入参数>>" + paramsMap.toString());
+                return getEntranceGuard(paramsMap);
+            default:
+                //车辆闸机事件
+                log.info("车辆闸机事件输入参数>>" + paramsMap.toString());
+                return getCarAutoGate(request, paramsMap);
+        }
+    }
+
+    //大门事件
+    private R getGateEvent(Map<String, Object> paramsMap) throws ClientException {
+        //绑定大门通道
+        String[] doorChannel = CommonConstant.DoorChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, doorChannel)).put("total", CountTimes(paramsMap, doorChannel)).put("isVideo", true);
+    }
+
+    //洗消事件
+    private R getWashEvent(Map<String, Object> paramsMap) throws ClientException {
+        //绑定大门通道
+        String[] washChannel = CommonConstant.XixiaoChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, washChannel)).put("total", CountTimes(paramsMap, washChannel)).put("isVideo", true);
+    }
+
+    //死猪事件
+    private R getDeadPigChannel(Map<String, Object> paramsMap) throws ClientException {
+        String[] deadPigChannel = CommonConstant.SIZhuChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, deadPigChannel)).put("total", CountTimes(paramsMap, deadPigChannel)).put("isVideo", true);
+    }
+
+    //熏蒸事件
+    private R getFumigateChannel(Map paramsMap) throws ClientException {
+        //绑定熏蒸通道
+        String[] fumigateChannel = CommonConstant.XunZhengChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, fumigateChannel)).put("total", CountTimes(paramsMap, fumigateChannel)).put("isVideo", true);
+    }
+
+    //卖猪事件
+    private R getSellPigsChannel(Map paramsMap) throws ClientException {
+        //卖猪通道
+        String[] sellPigsChannel = CommonConstant.MaiZhuChannle;
+        return R.ok("请求成功").put("data", getEventList(paramsMap, sellPigsChannel)).put("total", CountTimes(paramsMap, sellPigsChannel)).put("isVideo", true);
+    }
+
+    //人员门禁事件
+    private R getEntranceGuard(Map<String, Object> paramsMap) throws ClientException {
+//        String total = SendMassageGetPagePersonAlarm(paramsMap.get("alarmStartDateString").toString(),paramsMap.get("alarmEndDateString").toString());
+//        if(total == null){
+//            total = "0";
+//        }
+        //
+//        return R.ok("请求成功").put("data", getAccidentRecord(paramsMap)).put("total", Integer.parseInt(total)).put("isVideo",false);
+//        getAccidentRecord(paramsMap);
+
+
+        return getAccidentRecord(paramsMap).put("isVideo", false);
+    }
+
+    //解析总页码
+    private Integer parseTotal(String totalText) {
+        totalText = totalText.substring(totalText.indexOf("data"), totalText.length());
+        totalText = totalText.substring(totalText.indexOf(":") + 1, totalText.indexOf("}"));
+        return Integer.parseInt(totalText);
+    }
+
+    //车辆闸机事件
+    private R getCarAutoGate(HttpServletRequest request, Map<String, Object> paramsMap) throws ClientException {
+        Integer farmId = (int) paramsMap.get("farmId");
+        GeneralResponse grObj = getCarRecord(request, farmId);
+        com.alibaba.fastjson.JSONObject grJo = JSON.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(grObj));
+        com.alibaba.fastjson.JSONObject resultJo = grJo.getJSONObject("result");
+        com.alibaba.fastjson.JSONObject dataJo = resultJo.getJSONObject("data");
+        String totalRowsText = dataJo.getString("totalRows");
+        resultJo.put("total", Integer.parseInt(totalRowsText));
+        return R.ok("请求成功").put("data", grObj).put("total", Integer.parseInt(totalRowsText)).put("isVideo", false);
+    }
+
+    private R getCarAutoGate_old1(HttpServletRequest request, Map<String, Object> paramsMap) throws ClientException {
+        Integer farmId = (int) paramsMap.get("farmId");
+        JSONObject carJo = JSONObject.fromObject(getCarRecord(request, farmId));
+        String resultText = carJo.getString("result");
+        String dataText = JSON.parseObject(resultText).getString("data");
+        String totalRowsText = JSON.parseObject(dataText).getString("totalRows");
+        //
+        return R.ok("请求成功").put("data", resultText).put("total", Integer.parseInt(totalRowsText)).put("isVideo", false);
+    }
+
+    //查询车辆通行记录 by Yangdi
+    public GeneralResponse getCarRecord(HttpServletRequest request, @RequestParam(name = "farmId") Integer farmId) throws ClientException {
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        System.out.println(request.getRequestURL());
+        System.out.println(request.getQueryString());
+        String queryString = request.getQueryString();
+        String URL = "/evo-apigw/ipms/carcapture/find/conditions?";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = URL + queryString;
+        System.out.println(newUrl);
+        //这种已经在配置文件里面安排了账号ip以及密码    现在变了
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+    //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数 by Yangdi
+    public GeneralResponse getEventList(Map<String, Object> params1, String[] nodeCodeListIn) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("pageNum", (Integer) params1.get("pageNum"));
+        params.put("pageSize", (Integer) params1.get("pageSize"));
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+//        String[] nodeCodeList = CommonConstant.AllChannle;
+        params.put("nodeCodeList", nodeCodeListIn);
+        // String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+        String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        return generalResponse;
+    }
+
+    //计算次数 by Yangdi
+    public String CountTimes(Map<String, Object> params1, String[] nodeCodeListIn) throws ClientException {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", formatA);
+        params.put("alarmEndDateString", formatD);
+        if (StringUtilsWork.isNotEmpty((String) params1.get("alarmStartDateString"))) {
+            params.put("alarmStartDateString", (String) params1.get("alarmStartDateString"));
+            params.put("alarmEndDateString", (String) params1.get("alarmEndDateString"));
+        }
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+//        String[] nodeCodeList = CommonConstant.AllChannle;
+        params.put("nodeCodeList", nodeCodeListIn);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+    //刷脸失败记录 by Yangdi
+    public R getAccidentRecord(Map<String, Object> params1) throws ClientException {
+        System.out.println("## params1>>" + params1);
+        Integer farmId = (int) params1.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return null;
+        }
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        if (!StringUtilsWork.isNotEmpty((String) params1.get("startSwingTime"))) {
+            params1.put("startSwingTime", formatA);
+            params1.put("endSwingTime", formatD);
+        }
+        params1.put("containDomain", "1");
+        params1.put("openResult", 0); //刷脸失败
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params1));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        GetResponse getResponse = new GetResponse();
+
+        return R.ok("请求成功").put("data", generalResponse).put("total", getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime")));
+    }
+
+    //查询人员违规记录 by Yangdi
+    public GeneralResponse getAccidentRecord1(Map<String, Object> params) throws ClientException {
+        Integer farmId = (int) params.get("farmId");
+        if (farmId != 1) {
+            //返回为空数据
+            return new GeneralResponse();
+        }
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return generalResponse;
+    }
+
+    /**
+     * //查人员通过过去几个小时的接口---异常通过次数接口
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPagePersonAlarm(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime", begin);
+        params.put("endSwingTime", end);
+        params.put("containDomain", "1");
+        params.put("openResult", 0);
+        System.out.println("内部参数>>" + params);
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        System.out.println("## 内部打印结果>>" + data);
+        return data.toString();
+    }
+
+    //人员通道查询总页数 by Yangdi
+//    @RequestMapping("/get_person_record_totalpage")
+//    public GeneralResponse get_person_record_totalpage( @RequestBody Map<String, Object> params ) throws ClientException {
+//        Integer  farmId= (int) params.get("farmId");
+//        if(farmId!=1){
+//            //返回为空数据
+//            return  new GeneralResponse() ;
+//        }
+//        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+//        IClient iClient = new DefaultClient();
+//        String timestamp = String.valueOf((new Date()).getTime());
+//        Long aLong = Long.valueOf(timestamp);
+//        String NewUrl = URL + aLong;
+//        System.out.println("开始执行");
+//        //这种已经在配置文件里面安排了账号ip以及密码
+//        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+//        System.out.println(NewUrl);
+//        generalRequest.header("Content-Type", " application/json");
+//        System.out.println(JSON.toJSONString(params));
+//        //里面是
+//        generalRequest.body(JSON.toJSONString(params));
+//        //发起请求处理应答
+//        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+//        System.out.println("执行结束");
+//        return generalResponse;
+//    }
+
+    public static void main(String[] args) throws ClientException {
+
+        Map<String, Object> params1 = new HashMap<>();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        //调整天数
+        c.add(Calendar.DATE, 0);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        System.out.println(formatA + formatD);
+
+        System.out.println("########### formatA>>" + formatA);
+        System.out.println("########### formatD>>" + formatD);
+
+        params1.put("pageNum", 1);
+        params1.put("pageSize", 20);
+        params1.put("startSwingTime", formatA);
+        params1.put("endSwingTime", formatD);
+//        params1.put("startSwingTime","2021-12-24 00:00:00");
+//        params1.put("endSwingTime","2021-12-24 23:59:59");
+
+        params1.put("containDomain", "1");
+        params1.put("openResult", 0); //刷脸失败
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?systime=";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params1));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+//        System.out.println("## generalResponse>>"+generalResponse.toString());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+//        System.out.println("## getResult>>"+generalResponse.getResult());
+        GetResponse getResponse = new GetResponse();
+
+        System.out.println("total>>" + getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime")));
+        System.out.println(jsonObject.toString());
+//        System.out.println("## 1>>"+JSON.toJSONString(generalResponse.getResult()));
+//        JSON.parseObject(JSON.toJSONString(generalResponse.getResult()));
+//        com.alibaba.fastjson.JSONObject resultJo = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(generalResponse.getResult());
+//        System.out.println("## resultJo>>"+resultJo);
+        com.alibaba.fastjson.JSONObject grObj = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(generalResponse);
+        System.out.println("grObj>>" + grObj);
+        com.alibaba.fastjson.JSONObject resultJo = grObj.getJSONObject("result");
+        System.out.println("resultJo>>" + resultJo);
+        com.alibaba.fastjson.JSONObject dataJo = resultJo.getJSONObject("data");
+        System.out.println("dataJo>>" + dataJo);
+        JSONArray pageDataJa = dataJo.getJSONArray("pageData");
+        System.out.println("pageDataJa>>" + pageDataJa);
+        System.out.println("pageDataJa.size>>" + pageDataJa.size());
+
+
+    }
+}

+ 21 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccChannelServiceImpl.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.video.dhicc.entity.IccChannel;
+import com.huimv.video.dhicc.mapper.IccChannelMapper;
+import com.huimv.video.dhicc.service.IIccChannelService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Service
+public class IccChannelServiceImpl extends ServiceImpl<IccChannelMapper, IccChannel> implements IIccChannelService {
+
+}

+ 21 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/IccEventRecordServiceImpl.java

@@ -0,0 +1,21 @@
+package com.huimv.video.dhicc.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.video.dhicc.entity.IccEventRecord;
+import com.huimv.video.dhicc.mapper.IccEventRecordMapper;
+import com.huimv.video.dhicc.service.IIccEventRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-06
+ */
+@Service
+public class IccEventRecordServiceImpl extends ServiceImpl<IccEventRecordMapper, IccEventRecord> implements IIccEventRecordService {
+
+}

+ 26 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomEventServiceImpl.java

@@ -0,0 +1,26 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.mapper.SysTelecomEventMapper;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+@Service
+public class SysTelecomEventServiceImpl extends ServiceImpl<SysTelecomEventMapper, SysTelecomEvent> implements ISysTelecomEventService {
+
+    @Override
+    public Result listByRoom(Map map) {
+        String deviceId = (String) map.get("deviceId");
+        QueryWrapper<SysTelecomEvent> wrapper = new QueryWrapper<>();
+        wrapper.eq("device_id", deviceId);
+        this.list(wrapper);
+        return new Result(ResultCode.SUCCESS, wrapper);
+    }
+
+}

+ 33 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysTelecomServiceImpl.java

@@ -0,0 +1,33 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+import com.huimv.video.dhicc.service.ISysTelecomService;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-22
+ */
+@Service
+public class SysTelecomServiceImpl extends ServiceImpl<SysTelecomMapper, SysTelecom> implements ISysTelecomService {
+
+    @Override
+    public Result listByRoom(Map map) {
+        String deviceId = (String) map.get("deviceId");
+        QueryWrapper<SysTelecom> wrapper = new QueryWrapper<>();
+        wrapper.eq("device_id", deviceId);
+        this.list(wrapper);
+        return new Result(ResultCode.SUCCESS, wrapper);
+    }
+}

+ 20 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/service/impl/SysThresholdServiceImpl.java

@@ -0,0 +1,20 @@
+package com.huimv.video.dhicc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huimv.video.dhicc.entity.SysThreshold;
+import com.huimv.video.dhicc.mapper.SysThresholdMapper;
+import com.huimv.video.dhicc.service.ISysThresholdService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-30
+ */
+@Service
+public class SysThresholdServiceImpl extends ServiceImpl<SysThresholdMapper, SysThreshold> implements ISysThresholdService {
+
+}

+ 220 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/GetRecordFromIcc.java

@@ -0,0 +1,220 @@
+package com.huimv.video.dhicc.timmer;//package com.huimv.video.dhicc.timmer;
+//
+//import com.alibaba.fastjson.JSON;
+//import com.dahuatech.hutool.http.Method;
+//import com.dahuatech.icc.exception.ClientException;
+//import com.dahuatech.icc.oauth.http.DefaultClient;
+//import com.dahuatech.icc.oauth.http.IClient;
+//import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+//import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+//import com.huimv.video.dhicc.entity.IccEventRecord;
+//import com.huimv.video.dhicc.icc.CommonConstant;
+//import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+//import com.huimv.video.dhicc.service.IIccEventRecordService;
+//import com.huimv.video.dhicc.service.ISysTelecomEventService;
+//import net.sf.json.JSONObject;
+//import org.apache.commons.io.FileUtils;
+//import org.apache.http.HttpResponse;
+//import org.apache.http.client.methods.HttpGet;
+//import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+//import org.apache.http.conn.ssl.SSLContextBuilder;
+//import org.apache.http.conn.ssl.TrustStrategy;
+//import org.apache.http.impl.client.CloseableHttpClient;
+//import org.apache.http.impl.client.HttpClients;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.scheduling.annotation.Scheduled;
+//import org.springframework.stereotype.Component;
+//import javax.net.ssl.SSLContext;
+//import javax.servlet.http.HttpServletResponse;
+//import java.io.File;
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.io.OutputStream;
+//import java.security.cert.CertificateException;
+//import java.security.cert.X509Certificate;
+//import java.text.SimpleDateFormat;
+//import java.util.*;
+//
+//
+//import static com.huimv.video.dhicc.icc.CommonConstant.IPAndPort;
+//
+///**
+// * Icc事件同步到这里
+// */
+//@Component
+//public class GetRecordFromIcc {
+//
+//
+//    //访问时间的接口 将数据存到本地  但是这张表需要存  人员信息图片   车辆通过图片   事件图片三种基本的信息
+//    //需要明白的是  事件来自于这里  但是 这里只存储时间在两天之内的数据 实际上来说这里可以存储的数据需要合理设计
+//    //前端访问的接口还是不能变  我们不对齐做任何的改变 只是通过传入的开始结束时间来判断是从本地拿数据  还是从牧场拿数据
+//   //首先拿三天的数据过来再说
+//
+//
+//    @Autowired
+//    private SysTelecomMapper sysTelecomMapper;
+//
+//    @Autowired
+//    private ISysTelecomEventService sysTelecomEventService;
+//
+//    @Autowired
+//    private IIccEventRecordService iccEventRecordService ;
+//
+//    //每小时执行一次
+//   // @Scheduled(cron = " 0 */59 * * * ? ")
+//    @Scheduled(cron = " 0/5 * * * * ? ")
+//    private void getDataFromLocalIcc() throws ClientException, IOException {
+//         //这个地方拿出EVENT 数组 进行数据的判断 后面for循环一旦存在就抛弃
+//
+//        //返回所有的事件 的集合  包括死猪和洗消和大门 --分页参数
+//            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//            Calendar c = Calendar.getInstance();
+//            Date date = new Date();
+//            c.setTime(date);
+//            c.set(Calendar.HOUR, 0);
+//            c.set(Calendar.MINUTE, 0);
+//            c.set(Calendar.SECOND, 0);
+//            Date A = c.getTime();
+//            String formatA = format.format(A);
+//            c.set(Calendar.HOUR, +24);
+//            Date d = c.getTime();
+//            String formatD = format.format(d);
+//            Map<String, Object> params = new HashMap<>();
+//            params.put("alarmStartDateString",formatA);
+//            params.put("alarmEndDateString",formatD);
+//            params.put("pageNum",1);
+//            params.put("pageSize",10000);//足够大 包含时间段内所有的事件
+//            params.put("alarmType",303);
+//            params.put("dbType",0);
+//            params.put("deviceCategory",1);
+//            String[]  nodeCodeList= CommonConstant.AllChannle;
+//            params.put("nodeCodeList",nodeCodeList);
+//            //String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page"; //获取事件URL    post请求
+//            String URL = "/evo-apigw/evo-event/1.2.0/alarm-record/page";  //获取事件URL    post请求
+//            IClient iClient = new DefaultClient();
+//            String NewUrl = URL;
+//            //这种已经在配置文件里面安排了账号ip以及密码
+//            GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+//            System.out.println(NewUrl);
+//            generalRequest.header("Content-Type", " application/json");
+//            generalRequest.body(JSON.toJSONString(params));
+//            GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+//              JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+//        JSONObject jsonObject01     = (JSONObject) jsonObject.get("data");
+//        List<Map> ss1= (List<Map>) jsonObject01.get("pageData");
+////        JSONArray jsonArray = JSONArray.fromObject(pageData);
+////        List<IccEventRecord> ss  = JSONArray.toList(jsonArray) ;//处理   for循环 需要有对应
+//        System.out.println();
+//      /*  for (IccEventRecord s : ss) {
+//            System.out.println(s.getAlarmPicture());
+//        }
+//*/
+//        for (Object o : ss1) {
+//            System.out.println(o);
+//            IccEventRecord iccEventRecord = new IccEventRecord();
+//            iccEventRecord.setEventId )
+//
+//
+//            iccEventRecordService.save(iccEventRecord);
+//
+//        }
+//
+//    }
+//
+//
+//    public  static void   getAndSave(String access_token , String  alarmPicture ,String fileName  , HttpServletResponse response) throws  IOException {
+//        HttpResponse httpResponse = null;
+//        try {
+//            CloseableHttpClient buildSSLCloseableHttpClient = buildSSLCloseableHttpClient();
+//            System.setProperty("jsse.enableSNIExtension", "false");
+//            HttpGet httpGet = new HttpGet(
+//                    //事件的图片
+//           IPAndPort+"/evo-pic/"+alarmPicture+"?token="+access_token+"&oss_addr=172.16.3.223:8925" );
+//
+//                         httpResponse = buildSSLCloseableHttpClient.execute(httpGet);
+//        } catch (Exception e) {
+//            // TODO Auto-generated catch block
+//            e.printStackTrace();
+//        }
+//        System.out.println("返回图片");
+//        response.setContentLength(28539);
+//        response.setHeader("Content-Type"," image/jpeg");
+//        response.setHeader("Accept-Ranges","bytes");
+//        //流在这里
+//        //可以 图片存储成功//只要当前目录存在  就可以实现存储图片
+//        File outFile = new File( "D:\\test\\12.jpg");
+//        //拷贝文件到输出文件对象
+//        FileUtils.copyInputStreamToFile( httpResponse.getEntity().getContent(), outFile);
+//        InputStream content = httpResponse.getEntity().getContent();
+//
+//        OutputStream out = null;
+//        try {
+//            out = response.getOutputStream();
+//            int len = 0;
+//            byte[] b = new byte[1024];
+//            while ((len = content.read(b)) != -1) {
+//                out.write(b, 0, len);
+//            }
+//            out.flush();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } finally {
+//            try {
+//                if (out != null) {
+//                    out.close();
+//                }
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//            }
+//        }
+//    }
+//
+//
+//    private static CloseableHttpClient buildSSLCloseableHttpClient()
+//            throws Exception {
+//        SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null,
+//                new TrustStrategy() {
+//                    // 信任所有
+//                    public boolean isTrusted(X509Certificate[] chain,
+//                                             String authType) throws CertificateException {
+//                        return true;
+//                    }
+//                }).build();
+//        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+//                sslContext, new String[] { "TLSv1.2" }, null,
+//                SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+//        return HttpClients.custom().setSSLSocketFactory(sslsf).build();
+//    }
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//
+//    }
+//
+//
+//

+ 160 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/SysTelcomEnentTimmer.java

@@ -0,0 +1,160 @@
+package com.huimv.video.dhicc.timmer;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.huimv.video.dhicc.entity.SysTelecom;
+import com.huimv.video.dhicc.entity.SysTelecomEvent;
+import com.huimv.video.dhicc.entity.SysThreshold;
+import com.huimv.video.dhicc.mapper.SysTelecomEventMapper;
+import com.huimv.video.dhicc.mapper.SysTelecomMapper;
+import com.huimv.video.dhicc.mapper.SysThresholdMapper;
+import com.huimv.video.dhicc.service.ISysTelecomEventService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+//主要用来生产烘干数据的 时间拿时间 --可以吧大华的代码赋值出来 自己改一改  应该是OK的
+@Component
+public class SysTelcomEnentTimmer {
+    @Autowired
+    private SysTelecomMapper sysTelecomMapper;
+    @Autowired
+    private SysTelecomEventMapper sysTelecomEventMapperMapper;
+    @Autowired
+    private ISysTelecomEventService sysTelecomEventService;
+
+    @Autowired
+    private SysThresholdMapper sysThresholdMapper;
+
+    //检查烘干是否合格--找出时间 阈值直接计算
+    // @Scheduled(cron = " 0/10 * * * * ? ")
+    @Scheduled(cron = " 0 */59 * * * ? ")
+    private void checkOk() {
+
+        //拿对应牧场的阈值
+        LambdaQueryWrapper<SysThreshold> wrapper1 = Wrappers.lambdaQuery();
+        wrapper1.eq(SysThreshold::getFarmId, 1);
+        SysThreshold sysThreshold = sysThresholdMapper.selectOne(wrapper1);//System.out.println(sysTelecoms);
+        // System.out.println("yuzhi"+sysThreshold);
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar TimeDeviceId = Calendar.getInstance();
+        TimeDeviceId.setTime(new Date());
+        TimeDeviceId.add(Calendar.HOUR_OF_DAY, -30);
+        Date began1time = TimeDeviceId.getTime();
+        String startTime1 = format.format(began1time);
+        String endTime1 = format.format(new Date());
+
+        //拿事件
+        LambdaQueryWrapper<SysTelecomEvent> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(SysTelecomEvent::getFarmId, 1);
+        wrapper.between(SysTelecomEvent::getEventTime, startTime1, endTime1);
+        List<SysTelecomEvent> SysTelecomEvent = sysTelecomEventMapperMapper.selectList(wrapper);//System.out.println(sysTelecoms);
+        // System.out.println("yuzhi"+SysTelecomEvent);
+
+        for (SysTelecomEvent sysTelecomEvent : SysTelecomEvent) {
+            // System.out.println("yuzhi"+sysTelecomEvent);
+            Calendar eventTime = Calendar.getInstance();
+            eventTime.setTime(sysTelecomEvent.getEventTime());
+            //事件时间就是开始时间
+            String EventStartTime = format.format(sysTelecomEvent.getEventTime());
+            //一次烘干50度以上一般在8次左右  就是说40分钟  这里取一小时
+            eventTime.add(Calendar.MINUTE, +60);
+            Date EventEndTime1 = eventTime.getTime();
+            String EventEndTime = format.format(EventEndTime1);
+
+            //查第一次五十度事件之后的数据  统计持续在设定温度之上的事件
+            LambdaQueryWrapper<SysTelecom> wrapper3 = Wrappers.lambdaQuery();
+            wrapper3.eq(SysTelecom::getDeviceId, sysTelecomEvent.getDeviceId());
+            wrapper3.eq(SysTelecom::getFarmId, 1);
+            wrapper3.between(SysTelecom::getTimestamp, EventStartTime, EventEndTime);
+            List<SysTelecom> sysTelecoms = sysTelecomMapper.selectList(wrapper3);//System.out.println(sysTelecoms);
+
+            Integer count = 0;
+            for (SysTelecom sysTelecom : sysTelecoms) {
+                if (Double.parseDouble(sysTelecom.getTemp()) > Double.parseDouble(sysThreshold.getBenconValue())) {
+                    count++;
+
+                }
+            }
+            if (Double.parseDouble(sysThreshold.getBenconValue()) < count * 5) {
+                System.out.println("高于阈值温度时间" + count * 5);
+                //正确烘干为1
+
+                sysTelecomEvent.setRemark("1");
+            } else {
+                sysTelecomEvent.setRemark("0");
+            }
+            System.out.println("存储" + sysTelecomEvent.getRemark());
+            sysTelecomEventService.updateById(sysTelecomEvent);
+
+            //System.out.println("事件时间=" + EventStartTime + sysTelecoms);
+        }
+    }
+
+    //每小时执行一次
+    //@Scheduled(cron = " 0 */59 * * * ? ")
+    // @Scheduled(cron = " 0/5 * * * * ? ")
+    // @Scheduled(cron = " 0/50 * * * * ? ")
+    private void updateBox() {
+        //获得设备列表 查找烘干数据
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        LambdaQueryWrapper<SysTelecom> lambdaQueryWrapper =
+                new LambdaQueryWrapper<>();
+        lambdaQueryWrapper
+                .select(SysTelecom::getDeviceId);
+        List<String> collect = sysTelecomMapper.selectObjs(lambdaQueryWrapper).stream().map(o -> (String) o).collect(Collectors.toList());
+        //System.out.println(collect);
+        for (String deviceId : collect) {
+            Calendar TimeDeviceId = Calendar.getInstance();
+            TimeDeviceId.setTime(new Date());
+            TimeDeviceId.add(Calendar.HOUR, -300);
+            Date began1time = TimeDeviceId.getTime();
+            String startTime1 = format.format(began1time);
+            String endTime1 = format.format(new Date());
+            LambdaQueryWrapper<SysTelecom> wrapper = Wrappers.lambdaQuery();
+            wrapper.eq(SysTelecom::getDeviceId, deviceId);
+            wrapper.eq(SysTelecom::getFarmId, 1);
+            wrapper.between(SysTelecom::getTimestamp, startTime1, endTime1);
+            List<SysTelecom> sysTelecoms = sysTelecomMapper.selectList(wrapper);//System.out.println(sysTelecoms);
+            for (SysTelecom sysTelecom : sysTelecoms) {
+                if (Double.parseDouble(sysTelecom.getTemp()) > 50) {
+                    System.out.println("温度" + sysTelecom.getTemp() + sysTelecom.getDeviceId() + sysTelecom.getTimestamp());
+                    //产生时间段
+                    Calendar eventTime = Calendar.getInstance();
+                    eventTime.setTime(sysTelecom.getTimestamp());
+                    eventTime.add(Calendar.MINUTE, -60);
+                    Date began = eventTime.getTime();
+                    String EventStartTime = format.format(began);
+                    eventTime.add(Calendar.MINUTE, +110);
+                    Date EventEndTime1 = eventTime.getTime();
+                    String EventEndTime = format.format(EventEndTime1);
+                    //查询在大于50摄氏度这条记录的 前60分钟 后60分钟  时间里,有没有存储过报警事件  有就放弃  没有就加一条
+                    int count = sysTelecomEventService.count(Wrappers.<SysTelecomEvent>lambdaQuery()
+                            .eq(SysTelecomEvent::getDeviceId, sysTelecom.getDeviceId())
+                            .eq(SysTelecomEvent::getFarmId, sysTelecom.getFarmId())
+                            .between(SysTelecomEvent::getEventTime, EventStartTime, EventEndTime));
+                    System.out.println("插结果" + count);
+                    if (count == 0) {
+                        // System.out.println("保存了一条");
+                        SysTelecomEvent sysTelecomEvent = new SysTelecomEvent();
+                        sysTelecomEvent.setDeviceId(sysTelecom.getDeviceId());
+                        sysTelecomEvent.setEventTime(sysTelecom.getTimestamp());
+                        sysTelecomEvent.setEventId(sysTelecom.getId());
+                        sysTelecomEvent.setFarmId(sysTelecom.getFarmId());
+                        sysTelecomEvent.setRemark(sysTelecom.getTemp());
+                        sysTelecomEventService.save(sysTelecomEvent);
+                    }
+                    // System.out.println("抛弃");
+                }
+            }
+        }
+    }
+}

+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetPastTime.java

@@ -0,0 +1,16 @@
+package com.huimv.video.dhicc.util;
+
+import java.util.Date;
+
+public class GetPastTime {
+
+    //拿过去的时间  这个接口其实可以抽象出来
+    public Date getTimeBefor() {
+
+
+        return new Date();
+
+    }
+
+
+}

+ 385 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/GetResponse.java

@@ -0,0 +1,385 @@
+package com.huimv.video.dhicc.util;
+
+import com.alibaba.fastjson.JSON;
+import com.dahuatech.hutool.http.Method;
+import com.dahuatech.icc.exception.ClientException;
+import com.dahuatech.icc.oauth.http.DefaultClient;
+import com.dahuatech.icc.oauth.http.IClient;
+import com.dahuatech.icc.oauth.model.v202010.GeneralRequest;
+import com.dahuatech.icc.oauth.model.v202010.GeneralResponse;
+import com.huimv.video.dhicc.icc.CommonConstant;
+import com.huimv.video.dhicc.result.R;
+import net.sf.json.JSONObject;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+public class GetResponse {
+
+    /**
+     * //查车辆通行数量的接口**不分进出
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPage(String begin, String end) throws ClientException {
+        //条件只有开始结束时间  有问题 这个是条数  有统计条数的专门接口
+        //时间参数这里之前让前端传了  我这里只做转发  现在自己加上去
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        //设置时间参数
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime", begin);
+        params.put("endSwingTime", end);
+        params.put("openType", "61");//刷脸开门
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        Object data = JSONObject.fromObject(generalResponse.getResult()).get("data");
+        return data.toString();
+    }
+
+    /**
+     * //查车辆通行数量的接口**出去记录
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageCarOut(String begin, String end) throws ClientException {
+        String param = "queryTimeBegin=" + begin + "&queryTimeEnd=" + end + "&carDirect=9";
+        String Url = "/evo-apigw/ipms/carcapture/find/conditions?";
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject bject = JSONObject.fromObject(data);
+        Object data1 = bject.get("totalRows"); //打印 2390
+        return data1.toString();
+    }
+
+
+    /**
+     * //查车辆通行数量的接口**进入的记录----车辆闸机
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageCarIn(String begin, String end) throws ClientException {
+        String param = "queryTimeBegin=" + begin + "&queryTimeEnd=" + end + "&carDirect=8";
+        String Url = "/evo-apigw/ipms/carcapture/find/conditions?";
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        System.out.println(newUrl);
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.GET);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject bject = JSONObject.fromObject(data);
+        Object data1 = bject.get("totalRows"); //打印 2390
+        return data1.toString();
+
+    }
+
+
+    /**
+     * //查人员通过过去几个小时的接口---正常通过次数
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPagePerson(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime", begin);
+        params.put("endSwingTime", end);
+        params.put("openType", 61);
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        return data.toString();
+    }
+
+
+    /**
+     * //查人员通过过去几个小时的接口---异常通过次数接口
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGetPagePersonAlarm(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("startSwingTime", begin);
+        params.put("endSwingTime", end);
+        params.put("containDomain", "1");
+        params.put("openResult", 0);
+        String URL = "/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combinedCount?systime=";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String timestamp = String.valueOf((new Date()).getTime());
+        Long aLong = Long.valueOf(timestamp);
+        String NewUrl = URL + aLong;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        return data.toString();
+    }
+
+
+    public static void main(String[] args) throws ClientException {
+
+        Map<String, Object> params1 = new HashMap<>();
+
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Calendar c = Calendar.getInstance();
+        Date date = new Date();
+        c.setTime(date);
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+        //调整天数
+        c.add(Calendar.DATE, -1);
+        Date A = c.getTime();
+        String formatA = format.format(A);
+        c.set(Calendar.HOUR, +24);
+        Date d = c.getTime();
+        String formatD = format.format(d);
+        System.out.println(formatA + formatD);
+
+        params1.put("pageNum", 1);
+        params1.put("pageSize", 20);
+        params1.put("startSwingTime", formatA);
+        params1.put("endSwingTime", formatD);
+
+        params1.put("containDomain", "1");
+        params1.put("openResult", 0); //刷脸失败
+        String URL = "http://36.26.62.70:80/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined?systime=";
+        IClient iClient = new DefaultClient();
+        GeneralRequest generalRequest = new GeneralRequest(URL + Long.valueOf(String.valueOf((new Date()).getTime())), Method.POST);
+        generalRequest.header("Content-Type", " application/json");
+        generalRequest.body(JSON.toJSONString(params1));
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        GetResponse getResponse = new GetResponse();
+
+        System.out.println(jsonObject.toString() + getResponse.SendMassageGetPagePersonAlarm((String) params1.get("startSwingTime"), (String) params1.get("endSwingTime")));
+    }
+
+
+    /**
+     * //查洗消 ---时间次数的接口-----
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageXixiaoPerson(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", begin);
+        params.put("alarmEndDateString", end);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        params.put("nodeCodeList", CommonConstant.XixiaoChannle);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+    /**
+     * //查大门 ---时间次数的接口-----
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageGateCount(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", begin);
+        params.put("alarmEndDateString", end);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        params.put("nodeCodeList", CommonConstant.DoorChannle);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+    /**
+     * //查死猪 ---时间次数的接口-----
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendCountSiZhu(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", begin);
+        params.put("alarmEndDateString", end);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        //死猪通道
+        String[] nodeCodeList = CommonConstant.SIZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+    /**
+     * //查洗消死猪事件的时间-----次数的接口-----
+     *
+     * @param begin 开始时间
+     * @param end   结束时间
+     * @return
+     * @throws ClientException
+     */
+    public String SendMassageSiZhuRecord(String begin, String end) throws ClientException {
+        Map<String, Object> params = new HashMap<>();
+        params.put("alarmStartDateString", begin);
+        params.put("alarmEndDateString", end);
+        params.put("alarmType", 303);
+        params.put("dbType", 0);
+        params.put("deviceCategory", 1);
+        //死猪的通道
+        String[] nodeCodeList = CommonConstant.SIZhuChannle;
+        params.put("nodeCodeList", nodeCodeList);
+        String URL = "/evo-apigw/evo-event/1.0.0/alarm-record/count-num";  //获取事件URL    post请求
+        IClient iClient = new DefaultClient();
+        String NewUrl = URL;
+        System.out.println("开始执行");
+        //这种已经在配置文件里面安排了账号ip以及密码
+        GeneralRequest generalRequest = new GeneralRequest(NewUrl, Method.POST);
+        System.out.println(NewUrl);
+        generalRequest.header("Content-Type", " application/json");
+        System.out.println(JSON.toJSONString(params));
+        //里面是
+        generalRequest.body(JSON.toJSONString(params));
+        //发起请求处理应答
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        JSONObject jsonObject = JSONObject.fromObject(generalResponse.getResult());
+        Object data = jsonObject.get("data");
+        JSONObject jsonObject1 = JSONObject.fromObject(data);
+        System.out.println(jsonObject1);
+        return jsonObject1.get("value").toString();
+    }
+
+
+    public Object SendMassagePost(String param, String Url, String chooseMethod) throws ClientException {
+        IClient iClient = new DefaultClient();
+        System.out.println("开始执行");
+        String newUrl = Url + param;
+        //这种已经在配置文件里面安排了账号ip以及密码    现在变了
+        GeneralRequest generalRequest = new GeneralRequest(newUrl, Method.POST);
+        GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
+        System.out.println("执行结束");
+        return R.ok("请求成功").put("token", generalResponse);
+
+    }
+
+}

+ 385 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/HttpClient.java

@@ -0,0 +1,385 @@
+package com.huimv.video.dhicc.util;
+
+
+import org.apache.commons.collections.MapUtils;
+import org.apache.http.*;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.*;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.entity.mime.HttpMultipartMode;
+import org.apache.http.entity.mime.MultipartEntityBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.http.protocol.HTTP;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/*****
+ * @Author: yangdi  hm
+ * @Description: entity
+ ****/
+public class HttpClient {
+    private String url;
+    private Map<String, String> param;
+    private int statusCode;
+    private String content;
+    private String xmlParam;
+    private boolean isHttps;
+
+    public boolean isHttps() {
+        return isHttps;
+    }
+
+    public void setHttps(boolean isHttps) {
+        this.isHttps = isHttps;
+    }
+
+    public String getXmlParam() {
+        return xmlParam;
+    }
+
+    public void setXmlParam(String xmlParam) {
+        this.xmlParam = xmlParam;
+    }
+
+    public HttpClient(String url, Map<String, String> param) {
+        this.url = url;
+        this.param = param;
+    }
+
+
+    public HttpClient(String url) {
+        this.url = url;
+    }
+
+    public void setParameter(Map<String, String> map) {
+        param = map;
+    }
+
+
+    public void addParameter(String key, String value) {
+        if (param == null)
+            param = new HashMap<String, String>();
+        param.put(key, value);
+    }
+
+
+    public void post() throws ClientProtocolException, IOException {
+        HttpPost http = new HttpPost(url);
+        setEntity(http);
+        execute(http);
+    }
+
+    public void put() throws ClientProtocolException, IOException {
+        HttpPut http = new HttpPut(url);
+        setEntity(http);
+        execute(http);
+    }
+
+
+    public void get() throws ClientProtocolException, IOException {
+        if (param != null) {
+            StringBuilder url = new StringBuilder(this.url);
+            boolean isFirst = true;
+            for (String key : param.keySet()) {
+                if (isFirst) {
+                    url.append("?");
+                } else {
+                    url.append("&");
+                }
+                url.append(key).append("=").append(param.get(key));
+            }
+            this.url = url.toString();
+        }
+        HttpGet http = new HttpGet(url);
+        execute(http);
+    }
+
+    /**
+     * set http post,put param
+     */
+    private void setEntity(HttpEntityEnclosingRequestBase http) {
+        if (param != null) {
+            List<NameValuePair> nvps = new LinkedList<NameValuePair>();
+            for (String key : param.keySet()) {
+                nvps.add(new BasicNameValuePair(key, param.get(key))); // 参数
+            }
+            http.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8)); // 设置参数
+        }
+        if (xmlParam != null) {
+            http.setEntity(new StringEntity(xmlParam, Consts.UTF_8));
+        }
+    }
+
+    private void execute(HttpUriRequest http) throws ClientProtocolException,
+            IOException {
+        CloseableHttpClient httpClient = null;
+        try {
+            if (isHttps) {
+                SSLContext sslContext = new SSLContextBuilder()
+                        .loadTrustMaterial(null, new TrustStrategy() {
+                            // 信任所有
+                            @Override
+                            public boolean isTrusted(X509Certificate[] chain,
+                                                     String authType)
+                                    throws CertificateException {
+                                return true;
+                            }
+                        }).build();
+                SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+                        sslContext);
+                httpClient = HttpClients.custom().setSSLSocketFactory(sslsf)
+                        .build();
+            } else {
+                httpClient = HttpClients.createDefault();
+            }
+            CloseableHttpResponse response = httpClient.execute(http);
+            try {
+                if (response != null) {
+                    if (response.getStatusLine() != null) {
+                        statusCode = response.getStatusLine().getStatusCode();
+                    }
+                    HttpEntity entity = response.getEntity();
+                    // 响应内容
+                    content = EntityUtils.toString(entity, Consts.UTF_8);
+                }
+            } finally {
+                response.close();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            httpClient.close();
+        }
+    }
+
+
+    public static String httpClientPostSetBody(String url, Map<String, String> parmaMap1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+        HttpPost httpPost = new HttpPost(url);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8);
+        builder.setCharset(Charset.forName("utf-8"));
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.setCharset(StandardCharsets.UTF_8);
+        if (MapUtils.isNotEmpty(parmaMap1)) {
+            for (Map.Entry<String, String> entry : parmaMap1.entrySet()) {
+                System.out.println(entry.getKey());
+                System.out.println(entry.getValue());
+                builder.addTextBody(entry.getKey(), entry.getValue(), contentType);
+                System.out.println("正在循环");
+            }
+        }
+        System.out.println(builder.toString());
+        HttpEntity entity = builder.build();
+        httpPost.setEntity(entity);
+        // 执行提交
+        HttpResponse response = httpClient.execute(httpPost);
+        HttpEntity responseEntity = response.getEntity();
+        if (responseEntity != null) {
+            // 将响应内容转换为字符串
+            result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+        }
+        httpClient.close();
+        return result;
+    }
+
+
+    public static String httpClientUploadFilePut(String url, Map<String, String> parma1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+
+        HttpPut httpPut = new HttpPut(url);
+        MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+        //设置文本字符编码为UTF-8
+        //中间是格式
+        //ContentType contentType= ContentType.create("application/x-www-form-urlencoded", Charset.forName("UTF-8"));
+        ContentType contentType = ContentType.create(HTTP.PLAIN_TEXT_TYPE, HTTP.UTF_8);
+        builder.setCharset(Charset.forName("utf-8"));
+        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+        builder.setCharset(StandardCharsets.UTF_8);
+        // 文件流  应该写成可以复用的工具类
+        //builder.addBinaryBody("photo",file.getBytes());
+        // builder.addBinaryBody(file.getName(), file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());// 文件流
+        System.out.println("获取文件成功");
+        //暂时无法封装成工具
+
+        System.out.println("name=" + parma1.get("name"));
+        builder.addTextBody("id", parma1.get("id"), contentType);
+        builder.addTextBody("name", parma1.get("name"), contentType);
+        builder.addTextBody("mark", parma1.get("mark"), contentType);
+        System.out.println(builder.toString());
+        HttpEntity entity = builder.build();
+        httpPut.setEntity(entity);
+        // 执行提交
+        HttpResponse response = httpClient.execute(httpPut);
+        HttpEntity responseEntity = response.getEntity();
+        if (responseEntity != null) {
+            // 将响应内容转换为字符串
+            result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+        }
+        httpClient.close();
+
+        return result;
+    }
+
+
+    public static String doDelete(String url) {
+
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        HttpDelete httpDelete = new HttpDelete(url);
+        RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build();
+        httpDelete.setConfig(requestConfig);
+        httpDelete.setHeader("Content-type", "application/json");
+        httpDelete.setHeader("DataEncoding", "UTF-8");
+        // httpDelete.setHeader("token", token);
+
+        CloseableHttpResponse httpResponse = null;
+        try {
+            httpResponse = httpClient.execute(httpDelete);
+            HttpEntity entity = httpResponse.getEntity();
+            String result = EntityUtils.toString(entity);
+            return result;
+        } catch (ClientProtocolException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } finally {
+            if (httpResponse != null) {
+                try {
+                    httpResponse.close();
+                } catch (IOException e) {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+            if (null != httpClient) {
+                try {
+                    httpClient.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return null;
+    }
+
+
+    private static CloseableHttpClient buildSSLCloseableHttpClient()
+            throws Exception {
+        SSLContext sslContext = new org.apache.http.conn.ssl.SSLContextBuilder().loadTrustMaterial(null,
+                new TrustStrategy() {
+                    // 信任所有
+                    public boolean isTrusted(X509Certificate[] chain,
+                                             String authType) throws CertificateException {
+                        return true;
+                    }
+                }).build();
+        SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
+                sslContext, new String[]{"TLSv1.2"}, null,
+                SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+        return HttpClients.custom().setSSLSocketFactory(sslsf).build();
+    }
+
+
+    public static String httpClientUploadFilePost(String url, MultipartFile file, Map<String, String> header, Map<String, String> parma1) throws IOException {
+        CloseableHttpClient httpClient = HttpClients.createDefault();
+        String result = "";
+        try {
+
+            HttpPost httpPost = new HttpPost(url);
+            //请求头,women
+          /*  if (MapUtils.isNotEmpty(header)) {
+                for (Map.Entry<String, String> entry : header.entrySet()) {
+                    httpPost.addHeader(entry.getKey(), entry.getValue());
+                }
+            }
+            */
+
+            httpPost.setHeader("Authorization", "Bearer 1:0bf83146-2b0a-4dc9-9a61-044875561e75");
+            httpPost.setHeader("Connection", "keep-alive");
+            httpPost.setHeader("Content-Type", "multipart/form-data");
+            // httpPost.setHeader("Host","36.26.62.70");
+            // httpPost.setHeader("Content-Length",String.valueOf(file.getSize()));
+//            httpPost.setHeader("Accept","*/*");
+//            httpPost.setHeader("Accept-Encoding","gzip, deflate, br");
+            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
+            //设置文本字符编码为UTF-8
+            //中间是格式
+            //ContentType contentType= ContentType.create("application/x-www-form-urlencoded", Charset.forName("UTF-8"));
+            builder.setCharset(Charset.forName("utf-8"));
+            builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
+            builder.setCharset(StandardCharsets.UTF_8);
+
+            // 文件流  应该写成可以复用的工具类
+            // builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());
+            builder.addBinaryBody(file.getName(), file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());// 文件流
+            // builder.addBinaryBody("file", file.getInputStream(), ContentType.MULTIPART_FORM_DATA, file.getName());// 文件流
+            System.out.println("获取文件成功");
+            //暂时无法封装成工具
+
+
+            HttpEntity entity = builder.build();
+            System.out.println("获取文件成功1");
+            httpPost.setEntity(entity);
+            // 执行提交
+            System.out.println("获取文件成功2");
+
+            CloseableHttpClient buildSSLCloseableHttpClient = buildSSLCloseableHttpClient();
+            System.setProperty("jsse.enableSNIExtension", "false");
+
+            CloseableHttpResponse response = buildSSLCloseableHttpClient.execute(httpPost);
+            System.out.println("获取文件成功3");
+            System.out.println(response.toString());
+            System.out.println("获取文件成功4");
+            HttpEntity responseEntity = response.getEntity();
+            System.out.println("fanhui" + responseEntity.getContent().toString());
+            if (responseEntity != null) {
+                // 将响应内容转换为字符串
+                result = EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
+            }
+
+        } catch (Exception e) {
+            System.out.println(e);
+            System.out.println("baocuo");
+        } finally {
+            try {
+                httpClient.close();
+
+            } catch (IOException e) {
+                System.out.println("baocu");
+            }
+        }
+        return result;
+    }
+
+
+    public int getStatusCode() {
+        return statusCode;
+    }
+
+    public String getContent() throws ParseException, IOException {
+        return content;
+    }
+}

+ 104 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ImageByteUtil.java

@@ -0,0 +1,104 @@
+package com.huimv.video.dhicc.util;
+
+import javax.imageio.stream.FileImageInputStream;
+import javax.imageio.stream.FileImageOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+
+//存储图片到本地的工具类
+public class ImageByteUtil {
+    /**
+     * 实现图片与byte数组之间的互相转换
+     *
+     * @param args
+     */
+    public static void main(String[] args) {
+        //定义路径
+        String path = "C:\\Users\\yang\\Pictures\\Camera Roll\\123.jpg";
+        byte[] data = image2byte(path);
+        System.out.println(data.length);
+    }
+
+    /**
+     * 将图片转换为byte数组
+     *
+     * @param path 图片路径
+     * @return
+     */
+    public static byte[] image2byte(String path) {
+        //定义byte数组
+        byte[] data = null;
+        //输入流
+        FileImageInputStream input = null;
+        try {
+            input = new FileImageInputStream(new File(path));
+            ByteArrayOutputStream output = new ByteArrayOutputStream();
+            byte[] buf = new byte[1024];
+            int numBytesRead = 0;
+            while ((numBytesRead = input.read(buf)) != -1) {
+                output.write(buf, 0, numBytesRead);
+            }
+            data = output.toByteArray();
+            output.close();
+            input.close();
+        } catch (FileNotFoundException ex1) {
+            ex1.printStackTrace();
+        } catch (IOException ex1) {
+            ex1.printStackTrace();
+        }
+        return data;
+    }
+
+
+    //byte数组到图片
+    public void byte2image(byte[] data, String path) {
+        if (data.length < 3 || path.equals("")) {
+            return;
+        }
+        try {
+            FileImageOutputStream imageOutput = new FileImageOutputStream(new File(path));
+            imageOutput.write(data, 0, data.length);
+            imageOutput.close();
+            System.out.println("Make Picture success,Please find image in " + path);
+        } catch (Exception ex) {
+            System.out.println("Exception: " + ex);
+            ex.printStackTrace();
+        }
+    }
+
+    //byte数组到16进制字符串
+    public String byte2string(byte[] data) {
+        if (data == null || data.length <= 1) {
+            return "0x";
+        }
+        if (data.length > 200000) {
+            return "0x";
+        }
+        StringBuffer sb = new StringBuffer();
+        int buf[] = new int[data.length];
+        //byte数组转化成十进制
+        for (int k = 0; k < data.length; k++) {
+            buf[k] = data[k] < 0 ? (data[k] + 256) : (data[k]);
+        }
+        //十进制转化成十六进制
+        for (int k = 0; k < buf.length; k++) {
+            if (buf[k] < 16) {
+                sb.append("0" + Integer.toHexString(buf[k]));
+            } else {
+                sb.append(Integer.toHexString(buf[k]));
+            }
+        }
+        return "0x" + sb.toString().toUpperCase();
+    }
+}

+ 95 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ImageUploadUtils.java

@@ -0,0 +1,95 @@
+package com.huimv.video.dhicc.util;
+
+import org.apache.commons.io.FileUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.biosafety.uface.controller
+ * @Description : TODO
+ * @Version : 1.0
+ * @Author : ZhuoNing
+ * @Create : 2020-12-25
+ **/
+//存储图片到本地的工具类
+public class ImageUploadUtils {
+    public static String Upload(MultipartFile files[], HttpServletRequest request) {
+        //ogger.info("图片批量上传,files[]=",files);
+        String uploadPath = request.getSession().getServletContext().getRealPath("/") + "/upload";
+        StringBuilder filefiles = new StringBuilder();
+        // String uploadPath = "C:\\test\\upload";
+        File uploadDirectory = new File(uploadPath);
+        if (uploadDirectory.exists()) {
+            if (!uploadDirectory.isDirectory()) {
+                uploadDirectory.delete();
+            }
+        } else {
+            uploadDirectory.mkdir();
+        }
+        //这里可以支持多文件上传
+        if (files != null && files.length >= 1) {
+            BufferedOutputStream bw = null;
+            try {
+                for (MultipartFile file : files) {
+
+                    String fileName = file.getOriginalFilename();
+                    //判断是否有文件且是否为图片文件
+                    if (fileName != null && !"".equalsIgnoreCase(fileName.trim()) && isImageFile(fileName)) {
+                        filefiles.append(uploadPath + "/" + UUID.randomUUID().toString() + getFileType(fileName));
+                        filefiles.append(":");
+                        //创建输出文件对象
+                        File outFile = new File(uploadPath + "/" + UUID.randomUUID().toString() + getFileType(fileName));
+                        //拷贝文件到输出文件对象
+                        FileUtils.copyInputStreamToFile(file.getInputStream(), outFile);
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            } finally {
+                try {
+                    if (bw != null) {
+                        bw.close();
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+//        return "upload successful";
+        return filefiles.toString();
+    }
+
+
+    private static Boolean isImageFile(String fileName) {
+        String[] img_type = new String[]{".jpg", ".jpeg", ".png", ".gif", ".bmp"};
+        if (fileName == null) {
+            return false;
+        }
+        fileName = fileName.toLowerCase();
+        for (String type : img_type) {
+            if (fileName.endsWith(type)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * 获取文件后缀名
+     *
+     * @param fileName
+     * @return
+     */
+    private static String getFileType(String fileName) {
+        if (fileName != null && fileName.indexOf(".") >= 0) {
+            return fileName.substring(fileName.lastIndexOf("."), fileName.length());
+        }
+        return "";
+    }
+}

+ 68 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/Result.java

@@ -0,0 +1,68 @@
+package com.huimv.video.dhicc.util;
+
+import java.io.Serializable;
+
+public class Result implements Serializable {
+
+    private boolean success;
+    private Integer code;
+    private String message;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    private Object data;
+
+    //不需要返回数据时使用
+    public Result(ResultCode code) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+    }
+
+    public Result(ResultCode code, Object data) {
+        this.success = code.success;
+        this.code = code.code;
+        this.message = code.message;
+        this.data = data;
+    }
+
+    public Result(Integer code, String message, boolean success) {
+        this.code = code;
+        this.message = message;
+        this.success = success;
+    }
+
+    /*
+     * 调用ResultCode类封装常用的返回数据
+     */
+}

+ 41 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/dhicc/util/ResultCode.java

@@ -0,0 +1,41 @@
+package com.huimv.video.dhicc.util;
+
+public enum ResultCode {
+    SUCCESS(true, 10000, "操作成功!"),
+    //---系统错误返回码-----
+    FAIL(false, 10001, "操作失败"),
+    UNAUTHENTICATED(false, 10002, "您还未登录"),
+    UNAUTHORISE(false, 10003, "权限不足"),
+    SERVER_ERROR(false, 99999, "抱歉,系统繁忙,请稍后重试!"),
+
+    //---用户操作返回码  2xxxx----
+    MOBILEORPASSWORDERROR(false, 20001, "用户名或密码错误");
+    //---企业操作返回码  3xxxx----
+    //---权限操作返回码----
+    //---其他操作返回码----
+
+    //操作是否成功
+    boolean success;
+    //操作代码
+    int code;
+    //提示信息
+    String message;
+
+    ResultCode(boolean success, int code, String message) {
+        this.success = success;
+        this.code = code;
+        this.message = message;
+    }
+
+    public boolean success() {
+        return success;
+    }
+
+    public int code() {
+        return code;
+    }
+
+    public String message() {
+        return message;
+    }
+}

+ 25 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/config/MybatisPlusConfig.java

@@ -0,0 +1,25 @@
+package com.huimv.video.video.config;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class MybatisPlusConfig {
+
+    /**
+     * 分页插件
+     */
+//    @Bean
+//    public PaginationInterceptor paginationInterceptor() {
+//        return new PaginationInterceptor();
+//    }
+    @Bean
+    public MybatisPlusInterceptor mybatisPlusInterceptor() {
+        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
+        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
+        return interceptor;
+    }
+}

+ 63 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/BaseFaceController.java

@@ -0,0 +1,63 @@
+package com.huimv.video.video.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.video.entity.BaseFace;
+import com.huimv.video.video.service.IBaseFaceService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author author
+ * @since 2022-05-30
+ */
+@RestController
+@RequestMapping("/baseFace")
+public class BaseFaceController {
+    @Autowired
+    IBaseFaceService baseFaceService;
+
+
+    @PostMapping("/add")
+    public Result add(@RequestBody BaseFace baseFace) {
+        baseFaceService.save(baseFace);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(name = "id") String id) {
+
+        baseFaceService.removeById(id);
+
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody BaseFace baseFace) {
+
+        baseFaceService.updateById(baseFace);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @GetMapping("/list")
+    public Result list(@RequestParam(name = "farmId") Integer farmId) {
+
+        return new Result(ResultCode.SUCCESS, baseFaceService.list(new QueryWrapper<BaseFace>().eq("farm_id", farmId)));
+    }
+
+    @GetMapping("/listAll")
+    public Result listAll() {
+
+        return new Result(ResultCode.SUCCESS, baseFaceService.list());
+    }
+
+
+
+}

+ 68 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/BaseSpecificVideoController.java

@@ -0,0 +1,68 @@
+package com.huimv.video.video.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.video.entity.BaseSpecificVideo;
+import com.huimv.video.video.entity.Camera;
+import com.huimv.video.video.service.IBaseSpecificVideoService;
+import com.huimv.video.video.service.ICameraService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-20
+ */
+@RestController
+@RequestMapping("/baseSpecificVideo")
+public class  BaseSpecificVideoController {
+    @Autowired
+    IBaseSpecificVideoService baseSpecificVideoService;
+
+    @Autowired
+    ICameraService cameraService;
+
+    @PostMapping("/add")
+    public Result add(@RequestBody BaseSpecificVideo baseFarmX) {
+        Camera byId = cameraService.getById(baseFarmX.getVideoId());
+        baseFarmX.setVideoName(byId.getCameraName());
+        baseSpecificVideoService.save(baseFarmX);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(name = "id") Integer id) {
+        baseSpecificVideoService.removeById(id);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody BaseSpecificVideo baseFarmX) {
+        Camera byId = cameraService.getById(baseFarmX.getVideoId());
+        baseFarmX.setVideoName(byId.getCameraName());
+        baseSpecificVideoService.updateById(baseFarmX);
+        return new Result(ResultCode.SUCCESS);
+    }
+
+    @GetMapping("/list")
+    public Result list(@RequestParam(name = "farmId") Integer farmId) {
+
+        return new Result(ResultCode.SUCCESS, baseSpecificVideoService.list(new QueryWrapper<BaseSpecificVideo>().eq("farm_id", farmId)));
+    }
+
+    @GetMapping("/listSpecif")
+    public Result listSpecif(@RequestParam(name = "farmId") Integer farmId,
+                             @RequestParam(name = "type") Integer type) {
+
+        return new Result(ResultCode.SUCCESS, baseSpecificVideoService.listSpecif(farmId, type));
+    }
+
+
+}

+ 102 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraAreaController.java

@@ -0,0 +1,102 @@
+package com.huimv.video.video.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.huimv.common.utils.Result;
+import com.huimv.video.video.entity.Camera;
+import com.huimv.video.video.entity.CameraArea;
+import com.huimv.video.video.service.ICameraAreaService;
+import com.huimv.video.video.service.ICameraService;
+import com.huimv.video.video.utils.IpUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@RestController
+@RequestMapping("/cameraArea")
+public class CameraAreaController {
+    @Autowired
+    private ICameraAreaService cameraAreaService;
+
+    @Autowired
+    private ICameraService cameraService;
+
+
+    @PostMapping("/list")
+    public Result list(@RequestBody Map<String, Object> params) {
+        return cameraAreaService.cameraList(params);
+    }
+
+    @PostMapping("/add")
+    public Result add(@RequestBody CameraArea cameraArea) {
+        int brandName = cameraAreaService.count(new QueryWrapper<CameraArea>().eq("area_name", cameraArea.getAreaName()).eq("farm_id", cameraArea.getFarmId()));
+        if (brandName > 0) {
+            return new Result(100001, "区域名称重复", false);
+        }
+        cameraAreaService.save(cameraArea);
+        return new Result(10000, "添加成功", true);
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody CameraArea cameraArea) {
+        cameraAreaService.updateById(cameraArea);
+        int brandName = cameraAreaService.count(new QueryWrapper<CameraArea>().eq("area_name", cameraArea.getAreaName()));
+        if (brandName > 1) {
+            return new Result(100001, "区域名称重复", false);
+        }
+
+        String areaName = cameraArea.getAreaName();
+        Camera camera = new Camera();
+        if (StringUtils.isNotBlank(areaName)) {
+            camera.setAreaName(areaName);
+        }
+        UpdateWrapper<Camera> wrapper = new UpdateWrapper<>();
+        wrapper.eq("area_id", cameraArea.getId());
+        cameraService.update(camera, wrapper);
+
+
+        return new Result(10000, "修改成功", true);
+    }
+
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(value = "ids") List<Integer> ids) {
+
+        return cameraAreaService.removeIds(ids);
+
+    }
+
+
+    @GetMapping("/lsitAndCamera")
+    public Result lsitAndCamera(@RequestParam(value = "farmId") Integer farmId) {
+
+        return cameraAreaService.lsitAndCamera(farmId);
+
+    }
+
+    @GetMapping("/getUrl")
+    public String getUrl(@RequestParam(value = "farmId") Integer farmId, HttpServletRequest request) {
+
+        String ipAddr = IpUtil.getIpAddr(request);
+        CameraArea cameraArea = new CameraArea();
+        cameraArea.setPublicUrl(ipAddr + ":9080");
+        cameraAreaService.update(cameraArea, new QueryWrapper<CameraArea>().eq("farm_id", farmId));
+
+        return "成功";
+
+    }
+
+
+}

+ 77 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraBrandController.java

@@ -0,0 +1,77 @@
+package com.huimv.video.video.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.video.entity.Camera;
+import com.huimv.video.video.entity.CameraBrand;
+import com.huimv.video.video.service.ICameraBrandService;
+import com.huimv.video.video.service.ICameraService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 前端控制器
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@RestController
+@RequestMapping("/cameraBrand")
+public class CameraBrandController {
+
+    @Autowired
+    private ICameraBrandService cameraBrandService;
+
+    @Autowired
+    private ICameraService cameraService;
+
+    @PostMapping("/list")
+    public Result list(@RequestBody Map<String, Object> params) {
+        return cameraBrandService.listPage(params);
+    }
+
+    @PostMapping("/add")
+    public Result add(@RequestBody CameraBrand cameraBrand) {
+        int brandName = cameraBrandService.count(new QueryWrapper<CameraBrand>().eq("brand_name", cameraBrand.getBrandName()).eq("farm_id", cameraBrand.getFarmId()));
+        if (brandName > 0) {
+            return new Result(10001, "品牌名称重复", false);
+        }
+
+        cameraBrandService.save(cameraBrand);
+        return new Result(10000, "添加成功", true);
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody CameraBrand cameraArea) {
+        cameraBrandService.updateById(cameraArea);
+        int brandName = cameraBrandService.count(new QueryWrapper<CameraBrand>().eq("brand_name", cameraArea.getBrandName()));
+        if (brandName > 1) {
+            return new Result(10001, "品牌名称重复", false);
+        }
+        String areaName = cameraArea.getBrandName();
+        Camera camera = new Camera();
+        if (StringUtils.isNotBlank(areaName)) {
+            camera.setBrandName(areaName);
+        }
+        UpdateWrapper<Camera> wrapper = new UpdateWrapper<>();
+        wrapper.eq("brand_id", cameraArea.getId());
+        cameraService.update(camera, wrapper);
+
+        return new Result(ResultCode.SUCCESS, "修改成功");
+    }
+
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(value = "ids") List<Integer> ids) {
+        return cameraBrandService.removeIds(ids);
+    }
+
+}

+ 116 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/controller/CameraController.java

@@ -0,0 +1,116 @@
+package com.huimv.video.video.controller;
+
+
+import com.huimv.common.token.TokenSign;
+import com.huimv.common.utils.Result;
+import com.huimv.common.utils.ResultCode;
+import com.huimv.video.video.entity.Camera;
+import com.huimv.video.video.entity.vo.CameraListVo;
+import com.huimv.video.video.entity.vo.CameraListsVo;
+import com.huimv.video.video.entity.vo.CameraVo;
+import com.huimv.video.video.service.ICameraService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@RestController
+@RequestMapping("/camera")
+public class CameraController {
+    @Autowired
+    private ICameraService cameraService;
+
+
+    @PostMapping("/list")
+    public Result list(@RequestBody CameraListVo cameraListVo) {
+        return cameraService.listPage(cameraListVo);
+    }
+
+    @PostMapping("/add")
+    public Result add(@RequestBody Camera camera) {
+
+        if (camera == null) {
+            return new Result(ResultCode.FAIL, "添加失败");
+        }
+
+
+        return cameraService.add(camera);
+
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody Camera camera) {
+        return cameraService.updates(camera);
+
+    }
+
+    @GetMapping("/remove")
+    public Result remove(@RequestParam(value = "ids") List<Integer> ids) {
+        cameraService.removeByIds(ids);
+        return new Result(ResultCode.SUCCESS, "删除成功");
+    }
+
+    @PostMapping("/getCameraDetails")
+    private Result getCameraDetails(@RequestBody CameraListsVo cameraListsVo) {
+
+        List list = cameraService.getCameraDetails(cameraListsVo);
+        return new Result(ResultCode.SUCCESS, list);
+    }
+
+    //返回苹果手机看监控视频地址
+//    @PostMapping("/getCameraDetails2")
+//    private Result getCameraDetails2(@RequestBody CameraListsVo cameraListsVo){
+//        //
+//        List list =  cameraService.getCameraDetails2(cameraListsVo);
+//        return new Result(ResultCode.SUCCESS,list);
+//    }
+
+    @GetMapping("/getCameraDetailsByRoomId")
+    private Result getCameraDetailsByRoomId(@RequestParam(name = "roomId") Integer roomId) {
+
+        CameraVo list = cameraService.getCameraDetailsByRoomId(roomId);
+        return new Result(ResultCode.SUCCESS, list);
+    }
+
+    @GetMapping("/updateStatus")
+    private Result updateStatus(@RequestParam(value = "id") Integer id) {
+
+        return cameraService.updateStatus(id);
+    }
+
+
+    @RequestMapping("/getByAreaId")
+    private Result getByAreaId(Integer areaId, HttpServletRequest request) {
+
+        List list = cameraService.getByAreaId(areaId);
+        return new Result(ResultCode.SUCCESS, list);
+    }
+
+
+    @GetMapping("/initCamera")
+    private Result initCamera(@RequestParam(name = "farmId") Integer farmId, HttpServletRequest request) {
+        Integer userId = TokenSign.getMemberIdByJwtToken(request);
+
+        return cameraService.initCamera(farmId, userId);
+    }
+
+
+    @GetMapping("/listScreenCamera")
+    private Result listScreenCamera(@RequestParam(name = "farmId") Integer farmId) {
+
+        return cameraService.listScreenCamera(farmId);
+    }
+
+    @GetMapping("/screenCamera")
+    private Result screenCamera(@RequestParam(name = "farmId") Integer farmId) {
+
+        return cameraService.screenCamera(farmId);
+    }
+
+
+}

+ 38 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseFace.java

@@ -0,0 +1,38 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author author
+ * @since 2022-05-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("base_face")
+public class BaseFace implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String dataUrl;
+
+    private String imgUrl;
+
+    private Integer farmId;
+
+
+}

+ 34 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseRoom.java

@@ -0,0 +1,34 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class BaseRoom extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String boxId;
+
+    private String roomName;
+
+    private String alias;
+
+}

+ 35 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseScreenCameraAccount.java

@@ -0,0 +1,35 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class BaseScreenCameraAccount extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer farmId;
+
+    private Integer cameraId;
+
+    private Integer accountId;
+
+
+}

+ 38 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/BaseSpecificVideo.java

@@ -0,0 +1,38 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+public class BaseSpecificVideo extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private Integer videoId;
+
+    private Integer type;
+
+    private Integer farmId;
+
+    private String videoName;
+
+    private String selectVideo;
+
+}

+ 94 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/Camera.java

@@ -0,0 +1,94 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("sys_camera")
+public class Camera extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 摄像头名字
+     */
+    private String cameraName;
+
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 区域名字
+     */
+    private String areaName;
+
+    /**
+     * 区域id
+     */
+    private Integer areaId;
+
+    /**
+     * 摄像头ip
+     */
+    private String cameraIp;
+
+    /**
+     * 0未关注,1关注
+     */
+    private Integer attention;
+
+    /**
+     * 品牌名字
+     */
+    private String brandName;
+
+    /**
+     * 品牌id
+     */
+    private Integer brandId;
+
+    /**
+     * 0正常   1停用
+     */
+    private Boolean runStatus;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+
+    private Integer farmId;
+
+
+    private Integer roomId;
+    //icc通道
+    private String iccChannel;
+
+
+}

+ 40 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/CameraArea.java

@@ -0,0 +1,40 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("sys_camera_area")
+public class CameraArea extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    private String areaName;
+
+
+    private String remark;
+
+    private Integer farmId;
+
+    private String publicUrl;
+
+
+}

+ 53 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/CameraBrand.java

@@ -0,0 +1,53 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ *
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("sys_camera_brand")
+public class CameraBrand extends Model {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 品牌名称
+     */
+    private String brandName;
+
+    /**
+     * 主
+     */
+    private String mainStream;
+
+    /**
+     * 辅
+     */
+    private String assistStream;
+
+    /**
+     * 0主码流,1辅码流
+     */
+    private Integer streamType;
+
+    private Integer farmId;
+
+
+}

+ 36 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/PublicNetwork.java

@@ -0,0 +1,36 @@
+package com.huimv.video.video.entity;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.video.video.entity
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2021/9/26 0026 14:13
+ **/
+@Data
+@Accessors(chain = true)
+@TableName("public_network")
+public class PublicNetwork {
+
+    @TableId(value = "id")
+    private Integer id;
+
+    private String url;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date creationTime;
+
+    private String remark;
+
+    private Integer farmId;
+
+
+}

+ 15 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraListVo.java

@@ -0,0 +1,15 @@
+package com.huimv.video.video.entity.vo;
+
+
+import lombok.Data;
+
+@Data
+public class CameraListVo {
+    private Integer current;
+    private Integer size;
+    private String strchStr;
+    private Integer areaId;
+    private Integer brandId;
+    private Integer sort;
+    private Integer farmId;
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraListsVo.java

@@ -0,0 +1,19 @@
+package com.huimv.video.video.entity.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.video.video.entity.vo
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2021/9/29 0029 13:54
+ **/
+@Data
+public class CameraListsVo extends CameraListVo {
+
+
+    List<Integer> cameraIds;
+}

+ 22 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/entity/vo/CameraVo.java

@@ -0,0 +1,22 @@
+package com.huimv.video.video.entity.vo;
+
+import lombok.Data;
+
+/**
+ * @Project : huimv.shiwan
+ * @Package : com.huimv.video.video.entity
+ * @Description : TODO
+ * @Author : yuxuexuan
+ * @Create : 2021/9/26 0026 14:56
+ **/
+@Data
+public class CameraVo {
+    private String wsUrl;
+    private String rtspUrl;
+    private Integer areaId;
+    private String cameraName;
+    private Integer lastId;
+    private Integer nextId;
+    private String httpUrl;
+
+}

+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseFaceMapper.java

@@ -0,0 +1,16 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.BaseFace;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author author
+ * @since 2022-05-30
+ */
+public interface BaseFaceMapper extends BaseMapper<BaseFace> {
+
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseRoomMapper.java

@@ -0,0 +1,19 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.BaseRoom;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-11
+ */
+@Repository
+public interface BaseRoomMapper extends BaseMapper<BaseRoom> {
+
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseScreenCameraAccountMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.BaseScreenCameraAccount;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-02
+ */
+@Repository
+public interface BaseScreenCameraAccountMapper extends BaseMapper<BaseScreenCameraAccount> {
+
+}

+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/BaseSpecificVideoMapper.java

@@ -0,0 +1,16 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.BaseSpecificVideo;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-20
+ */
+public interface BaseSpecificVideoMapper extends BaseMapper<BaseSpecificVideo> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraAreaMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.CameraArea;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Repository
+public interface CameraAreaMapper extends BaseMapper<CameraArea> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraBrandMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.CameraBrand;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Repository
+public interface CameraBrandMapper extends BaseMapper<CameraBrand> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/CameraMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.Camera;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Repository
+public interface CameraMapper extends BaseMapper<Camera> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/mapper/PublicNetworkMapper.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.huimv.video.video.entity.PublicNetwork;
+import org.springframework.stereotype.Repository;
+
+/**
+ * <p>
+ * Mapper 接口
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-09-13
+ */
+@Repository
+public interface PublicNetworkMapper extends BaseMapper<PublicNetwork> {
+
+}

+ 0 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/readme


+ 16 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseFaceService.java

@@ -0,0 +1,16 @@
+package com.huimv.video.video.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.video.entity.BaseFace;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author author
+ * @since 2022-05-30
+ */
+public interface IBaseFaceService extends IService<BaseFace> {
+
+}

+ 18 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseRoomService.java

@@ -0,0 +1,18 @@
+package com.huimv.video.video.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.video.entity.BaseRoom;
+
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-11-11
+ */
+public interface IBaseRoomService extends IService<BaseRoom> {
+
+}

+ 17 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseScreenCameraAccountService.java

@@ -0,0 +1,17 @@
+package com.huimv.video.video.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.video.entity.BaseScreenCameraAccount;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-02
+ */
+public interface IBaseScreenCameraAccountService extends IService<BaseScreenCameraAccount> {
+
+}

+ 19 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/IBaseSpecificVideoService.java

@@ -0,0 +1,19 @@
+package com.huimv.video.video.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huimv.video.video.entity.BaseSpecificVideo;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author astupidcoder
+ * @since 2021-12-20
+ */
+public interface IBaseSpecificVideoService extends IService<BaseSpecificVideo> {
+
+    List listSpecif(Integer farmId, Integer type);
+}

+ 0 - 0
huimv-farm-datacenter-egg/huimv-farm-video/src/main/java/com/huimv/video/video/service/ICameraAreaService.java


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików