| | |
| | | package com.ruoyi.system.task.utils; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/11 8:39 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | @Autowired |
| | | RedisCache redisCache; |
| | | // 用于更新违约金账单 |
| | | // 每分钟执行一次的定时任务 |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void dayOfProportionBill() { |
| | | try { |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | // LocalDateTime now = LocalDateTime.now().minusMonths(1).withDayOfMonth(31); |
| | | // System.err.println(now); |
| | | // LocalDateTime now2 = now.plusMonths(1); |
| | | // System.err.println(now2); |
| | | //package com.ruoyi.system.task.utils; |
| | | // |
| | | // LocalDateTime now1 = LocalDateTime.now(); |
| | | // long days = ChronoUnit.DAYS.between(now, now1); |
| | | // long days2 = ChronoUnit.DAYS.between(now.plusDays(1), now1); |
| | | // |
| | | // System.err.println(days); |
| | | // System.err.println(days2); |
| | | // LocalDateTime endTime = now.with(TemporalAdjusters.lastDayOfMonth()).withSecond(59).withHour(23).withMinute(59); |
| | | //import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | //import com.ruoyi.common.constant.CacheConstants; |
| | | //import com.ruoyi.common.core.redis.RedisCache; |
| | | //import com.ruoyi.common.utils.uuid.UUID; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.scheduling.annotation.Scheduled; |
| | | //import org.springframework.stereotype.Component; |
| | | // |
| | | // System.err.println(endTime); |
| | | |
| | | } |
| | | |
| | | } |
| | | //import java.math.BigDecimal; |
| | | //import java.time.LocalDate; |
| | | //import java.time.LocalDateTime; |
| | | //import java.time.LocalTime; |
| | | //import java.time.temporal.ChronoUnit; |
| | | //import java.util.List; |
| | | // |
| | | ///** |
| | | // * @author zhibing.pu |
| | | // * @date 2023/7/11 8:39 |
| | | // */ |
| | | //@Component |
| | | //public class TaskUtil { |
| | | // @Autowired |
| | | // RedisCache redisCache; |
| | | // // 用于更新违约金账单 |
| | | // // 每分钟执行一次的定时任务 |
| | | // |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | // public void dayOfProportionBill() { |
| | | // try { |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // |
| | | // public static void main(String[] args) { |
| | | // |
| | | //// LocalDateTime now = LocalDateTime.now().minusMonths(1).withDayOfMonth(31); |
| | | //// System.err.println(now); |
| | | //// LocalDateTime now2 = now.plusMonths(1); |
| | | //// System.err.println(now2); |
| | | //// |
| | | //// LocalDateTime now1 = LocalDateTime.now(); |
| | | //// long days = ChronoUnit.DAYS.between(now, now1); |
| | | //// long days2 = ChronoUnit.DAYS.between(now.plusDays(1), now1); |
| | | //// |
| | | //// System.err.println(days); |
| | | //// System.err.println(days2); |
| | | //// LocalDateTime endTime = now.with(TemporalAdjusters.lastDayOfMonth()).withSecond(59).withHour(23).withMinute(59); |
| | | //// |
| | | //// System.err.println(endTime); |
| | | // |
| | | // } |
| | | // |
| | | //} |