From b2630bf5e3fc3d7d7b8e7f30f00ecd88efaaedf4 Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Tue, 30 Jan 2024 00:53:39 +0800 Subject: [PATCH] DDDDD --- .../DevopsDeviceInfoController.java | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java index 5f40f6a..ab936d8 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java @@ -1,33 +1,29 @@ package com.ruoyi.database.controller; -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.ruoyi.common.utils.PageUtils; -import com.ruoyi.database.domain.DevopsDeviceInfo; -import com.ruoyi.database.domain.DevopsDeviceStatus; -import com.ruoyi.database.domain.DevopsVideoInfo; -import com.ruoyi.database.domain.DevopsVideoStatus; -import com.ruoyi.database.service.DevopsDeviceInfoService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.DevopsDeviceInfo; +import com.ruoyi.database.domain.DevopsDeviceStatus; +import com.ruoyi.database.domain.DevopsVideoInfo; +import com.ruoyi.database.domain.dto.VideoDTO; +import com.ruoyi.database.service.DevopsDeviceInfoService; import com.ruoyi.database.service.DevopsDeviceStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import org.checkerframework.checker.units.qual.A; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; /** * 智能设备信息表(DevopsDeviceInfo)Controller @@ -54,7 +50,6 @@ public class DevopsDeviceInfoController extends BaseController { for (DevopsDeviceStatus devopsDeviceStatus : list1) { strings.add(devopsDeviceStatus.getGbsChannelNo()); } - PageUtils.startPage(); QueryWrapper devopsDeviceInfoQueryWrapper = new QueryWrapper<>(); devopsDeviceInfoQueryWrapper.in("gbs_channel_no",strings); devopsDeviceInfoQueryWrapper.eq("device_type",devopsDeviceInfo.getDeviceType()); @@ -76,6 +71,39 @@ public class DevopsDeviceInfoController extends BaseController { // .eq(DevopsDeviceInfo::getParentMonitoringType, devopsDeviceInfo.getParentMonitoringType())); // return getDataTable(deviceInfoList); } + @PostMapping("/boundary") + @ApiOperation("边界列表") + public TableDataInfo list( + @RequestParam("startLongitude") Double startLongitude, + @RequestParam("endLongitude") Double endLongitude, + @RequestParam("startLatitude") Double startLatitude, + @RequestParam("endLatitude") Double endLatitude,DevopsDeviceInfo devopsDeviceInfo) { + QueryWrapper devopsDeviceStatusQueryWrapper = new QueryWrapper<>(); + devopsDeviceStatusQueryWrapper.eq("is_online",1).groupBy("gbs_channel_no"); + List list1 = devopsDeviceStatusService.list(devopsDeviceStatusQueryWrapper); + List strings = new ArrayList<>(); + for (DevopsDeviceStatus devopsDeviceStatus : list1) { + strings.add(devopsDeviceStatus.getGbsChannelNo()); + } + PageUtils.startPage(); + QueryWrapper devopsDeviceInfoQueryWrapper = new QueryWrapper<>(); + devopsDeviceInfoQueryWrapper.in("gbs_channel_no",strings); + devopsDeviceInfoQueryWrapper.eq("device_type",devopsDeviceInfo.getDeviceType()); + devopsDeviceInfoQueryWrapper.eq("parent_monitoring_type",devopsDeviceInfo.getParentMonitoringType()); + devopsDeviceInfoQueryWrapper.between("longitude", startLongitude, endLongitude) + .between("latitude", startLatitude, endLatitude); + List list = devopsDeviceInfoService.list(devopsDeviceInfoQueryWrapper); + List resultList = new ArrayList<>(); + for (DevopsDeviceInfo info : list) { + VideoDTO dto = new VideoDTO(); + org.springframework.beans.BeanUtils.copyProperties(info, dto); + dto.setConcatenatedAddress(info.getDeviceAddress()); + resultList.add(dto); + } + TableDataInfo dataTable = getDataTable(resultList); + return dataTable; + + } @GetMapping("/type") @ApiOperation("查询智能设备沿海与海堤线")