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

import com.zfire.jiasm.syncdata.constant.TaskConfigEnum;
import com.zfire.jiasm.syncdata.service.InstallProduceUploadListService;
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;


/**
 * 生成上传任务清单列表
 * 1:从需要上传的订单数据表中提取数据 out_jiasm_to_gree_uploadnotifylist
 *:2:数据同步预处理规则表中提取对应表名的规则 out_jiasm_to_gree_prepare_rule
 * 3:对应表中提取表中数据
 * 4：生成上传任务清单表 out_jiasm_to_gree_upload_task_list
 */
@Slf4j
@Component
public class InstallProduceUploadList {
    @Value("${azuploadscc}")
    private String azuploadscc = "";
    @Autowired
    InstallProduceUploadListService installProduceUploadListService;


    @Scheduled(fixedDelayString = "${azuploadsc}")
    private void produceList(){
        if (azuploadscc.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }

        installProduceUploadListService.processUploadList();
    }


}
