예제 #1
0
        protected override string ExecuteCore()
        {
            decimal id;

            if (!decimal.TryParse(_orderId, out id))
            {
                throw new InterfaceInvokeException("1", "订单号");
            }
            var order = Service.OrderQueryService.QueryOrder(id);

            if (order == null)
            {
                throw new InterfaceInvokeException("9", "暂无此订单");
            }
            if (order.Purchaser.CompanyId != Company.CompanyId)
            {
                throw new InterfaceInvokeException("9", "暂无此订单");
            }
            id = ApplyRefundObj(order);

            //StringBuilder str = new StringBuilder();
            var obj = Service.ApplyformQueryService.QueryApplyform(id);

            //str.Append("<applyform><title>");
            ////退票申请
            //if (obj is RefundApplyform)
            //{
            //    var applyform = obj as RefundApplyform;
            //    str.AppendFormat("<id>{0}</id>", applyform.Id);
            //    str.AppendFormat("<applyType>{0}</applyType>", "1");
            //    str.AppendFormat("<status>{0}</status>", (int)applyform.Status);
            //    str.AppendFormat("<statusDescription>{0}</statusDescription>", applyform.Status.GetDescription());
            //    str.AppendFormat("<refundType>{0}</refundType>", (int)applyform.RefundType);
            //    str.AppendFormat("<originalPNR>{0}</originalPNR>", applyform.OriginalPNR == null ? "" : applyform.OriginalPNR.BPNR + "|" + applyform.OriginalPNR.PNR);
            //    str.AppendFormat("<newPNR>{0}</newPNR>", applyform.NewPNR == null ? "" : applyform.NewPNR.BPNR + "|" + applyform.NewPNR.PNR);
            //    str.AppendFormat("<amount>{0}</amount>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Amount.ToString() : "");//
            //    str.AppendFormat("<applyTime>{0}</applyTime>", applyform.AppliedTime);
            //    str.AppendFormat("<payTime>{0}</payTime>", "");//退票没有支付时间
            //    str.AppendFormat("<processedTime>{0}</processedTime>", applyform.ProcessedTime);
            //    str.Append("</title><passengers>");
            //    foreach (var item in applyform.Passengers)
            //    {
            //        str.Append("<p>");
            //        str.AppendFormat("<name>{0}</name>", item.Name);
            //        str.AppendFormat("<type>{0}</type>", (int)item.PassengerType);
            //        str.AppendFormat("<credentitals>{0}</credentitals>", item.Credentials);
            //        str.AppendFormat("<mobile>{0}</mobile>", item.Phone);
            //        str.AppendFormat("<settleCode>{0}</settleCode>", item.Tickets.Count() != 0 ? item.Tickets.FirstOrDefault().SettleCode : "");
            //        str.AppendFormat("<tickets>{0}</tickets>", item.Tickets.Count() != 0 ? item.Tickets.Join("|", num => num.No) : "");
            //        str.Append("</p>");
            //    }
            //    str.Append("</passengers><flights>");
            //    foreach (var item in applyform.Flights)
            //    {
            //        str.Append("<f>");
            //        str.AppendFormat("<departure>{0}</departure>", item.OriginalFlight.Departure.Code);
            //        str.AppendFormat("<arrival>{0}</arrival>", item.OriginalFlight.Arrival.Code);
            //        str.AppendFormat("<flightNo>{0}</flightNo>", item.OriginalFlight.FlightNo);
            //        str.AppendFormat("<aircraft>{0}</aircraft>", item.OriginalFlight.AirCraft);
            //        str.AppendFormat("<takeoffTime>{0}</takeoffTime>", item.OriginalFlight.TakeoffTime);
            //        str.AppendFormat("<arrivalTime>{0}</arrivalTime>", item.OriginalFlight.LandingTime);
            //        str.AppendFormat("<bunk>{0}</bunk>", item.OriginalFlight.Bunk.Code);
            //        str.AppendFormat("<fare>{0}</fare>", item.OriginalFlight.Price.Fare);
            //        str.AppendFormat("<discount>{0}</discount>", item.OriginalFlight.Bunk.Discount);
            //        str.AppendFormat("<airportFee>{0}</airportFee>", item.OriginalFlight.AirportFee);
            //        str.AppendFormat("<baf>{0}</baf>", item.OriginalFlight.Price.BAF);
            //        str.AppendFormat("<refundRate>{0}</refundRate>", applyform.Status == RefundApplyformStatus.Refunded ? item.RefundRate.ToString() : "");
            //        str.AppendFormat("<refundFee>{0}</refundFee>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Source.Details.First(o => o.Flight.Id == item.OriginalFlight.Id).RefundFee.ToString() : "");
            //        str.AppendFormat("<refundServiceCharge>{0}</refundServiceCharge>", item.RefundServiceCharge);
            //        str.AppendFormat("<newFlightNo>{0}</newFlightNo>", "");
            //        str.AppendFormat("<newAircraft>{0}</newAircraft>", "");
            //        str.AppendFormat("<newTakeoffTime>{0}</newTakeoffTime>", "");
            //        str.AppendFormat("<newArrivalTime>{0}</newArrivalTime>", "");
            //        str.AppendFormat("<postponeFee>{0}</postponeFee>", "");
            //        str.Append("</f>");
            //    }
            //    str.Append("</flights><bills>");
            //    str.AppendFormat("<b><type>{0}</type>", "1");
            //    str.AppendFormat("<amount>{0}</amount>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Tradement.Amount.ToString() : "");
            //    str.AppendFormat("<tradeNo>{0}</tradeNo>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Tradement.TradeNo.ToString() : "");
            //    str.AppendFormat("<time>{0}</time>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Time.ToString() : "");
            //    str.Append("</b></bills>");
            //}
            ////废票申请
            //if (obj is ScrapApplyform)
            //{
            //    var applyform = obj as ScrapApplyform;
            //    str.AppendFormat("<id>{0}</id>", applyform.Id);
            //    str.AppendFormat("<applyType>{0}</applyType>", "2");
            //    str.AppendFormat("<status>{0}</status>", (int)applyform.Status);
            //    str.AppendFormat("<statusDescription>{0}</statusDescription>", applyform.Status.GetDescription());
            //    str.AppendFormat("<refundType>{0}</refundType>", "");
            //    str.AppendFormat("<originalPNR>{0}</originalPNR>", applyform.OriginalPNR == null ? "" : applyform.OriginalPNR.BPNR + "|" + applyform.OriginalPNR.PNR);
            //    str.AppendFormat("<newPNR>{0}</newPNR>", applyform.NewPNR == null ? "" : applyform.NewPNR.BPNR + "|" + applyform.NewPNR.PNR);
            //    str.AppendFormat("<amount>{0}</amount>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Amount.ToString() : "");//
            //    str.AppendFormat("<applyTime>{0}</applyTime>", applyform.AppliedTime);
            //    str.AppendFormat("<payTime>{0}</payTime>", "");//退票没有支付时间
            //    str.AppendFormat("<processedTime>{0}</processedTime>", applyform.ProcessedTime);
            //    str.Append("</title><passengers>");
            //    foreach (var item in applyform.Passengers)
            //    {
            //        str.Append("<p>");
            //        str.AppendFormat("<name>{0}</name>", item.Name);
            //        str.AppendFormat("<type>{0}</type>", (int)item.PassengerType);
            //        str.AppendFormat("<credentitals>{0}</credentitals>", item.Credentials);
            //        str.AppendFormat("<mobile>{0}</mobile>", item.Phone);
            //        str.AppendFormat("<settleCode>{0}</settleCode>", item.Tickets.Count() != 0 ? item.Tickets.FirstOrDefault().SettleCode : "");
            //        str.AppendFormat("<tickets>{0}</tickets>", item.Tickets.Count() != 0 ? item.Tickets.Join("|", num => num.No) : "");
            //        str.Append("</p>");
            //    }
            //    str.Append("</passengers><flights>");
            //    foreach (var item in applyform.Flights)
            //    {
            //        str.Append("<f>");
            //        str.AppendFormat("<departure>{0}</departure>", item.OriginalFlight.Departure.Code);
            //        str.AppendFormat("<arrival>{0}</arrival>", item.OriginalFlight.Arrival.Code);
            //        str.AppendFormat("<flightNo>{0}</flightNo>", item.OriginalFlight.FlightNo);
            //        str.AppendFormat("<aircraft>{0}</aircraft>", item.OriginalFlight.AirCraft);
            //        str.AppendFormat("<takeoffTime>{0}</takeoffTime>", item.OriginalFlight.TakeoffTime);
            //        str.AppendFormat("<arrivalTime>{0}</arrivalTime>", item.OriginalFlight.LandingTime);
            //        str.AppendFormat("<bunk>{0}</bunk>", item.OriginalFlight.Bunk.Code);
            //        str.AppendFormat("<fare>{0}</fare>", item.OriginalFlight.Price.Fare);
            //        str.AppendFormat("<discount>{0}</discount>", item.OriginalFlight.Bunk.Discount);
            //        str.AppendFormat("<airportFee>{0}</airportFee>", item.OriginalFlight.AirportFee);
            //        str.AppendFormat("<baf>{0}</baf>", item.OriginalFlight.Price.BAF);
            //        str.AppendFormat("<refundRate>{0}</refundRate>", applyform.Status == RefundApplyformStatus.Refunded ? item.RefundRate.ToString() : "");
            //        str.AppendFormat("<refundFee>{0}</refundFee>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Source.Details.First(o => o.Flight.Id == item.OriginalFlight.Id).RefundFee.ToString() : "");
            //        str.AppendFormat("<refundServiceCharge>{0}</refundServiceCharge>", item.RefundServiceCharge);
            //        str.AppendFormat("<newFlightNo>{0}</newFlightNo>", "");
            //        str.AppendFormat("<newAircraft>{0}</newAircraft>", "");
            //        str.AppendFormat("<newTakeoffTime>{0}</newTakeoffTime>", "");
            //        str.AppendFormat("<newArrivalTime>{0}</newArrivalTime>", "");
            //        str.AppendFormat("<postponeFee>{0}</postponeFee>", "");
            //        str.Append("</f>");
            //    }
            //    str.Append("</flights><bills>");
            //    str.AppendFormat("<b><type>{0}</type>", "1");
            //    str.AppendFormat("<amount>{0}</amount>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Tradement.Amount.ToString() : "");
            //    str.AppendFormat("<tradeNo>{0}</tradeNo>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Tradement.TradeNo.ToString() : "");
            //    str.AppendFormat("<time>{0}</time>", applyform.Status == RefundApplyformStatus.Refunded ? applyform.RefundBill.Purchaser.Time.ToString() : "");
            //    str.Append("</b></bills>");
            //}
            //str.Append("</applyform>");
            return(QueryApplyform.GetApplyform(obj));
        }
예제 #2
0
        public XmlDocument QueryApplyform(string id, string userName, string sign)
        {
            var processor = new InterfaceProcessor.QueryApplyform(id, userName, sign);

            return(processor.Execute());
        }