| | |
| | | @ApiOperation(value = "获取风场数据", notes = "获取风场数据") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"), |
| | | @ApiImplicitParam(name = "monitorPointId", value = "站点id", required = true, paramType = "query", dataType = "String") |
| | | @ApiImplicitParam(name = "monitorPointIds", value = "站点id", required = true, paramType = "query", dataType = "String") |
| | | }) |
| | | public ResultMessage getWindData(HttpServletRequest request) { |
| | | Map<String, Object> params = WebUtils.getParametersStartingWith(request, null); |
| | |
| | | result.add(format); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | //根据date取之前第一个分钟为0或5的时间点。例:2021-08-09 15:32:00->2021-08-09 15:30:00,2021-08-09 15:39:00->2021-08-09 15:35:00 |
| | | public static Date getFiveMinuteDate(Date date) { |
| | | String dateString = dateToDateString(date, yyyy_MM_dd_HH_mm_EN); |
| | | String minute = dateString.substring(15, 16); |
| | | int i = Integer.parseInt(minute); |
| | | if (i > 0 && i < 5) { |
| | | i = 0; |
| | | } else if (i > 5 && i <= 9) { |
| | | i = 5; |
| | | } |
| | | StringBuilder stringBuffer = new StringBuilder(dateString); |
| | | stringBuffer.replace(15, 16, String.valueOf(i)); |
| | | return getDate(stringBuffer.toString(), yyyy_MM_dd_HH_mm_EN); |
| | | } |
| | | } |
| | |
| | | //时间格式化:yyyy-MM-dd HH:mm |
| | | String format = DateUtils.yyyy_MM_dd_HH_mm_EN; |
| | | Date now = new Date(); |
| | | now = DateUtils.getFiveMinuteDate(now); |
| | | |
| | | //从数据库获取数据参数 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | //开始时间 |