| | |
| | | import com.moral.util.TempAllocationUtils; |
| | | |
| | | import com.moral.util.mapUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import net.sf.json.JSONString; |
| | | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.apache.commons.net.ftp.FTPClient; |
| | |
| | | String time = map.get("time").toString(); |
| | | time = time.substring(time.length() - 2); |
| | | map.put("time", Integer.valueOf(time)); |
| | | if(parameters.get("type").equals("day")){ |
| | | map.put("time", Integer.valueOf(time)+1); |
| | | if (parameters.get("type").equals("day")) { |
| | | map.put("time", Integer.valueOf(time) + 1); |
| | | } |
| | | map.put("value", map.remove(sensorKey)); |
| | | } |
| | |
| | | if (minAngle > (Double) longAndLatiList.get(j).get("angle")) { |
| | | minAngle = (Double) longAndLatiList.get(j).get("angle"); |
| | | indexAngle = j; |
| | | }else { |
| | | indexAngle=indexAngle; |
| | | } else { |
| | | indexAngle = indexAngle; |
| | | } |
| | | } |
| | | preAngleDeviceList.add(deviceList.get((Integer) longAndLatiList.get(indexAngle).get("h"))); |
| | |
| | | locationList.add(fivethLoction); |
| | | String preAngleDeviceString = JSON.toJSON(preAngleDeviceList).toString(); |
| | | params.put("preAngleDeviceString", preAngleDeviceString);//两台添加箭头的设备 |
| | | params.put("locationList",locationList); |
| | | params.put("locationList", locationList); |
| | | return params; |
| | | } |
| | | |
| | | @GetMapping("forecastO3") |
| | | @ApiOperation(value = "预测和实际臭氧对比", notes = "预测和实际臭氧对比") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "monitorPointId", defaultValue = "1", value = "监控站id", required = true, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time", value = "时间(格式:2020-03-19)", required = true, paramType = "query", dataType = "String")}) |
| | | public ResultBean<List<Map<String, Object>>> getWeatherNextDayDataByRegion(HttpServletRequest request) throws Exception { |
| | | Map<String, Object> parameters = getParametersStartingWith(request, null); |
| | | parameters.put("typeFormat", "%Y-%m-%d %H:%i:%s"); |
| | | List<Map<String, Object>> resultList = weatherService.getForecastAndReal(parameters); |
| | | return new ResultBean<List<Map<String, Object>>>(resultList); |
| | | } |
| | | |
| | | @GetMapping("weatherData") |
| | | @ApiOperation(value = "根据city查询预测和实际数据", notes = "根据city查询预测和实际数据") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "city", value = "城市名", required = true, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time", value = "时间(格式:2020-03-19)", required = true, paramType = "query", dataType = "String")}) |
| | | public ResultBean<List<Map<String, Object>>> getWeatherData(HttpServletRequest request) throws Exception { |
| | | Map<String, Object> parameters = getParametersStartingWith(request, null); |
| | | parameters.put("typeFormat", "%Y-%m-%d %H:%i:%s"); |
| | | List<Map<String, Object>> weatherList = weatherService.getWeatherData(parameters); |
| | | return new ResultBean<List<Map<String, Object>>>(weatherList); |
| | | } |
| | | |
| | | @PostMapping("updateForecastWeather") |
| | | public void updateForecastWeather(HttpServletRequest request){ |
| | | Map<String, Object> parameters = getParametersStartingWith(request, null); |
| | | weatherService.updateForecastWeather(parameters); |
| | | } |
| | | } |