package com.hzs.third.job;

import com.hzs.scm.pub.IScmBillServiceApi;
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 ScmJob {

    @DubboReference
    IScmBillServiceApi iScmBillServiceApi;

    /**
     * 更新单据号初始化值
     */
    @XxlJob("updateBillNo")
    public void updateBillNo() {
        iScmBillServiceApi.updateScmBillNoNextValue();
    }
}
