xuhy
昨天 4955cdc73d9beb5733aa2c0a578c14798394fa61
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
package com.ruoyi.web.controller.task;
 
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.system.utils.util.AIUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
 
import java.time.LocalDate;
import java.util.Set;
 
/**
 * @author xiaochen
 * @date 2023/7/11 8:39
 */
@Component
public class TaskUtil {
 
    @Autowired
    private RedisCache redisCache;
    @Autowired
    private AIUtil aiUtil;
 
    @Scheduled(fixedRate = 86460000)
//    @Scheduled(cron = "10 0 0 * * ?")
    public void dayOfProportionBill() {
        try {
 
            // 查询跳转检测的用户
            Set<String> cacheSet = redisCache.getCacheSet(Constants.AI_USER_INSPECTION);
            // 获取前一天时间
            LocalDate lastDay = LocalDate.now().minusDays(1);
            for (String phone : cacheSet) {
                R<JSONObject> result = aiUtil.reportQuery(phone, lastDay.toString(), lastDay.toString());
                JSONObject data = result.getData();
                System.err.println(data);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
 
}