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

import com.zfire.jiasm.syncdata.constant.TaskConfigEnum;
import com.zfire.jiasm.syncdata.utils.oss.AddJdueUtil;
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;

/**
 * 京东工单数据同步到格力总部
 * 回传预约改约时间数据 itf_addJdueBookOnDoor_req
 */
@Slf4j
@Component
public class AppointmentModification {
    @Value("${jdyygyc}")
    private String jdyygyc = "";

    @Autowired
    private AddJdueUtil addJdueUtil;

    private String[] cols = new String[] { "orderNo", "createBy", "createDate", "bookDate",
            "bookDate2", "remark" };

    @Scheduled(fixedDelayString = "${jdyygy}")
    private void process() {
        if (jdyygyc.equals(TaskConfigEnum.FALSE.getCode())){
            return;
        }

        addJdueUtil.process("addJdueBookOnDoor", "api/jdueFeedback/addJdueBookOnDoor",
                "itf_addjduebookondoor_req", cols);
    }

}
