dengjunjie
3 天以前 9b7acc479dc747c8c78eae84d3f83e1347aa478d
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
33
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-11-01", Interval = 1000 * 10, IsEnabled = true, SkipWhileExecuting = true)]
        public void Run()
        {
            //冷库
            _containerService.Sensor();
            _equipmentAlarmInforService.getDeviceStatus();
            _inventoryInfoService.GetExpiredAndlow();
            _messageInfoService.GetMessageInfo();
            Console.WriteLine($"WMS任务执行结束:{DateTime.Now}");
        }
    }
}