From e82ad7909bcb862296a6ce0028ea24b1e509aeb8 Mon Sep 17 00:00:00 2001 From: weitang Date: Fri, 25 Apr 2025 14:41:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A3=B0=E7=BA=B9=E5=92=8C=E4=B8=BA=E5=BE=AE?= =?UTF-8?q?=E6=B0=94=E8=B1=A1=E6=A8=A1=E5=9D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/VoicePatrolLogController.java | 2 + .../controller/WeatherLogController.java | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/VoicePatrolLogController.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/VoicePatrolLogController.java index ecf543b..66a4e38 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/VoicePatrolLogController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/VoicePatrolLogController.java @@ -14,6 +14,7 @@ import com.yfd.platform.modules.basedata.domain.VoicePatrolLog; import com.yfd.platform.modules.basedata.service.ISubstationPatroldeviceService; import com.yfd.platform.modules.basedata.service.IVoicePatrolLogService; import com.yfd.platform.utils.HttpRESTfulUtils; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -35,6 +36,7 @@ import java.util.Map; */ @RestController @RequestMapping("/basedata/voice-patrol-log") +@Api(value = "VoicePatrolLogController", tags = "声纹巡视数据") public class VoicePatrolLogController { @Resource private IVoicePatrolLogService voicePatrolLogService; diff --git a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/WeatherLogController.java b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/WeatherLogController.java index 51975fb..b75d6c8 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/WeatherLogController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/basedata/controller/WeatherLogController.java @@ -1,7 +1,11 @@ package com.yfd.platform.modules.basedata.controller; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.yfd.platform.config.ResponseResult; +import com.yfd.platform.modules.basedata.domain.WeatherLog; import com.yfd.platform.modules.basedata.service.IWeatherLogService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -10,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.Date; import java.util.Map; /** @@ -39,4 +44,40 @@ public class WeatherLogController { return ResponseResult.successData(weatherDevice); } + @GetMapping("/getWeatherLogPage") + @ApiOperation("分页查询环境信息") + public ResponseResult getWeatherLogPage(Page> page, String stationId, String patroldeviceName + , String startDate, String endDate) { + if (StrUtil.isBlank(stationId)) { + return ResponseResult.error("未传变电站信息"); + } + String startFormat = ""; + if (StrUtil.isNotBlank(startDate)) { + Date parseStart = DateUtil.parse(startDate); + //一天的开始 + Date beginOfDay = DateUtil.beginOfDay(parseStart); + startFormat = DateUtil.format(beginOfDay, "yyyy-MM-dd HH:mm:ss"); + } + String endFormat = ""; + if (StrUtil.isNotBlank(startDate)) { + Date parseEnd = DateUtil.parse(endDate); + //一天的结束 + Date endOfDay = DateUtil.endOfDay(parseEnd); + endFormat = DateUtil.format(endOfDay, "yyyy-MM-dd HH:mm:ss"); + } + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (StrUtil.isNotBlank(stationId)) { + queryWrapper.eq(WeatherLog::getStationId, stationId); + } + if (StrUtil.isNotBlank(patroldeviceName)) { + queryWrapper.like(WeatherLog::getPatroldeviceName, patroldeviceName); + } + if (StrUtil.isNotBlank(startFormat) && StrUtil.isNotBlank(endFormat)) { + queryWrapper.le(WeatherLog::getTime, endFormat); + queryWrapper.ge(WeatherLog::getTime, startFormat); + } + Page> mapPage = weatherLogService.pageMaps(page, queryWrapper); + return ResponseResult.successData(mapPage); + } + }