45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
![]() |
using Quartz;
|
|||
|
using System.Linq;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using ToolLibrary.LogHelper;
|
|||
|
using Yunda.ISAS.DataMonitoringServer.WebSocket.Model;
|
|||
|
|
|||
|
namespace Yunda.ISAS.DataMonitoringServer.TimeWorkers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 布防撤防
|
|||
|
/// </summary>
|
|||
|
[DisallowConcurrentExecution]
|
|||
|
public class SafetyStateFixedTimeJob : IJob
|
|||
|
{
|
|||
|
public async Task Execute(IJobExecutionContext context)
|
|||
|
{
|
|||
|
//#if DEBUG
|
|||
|
// return;
|
|||
|
//#endif
|
|||
|
SafetyStateUpdate();
|
|||
|
}
|
|||
|
private void SafetyStateUpdate()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
TimeWorkService._webApiRequest.UpdateEuipmentSafetyData();
|
|||
|
DataMonitorMessageModel messageModel = new DataMonitorMessageModel
|
|||
|
{
|
|||
|
Content = TimeWorkService._runningDataCache.EquipmentDataDic.Values.ToList(),
|
|||
|
GroupType = GroupTypeEnum.All,
|
|||
|
MessageType = MessgeTypeEnum.All
|
|||
|
};
|
|||
|
TimeWorkService._webSocketServer.SendMsg(messageModel);
|
|||
|
|
|||
|
}
|
|||
|
catch (System.Exception ex)
|
|||
|
{
|
|||
|
Log4Helper.Error(this.GetType(), "定时布防撤防数据更新发生错误", ex);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|