using System; using System.Collections.Generic; using System.Linq; using System.Text; using Quartz; using SiaSun.LMS.Model; namespace SiaSun.LMS.WinService { [DisallowConcurrentExecution] public class TaskApplyJob : Job_Base,IJob { //服务端必须启动ActiveMQ服务,才能运行Job public void Execute(IJobExecutionContext context) { bool bResult = true; string sResult = string.Empty; try { foreach (SiaSun.LMS.Model.IO_CONTROL_APPLY mIO_CONTROL_APPLY in _P_IO_CONTROL_APPLY.GetList(0)) { if (string.IsNullOrEmpty(mIO_CONTROL_APPLY.CONTROL_APPLY_TYPE)) { _P_IO_CONTROL_APPLY.Delete(mIO_CONTROL_APPLY.CONTROL_APPLY_ID); continue; } string sMsg = SiaSun.LMS.Common.Xml.Serializer(mIO_CONTROL_APPLY); bResult = _ActiveMsg.SendMsg( "controlApply" , sMsg , out sResult); if (bResult) { mIO_CONTROL_APPLY.APPLY_TASK_STATUS = 3; _P_IO_CONTROL_APPLY.Update(mIO_CONTROL_APPLY); } } } catch (Exception ex) { Program.sysLog.Fatal("任务申请处理异常 ", ex); JobExecutionException e2 = new JobExecutionException(ex); e2.RefireImmediately = true; throw e2; } } } }