cjl
2023-07-26 0ce061d9ed37a6c25fff70e4734fa8cc8747237c
screen-job/src/main/java/com/moral/api/service/impl/CityWeatherForecastServiceImpl.java
@@ -40,6 +40,8 @@
    @Autowired
    private CityWeatherForecastMapper cityWeatherForecastMapper;
    //城市预测气象数据来源于,和风天气,逐小时天气预报(未来72小时)商业版
    @Override
    public void insertCityWeatherForecast() {
        Date nextDay = DateUtils.addDays(new Date(), 1);
@@ -71,4 +73,16 @@
        }
        cityWeatherForecastMapper.insertCityWeatherForecast(cityWeatherForecasts);
    }
    public static void main(String[] args) {
        String time = "20221231";
        long currentMils = DateUtils.getDate(time, DateUtils.yyyyMMdd_EN).getTime();
        long startMils = DateUtils.getDate("2022", DateUtils.yyyy).getTime();
        long mss = currentMils - startMils;
        long days = mss / (1000 * 60 * 60 * 24);
        System.out.println(days + 1);
    }
}