package com.prolog.eis.schedule;

import com.prolog.eis.service.carry.WmsCarryTaskService;
import com.prolog.eis.service.core.InboundService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @program: eis_qnym_java
 * @description: 搬运定时器
 * @author: Xiong
 * @create: 2022-11-11 16:30
 **/
@Slf4j
@Component
@RequiredArgsConstructor
public class WmsCarryTaskSchedule {

    private final WmsCarryTaskService wmsCarryTaskService;

    //借道任务完成回告wms 20->30
    @Scheduled(initialDelay = 3000, fixedDelay = 3000)
    public void wmsCarryTaskCallBack() {
        try {
            wmsCarryTaskService.wmsTaskCbWms();
        } catch (Exception e) {
            log.error("任务完成回告wms处理异常:" + e.getMessage(), e);
        }
    }

    //借道任务搬运
    @Scheduled(initialDelay = 3000, fixedDelay = 3000)
    public void wmsCarryTask() {
        try {
            wmsCarryTaskService.wmsCarryTask();
        } catch (Exception e) {
            log.error("借道任务搬运处理异常:" + e.getMessage(), e);
        }
    }
}
