dengjunjie
6 天以前 bc43fe34a67fa68bcfb3a51b79308fad0be11c08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Pomelo.AspNetCore.TimedJob;
using WIDESEA_ISquareCabinServices;
using static WIDESEA_DTO.SquareCabin.TowcsDto;
 
namespace WIDESEA_WMSServer
{
    public class GoodsJob : Job
    {
        private readonly IMedicineGoodsServices _medicineGoodsServices;
        public GoodsJob(IMedicineGoodsServices medicineGoodsServices)
        {
            _medicineGoodsServices = medicineGoodsServices;
        }
        //每隔1秒执行一次
        [Invoke(Begin = "2025-09-01", Interval = 1000 * 60, IsEnabled = true, SkipWhileExecuting = true)]
        public void Run()
        {
            _medicineGoodsServices.GetMedicineGoodsInfom();
            _medicineGoodsServices.ProductSynchronous();
            Console.WriteLine($"物料信息任务执行结束:{DateTime.Now}");
        }
    }
}