diff --git a/bocai.db b/bocai.db index 9586214..68bca7a 100644 Binary files a/bocai.db and b/bocai.db differ diff --git a/src/main/java/com/tem/bocai/controller/ChartController.java b/src/main/java/com/tem/bocai/controller/ChartController.java index 3ce09b6..10d3e54 100644 --- a/src/main/java/com/tem/bocai/controller/ChartController.java +++ b/src/main/java/com/tem/bocai/controller/ChartController.java @@ -61,10 +61,7 @@ public class ChartController { // 生成每5分钟的时间间隔标签 List labels = new ArrayList<>(); List data = new ArrayList<>(); - - // 计算累计盈亏 - double totalProfit = 0.0; - + // 遍历每5分钟间隔 Calendar intervalCalendar = (Calendar) calendar.clone(); while (intervalCalendar.getTime().before(currentTime)) { @@ -79,20 +76,12 @@ public class ChartController { intervalProfit += item.getResultAmount(); } } - // 更新总盈亏 - totalProfit = intervalProfit; - data.add(totalProfit); + data.add(intervalProfit); // 增加5分钟 intervalCalendar.add(Calendar.MINUTE, 5); - } - - // 添加当前时间点的数据 - if (!labels.isEmpty()) { - String currentTimeLabel = DateFormatUtils.format(currentTime, "HH:mm"); - labels.add(currentTimeLabel); - data.add(totalProfit); + } // 如果没有今日数据,生成默认的5分钟间隔数据 diff --git a/src/main/java/com/tem/bocai/schedules/BetSchedule.java b/src/main/java/com/tem/bocai/schedules/BetSchedule.java index 205a6a0..3891e37 100644 --- a/src/main/java/com/tem/bocai/schedules/BetSchedule.java +++ b/src/main/java/com/tem/bocai/schedules/BetSchedule.java @@ -41,7 +41,7 @@ public class BetSchedule { private BetRecordRepository betRecordRepository; // 从7:02分钟起每5分钟执行一次 - @Scheduled(cron = "30 2/5 * * * ?") + // @Scheduled(cron = "30 2/5 * * * ?") public void placeBet() { LocalDateTime now = LocalDateTime.now(); int hour = now.getHour(); diff --git a/src/main/java/com/tem/bocai/schedules/CrawlerSchedule.java b/src/main/java/com/tem/bocai/schedules/CrawlerSchedule.java index e76eaf1..bf76568 100644 --- a/src/main/java/com/tem/bocai/schedules/CrawlerSchedule.java +++ b/src/main/java/com/tem/bocai/schedules/CrawlerSchedule.java @@ -43,7 +43,7 @@ public class CrawlerSchedule { /*@Scheduled(cron = "0 6-59/5 7-23 * * ?") @Scheduled(cron = "0 0-55/5 0-6 * * ?")*/ // 从7:00分30秒起每5分钟执行一次 - @Scheduled(cron = "30 0/5 * * * ?") + // @Scheduled(cron = "30 0/5 * * * ?") public void executeLotteryDraw() { log.info("开始爬取开奖结果"); int retryCount = 0; @@ -110,7 +110,7 @@ public class CrawlerSchedule { } - @Scheduled(cron = "55 0/5 * * * ?") + // @Scheduled(cron = "55 0/5 * * * ?") //@Scheduled(cron = "*/9 * * * * ?") public void executePksHistory() { log.info("开始获取历史开奖结果"); diff --git a/src/main/java/com/tem/bocai/schedules/ExBetScriptSchedule.java b/src/main/java/com/tem/bocai/schedules/ExBetScriptSchedule.java index 8c6a7b6..414b6d9 100644 --- a/src/main/java/com/tem/bocai/schedules/ExBetScriptSchedule.java +++ b/src/main/java/com/tem/bocai/schedules/ExBetScriptSchedule.java @@ -125,7 +125,7 @@ public class ExBetScriptSchedule { } // 从7:01分钟起每5分钟执行一次 - @Scheduled(cron = "30 1/5 * * * ?") + // @Scheduled(cron = "30 1/5 * * * ?") public void executePythonScript() { LocalDateTime now = LocalDateTime.now(); int hour = now.getHour(); diff --git a/src/main/java/com/tem/bocai/util/HttpClientExample.java b/src/main/java/com/tem/bocai/util/HttpClientExample.java index d222a85..20abfdb 100644 --- a/src/main/java/com/tem/bocai/util/HttpClientExample.java +++ b/src/main/java/com/tem/bocai/util/HttpClientExample.java @@ -4,22 +4,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import lombok.extern.slf4j.Slf4j; -import org.apache.hc.client5.http.classic.methods.HttpGet; -import org.apache.hc.client5.http.config.RequestConfig; -import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; -import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse; -import org.apache.hc.client5.http.impl.classic.HttpClients; -import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager; -import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder; -import org.apache.hc.client5.http.ssl.NoopHostnameVerifier; -import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; -import org.apache.hc.core5.http.HttpEntity; -import org.apache.hc.core5.http.ParseException; -import org.apache.hc.core5.http.io.entity.EntityUtils; -import org.apache.hc.core5.ssl.SSLContexts; -import org.apache.hc.core5.ssl.TrustStrategy; -import org.apache.hc.core5.util.Timeout; -import org.springframework.beans.factory.annotation.Value; import javax.net.ssl.SSLContext; import java.io.BufferedReader; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b3cfcf5..e4670ac 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -10,4 +10,4 @@ spring.jpa.show-sql=true spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true -pypath:c:/py/PyModel \ No newline at end of file +pypath:D:/py/PyModel \ No newline at end of file