|
|
@@ -74,30 +74,6 @@ public class FmsConsoleController {
|
|
|
@Autowired
|
|
|
private WeatherService weatherService;
|
|
|
|
|
|
- public void getWeather(ScreenDataReqVo reqVo, Map<String, Object> resultMap) {
|
|
|
- FmsWeatherInfoResVo fmsWeatherInfoResVo = null;
|
|
|
- try {
|
|
|
- JSONObject resultObj = weatherService.getProjectWeather();
|
|
|
- fmsWeatherInfoResVo = JSONObject.parseObject(resultObj.toString(), FmsWeatherInfoResVo.class);
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 查询节气信息
|
|
|
*/
|
|
|
@@ -142,6 +118,7 @@ public class FmsConsoleController {
|
|
|
}
|
|
|
resultMap.put("weather", weatherList);
|
|
|
}catch (Exception e){
|
|
|
+ log.error("获取天气信息失败", e);
|
|
|
throw new BizException(ErrorCode.FMS_WEATHER_SEARCH_FAILED);
|
|
|
}
|
|
|
|