DDDDD---BINGTU,BOATUSER

develop
Angel 8 months ago
parent 0227f0b234
commit d4ae3e21e8

@ -1,4 +1,4 @@
package com.ruoyi.common.utils;
package com.ruoyi.business.controller.utils;
import java.util.concurrent.atomic.AtomicInteger;

@ -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) {

@ -1,7 +1,6 @@
package com.ruoyi.database.controller;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
@ -11,26 +10,20 @@ 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.TransitImpUserRecord;
import com.ruoyi.database.domain.TransitUserRecord;
import com.ruoyi.database.domain.vo.TransitUserRecordVO;
import com.ruoyi.database.service.DevopsDeviceInfoService;
import com.ruoyi.database.service.TransitImpUserRecordService;
import com.ruoyi.database.service.TransitUserRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -47,7 +40,7 @@ import java.util.stream.Collectors;
public class TransitUserRecordController extends BaseController {
private final TransitUserRecordService transitUserRecordService;
private final TransitImpUserRecordService transitImpUserRecordService;
private final DevopsDeviceInfoService devopsDeviceInfoService;
@GetMapping

@ -0,0 +1,26 @@
package com.ruoyi.database.domain.DAO;
public class Coordinate {
private Double longitude;
private Double latitude;
public Coordinate(Double longitude, Double latitude) {
this.longitude = longitude;
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public Double getLatitude() {
return latitude;
}
// 可以重写toString方法以便更好地格式化输出
@Override
public String toString() {
return "(" + longitude + ", " + latitude + ")";
}
}
Loading…
Cancel
Save