Exemplo n.º 1
0
        public static string GetArea(string pnrContent)
        {
            string area = "";

            PnrAnalysis.PnrModel pnrMode = GetPnrModel(pnrContent);
            area = pnrMode != null && pnrMode._LegList.Count > 0 ? pnrMode._LegList[0].FromCode : "";
            return(area);
        }
Exemplo n.º 2
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == EnumPlatform._Today.ToString().Replace("_", "")).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || !platSystem.State)
            {
                return(PolicyList);
            }
            string            area          = pnrModel._LegList[0].FromCode;
            _TodayAccountInfo accountInfo   = GetInfo(platSystem, area);
            string            _IsLowerPrice = IsLowPrice ? "1" : "0";
            string            CarryCode     = pnrModel._CarryCode;

            DataSet dsPolicy = new DataSet();
            PTMange ptMange  = new PTMange();

            Logger.WriteLog(LogType.DEBUG, "今日获取政策开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            //System.Data.DataSet dsPolicy = m_PTService.PT_JinRiGetPolicy(_todayAccout, _todayAccout2, _IsLowerPrice, pnrContent);
            //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
            //System.Data.DataSet dsPolicy = m_PTService.PT_NewJinRiGetPolicy(_todayAccout, _todayAccout2, _IsLowerPrice, pnrContent, PTPnrData);
            dsPolicy = ptMange._JinRiGetPolicy(accountInfo._todayAccout, accountInfo._todayAccout2, _IsLowerPrice, pnrContent, pnrData);
            Logger.WriteLog(LogType.DEBUG, "今日获取政策结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");

            //转化
            if (dsPolicy != null && dsPolicy.Tables.Count > 0)
            {
                if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                {
                    DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                    if (dr_Price["Status"].ToString() == "T")
                    {
                        decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                        decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                        decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                        decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                        bool IsLow = _IsLowerPrice == "1" ? true : false;

                        string            StartTime = "00:00", EndTime = "00:00";
                        decimal           PolicyPoint = 0m;
                        DataRowCollection drs         = dsPolicy.Tables[0].Rows;
                        foreach (DataRow dr in drs)
                        {
                            PlatformPolicy policy = new PlatformPolicy();
                            StartTime           = "00:00";
                            EndTime             = "00:00";
                            policy.Id           = dr["PolicyId"] != DBNull.Value ? dr["PolicyId"].ToString() : "";
                            policy.PlatformCode = this.Code;
                            policy.AreaCity     = area;
                            if (!string.IsNullOrEmpty(policy.Id))
                            {
                                policy.IsChangePNRCP = false;
                                policy.IsSp          = dr["RateType"].ToString() == "1" ? true : false;
                                policy.PolicyType    = string.Compare(dr["RateType"].ToString().Trim(), "B2P", true) == 0 ? "1" : "2";
                                policy.PolicyType    = policy.PolicyType == "1" ? "BSP" : "B2B";
                                policy.CarryCode     = CarryCode;
                                StartTime            = dr["WorkTimeBegin"].ToString();
                                EndTime         = dr["WorkTimeEnd"].ToString();
                                policy.WorkTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                StartTime = dr["RefundTimeBegin"].ToString();
                                EndTime   = dr["RefundTimeEnd"].ToString();
                                policy.ReturnTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                policy.AnnulTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                decimal.TryParse(dr["Discounts"].ToString(), out PolicyPoint);
                                policy.PolicyPoint = PolicyPoint;
                                policy.ReturnMoney = 0m;;
                                policy.CPOffice    = dr["OfficeNum"].ToString();
                                policy.Remark      = dr["Remark"].ToString();
                                policy.IssueSpeed  = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                policy.TodayGYCode = dr["RateId"].ToString();
                                policy.IsLow       = IsLow;
                                policy.SeatPrice   = SeatPrice;
                                policy.ABFee       = TaxFare;
                                policy.RQFee       = RQFare;
                                //过滤不符合的政策点数
                                if (PolicyPoint > 0 && PolicyPoint < 100)
                                {
                                    PolicyList.Add(policy);
                                }
                            }
                        }//foreach
                        //取前几条政策
                        if (platSystem != null)
                        {
                            PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                        }
                    }
                    else
                    {
                        //失败信息
                        string Message = dr_Price["Message"].ToString();
                    }
                }
            }
            return(PolicyList);
        }
Exemplo n.º 3
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == EnumPlatform._517.ToString().Replace("_", "")).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || platSystem == null || !platSystem.State)
            {
                return(PolicyList);
            }
            string          area        = pnrModel._LegList[0].FromCode;
            _517AccountInfo accountInfo = GetInfo(platSystem, area);
            //是否换编码出票 1:是
            string  _IsChangePNRCP = accountInfo._IsChangePNRCP;
            string  _IsLowerPrice  = IsLowPrice ? "1" : "0";
            PTMange ptMange        = new PTMange();
            DataSet dsPolicy       = new DataSet();

            Logger.WriteLog(LogType.DEBUG, "517开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            //System.Data.DataSet dsPolicy = m_PTService.PT_517GetPolicy(_517Accout, _517Password, _517Ag, _IsLowerPrice, pnrContent);
            //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
            //dsPolicy= m_PTService.PT_New517GetPolicy(_517Accout, _517Password, _517Ag, _IsLowerPrice, pnrContent, PTPnrData);
            dsPolicy = ptMange._517GetPolicy(accountInfo._517Accout, accountInfo._517Password, accountInfo._517Ag, _IsLowerPrice, pnrContent, pnrData);
            Logger.WriteLog(LogType.DEBUG, "517结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            if (dsPolicy != null && dsPolicy.Tables.Count > 0)
            {
                if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                {
                    DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                    if (dr_Price["Status"].ToString() == "T")
                    {
                        decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                        decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                        decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                        decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                        bool IsLow = _IsLowerPrice == "1" ? true : false;
                        DataRowCollection drs = dsPolicy.Tables[0].Rows;
                        string            StartTime = "00:00", EndTime = "00:00";
                        decimal           PolicyPoint = 0m;
                        foreach (DataRow dr in drs)
                        {
                            PlatformPolicy policy = new PlatformPolicy();
                            policy.AreaCity     = area;
                            StartTime           = "00:00";
                            EndTime             = "00:00";
                            policy.PlatformCode = this.Code;
                            policy.Id           = dr["PolicyID"].ToString() + "~" + dr["PolicyChildID"].ToString();
                            if (policy.Id != "~")
                            {
                                //IsChangePNRCP         //是否换编码出票
                                //IsSp                  //是否是特殊政策
                                //CarryCode             //航空格式二字码
                                //TravelType            //1单程  2单程/往返  3往返 4联程
                                //PolicyType            //政策类型1.BSP 2.B2B
                                //FromCity              //出发城市二字码
                                //ToCity                //到达城市二字码
                                //FlightType            //航班适用类型 0.适用全部 1.适用航班 2.不适用航班
                                //ScheduleConstraints   //班期限制
                                //Space                 //舱位
                                //EffectDate            //政策开始生效期
                                //ExpirationDate         //政策结束生效期
                                //Remark                //政策备注
                                //Policy                //政策点数
                                //GYOnlineTime          //供应工作时间
                                //GYFPTime              //退废票时间
                                //Office                //Office号
                                bool IsChangePNRCP = false;
                                policy.CarryCode = dr["CarryCode"].ToString();
                                bool.TryParse(dr["IsChangePNRCP"].ToString(), out IsChangePNRCP);
                                policy.IsChangePNRCP = IsChangePNRCP;
                                policy.IsSp          = dr["IsSp"].ToString() == "1" ? true : false;
                                policy.PolicyType    = dr["PolicyType"].ToString() == "1" ? "BSP" : "B2B";
                                if (dr["GYOnlineTime"].ToString().Split('-').Length == 2)
                                {
                                    StartTime = dr["GYOnlineTime"].ToString().Split('-')[0];
                                    EndTime   = dr["GYOnlineTime"].ToString().Split('-')[1];
                                }
                                policy.WorkTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };

                                var    now      = DateTime.Now;
                                string GYFPTime = "";
                                if (now.DayOfWeek == DayOfWeek.Sunday || now.DayOfWeek == DayOfWeek.Saturday)
                                {
                                    GYFPTime = dr["GYFPTimeNew"].ToString();
                                }
                                else
                                {
                                    GYFPTime = dr["GYFPTime"].ToString();
                                }
                                if (GYFPTime.Split('-').Length == 2)
                                {
                                    StartTime = GYFPTime.ToString().Split('-')[0];
                                    EndTime   = GYFPTime.ToString().Split('-')[1];
                                }
                                policy.ReturnTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                policy.AnnulTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                policy.ReturnMoney = 0m;
                                policy.CPOffice    = dr["Office"].ToString();
                                policy.Remark      = dr["Remark"].ToString().Contains("改期收回代理费") ? dr["Remark"].ToString() : dr["Remark"].ToString() + ",改期收回代理费";
                                decimal.TryParse(dr["Policy"].ToString(), out PolicyPoint);
                                policy.PolicyPoint = PolicyPoint;
                                if (_IsChangePNRCP != "1" && policy.IsChangePNRCP)
                                {
                                    continue;
                                }
                                string IssueSpeed  = dr["ChupPiaoXiaolu"] == DBNull.Value ? "" : dr["ChupPiaoXiaolu"].ToString();
                                int    _IssueSpeed = 0;
                                if (!string.IsNullOrEmpty(IssueSpeed) && int.TryParse(IssueSpeed, out _IssueSpeed))
                                {
                                    policy.IssueSpeed = _IssueSpeed <= 20 ? "极速" : _IssueSpeed + "秒";
                                }
                                else
                                {
                                    policy.IssueSpeed = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                }
                                policy.IsLow     = IsLow;
                                policy.SeatPrice = SeatPrice;
                                policy.ABFee     = TaxFare;
                                policy.RQFee     = RQFare;
                                //过滤不符合的政策点数
                                if (PolicyPoint > 0 && PolicyPoint < 100)
                                {
                                    PolicyList.Add(policy);
                                }
                            }
                        }//foreach
                        //取前几条政策
                        if (platSystem != null)
                        {
                            PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                        }
                    }
                    else
                    {
                        //失败信息
                        string Message = dr_Price["Message"].ToString();
                    }
                }
            }
            return(PolicyList);
        }
Exemplo n.º 4
0
    /// <summary>
    /// 取消订单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnCancelOrder_Click(object sender, EventArgs e)
    {
        string showMsg = "";


        try
        {
            //扩展参数
            ParamEx pe = new ParamEx();
            pe.UsePIDChannel = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|48|") ? 2 : 0;
            //发送指令管理类
            SendInsManage SendIns = new SendInsManage(mUser.LoginName, mCompany.UninCode, pe, configparam);

            string          id    = Hid_id.Value; //订单id
            Tb_Ticket_Order Order = new Tb_Ticket_OrderBLL().GetTicketOrderById(id);

            if (Order != null)  ////判断订单状态
            {
                bool restult = true;
                //白屏预订 新订单等待支付 并且开启退废票(分离、取消)编码的权限 才取消编码
                if (Order.OrderSourceType == 1 && Order.OrderStatusCode == 1 && KongZhiXiTong.Contains("|32|"))
                {
                    #region 1.白屏预订2.新订单等待支付3.开启退废票(分离、取消)编码的权限  判断是否需要取消编码

                    if (Hid_isCancelPnr.Value == "1") // 取消编码
                    {
                        Hid_isCancelPnr.Value = "0";

                        if (Order.PNR != "")
                        {
                            string ErrMsg = "";
                            PnrAnalysis.PnrModel pnrModel = SendIns.GetPnr(Order.PNR, out ErrMsg);
                            //编码状态不是已经出票的PNR
                            if (pnrModel != null && !pnrModel.PnrStatus.Contains("RR"))
                            {
                                //调用取消编码的方法
                                restult = SendIns.CancelPnr(Order.PNR, Order.Office);
                            }
                        }
                        showMsg = restult == true ? "取消编码成功!" : showMsg;
                    }
                    else
                    {
                        showMsg = "取消订单,用户需要保留编码!";
                    }

                    #endregion
                }
                else
                {
                    showMsg = "取消订单";
                }



                //取消订单
                restult = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().CancelOrder(Order, mUser, mCompany, showMsg);

                if (restult)
                {
                    OrderListDataBind();

                    showMsg = "取消订单成功!";
                }
                else
                {
                    showMsg = "取消订单失败!";
                }
            }
            else
            {
                showMsg = "该订单不能取消!!!";
            }
        }
        catch (Exception ex)
        {
            showMsg = "操作失败";
        }

        ScriptManager.RegisterStartupScript(this, GetType(), DateTime.Now.Ticks.ToString(), "showdialog('" + showMsg + "');", true);
    }
Exemplo n.º 5
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == EnumPlatform._BaiTuo.ToString().Replace("_", "")).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || !platSystem.State)
            {
                return(PolicyList);
            }
            PnrAnalysis.Model.LegInfo leg = pnrModel._LegList[0];
            //离起飞时间2小时内屏蔽获取政策接口
            DateTime t = DateTime.Parse(leg.FlyDate1 + " " + leg.FlyStartTime.Insert(2, ":") + ":00");

            t = t.AddHours(-2);
            if (DateTime.Compare(t, System.DateTime.Now) <= 0)
            {
                return(PolicyList);
            }
            string             area        = pnrModel._LegList[0].FromCode;
            _BaiTuoAccountInfo accountInfo = GetInfo(platSystem, area);
            //是否换编码出票 1:是
            string _IsChangePNRCP = accountInfo._IsChangePNRCP;
            string _IsLowerPrice  = IsLowPrice ? "1" : "0";
            string Message        = string.Empty;
            string CarryCode      = pnrModel._CarryCode;

            if (pnrModel._LegList.Count > 0)
            {
                int       Index     = 0;
                DayOfWeek dayOfWeek = System.DateTime.Now.DayOfWeek;
                switch (dayOfWeek)
                {
                case DayOfWeek.Monday:
                    Index = 0;
                    break;

                case DayOfWeek.Tuesday:
                    Index = 1;
                    break;

                case DayOfWeek.Wednesday:
                    Index = 2;
                    break;

                case DayOfWeek.Thursday:
                    Index = 3;
                    break;

                case DayOfWeek.Friday:
                    Index = 4;
                    break;

                case DayOfWeek.Saturday:
                    Index = 5;
                    break;

                case DayOfWeek.Sunday:
                    Index = 6;
                    break;

                default:
                    break;
                }
                DataSet dsPolicy = new DataSet();
                PTMange ptMange  = new PTMange();
                Logger.WriteLog(LogType.DEBUG, "百拓获取政策开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
                //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
                //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
                //System.Data.DataSet dsPolicy = m_PTService.PT_BaiTuoGetPolicy(_baiTuoAccout, _baiTuoPassword, baiTuoAg, _IsLowerPrice, pnrContent);
                //System.Data.DataSet dsPolicy = m_PTService.PT_NewBaiTuoGetPolicy(_baiTuoAccout, _baiTuoPassword, baiTuoAg, _IsLowerPrice, pnrContent, PTPnrData);
                dsPolicy = ptMange._BaiTuoGetPolicy(accountInfo._baiTuoAccout, accountInfo._baiTuoPassword, accountInfo._baiTuoAg, _IsLowerPrice, pnrContent, pnrData);
                Logger.WriteLog(LogType.DEBUG, "百拓获取政策结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
                //转化
                if (dsPolicy != null && dsPolicy.Tables.Count > 0)
                {
                    if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                    {
                        DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                        if (dr_Price["Status"].ToString() == "T")
                        {
                            decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                            decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                            decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                            decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                            bool IsLow = _IsLowerPrice == "1" ? true : false;

                            string            StartTime = "00:00", EndTime = "00:00";
                            decimal           PolicyPoint = 0m;
                            string[]          strTimeArr  = null;
                            DataRowCollection drs         = dsPolicy.Tables[0].Rows;
                            foreach (DataRow dr in drs)
                            {
                                PlatformPolicy policy = new PlatformPolicy();
                                StartTime           = "00:00";
                                EndTime             = "00:00";
                                policy.Id           = dr["Id"] != DBNull.Value ? dr["Id"].ToString() : "";
                                policy.PlatformCode = this.Code;
                                policy.AreaCity     = area;
                                if (!string.IsNullOrEmpty(policy.Id))
                                {
                                    policy.IsChangePNRCP = dr["ChangePnr"].ToString() == "1" ? true : false;
                                    policy.IsSp          = false;
                                    policy.PolicyType    = dr["PolicyType"].ToString() == "2" ? "2" : "1";
                                    policy.PolicyType    = policy.PolicyType == "1" ? "BSP" : "B2B";
                                    policy.CarryCode     = CarryCode;
                                    if (dr["ProviderWorkTime"].ToString().Split(',').Length == 7 && Index > -1 && Index < 7)
                                    {
                                        strTimeArr = dr["ProviderWorkTime"].ToString().Split(',');
                                        if (strTimeArr[Index].Split('-').Length == 2)
                                        {
                                            StartTime = strTimeArr[Index].Split('-')[0];
                                            EndTime   = strTimeArr[Index].Split('-')[1];
                                        }
                                    }
                                    policy.WorkTime = new StartAndEndTime()
                                    {
                                        StartTime = StartTime, EndTime = EndTime
                                    };
                                    if (dr["VoidWorkTime"].ToString().Split(',').Length == 7 && Index > -1 && Index < 7)
                                    {
                                        strTimeArr = dr["VoidWorkTime"].ToString().Split(',');
                                        if (strTimeArr[Index].Split('-').Length == 2)
                                        {
                                            StartTime = strTimeArr[Index].Split('-')[0];
                                            EndTime   = strTimeArr[Index].Split('-')[1];
                                        }
                                    }
                                    policy.ReturnTicketTime = new StartAndEndTime()
                                    {
                                        StartTime = StartTime, EndTime = EndTime
                                    };
                                    policy.AnnulTicketTime = new StartAndEndTime()
                                    {
                                        StartTime = StartTime, EndTime = EndTime
                                    };
                                    policy.ReturnMoney = 0m;
                                    policy.CPOffice    = dr["Office"].ToString();
                                    policy.Remark      = dr["Remark"].ToString();
                                    decimal.TryParse(dr["Rate"].ToString(), out PolicyPoint);
                                    policy.PolicyPoint = PolicyPoint * 100;
                                    policy.IssueSpeed  = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                    if (_IsChangePNRCP != "1" && policy.IsChangePNRCP)
                                    {
                                        continue;
                                    }

                                    policy.IsLow     = IsLow;
                                    policy.SeatPrice = SeatPrice;
                                    policy.ABFee     = TaxFare;
                                    policy.RQFee     = RQFare;
                                    //过滤不符合的政策点数
                                    if (PolicyPoint > 0 && PolicyPoint < 100)
                                    {
                                        PolicyList.Add(policy);
                                    }
                                }
                            }//foreach
                            //取前几条政策
                            if (platSystem != null)
                            {
                                PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                            }
                        }
                        else
                        {
                            //失败信息
                            Message = dr_Price["Message"].ToString();
                        }
                    }
                    else
                    {
                        if (dsPolicy.Tables.Contains("Error"))
                        {
                            //失败信息
                            Message = dsPolicy.Tables["Error"].Rows[0]["Error_Text"].ToString();
                        }
                    }
                }
            }
            else
            {
                Message = string.Format("PNR内容解析航段失败:{0}", pnrContent);
            }
            if (!string.IsNullOrEmpty(Message))
            {
                throw new PnrAnalysisFailException(Message);
            }
            return(PolicyList);
        }
Exemplo n.º 6
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || !platSystem.State)
            {
                return(PolicyList);
            }
            string             areaCity    = pnrModel._LegList[0].FromCode;
            _8000YIAccountInfo accountInfo = GetInfo(platSystem, areaCity);
            //是否换编码出票 1:是
            string  _IsChangePNRCP = accountInfo._IsChangePNRCP;
            string  _IsLowerPrice  = IsLowPrice ? "1" : "0";
            DataSet dsPolicy       = new DataSet();
            PTMange ptMange        = new PTMange();

            Logger.WriteLog(LogType.DEBUG, "8000YI开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
            //System.Data.DataSet dsPolicy = m_PTService.PT_8000YIGetPolicy(_8000yiAccout, _8000yiPassword, _IsLowerPrice, pnrContent);
            //System.Data.DataSet dsPolicy = m_PTService.PT_New8000YIGetPolicy(_8000yiAccout, _8000yiPassword, _IsLowerPrice, pnrContent, PTPnrData);
            dsPolicy = ptMange._8000YIGetPolicy(accountInfo._8000yiAccout, accountInfo._8000yiPassword, _IsLowerPrice, pnrContent, pnrData);
            Logger.WriteLog(LogType.DEBUG, "8000YI结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            if (dsPolicy != null && dsPolicy.Tables.Count > 0)
            {
                if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                {
                    DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                    if (dr_Price["Status"].ToString() == "T")
                    {
                        decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                        decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                        decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                        decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                        bool IsLow = _IsLowerPrice == "1" ? true : false;

                        string            StartTime = "00:00", EndTime = "00:00";
                        decimal           PolicyPoint = 0m;
                        DataRowCollection drs         = dsPolicy.Tables[0].Rows;
                        foreach (DataRow dr in drs)
                        {
                            PlatformPolicy policy = new PlatformPolicy();
                            StartTime           = "00:00";
                            EndTime             = "00:00";
                            policy.Id           = dr["A1"] != DBNull.Value ? dr["A1"].ToString() : "";
                            policy.PlatformCode = this.Code;
                            policy.AreaCity     = areaCity;
                            if (!string.IsNullOrEmpty(policy.Id))
                            {
                                policy.IsChangePNRCP = dr["A17"].ToString().Contains("换编码出票") ? true : false;
                                policy.IsSp          = dr["A22"].ToString() == "1" ? true : false;
                                policy.PolicyType    = string.Compare(dr["A16"].ToString().Trim(), "BSP", true) == 0 ? "1" : "2";
                                policy.PolicyType    = policy.PolicyType == "1" ? "BSP" : "B2B";
                                policy.CarryCode     = dr["A4"].ToString();

                                if (dr["A12"].ToString().Split('|').Length == 2)
                                {
                                    StartTime = dr["A12"].ToString().Split('|')[0];
                                    EndTime   = dr["A12"].ToString().Split('|')[1];
                                }
                                policy.WorkTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                if (dr["A19"].ToString().Split('|').Length == 2)
                                {
                                    StartTime = dr["A19"].ToString().Split('|')[0];
                                    EndTime   = dr["A19"].ToString().Split('|')[1];
                                }
                                policy.ReturnTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                if (dr["A20"].ToString().Split('|').Length == 2)
                                {
                                    StartTime = dr["A20"].ToString().Split('|')[0];
                                    EndTime   = dr["A20"].ToString().Split('|')[1];
                                }
                                policy.AnnulTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                policy.ReturnMoney = 0m;
                                policy.CPOffice    = dr["A26"].ToString();
                                policy.Remark      = dr["A17"].ToString();
                                decimal.TryParse(dr["A8"].ToString(), out PolicyPoint);
                                policy.PolicyPoint = PolicyPoint;
                                policy.IssueSpeed  = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                if (_IsChangePNRCP != "1" && policy.IsChangePNRCP)
                                {
                                    continue;
                                }
                                //dr["A30"].ToString() == "1" ? true : false;
                                policy.IsLow     = IsLow;
                                policy.SeatPrice = SeatPrice;
                                policy.ABFee     = TaxFare;
                                policy.RQFee     = RQFare;
                                //过滤不符合的政策点数
                                if (PolicyPoint > 0 && PolicyPoint < 100)
                                {
                                    PolicyList.Add(policy);
                                }
                            }
                        }//foreach
                        //取前几条政策
                        if (platSystem != null)
                        {
                            PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                        }
                    }
                    else
                    {
                        //失败信息
                        string Message = dr_Price["Message"].ToString();
                    }
                }
            }
            //转化
            return(PolicyList);
        }
Exemplo n.º 7
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == EnumPlatform._YeeXing.ToString().Replace("_", "")).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || !platSystem.State)
            {
                return(PolicyList);
            }
            string area = PnrHelper.GetArea(pnrContent);
            _YeeXingAccountInfo accountInfo = GetInfo(platSystem, area);
            //是否换编码出票 1:是
            string _IsChangePNRCP = accountInfo._IsChangePNRCP;
            string _IsLowerPrice  = IsLowPrice ? "1" : "0";

            if (pnrModel._LegList.Count > 0)
            {
                DayOfWeek dayOfWeek = System.DateTime.Now.DayOfWeek; //DateTime.Parse(pnrModel._LegList[0].FlyDate1).DayOfWeek;
                DataSet   dsPolicy  = new DataSet();
                PTMange   ptMange   = new PTMange();

                Logger.WriteLog(LogType.DEBUG, "易行获取政策开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
                //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
                //System.Data.DataSet dsPolicy = m_PTService.PT_YeeXingGetPolicy(_yeeXingAccout, _yeeXingAccout2, _IsLowerPrice, pnrContent);
                //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
                //System.Data.DataSet dsPolicy = m_PTService.PT_NewYeeXingGetPolicy(_yeeXingAccout, _yeeXingAccout2, _IsLowerPrice, pnrContent, PTPnrData);
                dsPolicy = ptMange._YeeXingGetPolicy(accountInfo._yeeXingAccout, accountInfo._yeeXingAccout2, _IsLowerPrice, pnrContent, pnrData);
                Logger.WriteLog(LogType.DEBUG, "易行获取政策结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");

                //转化
                if (dsPolicy != null && dsPolicy.Tables.Count > 0)
                {
                    if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                    {
                        DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                        if (dr_Price["Status"].ToString() == "T")
                        {
                            decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                            decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                            decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                            decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                            bool IsLow = _IsLowerPrice == "1" ? true : false;

                            string            StartTime = "00:00", EndTime = "00:00";
                            decimal           PolicyPoint = 0m, ReturnMoney = 0m;
                            DataRowCollection drs = dsPolicy.Tables[0].Rows;
                            foreach (DataRow dr in drs)
                            {
                                PlatformPolicy policy = new PlatformPolicy();
                                //outTime  出票速度
                                StartTime           = "00:00";
                                EndTime             = "00:00";
                                policy.Id           = dr["plcid"] != DBNull.Value ? dr["plcid"].ToString() : "";
                                policy.PlatformCode = this.Code;
                                policy.AreaCity     = area;
                                if (!string.IsNullOrEmpty(policy.Id))
                                {
                                    policy.IsChangePNRCP = dr["changePnr"].ToString().Trim() == "1" ? true : false;
                                    policy.IsSp          = dr["isSphigh"].ToString().Trim() == "1" ? true : false;
                                    policy.PolicyType    = dr["tickType"].ToString().Trim() == "1" ? "2" : "1";
                                    policy.PolicyType    = policy.PolicyType == "1" ? "BSP" : "B2B";
                                    policy.CarryCode     = dr["airComp"].ToString().Trim();
                                    if (dayOfWeek != DayOfWeek.Saturday && dayOfWeek != DayOfWeek.Sunday)
                                    {
                                        //周一到周五
                                        if (dr["workTime"].ToString().Split('-').Length == 2)
                                        {
                                            StartTime = dr["workTime"].ToString().Split('-')[0];
                                            EndTime   = dr["workTime"].ToString().Split('-')[1];
                                        }
                                        policy.WorkTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                        if (dr["workReturnTime"].ToString().Split('-').Length == 2)
                                        {
                                            StartTime = dr["workReturnTime"].ToString().Split('-')[0];
                                            EndTime   = dr["workReturnTime"].ToString().Split('-')[1];
                                        }
                                        policy.ReturnTicketTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                        policy.AnnulTicketTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                    }
                                    else
                                    {
                                        //周末
                                        if (dr["restWorkTime"].ToString().Split('-').Length == 2)
                                        {
                                            StartTime = dr["restWorkTime"].ToString().Split('-')[0];
                                            EndTime   = dr["restWorkTime"].ToString().Split('-')[1];
                                        }
                                        policy.WorkTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                        if (dr["restReturnTime"].ToString().Split('-').Length == 2)
                                        {
                                            StartTime = dr["restReturnTime"].ToString().Split('-')[0];
                                            EndTime   = dr["restReturnTime"].ToString().Split('-')[1];
                                        }
                                        policy.ReturnTicketTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                        policy.AnnulTicketTime = new StartAndEndTime()
                                        {
                                            StartTime = StartTime, EndTime = EndTime
                                        };
                                    }
                                    decimal.TryParse(dr["extReward"].ToString(), out ReturnMoney);
                                    policy.ReturnMoney = ReturnMoney;
                                    policy.CPOffice    = "";//易行适用航空公司大配置自动授权
                                    policy.Remark      = dr["memo"].ToString();
                                    decimal.TryParse(dr["disc"].ToString(), out PolicyPoint);
                                    policy.PolicyPoint = PolicyPoint;
                                    policy.IssueSpeed  = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                    if (_IsChangePNRCP != "1" && policy.IsChangePNRCP)
                                    {
                                        continue;
                                    }
                                    policy.IsLow     = IsLow;
                                    policy.SeatPrice = SeatPrice;
                                    policy.ABFee     = TaxFare;
                                    policy.RQFee     = RQFare;
                                    //过滤不符合的政策点数
                                    if (PolicyPoint > 0 && PolicyPoint < 100)
                                    {
                                        PolicyList.Add(policy);
                                    }
                                }
                            }//foreach
                            //取前几条政策
                            if (platSystem != null)
                            {
                                PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                            }
                        }
                        else
                        {
                            //失败信息
                            string Message = dr_Price["Message"].ToString();
                        }
                    }
                }
                else
                {
                    throw new PnrAnalysisFailException(string.Format("PNR内容解析航段失败:{0}", pnrContent));
                }
            }
            return(PolicyList);
        }
Exemplo n.º 8
0
    /// <summary>
    /// 机票支付
    /// </summary>
    /// <param name="id">订单</param>
    /// <param name="payWay">支付方式</param>
    /// <param name="code">网银银行代码</param>
    private void TicketOrderPay(string id, string payWay, string code)
    {
        string msgShow = "";
        string url     = string.Empty;

        try
        {
            bool   result     = false;
            string payDetails = "";//分账明细

            #region 获取订单信息

            //PayWay 支付方式:1支付宝、2快钱、3汇付、4财付通、5支付宝网银、6快钱网银 、7汇付网银、8财付通网银、
            //9支付宝pos、10快钱pos、11汇付pos、12财付通pos、13易宝pos、14账户支付、15收银
            //string tempSqlWhere = " OrderId='" + id + "'";

            string tempSqlWhere = " id='" + id + "'";
            List <Tb_Ticket_Order> bParametersList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(tempSqlWhere);
            Tb_Ticket_Order        mOrder          = null;

            if (bParametersList != null && bParametersList.Count == 1)
            {
                mOrder = bParametersList[0];

                #region 判断PNR状态是否取消等,取消就不能支付
                if (mOrder.OrderStatusCode != 1 && mOrder.OrderStatusCode != 9)
                {
                    msgShow = "订单异常,不能支付!";
                }
                #endregion

                if (this.KongZhiXiTong.Contains("|101|"))
                {
                    //超过 1 小时后的订单能支付
                }
                else
                {
                    #region  超过1个小时不能支付
                    if (mOrder.OrderStatusCode == 1)
                    {
                        DateTime dtTime = DateTime.Now;
                        if (dtTime.CompareTo(mOrder.CreateTime.AddHours(1)) > 0)
                        {
                            // 超过1个小时不能支付
                            msgShow = "超过1个小时的订单不能支付,请重新生成订单进行支付!";
                        }
                    }
                    #endregion
                }

                #region 判断PNR状态是否取消等,取消就不能支付

                //扩展参数
                ParamEx pe = new ParamEx();
                pe.UsePIDChannel = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|48|") ? 2 : 0;
                SendInsManage sendins = new SendInsManage(mUser.LoginName, mCompany.UninCode, pe, this.configparam);
                string        ErrMsg;

                if (mOrder.OrderSourceType == 1 && mOrder.A9 != "1")
                {
                    PnrAnalysis.PnrModel PnrModel = sendins.GetPnr(mOrder.PNR, mOrder.Office, out ErrMsg);

                    if (ErrMsg.IndexOf("已被取消") != -1)
                    {
                        msgShow = "此PNR(" + mOrder.PNR + ")状态为异常,请检查PNR状态后再试!";
                    }
                    else if (PnrModel != null && ErrMsg == "")
                    {
                        if (PnrModel.PassengerNameIsCorrent)
                        {
                            if (KongZhiXiTong != null && KongZhiXiTong.Contains("|23|"))
                            {
                                if ((PnrModel._OldPnrContent.Contains("THIS PNR WAS ENTIRELY CANCELLED") && PnrModel._OldPnrContent.ToUpper().Contains(mOrder.PNR.ToUpper())))
                                {
                                    msgShow = "此PNR(" + mOrder.PNR + ")状态为异常,请检查PNR状态后再试!";
                                }
                                else
                                {
                                    string PnrStatus = PnrModel.PnrStatus;
                                    if (string.IsNullOrEmpty(PnrStatus))
                                    {
                                        msgShow = "此PNR(" + mOrder.PNR + ")数据异常,请检查PNR状态后再试!";
                                    }
                                    else
                                    {
                                        if (!PnrStatus.Contains("HK") && !PnrStatus.Contains("DK") && !PnrStatus.Contains("RR") && !PnrStatus.Contains("KK"))
                                        {
                                            msgShow = "此PNR(" + mOrder.PNR + ")状态为:" + PnrStatus + ",请检查PNR状态后再试!";
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            msgShow = "此PNR(" + mOrder.PNR + ")中乘机人名字:" + string.Join(",", PnrModel.ErrorPassengerNameList.ToArray()) + " 不正确!";
                        }
                    }
                }

                #endregion 判断PNR状态是否取消等,取消就不能支付

                if (msgShow == "")
                {
                    mOrder.PayWay = int.Parse(payWay);

                    // 切换支付方式:修改订单账单明细数据
                    result = new PbProject.Logic.Pay.Bill().UpdateOrderAndTicketPayDetail(mOrder);

                    if (result == true)
                    {
                        //获取分账明细
                        payDetails = new PbProject.Logic.Pay.Bill().PayDetails(payWay, mOrder.OrderId);
                        result     = string.IsNullOrEmpty(payDetails) ? false : result;
                    }
                }
            }

            #endregion

            if (result)
            {
                #region 支付

                if (payWay == "1" || payWay == "5")//支付宝
                {
                    #region 支付参数赋值

                    AliPayParam aliPayParam = new AliPayParam();

                    aliPayParam.Body               = "机票订单";
                    aliPayParam.DefaultBank        = code;
                    aliPayParam.Extra_common_param = mUser.id.ToString(); //自定义:操作人id
                    aliPayParam.Out_trade_no       = mOrder.OrderId;
                    aliPayParam.Royalty_parameters = payDetails;          //分账明细
                    aliPayParam.Subject            = "机票订单";
                    aliPayParam.Total_fee          = mOrder.PayMoney.ToString("f2");


                    if ((!string.IsNullOrEmpty(mOrder.A9) && mOrder.A9 == "1") || string.IsNullOrEmpty(mOrder.PNR))
                    {
                        //不检查编码

                        OnErrorNew("不检查编码,PNR:" + mOrder.PNR, false);
                    }
                    else
                    {
                        //需要检查编码
                        #region 判断PNR

                        tempSqlWhere = " PNR='" + mOrder.PNR + "' and OrderStatusCode=4 and (PayWay=1 or PayWay=5)";
                        List <Tb_Ticket_Order> orderListNew = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(tempSqlWhere);

                        if (orderListNew == null || orderListNew.Count == 0)
                        {
                            //先看该订单支付已经支付过
                            aliPayParam.Extend_param = "PNR^" + mOrder.PNR;
                        }
                        else
                        {
                            OnErrorNew("该编码已经有支付记录,PNR:" + mOrder.PNR, false);
                        }

                        #endregion
                    }

                    #endregion

                    msgShow = new PbProject.Logic.Pay.AliPay().GetPay(aliPayParam);
                }
                else if (payWay == "2" || payWay == "6")//快钱
                {
                    PbProject.Logic.Pay.DataAction d = new PbProject.Logic.Pay.DataAction();
                    decimal tempMoney = d.FourToFiveNum(mOrder.PayMoney * 0.001M, 2) * 100; //手续费

                    #region 支付参数赋值
                    _99BillParam billParam = new _99BillParam();
                    billParam.Bankcode = code;
                    billParam.Detail   = payDetails;               //分账明细
                    billParam.Ext      = mUser.id.ToString();      //操作人id
                    billParam.Money    = tempMoney.ToString("f0"); //供应商收款
                    billParam.Orderid  = mOrder.OrderId;
                    //billParam.Payid = "*****@*****.**";
                    billParam.Payid   = "";
                    billParam.Paytype = (string.IsNullOrEmpty(code)) ? "00" : "10";
                    billParam.Pname   = "机票订单";
                    billParam.Price   = (mOrder.PayMoney * 100).ToString("f0"); //供应商收款
                    billParam.Ptype   = "1";

                    #endregion

                    msgShow = new PbProject.Logic.Pay._99Bill().GetPay(billParam);
                }
                else if (payWay == "3" || payWay == "7")//汇付天下
                {
                    #region 支付参数赋值

                    ChinaPnrParam chinaPnrParam = new ChinaPnrParam();
                    chinaPnrParam.Orderid = mOrder.OrderId;                 //订单号
                    chinaPnrParam.Price   = mOrder.PayMoney.ToString("f2"); //订单总价
                    chinaPnrParam.Merpriv = mUser.id.ToString();            //自定义字段
                    chinaPnrParam.Details = payDetails;                     //分账明细
                    chinaPnrParam.Pnr     = mOrder.PNR;

                    #endregion

                    msgShow = new PbProject.Logic.Pay.ChinaPnr().Buy(chinaPnrParam);
                }
                else if (payWay == "4" || payWay == "8" || payWay == "40")// 财付通
                {
                    string queryParam = string.Format("orderid={0}&total_tee={1}&userhostaddress={2}&attach={3}&busargs={4}&busdesc={5}&banktype={6}",
                                                      mOrder.OrderId, (mOrder.PayMoney * 100).ToString("F0"), Request.UserHostAddress, mUser.id.ToString(), payDetails, string.Format("{0}^{1}^{2}^{3}^{4}^{5}", mOrder.PNR, mOrder.Travel, mOrder.PassengerNumber, mUser.id.ToString(), mOrder.CreateUserName, "13800000000"), code);
                    url = string.Format("http://lzh.mypb.cn/Pay/TenPay.aspx?{0}", queryParam);
                    // url = string.Format("TenPay.aspx?{0}", queryParam);
                }

                #endregion
            }
            else
            {
                OnErrorNew("支付错误:" + payDetails, false);

                msgShow = string.IsNullOrEmpty(msgShow) ? "支付错误" : msgShow;
            }
        }
        catch (Exception ex)
        {
            msgShow = "支付异常";

            OnErrorNew(msgShow + ex.ToString(), false);
        }
        if (!string.IsNullOrEmpty(url))
        {
            Response.Redirect(url);
        }
        else
        {
            OnErrorNew(msgShow, false);
            Response.Write(msgShow);
        }
    }
Exemplo n.º 9
0
        public List <PlatformPolicy> GetPoliciesByPnrContent(string pnrContent, bool IsLowPrice, BPiaoBao.Common.PnrData pnrData)
        {
            PnrAnalysis.PnrModel  pnrModel   = pnrData.PnrMode;
            PlatSystem            platSystem = SystemConsoSwitch.PlatSystems.Where(p => p.PlatfromCode == this.Code).FirstOrDefault();
            List <PlatformPolicy> PolicyList = new List <PlatformPolicy>();

            if (pnrModel == null || pnrModel._LegList.Count == 0 || !platSystem.State)
            {
                return(PolicyList);
            }
            //获取区域对象
            string             area          = pnrModel._LegList[0].FromCode;
            _51BookAccountInfo accountInfo   = GetInfo(platSystem, area);
            string             _IsLowerPrice = IsLowPrice ? "1" : "0";
            //是否换编码出票 1:是
            string  _IsChangePNRCP = accountInfo._IsChangePNRCP;
            PTMange ptMange        = new PTMange();
            DataSet dsPolicy       = new DataSet();

            Logger.WriteLog(LogType.DEBUG, "51Book开始时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");
            //PTServiceSoapClient m_PTService = new PTServiceSoapClient();
            //BPiaoBao.DomesticTicket.Platforms._PTService.PnrData PTPnrData = Mapper.DynamicMap<BPiaoBao.Common.PnrData, BPiaoBao.DomesticTicket.Platforms._PTService.PnrData>(pnrData);
            //System.Data.DataSet dsPolicy = m_PTService.PT_51BookGetPolicy(_51bookAccout, _51bookPassword, _51bookAg, _IsLowerPrice, pnrContent);
            //System.Data.DataSet dsPolicy = m_PTService.PT_New51BookGetPolicy(_51bookAccout, _51bookPassword, _51bookAg, _IsLowerPrice, pnrContent, PTPnrData);
            dsPolicy = ptMange._51BookGetPolicy(accountInfo._51bookAccout, accountInfo._51bookPassword, accountInfo._51bookAg, _IsLowerPrice, pnrContent, pnrData);
            Logger.WriteLog(LogType.DEBUG, "51Book结束时间:" + System.DateTime.Now.ToString("yyy-MM-dd HH:mm:ss.fff") + "\r\n");

            if (dsPolicy != null && dsPolicy.Tables.Count > 0)
            {
                if (dsPolicy.Tables.Contains(this.Code) && dsPolicy.Tables.Contains("Policy") && dsPolicy.Tables[this.Code].Rows.Count > 0)
                {
                    DataRow dr_Price = dsPolicy.Tables[this.Code].Rows[0];
                    if (dr_Price["Status"].ToString() == "T")
                    {
                        decimal SeatPrice = 0m, TaxFare = 0m, RQFare = 0m;
                        decimal.TryParse(dr_Price["SeatPrice"].ToString(), out SeatPrice);
                        decimal.TryParse(dr_Price["ABFare"].ToString(), out TaxFare);
                        decimal.TryParse(dr_Price["RQFare"].ToString(), out RQFare);
                        bool IsLow = _IsLowerPrice == "1" ? true : false;

                        string            StartTime = "00:00", EndTime = "00:00";
                        decimal           PolicyPoint = 0m;
                        DataRowCollection drs         = dsPolicy.Tables[0].Rows;
                        foreach (DataRow dr in drs)
                        {
                            PlatformPolicy policy = new PlatformPolicy();
                            StartTime           = "00:00";
                            EndTime             = "00:00";
                            policy.Id           = dr["Id"] != DBNull.Value ? dr["Id"].ToString() : "";
                            policy.PlatformCode = this.Code;
                            policy.AreaCity     = area;
                            if (!string.IsNullOrEmpty(policy.Id))
                            {
                                //startDate                         政策开始生效日期
                                //expiredDate                       政策结束生效日期
                                //printTicketStartDate              政策出票开始生效日期
                                //printTicketExpiredDate            政策出票结束生效日期
                                //needSwitchPNR                     是否换编码出票 true是 false否
                                //routeType                         行程类型 OW单程 RT往返 否则联程
                                //businessUnitType                  是否是特殊政策  非0即是
                                //airlineCode                       航空格式二字码
                                //policyType                        B2P B2B
                                //flightCourse                      出发生成三字码 为"999-999"表示所有城市 格式:"出发城市三字码-到达城市三字码"
                                //flightNoIncluding                 适用航班号
                                //flightNoExclude                   不适用航班号
                                //flightCycle                       班期限制
                                //seatClass                         舱位
                                //comment                           政策备注
                                //Commission                        政策点数
                                //workTime                          供应工作时间
                                //chooseOutWorkTime                 退废票时间
                                //param2                            Office号
                                bool IsChangePNRCP = false;
                                bool.TryParse(dr["needSwitchPNR"].ToString(), out IsChangePNRCP);
                                policy.IsChangePNRCP = IsChangePNRCP;
                                policy.CarryCode     = dr["airlineCode"].ToString();
                                policy.IsSp          = dr["businessUnitType"].ToString() == "1" ? true : false;
                                policy.PolicyType    = string.Compare(dr["PolicyType"].ToString(), "B2P", true) == 0 ? "2" : "1";


                                policy.PolicyType = policy.PolicyType == "1" ? "BSP" : "B2B";
                                if (dr["workTime"].ToString().Split('-').Length == 2)
                                {
                                    StartTime = dr["workTime"].ToString().Split('-')[0];
                                    EndTime   = dr["workTime"].ToString().Split('-')[1];
                                }
                                policy.WorkTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                if (dr["chooseOutWorkTime"].ToString().Split('-').Length == 2)
                                {
                                    StartTime = dr["chooseOutWorkTime"].ToString().Split('-')[0];
                                    EndTime   = dr["chooseOutWorkTime"].ToString().Split('-')[1];
                                }
                                policy.ReturnTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                policy.AnnulTicketTime = new StartAndEndTime()
                                {
                                    StartTime = StartTime, EndTime = EndTime
                                };
                                decimal.TryParse(dr["Commission"].ToString(), out PolicyPoint);
                                policy.PolicyPoint = PolicyPoint;
                                policy.ReturnMoney = 0m;
                                policy.CPOffice    = dr["param2"].ToString();
                                policy.Remark      = dr["comment"].ToString();
                                policy.IssueSpeed  = platSystem != null ? platSystem.IssueTicketSpeed : "";
                                if (_IsChangePNRCP != "1" && policy.IsChangePNRCP)
                                {
                                    continue;
                                }

                                policy.IsLow     = IsLow;
                                policy.SeatPrice = SeatPrice;
                                policy.ABFee     = TaxFare;
                                policy.RQFee     = RQFare;
                                //过滤不符合的政策点数
                                if (PolicyPoint > 0 && PolicyPoint < 100)
                                {
                                    PolicyList.Add(policy);
                                }
                            }
                        }//foreach
                        //取前几条政策
                        if (platSystem != null)
                        {
                            PolicyList = PolicyList.OrderByDescending(pp => pp.PolicyPoint).Take(platSystem.GetPolicyCount).ToList();
                        }
                    }
                    else
                    {
                        //失败信息
                        string Message = dr_Price["Message"].ToString();
                    }
                }
            }
            //转化
            return(PolicyList);
        }