using DS.WMS.Core.QuarztJobs.Interface; using Quartz; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DS.WMS.Core.Jobs { /// /// 定时任务-获取银行流水 /// public class BankStatementJob : IJob { private readonly IBankStatementService _bank; public BankStatementJob(IBankStatementService bank) { _bank = bank; } public async Task Execute(IJobExecutionContext context) { //定时获取银行流水 try { await _bank.GetBankStatement(); Console.WriteLine($"定时获取银行流水: {DateTime.Now}"); } catch (Exception ex) { Console.WriteLine($"定时获取银行流水报错: {DateTime.Now};错误内容{ex.Message}"); } } } }