From 44f2a0a32c096bdb05d4cc0ac162cdc1eb14c3ed Mon Sep 17 00:00:00 2001
From: Administrator <1144154118@qq.com>
Date: 星期四, 10 八月 2023 13:14:29 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java | 68 ++++++++++++++++++---------------
1 files changed, 37 insertions(+), 31 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
index beb9483..e0efc82 100644
--- a/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
+++ b/ard-work/src/main/java/com/ruoyi/device/camera/controller/ArdCamerasController.java
@@ -3,11 +3,13 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.ruoyi.device.camera.domain.ArdCameras;
+import com.ruoyi.device.camera.domain.CameraCmd;
import com.ruoyi.device.camera.service.IArdCamerasService;
import com.ruoyi.device.hiksdk.service.impl.HikClientServiceImpl;
-import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.inspect.service.IArdVideoInspectTaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -25,11 +27,7 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.page.TableDataInfo;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
* 鐩告満璁惧Controller
@@ -46,6 +44,8 @@
private HikClientServiceImpl sdk;
@Resource
private IArdCamerasService ardCamerasService;
+ @Resource
+ private IArdVideoInspectTaskService ardVideoInspectTaskService;
/**
* 鏌ヨ鐩告満璁惧鍒楄〃
@@ -93,16 +93,7 @@
//娉ㄩ攢
sdk.loginOut(camera.getId());
//鐧诲綍
- camera = sdk.login(camera);
- if (camera.getLoginId() >= 0) {
- log.info("鐩告満" + camera.getIp() + ":" + camera.getPort() + "鐧诲綍鎴愬姛锛�" + camera.getLoginId());
- camera.setUpdateBy(SecurityUtils.getUsername());
- ardCamerasService.updateArdCameras(camera);
- }
- else
- {
- log.info("鐩告満" + camera.getIp() + ":" + camera.getPort() + "鐧诲綍澶辫触锛�" + camera.getLoginId());
- }
+ sdk.login(camera);
return toAjax(ardCamerasService.insertArdCameras(camera));
}
@@ -115,19 +106,10 @@
@PutMapping
public AjaxResult edit(@RequestBody ArdCameras camera) {
int i = ardCamerasService.updateArdCameras(camera);
- if(i>0)
- {
+ if (i > 0) {
ArdCameras cameras = ardCamerasService.selectArdCamerasById(camera.getId());
sdk.loginOut(cameras.getId());
- camera = sdk.login(cameras);
- if (camera.getLoginId() >= 0) {
- log.info("鐩告満" + camera.getIp() + ":" + camera.getPort() + "鐧诲綍鎴愬姛锛�" + camera.getLoginId());
- ardCamerasService.updateArdCameras(camera);
- }
- else
- {
- log.info("鐩告満" + camera.getIp() + ":" + camera.getPort() + "鐧诲綍澶辫触锛�" + camera.getLoginId());
- }
+ sdk.login(cameras);
}
return toAjax(i);
}
@@ -141,10 +123,11 @@
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
for (String id : ids) {
- sdk.loginOut(id);
- }
+ sdk.loginOut(id);
+ }
return toAjax(ardCamerasService.deleteArdCamerasByIds(ids));
}
+
@GetMapping("/options")
@ApiOperation("閫夋嫨鐩告満鏁版嵁")
public List options(ArdCameras ardCameras) {
@@ -154,10 +137,33 @@
Map option = new HashMap();
option.put("value", item.getId());
option.put("label", item.getName());
- // option.put("description", item.getOilProduction());
+ option.put("channel", item.getChannel());
+ List timeList = ardVideoInspectTaskService.getCameraIdleTimeList(item.getId());
+ option.put("idleTimeList", timeList);//绌洪棽鏃堕棿娈�
options.add(option);
}
return options;
}
-
+ @GetMapping("/getDeptAndCamera")
+ @ApiOperation("鑾峰彇閮ㄩ棬鍜岀浉鏈�")
+ public AjaxResult getDeptAndCamera()
+ {
+ Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(true);
+ return AjaxResult.success(deptAndCamera);
+ }
+ @GetMapping("/getDeptAndCameraWithCheckBox")
+ @ApiOperation("鑾峰彇閮ㄩ棬鍜岀浉鏈�(寮�鍚閫夋)")
+ public AjaxResult getDeptAndCameraWithCheckBox()
+ {
+ Map deptAndCamera = ardCamerasService.getChildDeptAndCamera(false);
+ return AjaxResult.success(deptAndCamera);
+ }
+ @PostMapping("/getNearCamerasBycoordinate")
+ @ApiOperation("鑾峰彇闄勮繎鐨勭浉鏈�")
+ @ApiOperationSupport(includeParameters = {"targetPosition"})
+ public AjaxResult getNearCamerasBycoordinate(@RequestBody CameraCmd cmd)
+ {
+ TreeMap nearCamerasBycoordinate = ardCamerasService.getNearCamerasBycoordinate(cmd);
+ return AjaxResult.success(nearCamerasBycoordinate);
+ }
}
--
Gitblit v1.9.3