|
@@ -3,6 +3,7 @@ package com.huimv.guowei.admin.timer;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.huimv.guowei.admin.entity.EnvDevice;
|
|
|
import com.huimv.guowei.admin.entity.EnvDeviceOnline;
|
|
|
+import com.huimv.guowei.admin.service.IBaseDuckInfoService;
|
|
|
import com.huimv.guowei.admin.service.IEnvDeviceOnlineService;
|
|
|
import com.huimv.guowei.admin.service.IEnvDeviceService;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
@@ -23,6 +24,8 @@ public class DeviceTimer {
|
|
|
private IEnvDeviceService envDeviceService;
|
|
|
@Resource
|
|
|
private IEnvDeviceOnlineService envDeviceOnlineService;
|
|
|
+ @Resource
|
|
|
+ private IBaseDuckInfoService baseDuckInfoService;
|
|
|
|
|
|
@Scheduled(cron = "0 */5 * * * ?")
|
|
|
// @Scheduled(cron = "*/5 * * * * ?")
|
|
@@ -47,4 +50,12 @@ public class DeviceTimer {
|
|
|
envDeviceOnlineService.save(envDeviceOnline);
|
|
|
}
|
|
|
|
|
|
+// @Scheduled(cron = "0 0 23 * * ?")
|
|
|
+ @Scheduled(cron = "0 * * * * ?")
|
|
|
+ private void setDayAge(){
|
|
|
+ System.out.println("--->更新日龄");
|
|
|
+ baseDuckInfoService.updateDayAge();
|
|
|
+ System.out.println("--->更新成功");
|
|
|
+ }
|
|
|
+
|
|
|
}
|