using Commonlib;
using System.Data;
using Quartz;
using NLog;

namespace BLW_Log.services
{
    public class DelSucess_Fault_File : IJob
    {
        private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
        public Task Execute(IJobExecutionContext context)
        {
            string[] dealwith_files = Directory.GetFiles(ExcelScan.DealWithDir);


            _logger.Info("开始读取 各个文件数据");
            List<DataTable> list_table = new List<DataTable>();
            foreach (var item in dealwith_files)
            {
                string fileName = Path.GetFileName(item);
                bool bbb = fileName.StartsWith(ExcelScan.上传成功);
                bool ccc = fileName.StartsWith(ExcelScan.上传失败);
                bool ddd = bbb || ccc;
                if (ddd == false)
                {
                    File.Delete(item);
                }
            }
            return Task.CompletedTask;
        }
    }
}
