package com.iailab.module.job.task; import com.iailab.module.device.service.DeviceStatUsageService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.annotation.Resource; import org.springframework.stereotype.Component; /** * åŒæ¥ä¸é€‰è®¾å¤‡è¿è¡Œæ—¶é—´ * 计算设备使用率 * æ¯å¤©8:00执行 * 0 0 8 * * ? */ @Component("syncDeviceStatUsageTask") public class SyncDeviceStatUsageTask implements ITask { private Logger logger = LoggerFactory.getLogger(getClass()); @Resource private DeviceStatUsageService deviceStatUsageService; @Override public void run(String params) { try { logger.info("SyncDeviceStatUsageTask 开始"); deviceStatUsageService.syncData(); logger.info("SyncDeviceStatUsageTask 完æˆ"); } catch (Exception ex) { logger.info("SyncDeviceStatUsageTask 异常"); ex.printStackTrace(); } } }