From 28e2c9b5a66b851e7057a35470637170c1b3145e Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Sun, 28 Jan 2024 18:53:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DevopsVideoInfoController.java | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java index 6750aad..55c6f3f 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsVideoInfoController.java @@ -18,12 +18,14 @@ import com.ruoyi.database.service.DevopsVideoStatusService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; +import org.apache.commons.lang3.StringUtils; 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; /** * 视频监控设备表(DevopsVideoInfo)Controller @@ -49,38 +51,45 @@ public class DevopsVideoInfoController extends BaseController { for (DevopsVideoStatus devopsVideoStatus : list1) { strings.add(devopsVideoStatus.getGbsChannelNo()); } - if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null){ - List list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings) - .like(DevopsVideoInfo::getDeviceName,devopsVideoInfo.getDeviceName()).list(); + if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null) { + List list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo, strings) + .like(DevopsVideoInfo::getDeviceName, devopsVideoInfo.getDeviceName()).list(); return getDataTable(list); } - List list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings).list(); + List list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo, strings).list(); return getDataTable(list); } + @PostMapping("/boundary") @ApiOperation("边界列表") public TableDataInfo list( @RequestParam("startLongitude") Double startLongitude, @RequestParam("endLongitude") Double endLongitude, @RequestParam("startLatitude") Double startLatitude, - @RequestParam("endLatitude") Double endLatitude) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.between("longitude", startLongitude, endLongitude) - .between("latitude", startLatitude, endLatitude); - List list = devopsVideoInfoService.list(queryWrapper); - List resultList = new ArrayList<>(); - for (DevopsVideoInfo info : list) { - VideoDTO dto = new VideoDTO(); - org.springframework.beans.BeanUtils.copyProperties(info, dto); - dto.setConcatenatedAddress(info.getDeviceAddress()); - resultList.add(dto); + @RequestParam("endLatitude") Double endLatitude,DevopsVideoInfo devopsVideoInfo) { + List list1 = devopsVideoStatusService.lambdaQuery().eq(DevopsVideoStatus::getIsOnline, 1).list(); + ArrayList strings = new ArrayList<>(); + for (DevopsVideoStatus devopsVideoStatus : list1) { + strings.add(devopsVideoStatus.getGbsChannelNo()); } - TableDataInfo dataTable = getDataTable(resultList); - return dataTable; + if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null) { + List list = devopsVideoInfoService.lambdaQuery() + .between(DevopsVideoInfo::getLongitude, startLongitude, endLongitude) + .between(DevopsVideoInfo::getLatitude, startLatitude, endLatitude) + .in(DevopsVideoInfo::getGbsChannelNo, strings) + .like(DevopsVideoInfo::getDeviceName, devopsVideoInfo.getDeviceName()).list(); + return getDataTable(list); + } + List list = devopsVideoInfoService.lambdaQuery() + .between(DevopsVideoInfo::getLongitude, startLongitude, endLongitude) + .between(DevopsVideoInfo::getLatitude, startLatitude, endLatitude) + .in(DevopsVideoInfo::getGbsChannelNo, strings).list(); + return getDataTable(list); } + @GetMapping("/type") @ApiOperation("查询视频设备沿海与海堤线") - public TableDataInfo levelList(DevopsVideoInfo devopsVideoInfo){ + public TableDataInfo levelList(DevopsVideoInfo devopsVideoInfo) { startPage(); List list = devopsVideoInfoService.list(new QueryWrapper<>(devopsVideoInfo)); return getDataTable(list);