大连融科 WMS
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.
 
 
 

74 lines
2.2 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 TaskControlJob : Job_Base, IJob
{
//服务端必须启动ActiveMQ服务,才能运行Job
public void Execute(IJobExecutionContext context)
{
bool bResult = true;
string sResult = string.Empty;
try
{
foreach (SiaSun.LMS.Model.IO_CONTROL mIO_CONTROL in _P_IO_CONTROL.GetListChangeTask())
{
//清除垃圾任务
if (mIO_CONTROL.MANAGE_ID.Equals(0))
{
switch (mIO_CONTROL.CONTROL_STATUS)
{
case 999://完成
case 990://异常完成
case 900://删除
_P_IO_CONTROL.DeleteControlID(mIO_CONTROL.CONTROL_ID);
break;
default:
break;
}
continue;
}
Msg_Control_Task_Change msg = new Msg_Control_Task_Change();
msg.MANAGE_ID = mIO_CONTROL.MANAGE_ID;
msg.PRE_CONTROL_STATUS = mIO_CONTROL.PRE_CONTROL_STATUS;
msg.CONTROL_STATUS = mIO_CONTROL.CONTROL_STATUS.ToString();
string sMsg = SiaSun.LMS.Common.Xml.Serializer<Msg_Control_Task_Change>(msg);
bResult = _ActiveMsg.SendMsg(
"controlTaskChange"
, sMsg
, out sResult);
if (bResult)
{
_P_IO_CONTROL.UpdateStatus(mIO_CONTROL.CONTROL_ID);
}
}
}
catch (Exception ex)
{
Program.sysLog.Fatal("任务完成处理异常 ", ex);
JobExecutionException e2 = new JobExecutionException(ex);
e2.RefireImmediately = true;
throw e2;
}
}
}
}