lizijie
2022-08-15 d0857416b2d72cac3b5b3cac449907c66feac737
src/main/java/com/moral/service/impl/WeatherServiceImpl.java
@@ -67,6 +67,10 @@
        ks.put("cityCode", 320583);
        ks.put("cityId", 101190404);
        cityList.add(ks);
        Map<String, Object> hq = new HashMap<>();
        hq.put("cityCode", 320505);
        hq.put("cityId", 101190406);
        cityList.add(hq);
        int state = 200;
        for (Map<String, Object> map : cityList) {
            String cityCode = map.get("cityCode").toString();
@@ -348,7 +352,7 @@
        RestTemplate restTemplate = new RestTemplate();
        c.setTime(new Date());
        Date endTime = sdf.parse(sdf.format(c.getTime()));
        c.add(Calendar.MONTH, -2);
        c.add(Calendar.MONTH, -1);
        Date startTime = sdf.parse(sdf.format(c.getTime()));
        int state = 200;
        List<Map<String, Object>> cityList = weatherMapper.getCityWeatherConfig();
@@ -514,8 +518,8 @@
                        sum2 = sum2 + temp * temp;
                    }
                    //光照
                    double cloud = Double.valueOf(listMap.get("cloud").toString().replace("\"", "").split("\\.")[0]);
                    if (listMap.get("beam") != null) {
                    if (listMap.get("beam") != null&&listMap.get("cloud") != null) {
                        double cloud = Double.valueOf(listMap.get("cloud").toString().replace("\"", "").split("\\.")[0]);
                        double beam = Double.valueOf(listMap.get("beam").toString().replace("\"", "").split("\\.")[0]);
                        cloudSum = cloudSum + cloud;
                        beamSum = beamSum + beam;