コード例 #1
0
ファイル: QueryOrder.cs プロジェクト: 842549829/Pool
        protected override string ExecuteCore()
        {
            string  _id = Context.GetParameterValue("id");
            decimal id  = 0M;

            if (decimal.TryParse(_id, out id))
            {
                var orderInfo = OrderQueryService.QueryOrder(id);
                if (orderInfo == null)
                {
                    InterfaceInvokeException.ThrowCustomMsgException("暂无此订单");
                }
                if (orderInfo.Purchaser.CompanyId != Company.CompanyId)
                {
                    InterfaceInvokeException.ThrowCustomMsgException("暂无此订单");
                }
                if (orderInfo.Bill == null)
                {
                    InterfaceInvokeException.ThrowCustomMsgException("暂无账单信息");
                }
                return(ReturnStringUtility.GetOrder(orderInfo));
            }
            InterfaceInvokeException.ThrowParameterErrorException("订单号");
            return("");
        }
コード例 #2
0
 private void queryOrders(Pagination pagination)
 {
     try
     {
         IEnumerable <RoyaltyFailedRecord> orders = OrderQueryService.QueryRoyaltyFailedRecords(getCondition(), pagination);
         dataList.DataSource = orders;
         dataList.DataBind();
         if (pagination.RowCount > 0)
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "分润失败订单查询");
     }
 }
コード例 #3
0
ファイル: QueryOrder.cs プロジェクト: 842549829/Pool
        protected override string ExecuteCore()
        {//待确定
            decimal id = 0M;

            if (decimal.TryParse(_id, out id))
            {
                var orderInfo = OrderQueryService.QueryOrder(id);
                if (orderInfo == null)
                {
                    throw new InterfaceInvokeException("9", "暂无此订单");
                }
                if (orderInfo.Bill == null)
                {
                    throw new InterfaceInvokeException("9", "暂无账单信息");
                }
                if (orderInfo.Purchaser.CompanyId != Company.CompanyId)
                {
                    throw new InterfaceInvokeException("9", "暂无此订单");
                }

                return(GetOrder(orderInfo));
            }
            else
            {
                throw new InterfaceInvokeException("1", "订单号");
            }
        }
コード例 #4
0
        private OrderQueryService _orderQueryService; //Q 端

        public ExpiredOrderJob()
        {
            var container = (ObjectContainer.Current as AutofacObjectContainer).Container;

            _commandService    = container.Resolve <ICommandService>();
            _orderQueryService = container.Resolve <OrderQueryService>();
        }
コード例 #5
0
        public object ExistsPNR()
        {
            var orderView = Session["OrderView"] as OrderView;

            if (orderView == null)
            {
                return new { HasPNR = false, OrderId = 0 }
            }
            ;
            var orderId = OrderQueryService.ExistsPNR(orderView.PNR, DateTime.Now.AddDays(-1), DateTime.Now, CurrentCompany.CompanyId);

            if (orderId == 0)
            {
                return(new
                {
                    HasPNR = false,
                    OrderId = 0
                });
            }
            else
            {
                return(new
                {
                    HasPNR = true,
                    OrderId = orderId
                });
            }
        }
コード例 #6
0
 private void queryOrders(Pagination pagination)
 {
     try
     {
         IEnumerable <RefundFailedRecord> orders = OrderQueryService.QueryRefundFailedRecords(getCondition(), pagination);
         dataList.DataSource = orders.Select(item => new
         {
             item.OrderId,
             item.ApplyformId,
             BusinessType = item.BusinessType.GetDescription(),
             item.RefundTime,
             item.RefundFailedInfo
         });
         dataList.DataBind();
         if (pagination.RowCount > 0)
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }
コード例 #7
0
 public void Test_GetAllOrders()
 {
     OrderQueryService query = new OrderQueryService();
       var results = query.All();
       int count = results.Count();
       Assert.That(count, Is.GreaterThan(0));
 }
コード例 #8
0
        private void queryExternalOrderList(Pagination pagination)
        {
            var isPlatform = CurrentCompany.CompanyType == CompanyType.Platform;

            try
            {
                var list = OrderQueryService.QueryExternalOrders(getCondition(), pagination).Select(item =>
                {
                    var fare                = item.Flights.Sum(f => f.Fare).TrimInvaidZero();
                    var airportFee          = item.Flights.Sum(f => f.AirportFee).TrimInvaidZero();
                    var BAF                 = item.Flights.Sum(f => f.BAF).TrimInvaidZero();
                    var settleAmount        = item.SettlementForPurchaser.Amount.TrimInvaidZero();
                    var rebateAndCommission = string.Format("{0}%/{1}", (item.SettlementForPurchaser.Rebate * 100).TrimInvaidZero(),
                                                            item.SettlementForPurchaser.Commission.TrimInvaidZero());
                    return(new
                    {
                        InternalOrderId = item.OrderId,
                        PlatformType = item.PlatformType.GetDescription(),
                        PlatformTypeValue = (byte)item.PlatformType,
                        OrderId = "<a href=\"ExternalOrderDetail.aspx?id=" + item.OrderId + "\">" + item.ExternalOrderId + "(外部)</a><br />" +
                                  "<a href=\"" + (isPlatform ? "/OrderModule/Operate/OrderDetail.aspx?id=" : "OrderDetail.aspx?id=") + item.OrderId + "\">" +
                                  item.OrderId + "(内部)</a>",
                        PNR = item.ETDZPNR != null ? item.ETDZPNR.ToListString() : item.ReservationPNR == null ? string.Empty : item.ReservationPNR.ToListString(),
                        FlightInfo = string.Join("<br/>", item.Flights.Select(f => string.Format("{0}{1} {2} {3}-{4}<br/>{5}",
                                                                                                 f.Carrier, f.FlightNo, f.Bunk, f.DepartureCity, f.ArrivalCity, f.TakeoffTime.ToString("yyyy-MM-dd HH:mm")))),
                        Passengers = string.Join("<br/>", item.Passengers),
                        Price = fare + "</br>" + airportFee + "/" + BAF,
                        Commission = settleAmount + "<br/>" + rebateAndCommission,
                        ProducedTime = item.ProducedTime.ToString("yyyy-MM-dd<br />HH:mm:ss"),
                        PayStatus = item.PayStatus == PayStatus.NoPay?item.PayStatus.GetDescription() :item.PayStatus.GetDescription() + (item.IsAutoPay ? "(自动)" : "(手工)"),
                        Status = item.Status == OrderStatus.Finished ? "已出票" : "未出票",
                        InternalPayStatus = Service.Order.StatusService.GetOrderStatus(item.Status, DataTransferObject.Order.OrderRole.Provider)
                    });
                });
                this.dataList.DataSource = list;
                this.dataList.DataBind();
                if (list.Count() > 0)
                {
                    this.dataList.Visible      = true;
                    this.emptyDataInfo.Visible = false;
                    this.pager.Visible         = true;
                    if (pagination.GetRowCount)
                    {
                        this.pager.RowCount = pagination.RowCount;
                    }
                }
                else
                {
                    this.dataList.Visible      = false;
                    this.emptyDataInfo.Visible = true;
                    this.pager.Visible         = false;
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "查询");
            }
        }
コード例 #9
0
ファイル: BaseApplyform.cs プロジェクト: 842549829/Pool
 void initLazyLoaders()
 {
     _operationLoader    = new EnumerableLazyLoader <Log.Domain.OrderLog>(() => LogService.QueryApplyformLog(this.Id));
     _coordinationLoader = new EnumerableLazyLoader <Coordination>(() => CoordinationService.QueryApplyformCoordinations(this.Id));
     _orderLoader        = new LazyLoader <Order>(() => OrderQueryService.QueryOrder(this.OrderId));
     _purchaserLoader    = new LazyLoader <DataTransferObject.Organization.CompanyInfo>(() => Organization.CompanyService.GetCompanyDetail(this.PurchaserId));
     _providerLoader     = new LazyLoader <DataTransferObject.Organization.CompanyInfo>(() => Organization.CompanyService.GetCompanyDetail(this.ProviderId));
     _OemInfoLoader      = new LazyLoader <OEMInfo>(() => OEMService.QueryOEMById(OEMID.Value));
 }
コード例 #10
0
        public ActionResult Display(Guid orderId)
        {
            var order = OrderQueryService.FindOrder(orderId);

            if (order == null)
            {
                return(RedirectToAction("Find", new { conferenceCode = this.ConferenceCode }));
            }
            return(View(order));
        }
コード例 #11
0
        public RedirectToRouteResult AssignSeatsForOrder(Guid orderId)
        {
            var order = OrderQueryService.FindOrder(orderId);

            if (order == null)
            {
                return(RedirectToAction("Display", new { orderId }));
            }

            return(RedirectToAction("AssignSeats", new { assignmentsId = order.OrderId }));
        }
コード例 #12
0
 protected override RefundAndReschedulingProvision QueryRefundAndReschedulingProvision(decimal orderId)
 {
     if (_isThirdRelation)
     {
         return(OrderQueryService.QuerySupplierRefundAndReschedulingProvision(orderId));
     }
     else
     {
         return(OrderQueryService.QueryProviderRefundAndReschedulingProvision(orderId));
     }
 }
コード例 #13
0
        public ActionResult AssignSeats(Guid orderId)
        {
            var assignments = OrderQueryService.FindOrderSeatAssignments(orderId);

            if (assignments == null)
            {
                return(RedirectToAction("Find", new { conferenceCode = this.ConferenceCode }));
            }
            return(View(new OrderSeatsViewModel {
                OrderId = orderId, SeatAssignments = assignments
            }));
        }
コード例 #14
0
        public ActionResult Find(string email, string accessCode)
        {
            var orderId = OrderQueryService.LocateOrder(email, accessCode);

            if (!orderId.HasValue)
            {
                // TODO: 404?
                return(RedirectToAction("Find", new { conferenceCode = this.ConferenceCode }));
            }

            return(RedirectToAction("Display", new { conferenceCode = this.ConferenceCode, orderId = orderId.Value }));
        }
コード例 #15
0
 private void QueryApplyForm(Pagination pagination)
 {
     try
     {
         IEnumerable <OrderListView> orderInfos = OrderQueryService.QueryOrders(getCondition(), pagination);
         dataList.DataSource = Enumerable.Select(orderInfos, order =>
         {
             return(new
             {
                 order.OrderId,
                 PNR = order.ETDZPNR == null ? string.Empty : order.ETDZPNR.ToListString(),
                 AirportPair = order.Flights.Join("<br />",
                                                  f =>
                                                  string.Format(
                                                      "{0}-{1}",
                                                      f.DepartureCity,
                                                      f.ArrivalCity)),
                 FlightInfo = order.Flights.Join("<br />",
                                                 f => string.Format(
                                                     "{0}{1}<br />{2} / {3}",
                                                     f.Carrier,
                                                     f.FlightNo,
                                                     string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk, getDiscountText(f.Discount))),
                 TakeoffTime = order.Flights.Join("<br />",
                                                  f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
                 Passengers = string.Join("<br />", order.Passengers),
                 ProducedTime =
                     order.ProducedTime.ToString("yyyy-MM-dd HH:mm"),
                 order.ProducedAccount,
                 order.PurchaserName,
                 allTakeOff = order.Flights.All(item => item.TakeoffTime < DateTime.Now)
             });
         });
         dataList.DataBind();
         if (orderInfos.Any())
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }
コード例 #16
0
        private void LoadOrderInfoHis(decimal orderId)
        {
            var orderInfo = OrderQueryService.QueryOrder(orderId);

            if (orderInfo == null)
            {
                ShowMessage("订单不存在!");
                return;
            }
            this.lblOrderId.Text     = orderId.ToString();
            applyFormList.DataSource = orderInfo.FinishedApplyforms;
            applyFormList.DataBind();
        }
コード例 #17
0
 void queryOrders(Pagination pagination)
 {
     try {
         var isAdmin = CurrentUser.IsAdministrator;
         IEnumerable <OrderListView> orderListViews = OrderQueryService.QueryOrders(getCondition(), pagination).ToList();
         var lockInfos = LockService.Query(orderListViews.Select(form => form.OrderId.ToString())).ToList();
         var orders    = from item in orderListViews
                         let IsShowPNR = item.Source == OrderSource.CodeImport ||
                                         item.Source == OrderSource.ContentImport ||
                                         item.Source == OrderSource.InterfaceOrder ||
                                         (item.Status > OrderStatus.PaidForSupply && item.Status != OrderStatus.Canceled)
                                         let lockInfo = lockInfos.FirstOrDefault(l => l.Key == item.OrderId.ToString())
                                                        select new
         {
             OrderId                                                 = item.OrderId,
             PNR                                                     = item.ETDZPNR != null?item.ETDZPNR.ToListString() : item.ReservationPNR == null || !IsShowPNR ? string.Empty : item.ReservationPNR.ToListString(),
                                                 Product             = item.ProductType.GetDescription(),
                                                 AirportPair         = item.Flights.Join("<br />", f => string.Format("{0}-{1}", f.DepartureCity, f.ArrivalCity)),
                                                 FlightInfo          = item.Flights.Join("<br />", f => string.Format("{0}{1}<br />{2}/{3}", f.Carrier, f.FlightNo, string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk, getDiscountText(f.Discount))),
                                                 TakeoffTime         = item.Flights.Join("<br />", f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
                                                 Passenger           = item.Passengers.Join("<br />"),
                                                 Fare                = item.Flights.Sum(f => f.Fare).TrimInvaidZero(),
                                                 AirportFee          = item.Flights.Sum(f => f.AirportFee).TrimInvaidZero(),
                                                 BAF                 = item.Flights.Sum(f => f.BAF).TrimInvaidZero(),
                                                 SettleAmount        = item.SettlementForPurchaser.Amount.TrimInvaidZero(),
                                                 RebateAndCommission = item.ProductType == ProductType.Special ? string.Empty : string.Format("{0}%/{1}",
                                                                                                                                              (item.SettlementForPurchaser.Rebate * 100).TrimInvaidZero(),
                                                                                                                                              item.SettlementForPurchaser.Commission.TrimInvaidZero()),
                                                 item.ProducedAccount,
                                                 ProducedTime = item.ProducedTime.ToString("yyyy-MM-dd<br />HH:mm:ss"),
                                                 item.ProducedAccountName,
                                                 UnLockEnable = isAdmin && lockInfo != null && lockInfo.Account != CurrentUser.UserName
         };
         this.dataList.DataSource = orders;
         this.dataList.DataBind();
         if (orders.Any())
         {
             this.pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 this.pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             this.pager.Visible = false;
         }
     } catch (Exception ex) {
         ShowExceptionMessage(ex, "查询");
     }
 }
コード例 #18
0
 protected void btnGetTicketNos_Click(object sender, EventArgs e)
 {
     try
     {
         var order = OrderQueryService.QueryExternalOrderTicket(decimal.Parse(this.lblInternalOrderId.Text), BasePage.OwnerOEMId);
         if (order != null)
         {
             bindOrder(order);
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "获取票号");
     }
 }
コード例 #19
0
        /// <summary>
        /// 支付订单
        /// 在线方式支付
        /// </summary>
        /// <param name="orderId">订单号</param>
        /// <param name="bankInfo">银行信息</param>
        /// <param name="clientIP">客户端IP</param>
        /// <param name="operatorAccount">操作员账号</param>
        public static string OnlinePayOrder(decimal orderId, string bankInfo, string clientIP, string operatorAccount)
        {
            var order         = OrderQueryService.QueryOrder(orderId);
            var bankInfoArray = bankInfo.Split('|');
            var channelId     = int.Parse(bankInfoArray[0]);
            var bankCode      = bankInfoArray[1];

            var payAccountNo    = getPayAccountNo(order.Purchaser.CompanyId);
            var payOrderRequest = new PayOrderRequestProcess(orderId, order.Purchaser.Amount,
                                                             payAccountNo, order.Bill.PayBill.Tradement.PayeeAccount, "支付机票款",
                                                             order.ReservationPNR == null ? string.Empty : (order.ReservationPNR.PNR ?? order.ReservationPNR.BPNR),
                                                             TicketOrderPayType + "|" + payAccountNo + "|" + operatorAccount, channelId.ToString(), bankCode);

            payOrderRequest.Execute();
            return(payOrderRequest.PayUrl);
        }
コード例 #20
0
 private void QueryApplyForm(Pagination pagination)
 {
     try {
         var orderInfos = OrderQueryService.QueryCredentialsUpdateInfos(getCondition(), pagination);
         dataList.DataSource = orderInfos.Select(order =>
                                                 new
         {
             order.OrderId,
             PNR         = order.PNR == null ? string.Empty : order.PNR.ToListString(),
             AirportPair = order.Flights.Join("<br />", f => f.DepartureCity + "-" + f.ArrivalCity),
             FlightInfo  = order.Flights.Join("<br />",
                                              f => string.Format(
                                                  "{0}{1}<br />{2} / {3}",
                                                  f.Carrier,
                                                  f.FlightNo,
                                                  string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk,
                                                  getDiscountText(f.Discount))),
             TakeoffTime = order.Flights.Join("<br />", f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
             order.Passenger,
             order.PassengerName,
             CommitTime = order.CommitTime.ToString("yyyy-MM-dd<br />HH:mm"),
             order.PurchaserName,
             order.OriginalCredentials,
             order.NewCredentials,
             Status = order.Success ? "成功" : "失败",
             IsFail = !order.Success,
             order.Id
         });
         dataList.DataBind();
         if (pagination.RowCount > 0)
         {
             pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             pager.Visible = false;
         }
     } catch (Exception ex) {
         ShowExceptionMessage(ex, "查询");
     }
 }
コード例 #21
0
ファイル: ResourceList.aspx.cs プロジェクト: 842549829/Pool
 void queryOrders(Pagination pagination)
 {
     try {
         var orderListViews = OrderQueryService.QueryOrders(getCondition(), pagination).ToList();
         var lockInfos      = LockService.Query(orderListViews.Select(form => form.OrderId.ToString())).ToList();
         var orders         = from item in orderListViews
                              let lockInfo = lockInfos.FirstOrDefault(l => l.Key == item.OrderId.ToString())
                                             select new
         {
             OrderId       = item.OrderId,
             AirportPair   = item.Flights.Join("<br />", f => string.Format("{0}-{1}", f.DepartureCity, f.ArrivalCity)),
             FlightInfo    = item.Flights.Join("<br />", f => f.Carrier + f.FlightNo),
             TakeoffTime   = item.Flights.Join("<br />", f => f.TakeoffTime.ToString("yyyy-MM-dd<br />HH:mm")),
             Passenger     = item.Passengers.Join("<br />"),
             Fare          = item.Flights.Sum(f => f.Fare).TrimInvaidZero(),
             AirportFee    = item.Flights.Sum(f => f.AirportFee).TrimInvaidZero(),
             BAF           = item.Flights.Sum(f => f.BAF).TrimInvaidZero(),
             Status        = Service.Order.StatusService.GetOrderStatus(item.Status, m_IsSupplier ? OrderRole.Supplier : OrderRole.Provider),
             ProducedTime  = item.ProducedTime.ToString("yyyy-MM-dd<br />HH:mm:ss"),
             LockInfo      = lockInfo == null ? string.Empty :  lockInfo.Name + "<br />",
             RemindContent = item.RemindTime.HasValue ? item.RemindContent : string.Empty,
             RemindIsShow  = item.IsNeedReminded
         };
         this.dataList.DataSource = orders;
         this.dataList.DataBind();
         if (orders.Any())
         {
             this.pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 this.pager.RowCount = pagination.RowCount;
             }
         }
         else
         {
             this.pager.Visible = false;
         }
     } catch (Exception ex) {
         ShowExceptionMessage(ex, "查询");
     }
 }
コード例 #22
0
        private void bindOrderLogs(decimal orderId)
        {
            var order = OrderQueryService.QueryOrder(orderId);

            if (order == null)
            {
                return;
            }
            var orderRole = GetOrderRole(order);
            var logs      = from item in LogService.QueryOrderLog(orderId)
                            where item.IsVisible(orderRole, CurrentCompany.CompanyId)
                            select new
            {
                item.Keyword,
                OperateTime = item.Time.ToString("yyyy-MM-dd<br />HH:mm:ss"),
                Detail      = Detail(item.Content),
                Operator    = getOperator(item),
                Applyform   = item.ApplyformId
            };

            logContent.DataSource = logs;
            logContent.DataBind();
        }
コード例 #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     RegisterOEMSkins("form.css");
     if (!IsPostBack)
     {
         setBackButton();
         string  id = Request.QueryString["id"];
         decimal orderId;
         if (decimal.TryParse(id, out orderId))
         {
             Order order = OrderQueryService.QueryOrder(orderId);
             if (order != null)
             {
                 if (order.Status == OrderStatus.Applied || order.Status == OrderStatus.PaidForSupply)
                 {
                     string lockErrorMsg;
                     if (Lock(orderId, LockRole.Supplier, "处理座位", out lockErrorMsg))
                     {
                         bindOrder(order);
                         setButtons(order);
                     }
                     else
                     {
                         showErrorMessage("锁定订单失败。原因:" + lockErrorMsg);
                     }
                 }
                 else
                 {
                     showErrorMessage("仅待确认座位或待提供座位的订单可做座位处理");
                 }
                 return;
             }
         }
         showErrorMessage("订单不存在");
     }
 }
コード例 #24
0
ファイル: RefundmentService.cs プロジェクト: 842549829/Pool
        internal static void ProcessTradeRefundemnt(RefundFailedRecord refundInfo)
        {
            //if(refundInfo.BusinessType == RefundBusinessType.PayTimeout) {
            //    var order = OrderQueryService.QueryOrder(refundInfo.OrderId);
            //    if(order != null) {
            //        TradeRefund(order, refundInfo.PayTradeNo);
            //    }
            //    return;
            //}
            var refundBill = DistributionQueryService.QueryNormalRefundBill(refundInfo.ApplyformId);

            if (refundBill != null)
            {
                var refundResult = TradeRefund(refundBill, refundInfo.BusinessType);
                if (refundResult != null && refundResult.Success)
                {
                    DistributionProcessService.NormalRefundSuccess(refundBill, new[] { refundResult });
                    using (var command = Order.Repository.Factory.CreateCommand()) {
                        command.BeginTransaction();
                        try {
                            var distributionRepository = Order.Repository.Factory.CreateDistributionRepository(command);
                            distributionRepository.UpdateRefundBillForRefundSuccess(refundBill);
                            command.CommitTransaction();
                        } catch (Exception ex) {
                            command.RollbackTransaction();
                            LogService.SaveExceptionLog(ex, "交易退款");
                            throw;
                        }
                        var order = OrderQueryService.QueryOrder(refundInfo.OrderId);
                        //发取消出票退款成功通知
                        var notifier = new Order.Notify.OrderNotifier(order);
                        notifier.SendRefundSuccessNotify();
                    }
                }
            }
        }
コード例 #25
0
        private OrderQueryService _orderQueryService; //Q 端

        public OrderController(ICommandService commandService,
                               OrderQueryService orderQueryService)
        {
            _commandService    = commandService;
            _orderQueryService = orderQueryService;
        }
コード例 #26
0
ファイル: OrderPay.aspx.cs プロジェクト: 842549829/Pool
        private void payOrder(decimal orderId)
        {
            string source = Request.QueryString["source"];
            Order  order  = OrderQueryService.QueryOrder(orderId);

            if (order == null)
            {
                showErrorMessage("订单 [" + orderId + "] 不存在");
            }
            else
            {
                if (order.Source != OrderSource.PlatformOrder)
                {
                    orderIsImport.Value = "1";
                }
                flights = order.PNRInfos.FirstOrDefault().Flights.ToList();
                PNRInfo pnr = order.PNRInfos.First();
                ShowTicketPrice.Value = pnr.Flights.First().Bunk is FreeBunk ||
                                        pnr.Passengers.First().Price.Fare != 0
                                            ? "1"
                                            : "0";

                // 状态是待申请的,则仅显示订单信息和提示信息
                if (order.Status == OrderStatus.Applied)
                {
                    bindOrder(order, source);
                    divOperations.Visible = false;
                }
                else
                {
                    // 内部机构订单不需要支付
                    if (order.IsInterior)
                    {
                        Response.Redirect("OrderDetail.aspx?id=" + orderId + "&returnUrl=OrderList.aspx");
                    }
                    // 其他情况,均要检查是否能支付和状态
                    string errorMessage;

                    if (OrderProcessService.Payable(orderId, out errorMessage))
                    {
                        string lockErrorMsg;
                        if (Lock(orderId, LockRole.Purchaser, "订单支付", out lockErrorMsg))
                        {
                            bindOrder(order, source);
                            bindPayTypes();
                        }
                        else
                        {
                            showErrorMessage("锁定订单失败。原因:" + lockErrorMsg);
                        }
                        if (!string.IsNullOrEmpty(errorMessage))
                        {
                            showErrorMessage(errorMessage);
                        }
                    }
                    else
                    {
                        showErrorMessage(errorMessage);
                    }
                }
            }
        }
コード例 #27
0
ファイル: CommonProductInfo.cs プロジェクト: 842549829/Pool
 protected override RefundAndReschedulingProvision QueryRefundAndReschedulingProvision(decimal orderId)
 {
     return(OrderQueryService.QueryProviderRefundAndReschedulingProvision(orderId));
 }
コード例 #28
0
        /// <summary>
        /// 申请升舱
        /// </summary>
        /// <param name="orderId">订单号</param>
        /// <param name="pnrCode">编码(小编码|大编码)</param>
        /// <param name="passengers">乘机人(乘机人id,以','隔开)</param>
        /// <param name="voyages">航段(航段id|新航班号|新航班日期,以','隔开)</param>
        /// <param name="originalPNR">原始编码 </param>
        public object ApplyUpgrade(decimal orderId, string pnrCode, List <PassengerViewEx> passengers, List <FlihgtInfo> voyages, string originalPNR)
        {
            try
            {
                var pnrPair = originalPNR.Split('|');
                if (originalPNR.ToUpper().IndexOf(pnrCode.ToUpper(), StringComparison.Ordinal) > -1)
                {
                    throw new CustomException("编码与原编码不能相同");
                }
                var flightViews = ImportHelper.AnalysisPNR(pnrCode, HttpContext.Current);
                if (flightViews.Item2.Count() != passengers.Count)
                {
                    throw new CustomException("所选乘客与编码中的乘客数量不一致");
                }
                if (flightViews.Item1.Count() != voyages.Count)
                {
                    throw new CustomException("所选航班与编码中的航班数量不一致");
                }
                var ValidateInfo = passengers.Join(flightViews.Item2, p => p.Name, p => p.Name, (p, q) => 1);
                if (ValidateInfo.Count() != passengers.Count)
                {
                    throw new CustomException("编码中的乘客姓名与所选乘客姓名不匹配!");
                }
                var order = OrderQueryService.QueryOrder(orderId);
                if (order == null)
                {
                    throw new ArgumentNullException("订单不存在");
                }
                List <Flight> allOrderFlights = new List <Flight>();
                foreach (PNRInfo info in order.PNRInfos)
                {
                    allOrderFlights.AddRange(info.Flights);
                }
                var applyformView = new UpgradeApplyformView()
                {
                    NewPNR     = new PNRPair(pnrCode, string.Empty),
                    Passengers = passengers.Select(p => p.PassengerId),
                    PNRSource  = OrderSource.CodeImport,
                    PNR        = new PNRPair(pnrPair[0], pnrPair[1])
                };
                foreach (var item in voyages)
                {
                    var flight = flightViews.Item1.FirstOrDefault(f => f.Departure.Code == item.Departure && f.Arrival.Code == item.Arrival);
                    if (flight == null)
                    {
                        throw new NullReferenceException("所选择的航程与编码提取航程不对应!");
                    }
                    applyformView.AddItem(new UpgradeApplyformView.Item()
                    {
                        Voyage = item.flightId,
                        Flight = new DataTransferObject.Order.FlightView()
                        {
                            SerialNo    = flight.Serial,
                            Airline     = flight.AirlineCode,
                            FlightNo    = flight.FlightNo,
                            Departure   = flight.Departure.Code,
                            Arrival     = flight.Arrival.Code,
                            AirCraft    = flight.Aircraft,
                            TakeoffTime = flight.Departure.Time,
                            LandingTime = flight.Arrival.Time,
                            YBPrice     = flight.YBPrice,
                            Bunk        = flight.BunkCode,
                            Type        = flight.BunkType == null ? BunkType.Economic : flight.BunkType.Value,
                            Fare        = flight.Fare
                        }
                    });
                }

                HttpContext.Current.Session["ApplyformView"]   = applyformView;
                HttpContext.Current.Session["Passengers"]      = passengers;
                HttpContext.Current.Session["ReservedFlights"] = flightViews.Item1;



                //Service.OrderProcessService.Apply(orderId, applyformView, CurrentUser.UserName);
                //releaseLock(orderId);
                return(new
                {
                    IsSuccess = true,
                    QueryString = string.Format("?source=3&orderId={0}&provider={1}", orderId, order.Provider.CompanyId)
                });
            }
            catch (Exception ex)
            {
                return(new
                {
                    IsSuccess = false,
                    QueryString = ex.Message
                });
            }
        }
コード例 #29
0
ファイル: WaitOrderList.aspx.cs プロジェクト: 842549829/Pool
        private void queryOrders(Pagination pagination)
        {
            try
            {
                List <OrderListView> orders       = OrderQueryService.QueryOrders(GetCondition(), pagination).ToList();
                List <OrderListView> SortedOrders = orders.Where(o => o.Flights.Min(f => f.TakeoffTime.Date) == DateTime.Today).ToList();
                SortedOrders.AddRange(orders.Where(o => o.Flights.Min(f => f.TakeoffTime.Date) != DateTime.Today).OrderByDescending(o => o.IsEmergentOrder).ThenBy(o => o.PayTime));
                var lockInfos = LockService.Query(orders.Select(form => form.OrderId.ToString())).ToList();

                dataList.DataSource = SortedOrders.Select(item =>
                {
                    LockInfo lockInfo      = lockInfos.FirstOrDefault(l => l.Key == item.OrderId.ToString());
                    DateTime?startStatTime = null;
                    if (CurrentCompany.CompanyType == CompanyType.Supplier)
                    {
                    }
                    else if (item.IsSpecial && item.Supplier.HasValue)
                    {
                        if (item.SupplyTime.HasValue && item.PayTime.HasValue)
                        {
                            startStatTime = item.SupplyTime.Value > item.PayTime.Value ? item.SupplyTime.Value : item.PayTime.Value;
                        }
                    }
                    else
                    {
                        startStatTime = item.PayTime;
                    }
                    bool isRelation = item.PurcharseProviderRelation == null || item.PurcharseProviderRelation == RelationType.Brother;

                    return(new
                    {
                        item.OrderId,
                        Product = item.ProductType.GetDescription(),
                        PNR =
                            item.ETDZPNR != null
                                                                            ? item.ETDZPNR.ToListString()
                                                                            : item.ReservationPNR == null ? string.Empty : item.ReservationPNR.ToListString(),
                        AirportPair =
                            item.Flights.Join("<br />",
                                              f =>
                                              string.Format(
                                                  "{0}{1} {2} {3}-{4}<br />{5:yyyy-MM-dd HH:mm}",
                                                  f.Carrier,
                                                  f.FlightNo,
                                                  string.IsNullOrEmpty(f.Bunk) ? "-" : f.Bunk,
                                                  f.DepartureCity,
                                                  f.ArrivalCity,
                                                  f.TakeoffTime)),
                        Passenger = item.Passengers.Join("<br />"),
                        Fare = item.Flights.Sum(f => f.Fare).TrimInvaidZero(),
                        AirportFee = item.Flights.Sum(f => f.AirportFee).TrimInvaidZero(),
                        BAF = item.Flights.Sum(f => f.BAF).TrimInvaidZero(),
                        SettleAmount = item.SettlementForProvider.Amount.TrimInvaidZero(),
                        Rebate = (item.SettlementForProvider.Rebate * 100).TrimInvaidZero() + "%",
                        Commission = item.SettlementForProvider.Commission.TrimInvaidZero(),
                        Status = StatusService.GetOrderStatus(item.Status, OrderRole.Provider),
                        EmergentOrderContnt = item.IsEmergentOrder ? string.Format("<a href='javascript:void(0);' id='{0}' class='tips_btn urgent'>紧急</a>", item.OrderId) : string.Empty,
                        // EmergentOrderContnt = isEmergentOrder ? string.Format("<a href='javascript:void(0);' class='tips_btn urgent'>紧急</a><div class='tips_box hidden'><div class='tips_bd'><p>{0}</p></div></div>", emergentOrderContnt) : string.Empty,
                        ProducedTime = item.ProducedTime.ToString("yyyy-MM-dd<br />HH:mm:ss"),
                        ProductType = item.ProviderProductType.GetDescription(),
                        LockInfo = lockInfo == null? string.Empty:lockInfo.Name + "<br />",
                        OfficeNum = item.OfficeNo,
                        PurchaseIsBother = isRelation,
                        Relation = isRelation ?
                                   "平台" : item.PurcharseProviderRelation == RelationType.Interior?"内部":"下级",
                        TodaysFlight = item.Flights.Any(f => f.TakeoffTime.Date == DateTime.Today),
                        PassengerType = item.PassengerType.GetDescription(),
                        IsChildTicket = item.PassengerType == PassengerType.Child,
                        ETDZTime = (startStatTime.HasValue && item.RefuseETDZTime.HasValue) ? Math.Round((item.RefuseETDZTime.Value - startStatTime.Value).TotalMinutes).ToString() : (startStatTime.HasValue) ? Math.Round(((item.ETDZTime ?? DateTime.Now) - startStatTime.Value).TotalMinutes).ToString() :string.Empty,
                        TicketType = item.IsSpecial ? string.Empty : string.Format("({0})", item.TicketType.ToString()),
                        RemindContent = item.RemindTime.HasValue ? item.RemindContent : string.Empty,
                        RemindIsShow = item.IsNeedReminded
                    });
                });
                dataList.DataBind();
                if (orders.Any())
                {
                    pager.Visible = true;
                    if (pagination.GetRowCount)
                    {
                        pager.RowCount = pagination.RowCount;
                    }
                }
                else
                {
                    pager.Visible = false;
                }
            }
            catch (Exception ex)
            {
                ShowExceptionMessage(ex, "查询");
            }
        }
コード例 #30
0
        public object CheckRefundCondition(decimal orderId, string passenger, string voyages, int refundType, string pnr, bool DelegageCancelPNR)
        {
            var passgners = getPassengers(passenger);
            var _voyages  = getRefundVoyages(voyages);
            var pnrPair   = getPNRPair(pnr);
            var order     = OrderQueryService.QueryOrder(orderId);


            RefundOrScrapApplyformView applyformView = null;

            if (refundType == -1)
            {
                applyformView = new ScrapApplyformView();
            }
            else
            {
                applyformView = new RefundApplyformView();
                var view = applyformView as RefundApplyformView;
                view.RefundType = (RefundType)refundType;

                applyformView = view;
            }
            applyformView.PNR               = pnrPair;
            applyformView.Passengers        = passgners;
            applyformView.Reason            = "退票验证";
            applyformView.DelegageCancelPNR = DelegageCancelPNR;
            foreach (var item in getRefundVoyages(voyages))
            {
                applyformView.AddVoyage(item);
            }
            OrderProcessService.ApplyValidate(orderId, applyformView, CurrentUser, BasePage.OwnerOEMId);
            if (order == null)
            {
                throw new CustomException("订单不存在!");
            }
            if (!SystemParamService.ValidateRefundCondition)
            {
                return(new
                {
                    PNRCancled = true,
                    TicketUnUse = true,
                    IsNotPrinted = true,
                    IsSameName = true,
                    Successed = true,
                    NeedPlatfromDeal = false,
                    CheckCondition = false
                });
            }
            var result = OrderProcessService.CheckRefundCondition(order, passgners, _voyages, pnrPair, DelegageCancelPNR, BasePage.OwnerOEMId);

            if (result.Item5)
            {
                return(new
                {
                    PNRCancled = result.Item1,
                    TicketUnUse = result.Item2,
                    IsNotPrinted = result.Item3,
                    IsSameName = result.Item4,
                    Successed = result.Item1 && result.Item2 && result.Item3 && result.Item4,
                    NeedPlatfromDeal = false,
                    CheckCondition = true
                });
            }
            Session["NeedPlatformCancelPNR"] = orderId;
            return(new
            {
                PNRCancled = result.Item1,
                TicketUnUse = false,
                IsNotPrinted = false,
                IsSameName = false,
                Successed = true,
                NeedPlatfromDeal = true,
                CheckCondition = true
            });
        }
コード例 #31
0
        private void process()
        {
            showMessage("开始下一批处理");
            var noPorcess = AutoPayService.QueryNoPorcess();
            //var str = Environment.CurrentDirectory;
            string msg = "";

            foreach (var item in noPorcess)
            {
                if (!_run)
                {
                    break;
                }
                AccountTradeDTO tradeView = null;
                //处理订单
                if (item.OrderType == OrderType.Order)
                {
                    OrderProcessService.Payable(item.OrderId, out msg);
                    if (string.IsNullOrEmpty(msg))
                    {
                        Order order = OrderQueryService.QueryOrder(item.OrderId);
                        tradeView = getPayTradeView(order, getPayAccountNo(item.PayType, order.Purchaser.Amount, order.Purchaser.CompanyId), "");
                    }
                }
                //处理申请单
                else if (item.OrderType == OrderType.Postpone)
                {
                    ApplyformProcessService.Payable(item.OrderId, out msg);
                    if (string.IsNullOrEmpty(msg))
                    {
                        PostponeApplyform applyform = ApplyformQueryService.QueryPostponeApplyform(item.OrderId);
                        if (applyform.PayBill.Tradement == null)
                        {
                            msg = "申请单:" + item.OrderId + " 不能进行代扣,无支付信息!";
                        }
                        tradeView = getPayTradeView(applyform, getPayAccountNo(item.PayType, Math.Abs(applyform.PayBill.Applier.Amount), applyform.PurchaserId), "");
                    }
                }
                if (item.PayType == WithholdingAccountType.Alipay)
                {
                    tradeView.BuyerEmail = item.PayAccountNo;
                }
                try
                {
                    if (string.IsNullOrEmpty(msg))
                    {
                        global::PoolPay.DomainModel.Trade.PayTrade pay = AutoPayService.AutoPay(tradeView, item.PayType);
                        if (item.PayType == WithholdingAccountType.Poolpay)
                        {
                            //如果是国付通代扣就直接修改订单状态
                            if (pay != null && pay.Status == global::PoolPay.DataTransferObject.PayStatus.PaySuccess)
                            {
                                NotifyService.PaySuccess(item.OrderId, pay.CustomParameter, pay.Id.ToString(), pay.FillChargeId.ToString(), pay.PayDate.Value, "", (pay.BuyerAccount.Character as global::PoolPay.DomainModel.Accounts.CreditAccount) == null ? "0" : "1", pay.BuyerAccount.AccountNo);
                            }
                        }
                        showMessage("处理成功");
                    }
                    else
                    {
                        showMessage("处理失败" + Environment.NewLine + "原因:" + msg);
                    }
                }
                catch (Exception ex)
                {
                    showMessage("处理失败" + Environment.NewLine + "原因:" + ex.Message);
                }
                AutoPayService.UpdateProcess(item.OrderId);
                System.Threading.Thread.Sleep(50);
            }
            showMessage("当前批次处理结束,共处理 " + noPorcess.Count + " 条");
        }