private string getEI(Flight flight, ChinaPay.B3B.Service.Order.Domain.Order order)
        {
            switch (order.Product.ProductType)
            {
            case ProductType.Promotion:
                return(getProvision(order.Provider.Product.RefundAndReschedulingProvision));

            case ProductType.Special:
                if (order.IsThirdRelation && GetOrderRole(order) != OrderRole.Supplier)
                {
                    return(getProvision(order.Supplier.Product.RefundAndReschedulingProvision));
                }
                else
                {
                    return(getProvision(order.Provider == null ? null : order.Provider.Product.RefundAndReschedulingProvision));
                }

            default:
                var   eiTemplate = new Regex("退票规定:(?<RefundRegulation>.+?)改签规定:(?<ChangeRegulation>.+?)签转规定:(?<EndorseRegulation>.+?)备注:(?<Remarks>.+)");
                Match bunkEI     = eiTemplate.Match(flight.Bunk.EI);
                if (bunkEI.Success)
                {
                    return(GetRegulations(bunkEI.Groups["RefundRegulation"].Value, bunkEI.Groups["ChangeRegulation"].Value,
                                          bunkEI.Groups["EndorseRegulation"].Value, bunkEI.Groups["Remarks"].Value));
                }
                return(flight.Bunk.EI);
            }
        }
Beispiel #2
0
 public static void RemindOrder(Domain.Order order) {
     try {
         switch(order.Status) {
             case DataTransferObject.Order.OrderStatus.Applied:
                 var appliedAcceptor = order.IsThirdRelation ? order.Supplier.CompanyId : order.Provider.CompanyId;
                 Remind.OrderRemindService.Save(order.Id, Remind.Model.RemindStatus.AppliedForConfirm, getCarrier(order), appliedAcceptor);
                 break;
             case DataTransferObject.Order.OrderStatus.Ordered:
                 Remind.OrderRemindService.Save(order.Id, Remind.Model.RemindStatus.OrderedForPay, getCarrier(order), order.Purchaser.CompanyId);
                 break;
             case DataTransferObject.Order.OrderStatus.PaidForSupply:
                 var supplyAcceptor = order.IsThirdRelation ? order.Supplier.CompanyId : order.Provider.CompanyId;
                 Remind.OrderRemindService.Save(order.Id, Remind.Model.RemindStatus.PaidForSupply, getCarrier(order), supplyAcceptor);
                 break;
             case DataTransferObject.Order.OrderStatus.PaidForETDZ:
                 Remind.OrderRemindService.Save(order.Id, Remind.Model.RemindStatus.PaidForETDZ, getCarrier(order), order.Provider.CompanyId,order.CustomNo);
                 break;
             case DataTransferObject.Order.OrderStatus.ConfirmFailed:
             case DataTransferObject.Order.OrderStatus.DeniedWithSupply:
             case DataTransferObject.Order.OrderStatus.DeniedWithETDZ:
             case DataTransferObject.Order.OrderStatus.Canceled:
             case DataTransferObject.Order.OrderStatus.Finished:
                 Remind.OrderRemindService.Delete(order.Id);
                 break;
         }
     } catch(System.Exception ex) {
         LogService.SaveExceptionLog(ex, "处理订单提醒信息");
     }
 }
Beispiel #3
0
 static string getCarrier(Domain.Order order) {
     return order.PNRInfos.First().Flights.First().Carrier.Code;
 }
        private void bindProcessInfo(RefundOrScrapApplyform applyform)
        {
            var passenagerCount = applyform.Passengers.Count();

            hdPassengerCount.Value = passenagerCount.ToString();
            ChinaPay.B3B.Service.Order.Domain.Order order = applyform.Order;
            decimal CommissionRate = applyform.Order.Bill.PayBill.Provider.Source.Fare == 0
                                         ? 0
                                         : Math.Abs(applyform.Order.Bill.PayBill.Provider.Source.Commission) / applyform.Order.Bill.PayBill.Provider.Source.Fare;
            var flightsPassengerRelation = applyform.Flights.OrderBy(f => f.OriginalFlight.Serial)
                                           .Select(flightInfo =>
            {
                var bill         = applyform.RefundBill.Purchaser.Source.Details.First(f => f.Flight.Id == flightInfo.OriginalFlight.ReservateFlight);
                var maxRufundFee = bill != null ? bill.Anticipation : short.MaxValue;
                return
                (new
                {
                    Refunded = bill.Amount,
                    RefundFee = Math.Abs(bill.RefundFee),
                    RefundReate = (bill.RefundRate * 100).ToString("0.00"),
                    Flight = flightInfo,
                    flightId = flightInfo.OriginalFlight.Id,
                    Departure = flightInfo.OriginalFlight.Departure.Name,
                    Arrival = flightInfo.OriginalFlight.Arrival.Name,
                    Carrier = flightInfo.OriginalFlight.Carrier.Code,
                    flightInfo.OriginalFlight.FlightNo,
                    TicketPrice = flightInfo.OriginalFlight.Price.Fare,
                    flightInfo.OriginalFlight.Id,
                    Bunk = flightInfo.OriginalFlight.Bunk.Code,
                    TakeoffTime =
                        flightInfo.OriginalFlight.TakeoffTime.ToString("yyyy-MM-dd"),
                    Rate = string.Empty,
                    Fee = string.Empty,
                    Total = string.Empty,
                    PassengerCount = passenagerCount,
                    EI = getEI(flightInfo.OriginalFlight, applyform.Order),
                    TripType = order.TripType.GetDescription(),
                    RenderServiceCharge = IsSpeical && !order.IsThirdRelation,
                    Seaial = CNIndex[flightInfo.OriginalFlight.Serial],
                    Passengers = from p in applyform.Passengers
                                 let serviceCharge = getServiceCharge(p)
                                                     let ticket = p.Tickets.First(
                        t => t.Flights
                        .Any(f => f.ReservateFlight == flightInfo.OriginalFlight.ReservateFlight))
                                                                  select new
                    {
                        first = bill.Anticipation,
                        p.Name,
                        No = ticket == null ? string.Empty : ticket.SettleCode + "-" + ticket.No,
                        PassengerType =
                            p.PassengerType.GetDescription(),
                        flightInfo.OriginalFlight.Price.AirportFee,
                        flightInfo.OriginalFlight.Price.BAF,
                        TicketPrice =
                            flightInfo.OriginalFlight.Price.Fare,
                        YingShou =
                            flightInfo.OriginalFlight.Price.Total -
                            (CommissionRate *
                             flightInfo.OriginalFlight.Price.Fare),
                        Rate = string.Empty,
                        Fee = string.Empty,
                        AirportPair = string.Format("{0}-{1}",
                                                    flightInfo.OriginalFlight.Departure.Code,
                                                    flightInfo.OriginalFlight.Arrival.Code),
                        TotalRefund = string.Empty,
                        RenderServiceCharge =
                            IsSpeical && !order.IsThirdRelation,
                        p.CredentialsType,
                        RefundServiceCharge =
                            flightInfo.RefundServiceCharge == 0
                                             ? string.Format("{0}(不退)", serviceCharge)
                                             : serviceCharge ==
                            flightInfo.RefundServiceCharge
                                                   ? string.Format("{0}(全退)",
                                                                   flightInfo.RefundServiceCharge ?? 0)
                                                   : string.Format("{0}(退{1})",
                                                                   serviceCharge,
                                                                   flightInfo.
                                                                   RefundServiceCharge ?? 0),
                        Commission =
                            IsSpeical
                                             ? "0"
                                             : (CommissionRate *
                                                flightInfo.OriginalFlight.Price.Fare).
                            TrimInvaidZero(),
                        //是否是特殊票,民航基金,燃油,佣金
                        StrFee =
                            string.Format(
                                "parameters={{IsSpeical:{0},AirportFee:{1},BAF:{2},Commission:{3},Price:{4},ServiceCharge:{5},maxRufundFee:{6}}}",
                                IsSpeical ? 1 : 0,
                                flightInfo.OriginalFlight.Price.AirportFee,
                                flightInfo.OriginalFlight.Price.BAF,
                                (IsSpeical
                                                  ? 0
                                                  : CommissionRate *
                                 flightInfo.OriginalFlight.Price.Fare).
                                TrimInvaidZero(),
                                flightInfo.OriginalFlight.Price.Fare,
                                0,
                                maxRufundFee
                                )
                    }
                });
            }
                                                   );

            RefundInfos.DataSource = flightsPassengerRelation;
            RefundInfos.DataBind();
        }