@Component
@Slf4j
public class AutoCancelCntrJob{
@Resource
IPlansService plansService;
@Resource(name = "taskExecutor")
private AsyncTaskExecutor taskExecutor;
@XxlJob("AutoCancelCntrHandler")
public void run() {
SecurityContext emptyContext = SecurityContextHolder.createEmptyContext();
SimpleAuthentication simpleAuthentication = new SimpleAuthentication("super", "SUPER", null);
simpleAuthentication.setAuthenticated(true);
emptyContext.setAuthentication(simpleAuthentication);
SecurityContextHolder.setContext(emptyContext);
plansService.handerOverduePlans();
SecurityContextHolder.clearContext();
}
}
08-16
1122
08-16