声纹和为微气象模块优化
This commit is contained in:
parent
19ff7288ea
commit
e82ad7909b
@ -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;
|
||||
|
@ -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<Map<String, Object>> 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<WeatherLog> 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<Map<String, Object>> mapPage = weatherLogService.pageMaps(page, queryWrapper);
|
||||
return ResponseResult.successData(mapPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user