package com.tofly.xrtygis.handle.noise;

import com.tofly.xrtygis.service.NoiseJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class NoiseJobHandler {

    @Autowired
    private NoiseJobService noiseJobService;

    @XxlJob("sendNoiseLoggerInfo")
    public ReturnT<String> sendNoiseLoggerInfo(String param) {
        long l = System.currentTimeMillis();
        log.info("开始同步HWM噪音设备站点信息");
        noiseJobService.sendNoiseLoggerInfo();
        long l1 = System.currentTimeMillis();
        log.info("同步结束HWM噪音设备站点信息,用时{}mm",l1-l);
        return ReturnT.SUCCESS;
    }


    @XxlJob("sendNoiseFileInfo")
    public ReturnT<String> sendNoiseFileInfo(String param) {
        long l = System.currentTimeMillis();
        log.info("开始同步HWM噪音录音相关文件");
        noiseJobService.sendNoiseInfo();
        long l1 = System.currentTimeMillis();
        log.info("同步结束HWM噪音录音相关文件,用时{}mm",l1-l);
        return ReturnT.SUCCESS;
    }
}
