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

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

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 同步证件到格力总部
 */
@Slf4j
// @Component
public class UploadWorkeCertificateBak {
    @Value("${workercertificatec}")
    private String workercertificatec = "";

    @Autowired
    UploadWorkeCertificateService uploadWorkeCertificateService;



    // 师傅证件照同步到格力总部  不再使用
    @Scheduled(fixedDelayString = "${workercertificate}")
    public void processUploadTask(){
        if (1==1){
            return;
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (workercertificatec.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }

        log.info("开始同步师傅证件信息: \uF0B7{}",sdf.format(new Date()));

        uploadWorkeCertificateService.procesUploadWorkeCert();

        log.info("同步师傅证件信息结束: \uF0B7{}",sdf.format(new Date()));
    }

}
