package com.hzs.third.job;

import com.hzs.sale.order.ISaOrderServiceApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

@Slf4j
@ConditionalOnProperty(name = "xxl-job.start", havingValue = "true")
@Component
public class OrderJob {

    @DubboReference
    ISaOrderServiceApi iSaOrderServiceApi;

    /**
     * 定时关单  订单三十分钟未支付自动关闭
     */
    @XxlJob("autoCloseOrder")
    public void timingCloseOrder() {
        iSaOrderServiceApi.closeOrder();
    }

}
