|
@@ -307,34 +307,32 @@ public class FmsConsoleController {
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
throw new BizException(ErrorCode.WEATHER_PARAM_GET_ERROR);
|
|
throw new BizException(ErrorCode.WEATHER_PARAM_GET_ERROR);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- String result = WeatherUtil.getWeatherNearlySevenDays(weatherReqVo);
|
|
|
|
|
- if (StringUtils.isEmpty(result)) {
|
|
|
|
|
- throw new BizException(ErrorCode.FMS_WEATHER_SEARCH_FAILED);
|
|
|
|
|
- }
|
|
|
|
|
- FmsWeatherInfoResVo fmsWeatherInfoResVo = JSONObject.parseObject(result, FmsWeatherInfoResVo.class);
|
|
|
|
|
- if (null == fmsWeatherInfoResVo) {
|
|
|
|
|
|
|
+ FmsWeatherInfoResVo fmsWeatherInfoResVo = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ String result = WeatherUtil.getWeatherNearlySevenDays(weatherReqVo);
|
|
|
|
|
+ JSONObject resultObj = JSONObject.parseObject(result).getJSONObject("data").getJSONObject("content");
|
|
|
|
|
+ fmsWeatherInfoResVo = JSONObject.parseObject(resultObj.toString(), FmsWeatherInfoResVo.class);
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ if (!StringUtils.isEmpty(fmsWeatherInfoResVo.getCityid())) {
|
|
|
|
|
+ map = iFmsSolarService.getSysZoneByZoneCode(fmsWeatherInfoResVo.getCityid());
|
|
|
|
|
+ }
|
|
|
|
|
+ List<FmsWeatherInfoResVo> weatherList = new ArrayList<>();
|
|
|
|
|
+ JSONArray data = resultObj.getJSONArray("data");
|
|
|
|
|
+ if (data != null) {
|
|
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
|
|
+ String str = data.getString(i);
|
|
|
|
|
+ FmsWeatherInfoResVo weatherResVo = JSONObject.parseObject(str, FmsWeatherInfoResVo.class);
|
|
|
|
|
+ weatherResVo.setCity(fmsWeatherInfoResVo.getCity());
|
|
|
|
|
+ weatherResVo.setZoneProvincezh(map.get("zoneProvincezh") == null ? "" : map.get("zoneProvincezh").toString());
|
|
|
|
|
+ weatherResVo.setZoneCapitalzh(map.get("zoneCapitalzh") == null ? "" : map.get("zoneCapitalzh").toString());
|
|
|
|
|
+ weatherList.add(weatherResVo);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ resultMap.put("weather", weatherList);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
throw new BizException(ErrorCode.FMS_WEATHER_SEARCH_FAILED);
|
|
throw new BizException(ErrorCode.FMS_WEATHER_SEARCH_FAILED);
|
|
|
}
|
|
}
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
- if (!StringUtils.isEmpty(fmsWeatherInfoResVo.getCityid())) {
|
|
|
|
|
- map = iFmsSolarService.getSysZoneByZoneCode(fmsWeatherInfoResVo.getCityid());
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(result);
|
|
|
|
|
- JSONArray data = jsonObject.getJSONArray("data");
|
|
|
|
|
- List<FmsWeatherInfoResVo> weatherList = new ArrayList<>();
|
|
|
|
|
- if (data != null) {
|
|
|
|
|
- for (int i = 0; i < data.size(); i++) {
|
|
|
|
|
- String str = data.getString(i);
|
|
|
|
|
- FmsWeatherInfoResVo weatherResVo = JSONObject.parseObject(str, FmsWeatherInfoResVo.class);
|
|
|
|
|
- weatherResVo.setCity(fmsWeatherInfoResVo.getCity());
|
|
|
|
|
- weatherResVo.setZoneProvincezh(map.get("zoneProvincezh") == null ? "" : map.get("zoneProvincezh").toString());
|
|
|
|
|
- weatherResVo.setZoneCapitalzh(map.get("zoneCapitalzh") == null ? "" : map.get("zoneCapitalzh").toString());
|
|
|
|
|
- weatherList.add(weatherResVo);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- resultMap.put("weather", weatherList);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void getLandStat(ScreenDataReqVo reqVo, Map<String, Object> resultMap, boolean isValid) {
|
|
public void getLandStat(ScreenDataReqVo reqVo, Map<String, Object> resultMap, boolean isValid) {
|