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_addJdueFinish_req
 */
@Slf4j
@Component
public class Finish {
    @Value("${jdbwgc}")
    private String jdbwgc = "";

    @Autowired
    private AddJdueUtil addJdueUtil;

    private String[] cols = new String[] { "orderNo", "createBy", "createDate", "barcode1",
            "barcode2", "dealRemark" };

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

        addJdueUtil.process("addJdueFinish", "api/jdueFeedback/addJdueFinish",
                "itf_addjduefinish_req", cols);
    }

}
