using DS.WMS.Core.HangfireJob.Interface; using Quartz; namespace DS.WMS.Core.Jobs { /// /// 定时获取进项发票 /// public class InInvoiceJob : IJob { private readonly IInInvoiceJobService _ininvice; public InInvoiceJob(IInInvoiceJobService ininvice) { _ininvice = ininvice; } public async Task Execute(IJobExecutionContext context) { //定时获取进项发票 try { await _ininvice.GetInInvoiceData(); Console.WriteLine($"定时获取进项发票: {DateTime.Now}"); } catch (Exception ex) { Console.WriteLine($"定时获取进项发票报错: {DateTime.Now};错误内容{ex.Message}"); } } } }