public static void SaveOutTicketLog(Order.Domain.Order order, TicketNoView ticketNoView, string operatorAccount, string originalTicketType, string orginalOfficeNo) { var keyword = "出票"; var logContentBase = string.Format("出票。订座编码:{0} 出票编码:{1} {2}", order.ReservationPNR == null ? string.Empty : order.ReservationPNR.ToString(), order.ETDZPNR == null ? string.Empty : order.ETDZPNR.ToString(), ticketNoView.Items.Join(",", xx => string.Format("姓名:{0} 票号:{1}", xx.Name, xx.TicketNos.Join("、")))); var logContent = logContentBase + string.Format(",客票类型:{0}->{1},Office号{2}->{3}", originalTicketType, ticketNoView.TicketType.ToString(), orginalOfficeNo, ticketNoView.OfficeNo); LogService.SaveOrderLog(new Log.Domain.OrderLog { OrderId = order.Id, Keyword = keyword, Content = logContentBase, Company = order.Provider.CompanyId, Account = operatorAccount, Role = OperatorRole.Provider, VisibleRole = OrderRole.Supplier | OrderRole.Purchaser }); LogService.SaveOrderLog(new Log.Domain.OrderLog { OrderId = order.Id, Keyword = keyword, Content = logContent, Company = order.Provider.CompanyId, Account = operatorAccount, Role = OperatorRole.Provider, VisibleRole = OrderRole.Provider | OrderRole.Platform }); }
/// <summary> /// 出票成功,填票号 /// </summary> internal void FillTicketNo(DateTime etdzTime, TicketNoView ticketNoView, string operatorAccount, string operatorName, Guid oemId) { if (this.Status == OrderStatus.PaidForETDZ) { if (ticketNoView == null) { throw new ArgumentNullException("ticketNoView"); } var ticketNos = from p in ticketNoView.Items from t in p.TicketNos select t; if (ticketNos.Count() > ticketNos.Distinct().Count()) { throw new CustomException("票号不能重复"); } this.ETDZPNR = this.PNRInfos.First().FillTicketNos(ticketNoView.ETDZPNR, ticketNoView.Mode, ticketNoView.NewSettleCode, ticketNoView.Items, oemId); if (!string.IsNullOrWhiteSpace(ticketNoView.OfficeNo)) { Provider.Product.OfficeNo = ticketNoView.OfficeNo; } Provider.Product.TicketType = ticketNoView.TicketType; this.Status = OrderStatus.Finished; this.ETDZTime = etdzTime; this.IsEmergentOrder = false; if (!string.IsNullOrEmpty(operatorName)) { Provider.OperatorName = operatorName; } if (!string.IsNullOrEmpty(operatorAccount)) { Provider.OperatorAccount = operatorAccount; } } else { throw new StatusException(this.Id.ToString()); } }
public static ExternalOrder QueryExternalOrderTicket(decimal orderId, Guid oemId) { var extOrder = QueryExternalOrder(orderId); var queryResult = ExternalPlatform.OrderService.QueryTicketNo(extOrder.Platform, orderId, extOrder.ExternalOrderId); var pnrInfo = extOrder.PNRInfos.FirstOrDefault(); if (pnrInfo == null) { throw new CustomException("编码不存在!"); } if (queryResult.Success && queryResult.Result.TicketNos.Any()) { var ticketNoView = new TicketNoView() { ETDZPNR = queryResult.Result.NewPNR, Mode = ETDZMode.Manual, Items = queryResult.Result.TicketNos, NewSettleCode = queryResult.Result.SettleCode }; var setting = ExternalPlatform.Processor.PlatformBase.GetPlatform(extOrder.Platform); OrderProcessService.ETDZ(ticketNoView, setting.Setting.ProviderAccount, extOrder.Platform.GetDescription(), extOrder, oemId); } return(extOrder); }