using DS.WMS.Core.QuarztJobs.Interface; using NLog; 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; private static readonly Logger _logger = LogManager.GetCurrentClassLogger(); public BankStatementJob(IBankStatementService bank) { _bank = bank; } public async Task Execute(IJobExecutionContext context) { //定时获取银行流水 try { _logger.Info($"定时任务-获取银行流水:{DateTime.Now}"); await _bank.GetBankStatement(); } catch (Exception ex) { _logger.Error ($"定时任务-获取银行流水报错:{DateTime.Now};错误内容{ex.Message}"); } } } }