jinpengyong
2020-08-25 8a6dd43d9bd8a9720c0fad354135fd89cce575c3
src/main/java/com/moral/service/impl/RealWeatherServiceImpl.java
@@ -138,9 +138,23 @@
            Map<String, Object> jsonMap = (Map<String, Object>) map.get("data");
            jsonMap.remove("obsTime");
            jsonMap.remove("icon");
            String text = jsonMap.get("text").toString();
            if(text.equals("晴")){
                jsonMap.put("condition","100");
            }else if(text.equals("多云")){
                jsonMap.put("condition","80");
            }else if(text.equals("阴")){
                jsonMap.put("condition","60");
            }else if(text.equals("雷阵雨")){
                jsonMap.put("condition","40");
            }else if(text.equals("小雨")){
                jsonMap.put("condition","20");
            }else if(text.equals("雨")){
                jsonMap.put("condition","0");
            }
            resultMap.put("json",JSONObject.toJSONString(jsonMap));
            resultList.add(resultMap);
        }
        return realWeatherMapper.insertRealWeather(resultList);
        return realWeatherMapper.insertRealWeather(null);
    }
}