|
|
|
@ -1,35 +1,33 @@
|
|
|
|
|
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.business.domain.dto.DevopsVideoInfoDto;
|
|
|
|
|
import com.ruoyi.common.utils.StringKit;
|
|
|
|
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
|
|
import com.ruoyi.database.domain.DevopsVideoInfo;
|
|
|
|
|
import com.ruoyi.database.domain.DevopsVideoStatus;
|
|
|
|
|
import com.ruoyi.database.domain.MetaActualUnitInfo;
|
|
|
|
|
import com.ruoyi.database.domain.dto.VideoDTO;
|
|
|
|
|
import com.ruoyi.database.domain.vo.MetaActualUnitInfoVO;
|
|
|
|
|
import com.ruoyi.database.service.DevopsVideoInfoService;
|
|
|
|
|
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.StringKit;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.database.domain.DevopsVideoInfo;
|
|
|
|
|
import com.ruoyi.database.domain.DevopsVideoStatus;
|
|
|
|
|
import com.ruoyi.database.service.DevopsVideoInfoService;
|
|
|
|
|
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.http.ResponseEntity;
|
|
|
|
|
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.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 视频监控设备表(DevopsVideoInfo)Controller
|
|
|
|
|
*
|
|
|
|
@ -90,6 +88,63 @@ public class DevopsVideoInfoController extends BaseController {
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/name")
|
|
|
|
|
@ApiOperation("按名称查询设备经纬度")
|
|
|
|
|
public TableDataInfo<DevopsVideoInfo> getNameWhereList(@RequestParam String name){
|
|
|
|
|
startPage();
|
|
|
|
|
// 使用LambdaQueryWrapper构建查询条件
|
|
|
|
|
LambdaQueryWrapper<DevopsVideoInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
queryWrapper.like(DevopsVideoInfo::getDeviceName, name);
|
|
|
|
|
// 执行查询
|
|
|
|
|
List<DevopsVideoInfo> list = devopsVideoInfoService.list(queryWrapper);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
|
}
|
|
|
|
|
@GetMapping("/Noname")
|
|
|
|
|
@ApiOperation("按名称查询设备channelNo")
|
|
|
|
|
public ResponseEntity<List<String>> getChannalNoList(@RequestParam String name){
|
|
|
|
|
startPage();
|
|
|
|
|
// 使用LambdaQueryWrapper构建查询条件
|
|
|
|
|
LambdaQueryWrapper<DevopsVideoInfo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
|
queryWrapper.like(DevopsVideoInfo::getDeviceName, name);
|
|
|
|
|
// 执行查询
|
|
|
|
|
List<DevopsVideoInfo> list = devopsVideoInfoService.list(queryWrapper);
|
|
|
|
|
|
|
|
|
|
// 提取channelNo字段的值并转换为String后放入列表中
|
|
|
|
|
List<String> channelNos = list.stream()
|
|
|
|
|
.map(devopsVideoInfo -> String.valueOf(devopsVideoInfo.getChannelNo()))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
// 返回channelNo列表
|
|
|
|
|
return ResponseEntity.ok(channelNos);
|
|
|
|
|
}
|
|
|
|
|
@GetMapping("/device/coordinates")
|
|
|
|
|
@ApiOperation("根据设备ID查询设备经纬度")
|
|
|
|
|
public ResponseEntity<Map<String, Object>> getDeviceCoordinates(@RequestParam String ChannelNo) {
|
|
|
|
|
// 根据设备ID查询设备信息
|
|
|
|
|
DevopsVideoInfo device = devopsVideoInfoService.getById(ChannelNo);
|
|
|
|
|
|
|
|
|
|
// 检查设备是否存在
|
|
|
|
|
if (device == null) {
|
|
|
|
|
return ResponseEntity.notFound().build();
|
|
|
|
|
}
|
|
|
|
|
// 获取设备的经纬度
|
|
|
|
|
double longitude = device.getLongitude();
|
|
|
|
|
double latitude = device.getLatitude();
|
|
|
|
|
|
|
|
|
|
// 检查经纬度是否都为0
|
|
|
|
|
if (longitude == 0 && latitude == 0) {
|
|
|
|
|
// 如果经纬度都为0,返回200状态码和一个空的响应体
|
|
|
|
|
return ResponseEntity.ok(Collections.emptyMap());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 准备返回的经纬度信息
|
|
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
|
|
result.put("longitude", device.getLongitude());
|
|
|
|
|
result.put("latitude", device.getLatitude());
|
|
|
|
|
|
|
|
|
|
// 返回经纬度信息
|
|
|
|
|
return ResponseEntity.ok(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/type")
|
|
|
|
|
@ApiOperation("查询视频设备沿海与海堤线")
|
|
|
|
|
public TableDataInfo<DevopsVideoInfo> levelList(DevopsVideoInfo devopsVideoInfo) {
|
|
|
|
|