/// <summary> /// 生成订单 /// </summary> public string ProduceOrder(Guid policyId, PolicyType policyType, Guid publisher, string officeNo, string source, int choise, bool needAUTH, bool HasSubsidized, bool IsUsePatPrice, bool forbidChnagePNR) { var orderView = Session["OrderView"] as OrderView; var flights = Session["ReservedFlights"] as IEnumerable <FlightView>; MatchedPolicy matchedPolicy = MatchedPolicyCache.FirstOrDefault(p => p.Id == policyId); if (matchedPolicy == null) { throw new CustomException("政策选择超时"); } if (flights.First().BunkType != null && orderView.Source == OrderSource.PlatformOrder && (flights.First().BunkType == BunkType.Free || matchedPolicy.OriginalPolicy is SpecialPolicyInfo && ((SpecialPolicyInfo)matchedPolicy.OriginalPolicy).Type == SpecialProductType.LowToHigh)) { SpecialPolicy policy = PolicyManageService.GetSpecialPolicy(policyId); //低打高返和集团票性质一样 不需要去订坐 2013-4-3 wangsl //if (policy != null && (policy.SynBlackScreen||policy.Type==SpecialProductType.LowToHigh)) if (policy != null && policy.SynBlackScreen) { PNRPair pnr = PNRHelper.ReserveSeat(flights, orderView.Passengers); orderView.PNR = pnr; } } Order order = OrderProcessService.ProduceOrder(orderView, matchedPolicy, CurrentUser, BasePage.OwnerOEMId, forbidChnagePNR, (AuthenticationChoise)choise); FlightQuery.ClearFlightQuerySessions(); if (order.Source == OrderSource.PlatformOrder && !PNRPair.IsNullOrEmpty(order.ReservationPNR) && !String.IsNullOrWhiteSpace(order.Product.OfficeNo)) { if (needAUTH) { authorize(order.ReservationPNR, officeNo, source, BasePage.OwnerOEMId); } } return(order.Id.ToString()); }
protected override string ExecuteCore() { var flights = Context.GetParameterValue("flights"); var passengers = Context.GetParameterValue("passengers"); var contact = Context.GetParameterValue("contact"); var policyType = Context.GetParameterValue("policyType"); Vaild(flights, passengers, contact, policyType, InterfaceSetting); DataTransferObject.Order.OrderView orderView = new DataTransferObject.Order.OrderView(); bindOrderView(flights, passengers, contact, orderView); var pnrh = new PNRHelper(); try { if ((PolicyType)byte.Parse(policyType) != PolicyType.Special) { PNRPair pnr = pnrh.ReserveSeat(loadFlightView(flights, passengers), orderView.Passengers, Employee, Company); orderView.PNR = pnr; } if (pnrh.RequirePat(loadFlightView(flights, passengers), (PolicyType)byte.Parse(policyType))) { orderView.PATPrice = pnrh.Pat(orderView.PNR, loadFlightView(flights, passengers), PassengerType.Adult); } MatchedPolicy policy = QueryPolicies((PolicyType)byte.Parse(policyType), flights, passengers, orderView); if (policy != null) { if (policy.PolicyType == PolicyType.Special) { var p = PolicyManageService.GetSpecialPolicy(policy.Id); if (p != null && p.SynBlackScreen) { PNRPair pnr = pnrh.ReserveSeat(loadFlightView(flights, passengers), orderView.Passengers, Employee, Company); orderView.PNR = pnr; } } orderView.IsTeam = false; orderView.Source = OrderSource.InterfaceReservaOrder; Order order = OrderProcessService.ProduceOrder(orderView, policy, Employee, Guid.Empty, false); if (order.Source == OrderSource.InterfaceReservaOrder && !PNRPair.IsNullOrEmpty(order.ReservationPNR) && !String.IsNullOrWhiteSpace(order.Product.OfficeNo)) { if (policy.NeedAUTH && !string.IsNullOrEmpty(policy.OfficeNumber)) { authorize(order.ReservationPNR, policy.OfficeNumber); } } return("<id>" + order.Id + "</id><payable>" + (policy.ConfirmResource ? 0 : 1) + "</payable>" + ReturnStringUtility.GetOrder(order)); } } catch (Exception ex) { InterfaceInvokeException.ThrowCustomMsgException(ex.Message); } InterfaceInvokeException.ThrowCustomMsgException("生成订单失败,没有对应直达航班!"); return(""); }
private void InitlblData() { SpecialPolicy Special = PolicyManageService.GetSpecialPolicy(Guid.Parse(Request.QueryString["id"].ToString())); if (Special != null) { lowTr.Visible = false; hidIds.Value = Request.QueryString["id"]; lblAirline.Text = Special.Airline; lblVoyage.Text = Special.VoyageType.GetDescription(); lblOfficeNo.Text = Special.OfficeCode; lblSpecialType.Text = Special.Type.GetDescription(); lblDeparture.Text = Special.Departure; lblArrival.Text = Special.Arrival; lblDepartureDate.Text = (Special.DepartureDateStart == null ? "" : Special.DepartureDateStart.ToString("yyyy-MM-dd")) + "至" + (Special.DepartureDateEnd == null ? "" : Special.DepartureDateEnd.ToString("yyyy-MM-dd")); lblOutWithFilght.Text = Special.DepartureFlightsFilterType == LimitType.None ? "所有" : (Special.DepartureFlightsFilterType == LimitType.Include ? "适用:" + Special.DepartureFlightsFilter : "不适用:" + Special.DepartureFlightsFilter); lblExceptDay.Text = Special.DepartureDateFilter; //lblDepartureWeekFilter.Text = PublicClass.StringOperation.TransferToChinese(Special.DepartureDatesFilter); lblCreateTime.Text = Special.ProvideDate.ToString("yyyy-MM-dd"); lblCustomCode.Text = Special.CustomCode; lblRetreat.Text = "作废规定:" + Special.InvalidRegulation + "<br />" + "改签规定:" + Special.ChangeRegulation + "<br />" + "签转规定:" + Special.EndorseRegulation + "<br />" + "退票规定:" + Special.RefundRegulation + "<br />"; lblDays.Text = Special.BeforehandDays > -1 ? Special.BeforehandDays + "天" : ""; lblChang.Text = Special.ConfirmResource ? "需要" : "不需要"; lblDrawerCondition.Text = Special.DrawerCondition; lblRemark.Text = Special.Remark; lblPrintBeforeTwoHours.Text = Special.PrintBeforeTwoHours ? "可以" : "不可以"; if (Special.Freezed) { this.btnunlock.Visible = true; this.btnlock.Visible = false; this.unlock.Visible = true; [email protected] = false; } else { this.btnunlock.Visible = false; this.btnlock.Visible = true; this.unlock.Visible = false; [email protected] = true; } if (Special.PlatformAudited) { btnTongGuo.Visible = false; btnUnTongGuo.Visible = true; } else { btnTongGuo.Visible = true; btnUnTongGuo.Visible = false; } if (Special.PriceType == PriceType.Price) { lblPrice.Text = Special.Price == -1 ? "" : "¥" + Special.Price.TrimInvaidZero(); if (Special.IsInternal) { lblInternal.Text = "¥" + Special.InternalCommission.TrimInvaidZero(); } else { internalTitle.Visible = false; internalValue.Visible = false; } lblSubOrdinate.Text = Special.SubordinateCommission.TrimInvaidZero() == "-1" ? "" : "¥" + Special.SubordinateCommission.TrimInvaidZero(); if (Special.IsPeer) { lblProfession.Text = "¥" + Special.ProfessionCommission.TrimInvaidZero(); } else { professionTitle.Visible = false; professionValue.Visible = false; } } else { lblPrice.Text = Special.Price == -0.01M ? "" : "直减 " + (Special.Price * 100).TrimInvaidZero() + "%"; if (Special.IsInternal) { lblInternal.Text = (Special.InternalCommission * 100).TrimInvaidZero() + "%"; } else { internalTitle.Visible = false; internalValue.Visible = false; } lblSubOrdinate.Text = Special.SubordinateCommission == -1 ? "" : (Special.SubordinateCommission * 100).TrimInvaidZero() + "%"; if (Special.IsPeer) { lblProfession.Text = (Special.ProfessionCommission * 100).TrimInvaidZero() + "%"; } else { professionTitle.Visible = false; professionValue.Visible = false; } } if (Special.Type == SpecialProductType.CostFree) { lblPrice.Text = Special.Price == -1 ? "" : "¥" + Special.Price.TrimInvaidZero(); freeTicket.Visible = true; productNumberTitle.Visible = false; productNumberValue.Visible = false; lblExceptAirlines.Text = Special.ExceptAirways; if (Special.SynBlackScreen) { lblIsSynsy.Text = "同步:舱位 " + Special.Berths; } else { lblIsSynsy.Text = "不同步:可提供产品数量 " + Special.ResourceAmount; } } if (Special.Type == SpecialProductType.Bloc || Special.Type == SpecialProductType.Business) { productNumberTitle.Visible = false; productNumberValue.Visible = false; bussiness.Visible = true; if (Special.Type == SpecialProductType.Bloc) { this.lblTicketType.Text = Special.TicketType.GetDescription(); } else { this.ticketTypeTitle.Visible = false; this.ticketTypeValue.Visible = false; } lowTr.Visible = true; lblLowtype.Text = Special.LowNoType.GetDescription(); lblLowPrice.Text = Special.LowNoType == LowNoType.LowInterval ? (Special.LowNoType == LowNoType.LowInterval ? "票面价区间:" + Special.LowNoMinPrice.TrimInvaidZero() + "元(包含)至" + Special.LowNoMaxPrice.TrimInvaidZero() + "元(包含)" : "") : "无"; } if (Special.Type == SpecialProductType.LowToHigh) { productNumberTitle.Visible = false; productNumberValue.Visible = false; bussiness.Visible = true; this.ticketTypeTitle.Visible = false; this.ticketTypeValue.Visible = false; lowTr.Visible = false; lblPrice.Text = ""; if (Special.IsInternal) { lblInternal.Text = "返佣:" + (Special.InternalCommission * 100).TrimInvaidZero() + "%"; } else { internalTitle.Visible = false; internalValue.Visible = false; } lblSubOrdinate.Text = "返佣:" + (Special.SubordinateCommission == -1 ? "" : (Special.SubordinateCommission * 100).TrimInvaidZero() + "%"); if (Special.IsPeer) { lblProfession.Text = "返佣:" + (Special.ProfessionCommission * 100).TrimInvaidZero() + "%"; } else { professionTitle.Visible = false; professionValue.Visible = false; } } else { lblPrice.Text = Special.Price == -1 ? "" : "¥" + Special.Price.TrimInvaidZero(); } lblExceptAirlines.Text = Special.ExceptAirways; lblNum.Text = Special.ResourceAmount == -1 ? "" : Special.ResourceAmount + "张"; lblBunks.Text = Special.Berths; } }