xuhy
昨天 4955cdc73d9beb5733aa2c0a578c14798394fa61
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java
@@ -1,7 +1,17 @@
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
@@ -10,12 +20,25 @@
@Component
public class TaskUtil {
    @Scheduled(cron = "0 0 0 * * ?")
    @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();
        }