边界列表

develop
Angel 10 months ago
parent b5f739cbf1
commit 28e2c9b5a6

@ -18,12 +18,14 @@ import com.ruoyi.database.service.DevopsVideoStatusService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* (DevopsVideoInfo)Controller * (DevopsVideoInfo)Controller
@ -49,38 +51,45 @@ public class DevopsVideoInfoController extends BaseController {
for (DevopsVideoStatus devopsVideoStatus : list1) { for (DevopsVideoStatus devopsVideoStatus : list1) {
strings.add(devopsVideoStatus.getGbsChannelNo()); strings.add(devopsVideoStatus.getGbsChannelNo());
} }
if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null){ if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null) {
List<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings) List<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo, strings)
.like(DevopsVideoInfo::getDeviceName,devopsVideoInfo.getDeviceName()).list(); .like(DevopsVideoInfo::getDeviceName, devopsVideoInfo.getDeviceName()).list();
return getDataTable(list); return getDataTable(list);
} }
List<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo,strings).list(); List<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery().in(DevopsVideoInfo::getGbsChannelNo, strings).list();
return getDataTable(list); return getDataTable(list);
} }
@PostMapping("/boundary") @PostMapping("/boundary")
@ApiOperation("边界列表") @ApiOperation("边界列表")
public TableDataInfo<DevopsVideoInfo> list( public TableDataInfo<DevopsVideoInfo> list(
@RequestParam("startLongitude") Double startLongitude, @RequestParam("startLongitude") Double startLongitude,
@RequestParam("endLongitude") Double endLongitude, @RequestParam("endLongitude") Double endLongitude,
@RequestParam("startLatitude") Double startLatitude, @RequestParam("startLatitude") Double startLatitude,
@RequestParam("endLatitude") Double endLatitude) { @RequestParam("endLatitude") Double endLatitude,DevopsVideoInfo devopsVideoInfo) {
QueryWrapper<DevopsVideoInfo> queryWrapper = new QueryWrapper<>(); List<DevopsVideoStatus> list1 = devopsVideoStatusService.lambdaQuery().eq(DevopsVideoStatus::getIsOnline, 1).list();
queryWrapper.between("longitude", startLongitude, endLongitude) ArrayList<String> strings = new ArrayList<>();
.between("latitude", startLatitude, endLatitude); for (DevopsVideoStatus devopsVideoStatus : list1) {
List<DevopsVideoInfo> list = devopsVideoInfoService.list(queryWrapper); strings.add(devopsVideoStatus.getGbsChannelNo());
List<VideoDTO> 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);
} }
TableDataInfo dataTable = getDataTable(resultList); if (!"".equals(devopsVideoInfo.getDeviceName()) && devopsVideoInfo.getDeviceName() != null) {
return dataTable; List<DevopsVideoInfo> 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<DevopsVideoInfo> list = devopsVideoInfoService.lambdaQuery()
.between(DevopsVideoInfo::getLongitude, startLongitude, endLongitude)
.between(DevopsVideoInfo::getLatitude, startLatitude, endLatitude)
.in(DevopsVideoInfo::getGbsChannelNo, strings).list();
return getDataTable(list);
} }
@GetMapping("/type") @GetMapping("/type")
@ApiOperation("查询视频设备沿海与海堤线") @ApiOperation("查询视频设备沿海与海堤线")
public TableDataInfo<DevopsVideoInfo> levelList(DevopsVideoInfo devopsVideoInfo){ public TableDataInfo<DevopsVideoInfo> levelList(DevopsVideoInfo devopsVideoInfo) {
startPage(); startPage();
List<DevopsVideoInfo> list = devopsVideoInfoService.list(new QueryWrapper<>(devopsVideoInfo)); List<DevopsVideoInfo> list = devopsVideoInfoService.list(new QueryWrapper<>(devopsVideoInfo));
return getDataTable(list); return getDataTable(list);

Loading…
Cancel
Save