|
@@ -9,6 +9,7 @@ import com.huimv.guowei.admin.service.IEnvDeviceService;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
@@ -16,7 +17,7 @@ import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
|
|
|
-@Configuration
|
|
|
+@Component
|
|
|
@EnableScheduling
|
|
|
public class DeviceTimer {
|
|
|
|
|
@@ -52,8 +53,8 @@ public class DeviceTimer {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @Scheduled(cron = "0 * * * * ?")
|
|
|
-// @Scheduled(cron = "0 0 23 * * ?")
|
|
|
+// @Scheduled(cron = "0 * * * * ?")
|
|
|
+ @Scheduled(cron = "0 0 23 * * ?")
|
|
|
private void setDayAge(){
|
|
|
System.out.println("--->更新日龄");
|
|
|
baseDuckInfoService.updateDayAge();
|