public static MessageStructure SendMessageOrNotity(this MessageStructure ms) { try { string title = CommonHelper.GetEnumDescription <MTypeEnum>(ms.MType); string billName = CommonHelper.GetEnumDescription <BillTypeEnum>(ms.BillType); switch (ms.MType) { case MTypeEnum.Message: //审批 ms.Content = $"{billName} ({ms.BillNumber}) 需要审批,请尽快处理。"; break; case MTypeEnum.Receipt: //收款 ms.Content = $"{string.Join(",", ms.Terminals)} 等 {ms.Terminals.Count} 家门店欠款近 {ms.Month} 月,累计 {ms.Amount.Value:#.00} 元,请尽快收取。"; break; case MTypeEnum.Hold: //交账 ms.Content = $"你有{ms.Amount.Value:#.00} 元需要交账,请尽快处理。"; break; case MTypeEnum.Audited: //审核完成 ms.Content = $"你保存的 {billName} ({ms.BillNumber}) 已经审核通过,请留意。"; break; case MTypeEnum.Scheduled: //调度完成 ms.Content = $"你保存的 {billName} ({ms.BillNumber}) 已经调度完成,请留意。"; break; case MTypeEnum.InventoryCompleted: //盘点完成 ms.Content = $"{billName} ({ms.BillNumber}) 已经盘点完成,请留意。"; break; case MTypeEnum.TransferCompleted: //转单/签收完成 ms.Content = $"{billName} ({ms.BillNumber}) 转单/签收完成,请留意。"; break; case MTypeEnum.InventoryWarning: //库存预警 ms.Content = $"{string.Join(",", ms.Products)} 等 {ms.Products.Count}件商品缺货,请尽快处理。"; break; case MTypeEnum.CheckException: //签到异常 ms.Content = $"{ms.BusinessUser}在拜访{ms.TerminalName}时,距离{ms.Distance}米签到,请留意。"; break; case MTypeEnum.LostWarning: //客户流失预警 ms.Content = $"你有{ms.Terminals.Count}个客户可能流失,请关注。"; break; case MTypeEnum.LedgerWarning: //开单异常 ms.Content = $"{ms.BusinessUser} 在交账后,开具单据({ms.BillNumber}),请留意。"; break; case MTypeEnum.Paymented: //交账完成/撤销 ms.Content = $"于{ms.Date:yyyy年MM月dd日hh时MM分},你已上交钱款{ms.Amount.Value:#.00},包含单据: ({string.Join(",", ms.Bills)}), 请留意。"; break; default: break; } return(ms); } catch (Exception) { return(null); } }