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);