package com.sinosoft.am.drill.dao; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.log4j.Logger; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import com.persistence.service.PersistenceFactory; import com.persistence.service.SysPersistence; import com.sinosoft.lz.system.sms.dao.SmsDao; import com.sysmodel.datamodel.xmlmodel.ModelFactory; import com.sysmodel.datamodel.xmlmodel.able.SysModel; public class DrillMonitor implements Job{ private Logger log = Logger.getLogger(this.getClass()); public void getList(){ SysModel sysmodel = ModelFactory.getSysmodel(); SysPersistence persistence = PersistenceFactory.getInstance(sysmodel); ListList=new ArrayList(); try { // String sql="select name from sys_department_0827 where id='"+list.get(i)+"'"; String sql="select a.drill_name,b.mobile,a.plan_time,b.real_name from EMC_AM_EMERGENCY_DRILL a,sys_user_info b where a.plan_maker=b.user_id and a.is_del='0' and IMPLEMENT_STAT='0'and (to_date(a.plan_time,'yyyy-mm-dd')+interval '15' day)=sysdate"; List tempList; tempList = persistence.getSearchResult(99, sql.toString()); log.info("tempList.size===="+tempList.size()); for(int i=0;il=new ArrayList(); l.add(mobile); String content=name+",您好!你指定的应急演练计划:"+drill_name+"将于"+plan_time+"到达计划完成时间,特此提醒!"; sd.saveSms("应急演练计划执行提醒", l, new Date()+"", content, "zkradmin"); } }catch(Exception e){ this.log.error(e.getMessage(), e); } } @Override public void execute(JobExecutionContext arg0) throws JobExecutionException { // TODO Auto-generated method stub getList(); } }