示例#1
0
        protected override string ExecuteCore()
        {
            StringBuilder str       = new StringBuilder();
            var           flights   = ReserveViewConstuctor.GetQueryFlightView(_pnr.Voyage.Segments, _pnr.Voyage.Type, _pnr.Passengers.First().Type, _pnr.IsTeam);
            var           orderView = GetOrderView(OrderSource.InterfaceOrder, _pnr, new ChinaPay.B3B.DataTransferObject.Common.PNRPair()
            {
                BPNR = _associatePNR == "" ? "" : _associatePNR.Split('|')[0], PNR = _associatePNR == "" ? "" : (_associatePNR.Split('|').Count() < 2 ? "" : _associatePNR.Split('|')[1])
            }, flights, _contact);

            var orderInfo = Service.OrderProcessService.ProduceOrder(orderView, _matchedPolicy, Employee, Guid.Empty, false);

            str.AppendFormat("<id>{0}</id>", orderInfo.Id);
            str.AppendFormat("<officeNo>{0}</officeNo>", _matchedPolicy.OriginalPolicy == null && _matchedPolicy.NeedAUTH ? _matchedPolicy.OfficeNumber : (_matchedPolicy.OriginalPolicy != null && _matchedPolicy.OriginalPolicy.NeedAUTH ? _matchedPolicy.OriginalPolicy.OfficeCode : ""));
            str.AppendFormat("<payable>{0}</payable>", _matchedPolicy.ConfirmResource ? 0 : 1);
            str.Append(QueryOrder.GetOrder(orderInfo));
            //str.Append("<order><title>");
            //str.AppendFormat("<id>{0}</id>", orderInfo.Id);
            //str.AppendFormat("<status>{0}</status>", (int)orderInfo.Status);
            //str.AppendFormat("<statusDescription>{0}</statusDescription>", orderInfo.Status.GetDescription());
            //str.AppendFormat("<product>{0}</product>", (int)orderInfo.Product.ProductType);
            //str.AppendFormat("<ticket>{0}</ticket>", (int)orderInfo.Product.TicketType);
            //str.AppendFormat("<associatePNR>{0}</associatePNR>", orderInfo.AssociatePNR == null ? "" : orderInfo.AssociatePNR.BPNR + "|" + orderInfo.AssociatePNR.PNR);
            //str.AppendFormat("<rebate>{0}</rebate>", orderInfo.Purchaser.Rebate);
            //str.AppendFormat("<commission>{0}</commission>", orderInfo.Purchaser.Commission);
            //str.AppendFormat("<amount>{0}</amount>", orderInfo.Purchaser.Amount);
            //str.AppendFormat("<producedTime>{0}</producedTime>", orderInfo.Purchaser.ProducedTime);
            //str.AppendFormat("<payTime>{0}</payTime>", orderInfo.Bill.PayBill.Purchaser.Time);
            //str.AppendFormat("<etdzTime>{0}</etdzTime>", orderInfo.ETDZTime);
            //str.Append("</title>");

            //str.Append("<pnrs>");

            //foreach (var pnr in orderInfo.PNRInfos)
            //{
            //    str.Append("<pnr>"); str.AppendFormat("<code>{0}</code>", pnr.Code == null ? "" : pnr.Code.BPNR + "|" + pnr.Code.PNR);
            //    str.Append("<passengers>");
            //    foreach (var person in pnr.Passengers)
            //    {
            //        str.AppendFormat("<p><name>{0}</name><type>{1}</type><credentitals>{2}</credentitals><mobile>{3}</mobile><settleCode>{4}</settleCode><tickets>{5}</tickets></p>", person.Name, (int)person.PassengerType, person.Credentials, person.Phone, person.Tickets.FirstOrDefault().SettleCode, person.Tickets.Join("|", num => num.No));
            //    }
            //    str.Append("</passengers>");
            //    str.Append("<flights>");
            //    foreach (var filght in pnr.Flights)
            //    {
            //        str.AppendFormat("<f><departure>{0}</departure><arrival>{1}</arrival><airline>{2}</airline><flightNo>{3}</flightNo><aircraft>{11}</aircraft><takeoffTime>{4}</takeoffTime><arrivalTime>{5}</arrivalTime><bunk>{6}</bunk><fare>{7}</fare><discount>{8}</discount><airportFee>{9}</airportFee><baf>{10}</baf></f>", filght.Departure.Code + "|" + filght.Departure.City, filght.Arrival.Code + "|" + filght.Arrival.City, filght.Carrier.Code + "|" + filght.Carrier.Name, filght.FlightNo, filght.TakeoffTime, filght.LandingTime, filght.Bunk.Code, filght.Price.Fare, filght.Bunk.Discount, filght.AirportFee, filght.BAF, filght.AirCraft);
            //    }
            //    str.Append("</flights>");
            //    str.Append("</pnr>");
            //}

            //str.Append("</pnrs>");
            //str.Append("<bills>");
            //if (orderInfo.Bill.PayBill != null)
            //{//支付
            //    str.Append("<b>");
            //    str.AppendFormat("<type>1</type>");
            //    str.AppendFormat("<amount>{0}</amount>", orderInfo.Bill.PayBill.Purchaser.Amount);
            //    str.AppendFormat("<tradeNo>{0}</tradeNo>", orderInfo.Bill.PayBill.Tradement.TradeNo);
            //    str.AppendFormat("<time>{0}</time>", orderInfo.Bill.PayBill.Purchaser.Time);
            //    str.Append("</b>");
            //}

            //if (orderInfo.Bill.NormalRefundBills != null)
            //{//退款
            //    foreach (var item in orderInfo.Bill.NormalRefundBills)
            //    {
            //        str.Append("<b>");
            //        str.AppendFormat("<type>2</type>");
            //        str.AppendFormat("<amount>{0}</amount>", item.Tradement.Amount);
            //        str.AppendFormat("<tradeNo>{0}</tradeNo>", item.Tradement.TradeNo);
            //        str.AppendFormat("<time>{0}</time>", item.Purchaser.Time);
            //        str.Append("</b>");
            //    }
            //}
            //if (orderInfo.Bill.PostponePayBills != null)
            //{//支付
            //    foreach (var item in orderInfo.Bill.PostponePayBills)
            //    {
            //        str.Append("<b>");
            //        str.AppendFormat("<type>1</type>");
            //        str.AppendFormat("<amount>{0}</amount>", item.Tradement.Amount);
            //        str.AppendFormat("<tradeNo>{0}</tradeNo>", item.Tradement.TradeNo);
            //        str.AppendFormat("<time>{0}</time>", item.Applier.Time);
            //        str.Append("</b>");
            //    }
            //}

            //if (orderInfo.Bill.PostponeRefundBills != null)
            //{//退款
            //    foreach (var item in orderInfo.Bill.PostponeRefundBills)
            //    {
            //        str.Append("<b>");
            //        str.AppendFormat("<type>2</type>");
            //        str.AppendFormat("<amount>{0}</amount>", item.Tradement.Amount);
            //        str.AppendFormat("<tradeNo>{0}</tradeNo>", item.Tradement.TradeNo);
            //        str.AppendFormat("<time>{0}</time>", item.Applier.Time);
            //        str.Append("</b>");
            //    }
            //}

            //str.Append("</bills></order>");
            //清空缓存
            ContextCenter.Instance.Remove(_orgbatchNo);
            return(str.ToString());
        }
示例#2
0
        public XmlDocument QueryOrder(string id, string userName, string sign)
        {
            var processor = new InterfaceProcessor.QueryOrder(id, userName, sign);

            return(processor.Execute());
        }