jinpengyong
2020-08-25 a251876c40e679f797d5925ae8ffa82cd1b3e561
src/main/java/com/moral/service/impl/RealWeatherServiceImpl.java
@@ -138,6 +138,20 @@
            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);
        }