每日设备接入定时任务

This commit is contained in:
2023-11-08 16:17:59 +08:00
parent 277ca39dfc
commit 14817411aa

View File

@@ -1,50 +1,50 @@
//package com.njcn.access.runner; package com.njcn.access.runner;
//
//import com.njcn.access.service.ICsEquipmentDeliveryService; import com.njcn.access.service.ICsEquipmentDeliveryService;
//import com.njcn.access.service.ICsTopicService; import com.njcn.access.service.ICsTopicService;
//import com.njcn.access.service.impl.CsDeviceServiceImpl; import com.njcn.access.service.impl.CsDeviceServiceImpl;
//import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO; import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
//import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource; import javax.annotation.Resource;
//import java.util.List; import java.util.List;
//import java.util.Objects; import java.util.Objects;
//
///** /**
// * 类的介绍:防止设备掉线 系统未能调整,做一个定时任务,每天凌晨将所有设备重新接入 * 类的介绍:防止设备掉线 系统未能调整,做一个定时任务,每天凌晨将所有设备重新接入
// * *
// * @author xuyang * @author xuyang
// * @version 1.0.0 * @version 1.0.0
// * @createTime 2023/8/28 14:21 * @createTime 2023/8/28 14:21
// */ */
//@Component @Component
//@Slf4j @Slf4j
//public class AccessScheduledTask { public class AccessScheduledTask {
//
// @Resource @Resource
// private CsDeviceServiceImpl csDeviceService; private CsDeviceServiceImpl csDeviceService;
//
// @Resource @Resource
// private ICsTopicService csTopicService; private ICsTopicService csTopicService;
//
// @Resource @Resource
// private ICsEquipmentDeliveryService csEquipmentDeliveryService; private ICsEquipmentDeliveryService csEquipmentDeliveryService;
//
// /** /**
// * {秒数} {分钟} {小时} {日期} {月份} {星期} {年份(可为空)} * {秒数} {分钟} {小时} {日期} {月份} {星期} {年份(可为空)}
// */ */
// @Scheduled(cron = "0 0 0 * * ?") @Scheduled(cron = "0 0 0 * * ?")
// public void executeTask() { public void executeTask() {
// log.info("每日凌晨定时任务执行"); log.info("每日凌晨定时任务执行");
// List<CsEquipmentDeliveryPO> list = csEquipmentDeliveryService.getAll(); List<CsEquipmentDeliveryPO> list = csEquipmentDeliveryService.getAll();
// list.forEach(item->{ list.forEach(item->{
// String version = csTopicService.getVersion(item.getNdid()); String version = csTopicService.getVersion(item.getNdid());
// if (!Objects.isNull(version)){ if (!Objects.isNull(version)){
// csDeviceService.devAccess(item.getNdid(),version); csDeviceService.devAccess(item.getNdid(),version);
// } }
// }); });
// } }
//
//} }