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.
57 lines
1.7 KiB
57 lines
1.7 KiB
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<IO_CONTROL_APPLY>(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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|