yanjinhui
3 天以前 bfc11f87e2b64420c9917c0b9881b3e327d6f796
н¨Îļþ¼Ð/WIDESEA_WMSServer/WIDESEA_WMSServer/OutOrderJob.cs
@@ -1,25 +1,28 @@
using Pomelo.AspNetCore.TimedJob;
using WIDESEA_ISquareCabinServices;
using WIDESEA_IWMsInfoServices;
namespace WIDESEA_WMSServer
{
    public class OutOrderJob : Job
    {
        private readonly IDeliveryOrderServices _deliveryOrderServices;
        public OutOrderJob(IDeliveryOrderServices deliveryOrderServices)
        private readonly IBusiness _business;
        private readonly IMaterielInfoService _materielInfoService;
        public OutOrderJob(IBusiness business, IMaterielInfoService materielInfoService)
        {
            _deliveryOrderServices = deliveryOrderServices;
            _business = business;
            _materielInfoService = materielInfoService;
        }
        //每隔1秒执行一次
        [Invoke(Begin = "2025-09-01", Interval = 1000 * 5, IsEnabled =false, SkipWhileExecuting = true)]
        [Invoke(Begin = "2025-11-01", Interval = 1000 * 5, IsEnabled = true, SkipWhileExecuting = true)]
        public void Run()
        {
            Thread.Sleep(3000);
            //获取上游出库单数据
            _deliveryOrderServices.GetUpstreamOutOrder();
            //下发wcs
            _deliveryOrderServices.EdiOut();
            _deliveryOrderServices.CompleteAllOutOrders();
            _materielInfoService.ProductSynchronous();
            _business.EdiIn();
            _business.EdiOut();
            Console.WriteLine($"WCS任务执行结束:{DateTime.Now}");
        }
    }
}