From 585a292942e889fe5a99d289da62ef12add38dcf Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Sun, 28 Jan 2024 17:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=B9=E7=95=8C=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BigScreenController.java | 9 ++---- .../DevopsDeviceInfoController.java | 16 +++++++++++ .../controller/DevopsVideoInfoController.java | 23 ++++++++++++++- .../MetaActualUnitInfoController.java | 28 ++++++++++++++++++- .../controller/MetaAlarmInfoController.java | 4 +-- .../domain/dto/MetaActualUnitInfoDTO.java | 18 ++++++++++++ .../ruoyi/database/domain/dto/VideoDTO.java | 17 +++++++++++ 7 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 gather-app/src/main/java/com/ruoyi/database/domain/dto/MetaActualUnitInfoDTO.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/domain/dto/VideoDTO.java diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index 7c9c105..e33775e 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -3,13 +3,12 @@ package com.ruoyi.business.controller; import cn.hutool.core.date.DateUtil; 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.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; 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.database.domain.*; import com.ruoyi.database.domain.dto.MetaRealEstateInfoDTO; @@ -19,10 +18,8 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import org.apache.commons.collections4.map.LinkedMap; -import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.*; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; import java.util.regex.Matcher; @@ -74,7 +71,7 @@ public class BigScreenController extends BaseController { //实有房屋总数 // int countSyfw = realEstateInfoService.countSyfw(new MetaRealEstateInfo()); int countSyfw = realEstateInfoService.count(); - //实有单位总数 + //总数 int countSydw = actualUnitInfoService.count(); // 常驻人员查询 diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java index bda122e..8e1decc 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/DevopsDeviceInfoController.java @@ -3,6 +3,7 @@ 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.database.domain.DevopsDeviceInfo; import com.ruoyi.database.domain.DevopsDeviceStatus; import com.ruoyi.database.domain.DevopsVideoInfo; @@ -25,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 智能设备信息表(DevopsDeviceInfo)Controller @@ -58,6 +60,20 @@ public class DevopsDeviceInfoController extends BaseController { devopsDeviceInfoQueryWrapper.eq("parent_monitoring_type",devopsDeviceInfo.getParentMonitoringType()); List list = devopsDeviceInfoService.list(devopsDeviceInfoQueryWrapper); return getDataTable(list); +// 查询在线设备的 gbs_channel_no 列表 +// List onlineChannels = devopsDeviceStatusService.list(Wrappers.lambdaQuery() +// .eq(DevopsDeviceStatus::getIsOnline, 1) +// .groupBy(DevopsDeviceStatus::getGbsChannelNo)) +// .stream() +// .map(DevopsDeviceStatus::getGbsChannelNo) +// .collect(Collectors.toList()); + +// 查询设备信息 +// List deviceInfoList = devopsDeviceInfoService.list(Wrappers.lambdaQuery() +// .in(DevopsDeviceInfo::getGbsChannelNo, onlineChannels) +// .eq(DevopsDeviceInfo::getDeviceType, devopsDeviceInfo.getDeviceType()) +// .eq(DevopsDeviceInfo::getParentMonitoringType, devopsDeviceInfo.getParentMonitoringType())); +// return getDataTable(deviceInfoList); } @GetMapping("/type") 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 27bfd30..6750aad 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 @@ -6,6 +6,7 @@ import com.ruoyi.business.domain.dto.DevopsVideoInfoDto; import com.ruoyi.common.utils.StringKit; import com.ruoyi.database.domain.DevopsVideoInfo; import com.ruoyi.database.domain.DevopsVideoStatus; +import com.ruoyi.database.domain.dto.VideoDTO; import com.ruoyi.database.service.DevopsVideoInfoService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -56,7 +57,27 @@ public class DevopsVideoInfoController extends BaseController { 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); + } + TableDataInfo dataTable = getDataTable(resultList); + return dataTable; + } @GetMapping("/type") @ApiOperation("查询视频设备沿海与海堤线") public TableDataInfo levelList(DevopsVideoInfo devopsVideoInfo){ diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java index e1ea302..532d9b0 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaActualUnitInfoController.java @@ -4,6 +4,9 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.common.utils.bean.BeanUtils; 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.service.MetaActualUnitInfoService; import com.ruoyi.common.annotation.Log; @@ -19,6 +22,7 @@ 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; @@ -44,6 +48,28 @@ public class MetaActualUnitInfoController extends BaseController { 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 = metaActualUnitInfoService.list(queryWrapper); + List 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 @ApiOperation("新增实有单位信息表") @Log(title = "实有单位信息表", businessType = BusinessType.INSERT) @@ -115,7 +141,7 @@ public class MetaActualUnitInfoController extends BaseController { Math.sin(dLon / 2) * Math.sin(dLon / 2); double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); double distance = 6371 * c * 1000; - metaActualUnitInfoVO.setDistance((int)distance + "米"); + metaActualUnitInfoVO.setDistance((int) distance + "米"); return metaActualUnitInfoVO; }).collect(Collectors.toList()); return getDataTable(metaActualUnitInfoVOS); diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java index 1b35e89..4e1d48b 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java @@ -108,7 +108,7 @@ public class MetaAlarmInfoController extends BaseController { return getDataTable(list); } - @GetMapping("/filterByDay") + @GetMapping("/filterByDay") @ApiOperation("七天接警信息表") public AjaxResult filterByDay(MetaAlarmInfo metaAlarmInfo) { try { @@ -118,7 +118,7 @@ public class MetaAlarmInfoController extends BaseController { // 创建一个 TreeMap 用于存储每天的数据量 Map dailyCountsMap = new TreeMap<>(); // 循环迭代前7天 - for (int i = 1; i <= 7; i++) { + for (int i = 0; i < 7 ; i++) { LocalDate date = currentDate.minusDays(i); LocalDateTime startDateTime = date.atStartOfDay(); LocalDateTime endDateTime = date.atTime(LocalTime.MAX); diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/dto/MetaActualUnitInfoDTO.java b/gather-app/src/main/java/com/ruoyi/database/domain/dto/MetaActualUnitInfoDTO.java new file mode 100644 index 0000000..af1afd0 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/domain/dto/MetaActualUnitInfoDTO.java @@ -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; + } + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/dto/VideoDTO.java b/gather-app/src/main/java/com/ruoyi/database/domain/dto/VideoDTO.java new file mode 100644 index 0000000..91533e1 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/domain/dto/VideoDTO.java @@ -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; + } + +}