package com.jjt.task;

import com.jjt.order.service.ITwinOrderService;
import com.jjt.vms.service.IWmsService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * 订单/库存定时任务
 *
 * @author jjt
 */
@Component("order")
public class OrderTask {
    @Resource
    private ITwinOrderService orderService;
    @Resource
    private IWmsService wmsService;

    /**
     * 获取昨日订单
     */
    public void day() {
        LocalDate localDate = LocalDate.now().minusDays(1);
        orderService.getOrder(localDate);
    }

    /**
     * 首页库存
     */
    public void stock() {
        wmsService.currStock();
    }

}
