From beae673180dad056f7174cf8bcca12c943d1f4ed Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Tue, 22 Sep 2020 13:30:30 +0800 Subject: [PATCH] 接口请求方式更改 --- src/main/java/com/moral/service/impl/WeatherServiceImpl.java | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/moral/service/impl/WeatherServiceImpl.java b/src/main/java/com/moral/service/impl/WeatherServiceImpl.java index 0184499..5c6d0e4 100644 --- a/src/main/java/com/moral/service/impl/WeatherServiceImpl.java +++ b/src/main/java/com/moral/service/impl/WeatherServiceImpl.java @@ -744,9 +744,15 @@ map.put("COC", map.get("CO").toString()); map.remove("CO"); } - if ((!map.containsKey("PM25C")) && map.containsKey("PM2_5")) { - map.put("PM25C", map.get("PM2_5").toString().replace("\\.", "")); - map.remove("PM2_5"); + if ((!map.containsKey("PM25C")) && (map.containsKey("PM2_5")||map.containsKey("PM25"))) { + if (map.get("PM2_5") != null) { + map.put("PM25C", map.get("PM2_5").toString().replace("\\.", "")); + map.remove("PM2_5"); + } + if(map.get("PM25") != null){ + map.put("PM25C", map.get("PM25").toString().replace("\\.", "")); + map.remove("PM25"); + } } if ((!map.containsKey("PM10C")) && map.containsKey("PM10")) { map.put("PM10C", map.get("PM10").toString().replace("\\.", "")); -- Gitblit v1.8.0