package com.zfire.jiasm.syncdata.download.order;

import com.zfire.jiasm.syncdata.constant.TaskConfigEnum;
import com.zfire.jiasm.syncdata.service.OrderDownloadGDService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 从工单系统下载维修工单
 *
 */
@Slf4j
@Component
public class InstallDownloadGD {
    @Value("${installdownc}")
    private String installdownc = "";
    @Value("${installflag}")
    private String installflag = "";
    @Autowired
    OrderDownloadGDService orderDownloadGDService;


    // 下载安装工单数据
    @Scheduled(fixedDelayString = "${installdown}")
    public void download() throws Exception {
        if (installdownc.equals(TaskConfigEnum.TRUE.getCode())){
            return;
        }
        if (installflag.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }

        orderDownloadGDService.processInstallDownload();
    }



}
