package com.ruoyi.task.device;

import com.ruoyi.ss.device.service.DeviceService;
import com.ruoyi.ss.meterReadingRecord.service.ISmMeterReadingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author wjh
 * 2024/3/21
 */
@Component("deviceTask")
public class DeviceTask {

    @Autowired
    private DeviceService smDeviceService;

    @Autowired
    private ISmMeterReadingRecordService smMeterReadingRecordService;

    // 定时拉取设备信息
//    public void pullDeviceInfo() throws InterruptedException {
//        smDeviceService.pullDeviceInfo(null);
//        Thread.sleep(3000); // 睡眠3秒，防止quartz重复调度
//    }

    // 定时抄表
    public void recordElectriQuantity() throws InterruptedException {
        smMeterReadingRecordService.record(null);
        Thread.sleep(3000); // 睡眠3秒，防止quartz重复调度
    }

}
