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

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

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
@Component
public class SynFileOrderOperatingLog {
    @Value("${zjzbxc}")
    private String zjzbxc = "";

    @Resource
    OrderOperatingLogFileService orderOperatingLogFileService;




    // 从格力总部同步的反馈明细附件生成平台的附件信息
    @Scheduled(fixedDelay = 1 * 60 * 1000)
    public void process(){
        if (zjzbxc.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }


        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        log.info("开始生成维修工单同步的附件信息: \uF0B7{}",sdf.format(new Date()));

        orderOperatingLogFileService.extractedRepairFile();

        log.info("生成维修工单同步的附件信息结束: \uF0B7{}",sdf.format(new Date()));
    }
}
