1
dengjunjie
8 天以前 5621e29bd415c85fd719e0e6366eae813b970ea2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Pomelo.AspNetCore.TimedJob;
using WIDESEA_ISquareCabinServices;
using WIDESEA_IWMsInfoServices;
using static WIDESEA_DTO.SquareCabin.TowcsDto;
 
namespace WIDESEA_WMSServer
{
    public class AlarmJob : Job
    {
        private readonly IContainerService _containerService;
        private readonly IEquipmentAlarmInforService _equipmentAlarmInforService;
        private readonly IMessageInfoService _messageInfoService;
        private readonly IInventory_BatchServices _inventoryInfoService;
        public AlarmJob(IContainerService containerService, IEquipmentAlarmInforService equipmentAlarmInforService, IMessageInfoService messageInfoService, IInventory_BatchServices inventoryInfoService)
        {
            _containerService = containerService;
            _equipmentAlarmInforService = equipmentAlarmInforService;
            _messageInfoService = messageInfoService;
            _inventoryInfoService = inventoryInfoService;
        }
        //每隔1秒执行一次
        [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
        public void Run()
        {
            //冷库
            _containerService.Sensor();
            _equipmentAlarmInforService.getDeviceStatus();
            _inventoryInfoService.GetExpiredAndlow();
            _messageInfoService.GetMessageInfo();
        }
    }
}