From 516a56260c86e1b78f13d3889f4f37cfe67d555c Mon Sep 17 00:00:00 2001 From: ‘liusuyi’ <1951119284@qq.com> Date: 星期六, 16 三月 2024 08:48:29 +0800 Subject: [PATCH] 增加通道查询列表排序 增加按范围多边形查井 --- ard-work/src/main/resources/mapper/device/ArdChannelMapper.xml | 38 +++++++++++-------- ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java | 3 - ard-work/src/main/java/com/ruoyi/inspect/controller/TaskController.java | 56 ++++++++++++++++++++------- ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java | 1 4 files changed, 65 insertions(+), 33 deletions(-) diff --git a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java index f4c899e..00d2aff 100644 --- a/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java +++ b/ard-work/src/main/java/com/ruoyi/device/camera/service/impl/ArdCamerasServiceImpl.java @@ -355,6 +355,7 @@ ardChannel.setDeviceId(camera.getId()); List<ArdChannel> ardChannels = ardChannelMapper.selectArdChannelList(ardChannel); if (ardChannels != null) { + ardChannels.stream().sorted(); camera.setChannelList(ardChannels); } Map<String, Object> cameraMap = ArdTool.convertEntityToMap(camera); 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..ac527be 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,25 @@ Set<String> taskIds = inspectionTaskManager.getTaskMap().keySet(); return AjaxResult.success(taskIds); } + + @ApiOperation("鏌ヨ鑼冨洿鍐呯殑浜�") + @PostMapping("/getWellListByPolygon") + AjaxResult getWellListByPolygon(@RequestBody List<Point> points) { + List<List<ArdAlarmpointsWell>> listOfLists = new ArrayList<>(); + List<SysDept> depts = deptService.selectDeptList(new SysDept()); + depts.stream().forEach(dept -> { + ArdAlarmpointsWell ardAlarmpointsWell = new ArdAlarmpointsWell(); + ardAlarmpointsWell.setDeptId(dept.getDeptId()); + List<ArdAlarmpointsWell> wellList = ardAlarmpointsWellService.selectArdAlarmpointsWellList(ardAlarmpointsWell); + List<ArdAlarmpointsWell> wells = wellList.stream() + .filter(well -> well.getLongitude() != null && well.getLatitude() != null) + .filter(well -> GisUtil.isInPolygon(new Point(well.getLongitude(), well.getLatitude()), points) + ).collect(Collectors.toList()); + listOfLists.add(wells); + }); + List<ArdAlarmpointsWell> inPolygonWellList = listOfLists.stream() + .flatMap(List::stream) + .collect(Collectors.toList()); + return AjaxResult.success(inPolygonWellList); + } } diff --git a/ard-work/src/main/resources/mapper/device/ArdChannelMapper.xml b/ard-work/src/main/resources/mapper/device/ArdChannelMapper.xml index 333dbe6..dbac841 100644 --- a/ard-work/src/main/resources/mapper/device/ArdChannelMapper.xml +++ b/ard-work/src/main/resources/mapper/device/ArdChannelMapper.xml @@ -1,18 +1,19 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.device.channel.mapper.ArdChannelMapper"> - + <resultMap type="ArdChannel" id="ArdChannelResult"> - <result property="id" column="id" /> - <result property="name" column="name" /> - <result property="chanNo" column="chan_no" /> - <result property="deviceId" column="device_id" /> + <result property="id" column="id"/> + <result property="name" column="name"/> + <result property="chanNo" column="chan_no"/> + <result property="deviceId" column="device_id"/> </resultMap> <sql id="selectArdChannelVo"> - select id, name, chan_no, device_id from ard_channel + select id, name, chan_no, device_id + from ard_channel </sql> <select id="selectArdChannelList" parameterType="ArdChannel" resultMap="ArdChannelResult"> @@ -20,13 +21,14 @@ <where> <if test="deviceId!=null">device_id=#{deviceId}</if> </where> + order by chan_no </select> - + <select id="selectArdChannelById" parameterType="String" resultMap="ArdChannelResult"> <include refid="selectArdChannelVo"/> where id = #{id} </select> - + <insert id="insertArdChannel" parameterType="ArdChannel"> insert into ard_channel <trim prefix="(" suffix=")" suffixOverrides=","> @@ -34,13 +36,13 @@ <if test="name != null">name,</if> <if test="chanNo != null">chan_no,</if> <if test="deviceId != null">device_id,</if> - </trim> + </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="name != null">#{name},</if> <if test="chanNo != null">#{chanNo},</if> <if test="deviceId != null">#{deviceId},</if> - </trim> + </trim> </insert> <update id="updateArdChannel" parameterType="ArdChannel"> @@ -54,16 +56,20 @@ </update> <delete id="deleteArdChannelById" parameterType="String"> - delete from ard_channel where id = #{id} + delete + from ard_channel + where id = #{id} </delete> <delete id="deleteArdChannelByIds" parameterType="String"> - delete from ard_channel where id in + delete from ard_channel where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> <delete id="deleteArdChannelByDeviceId" parameterType="String"> - delete from ard_channel where device_id = #{deviceId} + delete + from ard_channel + where device_id = #{deviceId} </delete> -</mapper> \ No newline at end of file +</mapper> diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java index 18c80f2..3b83022 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java @@ -45,8 +45,7 @@ @Autowired private SysPermissionService permissionService; - @Autowired - private SysPasswordService passwordService; + @Autowired private ISysUserService userService; /** -- Gitblit v1.9.3