边界列表

develop
Angel 10 months ago
parent 22f01e5336
commit 585a292942

@ -3,13 +3,12 @@ package com.ruoyi.business.controller;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.business.domain.vo.*; import com.ruoyi.business.domain.vo.*;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.NumKit;
import com.ruoyi.common.utils.StringKit;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.*; import com.ruoyi.database.domain.*;
import com.ruoyi.database.domain.dto.MetaRealEstateInfoDTO; import com.ruoyi.database.domain.dto.MetaRealEstateInfoDTO;
@ -19,10 +18,8 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.map.LinkedMap; import org.apache.commons.collections4.map.LinkedMap;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -74,7 +71,7 @@ public class BigScreenController extends BaseController {
//实有房屋总数 //实有房屋总数
// int countSyfw = realEstateInfoService.countSyfw(new MetaRealEstateInfo()); // int countSyfw = realEstateInfoService.countSyfw(new MetaRealEstateInfo());
int countSyfw = realEstateInfoService.count(); int countSyfw = realEstateInfoService.count();
//实有单位总数 //总数
int countSydw = actualUnitInfoService.count(); int countSydw = actualUnitInfoService.count();
// 常驻人员查询 // 常驻人员查询

@ -3,6 +3,7 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.database.domain.DevopsDeviceInfo; import com.ruoyi.database.domain.DevopsDeviceInfo;
import com.ruoyi.database.domain.DevopsDeviceStatus; import com.ruoyi.database.domain.DevopsDeviceStatus;
import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoInfo;
@ -25,6 +26,7 @@ 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;
/** /**
* (DevopsDeviceInfo)Controller * (DevopsDeviceInfo)Controller
@ -58,6 +60,20 @@ public class DevopsDeviceInfoController extends BaseController {
devopsDeviceInfoQueryWrapper.eq("parent_monitoring_type",devopsDeviceInfo.getParentMonitoringType()); devopsDeviceInfoQueryWrapper.eq("parent_monitoring_type",devopsDeviceInfo.getParentMonitoringType());
List<DevopsDeviceInfo> list = devopsDeviceInfoService.list(devopsDeviceInfoQueryWrapper); List<DevopsDeviceInfo> list = devopsDeviceInfoService.list(devopsDeviceInfoQueryWrapper);
return getDataTable(list); return getDataTable(list);
// 查询在线设备的 gbs_channel_no 列表
// List<String> onlineChannels = devopsDeviceStatusService.list(Wrappers.<DevopsDeviceStatus>lambdaQuery()
// .eq(DevopsDeviceStatus::getIsOnline, 1)
// .groupBy(DevopsDeviceStatus::getGbsChannelNo))
// .stream()
// .map(DevopsDeviceStatus::getGbsChannelNo)
// .collect(Collectors.toList());
// 查询设备信息
// List<DevopsDeviceInfo> deviceInfoList = devopsDeviceInfoService.list(Wrappers.<DevopsDeviceInfo>lambdaQuery()
// .in(DevopsDeviceInfo::getGbsChannelNo, onlineChannels)
// .eq(DevopsDeviceInfo::getDeviceType, devopsDeviceInfo.getDeviceType())
// .eq(DevopsDeviceInfo::getParentMonitoringType, devopsDeviceInfo.getParentMonitoringType()));
// return getDataTable(deviceInfoList);
} }
@GetMapping("/type") @GetMapping("/type")

@ -6,6 +6,7 @@ import com.ruoyi.business.domain.dto.DevopsVideoInfoDto;
import com.ruoyi.common.utils.StringKit; import com.ruoyi.common.utils.StringKit;
import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoInfo;
import com.ruoyi.database.domain.DevopsVideoStatus; import com.ruoyi.database.domain.DevopsVideoStatus;
import com.ruoyi.database.domain.dto.VideoDTO;
import com.ruoyi.database.service.DevopsVideoInfoService; import com.ruoyi.database.service.DevopsVideoInfoService;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
@ -56,7 +57,27 @@ public class DevopsVideoInfoController extends BaseController {
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")
@ApiOperation("边界列表")
public TableDataInfo<DevopsVideoInfo> list(
@RequestParam("startLongitude") Double startLongitude,
@RequestParam("endLongitude") Double endLongitude,
@RequestParam("startLatitude") Double startLatitude,
@RequestParam("endLatitude") Double endLatitude) {
QueryWrapper<DevopsVideoInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.between("longitude", startLongitude, endLongitude)
.between("latitude", startLatitude, endLatitude);
List<DevopsVideoInfo> list = devopsVideoInfoService.list(queryWrapper);
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);
return dataTable;
}
@GetMapping("/type") @GetMapping("/type")
@ApiOperation("查询视频设备沿海与海堤线") @ApiOperation("查询视频设备沿海与海堤线")
public TableDataInfo<DevopsVideoInfo> levelList(DevopsVideoInfo devopsVideoInfo){ public TableDataInfo<DevopsVideoInfo> levelList(DevopsVideoInfo devopsVideoInfo){

@ -4,6 +4,9 @@ package com.ruoyi.database.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.database.domain.MetaActualUnitInfo; import com.ruoyi.database.domain.MetaActualUnitInfo;
import com.ruoyi.database.domain.MetaRealEstateInfo;
import com.ruoyi.database.domain.dto.MetaActualUnitInfoDTO;
import com.ruoyi.database.domain.dto.MetaRealEstateInfoDTO;
import com.ruoyi.database.domain.vo.MetaActualUnitInfoVO; import com.ruoyi.database.domain.vo.MetaActualUnitInfoVO;
import com.ruoyi.database.service.MetaActualUnitInfoService; import com.ruoyi.database.service.MetaActualUnitInfoService;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
@ -19,6 +22,7 @@ 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.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -44,6 +48,28 @@ public class MetaActualUnitInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@PostMapping("/boundary")
@ApiOperation("边界列表")
public TableDataInfo<MetaActualUnitInfo> list(
@RequestParam("startLongitude") Double startLongitude,
@RequestParam("endLongitude") Double endLongitude,
@RequestParam("startLatitude") Double startLatitude,
@RequestParam("endLatitude") Double endLatitude) {
QueryWrapper<MetaActualUnitInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.between("longitude", startLongitude, endLongitude)
.between("latitude", startLatitude, endLatitude);
List<MetaActualUnitInfo> list = metaActualUnitInfoService.list(queryWrapper);
List<MetaActualUnitInfoDTO> resultList = new ArrayList<>();
for (MetaActualUnitInfo info : list) {
MetaActualUnitInfoDTO dto = new MetaActualUnitInfoDTO();
org.springframework.beans.BeanUtils.copyProperties(info, dto);
dto.setConcatenatedAddress(info.getUintAddress());
resultList.add(dto);
}
TableDataInfo dataTable = getDataTable(resultList);
return dataTable;
}
@PostMapping @PostMapping
@ApiOperation("新增实有单位信息表") @ApiOperation("新增实有单位信息表")
@Log(title = "实有单位信息表", businessType = BusinessType.INSERT) @Log(title = "实有单位信息表", businessType = BusinessType.INSERT)
@ -115,7 +141,7 @@ public class MetaActualUnitInfoController extends BaseController {
Math.sin(dLon / 2) * Math.sin(dLon / 2); Math.sin(dLon / 2) * Math.sin(dLon / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = 6371 * c * 1000; double distance = 6371 * c * 1000;
metaActualUnitInfoVO.setDistance((int)distance + "米"); metaActualUnitInfoVO.setDistance((int) distance + "米");
return metaActualUnitInfoVO; return metaActualUnitInfoVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return getDataTable(metaActualUnitInfoVOS); return getDataTable(metaActualUnitInfoVOS);

@ -108,7 +108,7 @@ public class MetaAlarmInfoController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/filterByDay") @GetMapping("/filterByDay")
@ApiOperation("七天接警信息表") @ApiOperation("七天接警信息表")
public AjaxResult filterByDay(MetaAlarmInfo metaAlarmInfo) { public AjaxResult filterByDay(MetaAlarmInfo metaAlarmInfo) {
try { try {
@ -118,7 +118,7 @@ public class MetaAlarmInfoController extends BaseController {
// 创建一个 TreeMap 用于存储每天的数据量 // 创建一个 TreeMap 用于存储每天的数据量
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>(); Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
// 循环迭代前7天 // 循环迭代前7天
for (int i = 1; i <= 7; i++) { for (int i = 0; i < 7 ; i++) {
LocalDate date = currentDate.minusDays(i); LocalDate date = currentDate.minusDays(i);
LocalDateTime startDateTime = date.atStartOfDay(); LocalDateTime startDateTime = date.atStartOfDay();
LocalDateTime endDateTime = date.atTime(LocalTime.MAX); LocalDateTime endDateTime = date.atTime(LocalTime.MAX);

@ -0,0 +1,18 @@
package com.ruoyi.database.domain.dto;
import com.ruoyi.database.domain.MetaActualUnitInfo;
public class MetaActualUnitInfoDTO extends MetaActualUnitInfo {
private String concatenatedAddress;
// getters and setters for the new field
public String getConcatenatedAddress() {
return concatenatedAddress;
}
public void setConcatenatedAddress(String concatenatedAddress) {
this.concatenatedAddress = concatenatedAddress;
}
}

@ -0,0 +1,17 @@
package com.ruoyi.database.domain.dto;
import com.ruoyi.database.domain.DevopsVideoInfo;
public class VideoDTO extends DevopsVideoInfo {
private String concatenatedAddress;
// getters and setters for the new field
public String getConcatenatedAddress() {
return concatenatedAddress;
}
public void setConcatenatedAddress(String concatenatedAddress) {
this.concatenatedAddress = concatenatedAddress;
}
}
Loading…
Cancel
Save