运行定时任务时dao是空的 是为什么呢
package cn.wizzer.common.quartz.job;
import cn.wizzer.modules.models.opo.Opo_order;
import cn.wizzer.modules.services.opo.OpoOrderService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 订单任务更新订单状态
* Created by Hamming on 2016/12/15.
*/
public class OrderJob implements Job {
private static final Log log = Logs.get();
@Inject
protected Dao dao;
public void execute(JobExecutionContext context) throws JobExecutionException {
log.info("Order Job");
List<Opo_order> orderList = dao.query(Opo_order.class,Cnd.where("delFlag","=",false));
List<Opo_order> opo_orders = new ArrayList<>();
for(Opo_order ol:orderList){
boolean flag = ol.getEnd_time().before(new Date());
if(flag&&Opo_order.STATE_RETURN.equals(ol.getState())){
ol.setState(Opo_order.STATE_RETURN_MATCH);
opo_orders.add(ol);
}
}
if(opo_orders.size()> 0){
dao.update(opo_orders);
}
}
}