xuhy
8 天以前 f131c141bafa2a060050fa85799fb9d1eb617b69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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);
//
//        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);
 
    }
 
}