package cn.iocoder.yudao.module.inspection.task;

import cn.iocoder.yudao.module.inspection.service.AppUserOwnService;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component("InspectionWarnTask")
public class InspectionWarnTask {
    //关键代码，设置一个静态上下文属性appcontext
    private static ApplicationContext appcontext;
    public static void setAppcontext(ApplicationContext appcontext) {
        InspectionWarnTask.appcontext = appcontext;
    }
    public static ApplicationContext getAppcontext() {
        return appcontext;
    }
    public void carInspectionWarnTask()
    {
        AppUserOwnService appUserOwnService = appcontext.getBean(AppUserOwnService.class);
        appUserOwnService.userCarWarn();
    }
}
