From dae6e068207ad1bff32dafd8c71f12d8a2a59aa2 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期一, 15 四月 2024 16:21:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev
---
ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java | 53 ++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java b/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
index 955d788..df6b92e 100644
--- a/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
+++ b/ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java
@@ -1,18 +1,25 @@
package com.ruoyi.inspect.controller;
+import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
+import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.inspect.service.IArdVideoInspectTaskService;
import com.ruoyi.inspect.service.impl.InspectionTaskManager;
+import com.ruoyi.system.service.ISysDeptService;
+import com.ruoyi.utils.gis.GisUtil;
+import com.ruoyi.utils.gis.Point;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
import java.util.Set;
+import java.util.stream.Collectors;
/**
* @Description: 宸℃浠诲姟controller
@@ -29,37 +36,35 @@
private InspectionTaskManager inspectionTaskManager;
@Autowired
IArdVideoInspectTaskService ardVideoInspectTaskService;
+ @Autowired
+ IArdAlarmpointsWellService ardAlarmpointsWellService;
+ @Autowired
+ private ISysDeptService deptService;
+
@PreAuthorize("@ss.hasPermi('inspect:control:manual')")
@GetMapping("/startTask/{taskId}")
@ApiOperation("鎵嬪姩寮�鍚贰妫�")
AjaxResult startTask(@PathVariable String taskId) {
boolean enablemanualTask = ardVideoInspectTaskService.isEnablemanualTask(taskId);
- if (enablemanualTask)
- {
+ if (enablemanualTask) {
// 寮�鍚贰妫�浠诲姟
inspectionTaskManager.startInspectionTask(taskId);
return AjaxResult.success();
- }
- else
- {
+ } else {
return AjaxResult.error();
}
}
-
@GetMapping("/startTask/{taskId}/noPerm")
@ApiOperation("鎵嬪姩寮�鍚贰妫�-涓嶆牎楠屾潈闄�")
AjaxResult startTaskNoPerm(@PathVariable String taskId) {
boolean enablemanualTask = ardVideoInspectTaskService.isEnablemanualTask(taskId);
- if (enablemanualTask)
- {
+ if (enablemanualTask) {
// 寮�鍚贰妫�浠诲姟
inspectionTaskManager.startInspectionTask(taskId);
return AjaxResult.success();
- }
- else
- {
+ } else {
return AjaxResult.error();
}
@@ -98,4 +103,22 @@
Set<String> taskIds = inspectionTaskManager.getTaskMap().keySet();
return AjaxResult.success(taskIds);
}
+
+ @ApiOperation("鏌ヨ鑼冨洿鍐呯殑浜�")
+ @PostMapping("/getWellListByPolygon")
+ AjaxResult getWellListByPolygon(@RequestBody List<Point> points) {
+ List<ArdAlarmpointsWell> inPolygonWellList = deptService.selectDeptList(new SysDept()).stream()
+ .map(dept -> {
+ ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell();
+ ardAlarmpointsWell.setDeptId(dept.getDeptId());
+ return ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell).stream()
+ .filter(well -> well.getLongitude() != null && well.getLatitude() != null)
+ .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points))
+ .collect(Collectors.toList());
+ })
+ .flatMap(List::stream)
+ .collect(Collectors.toList());
+
+ return AjaxResult.success(inPolygonWellList);
+ }
}
--
Gitblit v1.9.3