From fb3794144800ee442bd632528d16afb14cab891c Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 04 二月 2026 15:57:59 +0800
Subject: [PATCH] yys  增加日志打印

---
 src/main/java/com/ruoyi/api/ScheduledApi.java |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ruoyi/api/ScheduledApi.java b/src/main/java/com/ruoyi/api/ScheduledApi.java
index c6e394b..d315f1a 100644
--- a/src/main/java/com/ruoyi/api/ScheduledApi.java
+++ b/src/main/java/com/ruoyi/api/ScheduledApi.java
@@ -42,6 +42,12 @@
     @Value("${api.electricityCost}")
     private Double electricityCost;
 
+    @Value("${api.loginPush}")
+    private boolean loginPush;
+
+    @Value("${api.push}")
+    private boolean push;
+
 
     @Autowired
     private Api api;
@@ -52,8 +58,13 @@
     private static final Random RANDOM = new Random();
 
     //鎺ㄩ�佺櫥褰曟棩蹇楁瘡鍛�
-//    @Scheduled(cron = "0 0 1 ? * 1")
+    @Scheduled(cron = "0 0 1 ? * 1")
     public void logging(){
+        log.info("create---杩涘叆鎺ㄩ�佺櫥褰曟棩蹇�......");
+        if (!loginPush){
+            return;
+        }
+        log.info("loginPush---寮�濮嬫帹閫佺櫥褰曟棩蹇�......");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd");
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         //鑾峰彇鐧诲綍鏃ュ織
@@ -83,8 +94,13 @@
     }
 
     //鎺ㄩ�佺數姣忔湀
-//    @Scheduled(cron = "0 0 1 1 * ?")
+    @Scheduled(cron = "0 0 1 1 * ?")
     public void electricity(){
+        log.info("create---杩涘叆鎺ㄩ�佺數姣忔湀......");
+        if (!push){
+            return;
+        }
+        log.info("electricity---寮�濮嬫帹閫佺數姣忔湀......");
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:dd");
         //鑾峰彇鐧诲綍鏃ュ織
         List<ElectricityDto> electricityDtos = new ArrayList<>();

--
Gitblit v1.9.3