1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- 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);
- }
- }
- }
- }
|