You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package com.xmomen.module.schedule ;
import com.xmomen.framework.support.SpringContextUtil ;
import com.xmomen.module.order.model.CreatePurchase ;
import com.xmomen.module.order.service.PurchaseService ;
import com.xmomen.module.plan.service.TablePlanSercvice ;
import org.quartz.Job ;
import org.quartz.JobExecutionContext ;
import org.quartz.JobExecutionException ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.stereotype.Component ;
import java.text.SimpleDateFormat ;
import java.util.Date ;
/**
* 计划任务
*/
@Component ( value = "planJob" )
public class PlanJob implements Job {
// 注入TablePlanSercvice
@Autowired
TablePlanSercvice tablePlanSercvice ;
@Override
public void execute ( JobExecutionContext jobExecutionContext ) throws JobExecutionException {
// 如果tablePlanSercvice为空, 则从Spring上下文中获取
if ( tablePlanSercvice = = null ) {
tablePlanSercvice = ( TablePlanSercvice ) SpringContextUtil . getApplicationContext ( ) . getBean ( TablePlanSercvice . class ) ;
// 调用createTablePlanOrder方法
tablePlanSercvice . createTablePlanOrder ( ) ;
}
}
}