| | |
| | | @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); |
| | |
| | | } |
| | | |
| | | /* |
| | | * 根据时间获取时间内时间点 |
| | | * 例:time=2021-08-04 就得到这天内每个小时时间点 |
| | | * time=2021-08 就得到这月内每天时间点 |
| | | * */ |
| | | * 根据时间获取时间内时间点 |
| | | * 例:time=2021-08-04 就得到这天内每个小时时间点 |
| | | * time=2021-08 就得到这月内每天时间点 |
| | | * */ |
| | | public static List<String> getTimeLag(String time) { |
| | | List<String> result = new ArrayList<>(); |
| | | int length = time.length(); |
| | |
| | | i = Calendar.DAY_OF_MONTH; |
| | | } else {//年 |
| | | end = getDateAddYear(time, 1); |
| | | dateFormat =yyyy; |
| | | dateFormat = yyyy; |
| | | i = Calendar.MONTH; |
| | | } |
| | | cal.setTime(getDate(time, dateFormat)); |
| | |
| | | } |
| | | 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<>(); |
| | | //开始时间 |