/// <summary> /// 导出报表 /// </summary> /// <param name="obj"></param> private void OrderOptionBase_OnPostCompletedEventHandle(List <OMS.Models.OrderEntity> obj, OptionType optionType) { if (obj != null && obj.Any()) { try { ERP.ExportExcel <OrderEntity>(optionType, obj); } catch (Exception ex) { Util.Logs.Log.GetLog(nameof(AppServer)).Error($"{obj.First().SourceDesc}-{Util.Helpers.Enum.GetDescription<OptionType>(optionType)}生成失败.\r\n{ex.Message}\r\n{ex.StackTrace}"); } } else { //if (Environment.UserInteractive) //{ // var commcolor = Console.ForegroundColor; // Console.ForegroundColor = ConsoleColor.Green; // Console.WriteLine($"没有检测到新订单数据。ERP-{obj[0].Source}导入订单生成失败"); // Console.ForegroundColor = commcolor; //} } }
private void OrderOptionBase_ExceptionMessageEventHandle1(ICollection <ExceptionOrder> obj) { if (obj != null && obj.Any()) { ERP.ExportExcel <ExceptionOrder>(OptionType.ExceptionExcel, obj.ToList()); var glst = obj.GroupBy(e => e.ErrorCode); foreach (var item in glst) { WxPushNews.SendErrorText($"错误类型:{Util.Helpers.Enum.GetDescription<ExceptionType>(item.Key)},数量:{item.Count()}"); } } else { } }