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.stockdaily.service.StockDailyService ;
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.util.Date ;
/**
* Created by Jeng on 2016/2/23.
*/
@Component ( value = "stockDailyJob" )
public class StockDailyJob implements Job {
// 注入StockDailyService
StockDailyService stockDailyService ;
@Override
public void execute ( JobExecutionContext jobExecutionContext ) throws JobExecutionException {
// 如果stockDailyService为空, 则从Spring上下文中获取
if ( stockDailyService = = null ) {
stockDailyService = ( StockDailyService ) SpringContextUtil . getApplicationContext ( ) . getBean ( StockDailyService . class ) ;
// 调用createStockDaily方法
stockDailyService . createStockDaily ( ) ;
}
}
}