package com.gree.mall.manager.schedule.daily;



import com.gree.mall.manager.logic.EsOrder.EsOrderLogic;
import com.gree.mall.manager.logic.SyncOrderInfoLogic;
import com.gree.mall.manager.logic.workorder.OrderBaseEsLogic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.mail.MessagingException;
import java.io.IOException;

/**
 * 定时购买保险
 */
@ConditionalOnProperty(name = "schedule.gongdan.es.enable", havingValue = "true", matchIfMissing = true)
@Component
public class EsSyncSchedule {


    @Autowired
    private OrderBaseEsLogic orderBaseEsLogic;



    //同步工单数据
    @Scheduled(fixedDelay =2* 1000)
    public void task() throws IOException {
        orderBaseEsLogic.esSync();
    }


    //同步工单数据
    @Scheduled(fixedDelay =2* 1000)
    public void task1() throws IOException {
        orderBaseEsLogic.esSync1();
    }

}
