Example #1
0
    /// <summary>
    /// 更新出票相关信息
    /// </summary>
    /// <param name="order"></param>
    private void UpdateTicketOrder(PbProject.Model.Tb_Ticket_Order order)
    {
        string resultDes = HttpUtility.UrlDecode(m_DrawResultDes, Encoding.GetEncoding("gb2312"));

        if (m_DrawResult.Trim() == "000000")//出票成功
        {
            string[] passengerInfoList = resultDes.Split(';');
            PbProject.Logic.Order.Tb_Ticket_PassengerBLL psb     = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
            List <PbProject.Model.Tb_Ticket_Passenger>   psmList = psb.GetPasListByOrderID(order.OrderId);

            psmList = ModifyPassenger(passengerInfoList, psb, psmList);

            order = ModifyOrder(order);

            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
            bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(order, psmList, mUser[0], mCompany[0], "");
            if (reuslt)
            {
                #region  票宝开放服务接口异步通知出票

                if (order.OrderSourceType == 5)
                {
                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                    if (pbInterfaceCmd != null)
                    {
                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(order);
                    }
                }
                #endregion
                string msg = PnrNo + "_SUCC";
                client.Send(AddHeadLen(msg));
                LogInfo(string.Format("出票成功.订单号:{0},PNR:{1}", order.OrderId, PnrNo), false);
            }
            else
            {
                LogInfo(string.Format("出票失败.订单号:{0},PNR:{1}", order.OrderId, PnrNo), false);
            }
        }
        else
        {
            LogInfo(resultDes + ",订单号:" + order.OrderId + ",PNR:" + PnrNo, false);
            RollBackTicketOrderState(order, string.Format("出票失败,原因:{0}", resultDes));
        }
        client.Send(AddHeadLen(PnrNo + "_SUCC"));//返回成功
    }
Example #2
0
        private void AlipayWork(List <string> CpyNoList, List <ListParam> LPList, B2BShowLog Log)
        {
            try
            {
                List <string> removeList = new List <string>();
                foreach (string CpyNo in CpyNoList)
                {
                    string KonZhiXT = GetGYParameters(CpyNo);
                    if (KonZhiXT != null && !KonZhiXT.Contains("|22|"))//开启B2B自动出票
                    {
                        removeList.Add(CpyNo);
                    }
                }
                //移除掉没有开启的B2B运营商
                if (removeList.Count > 0)
                {
                    foreach (string item in removeList)
                    {
                        if (CpyNoList.Contains(item))
                        {
                            Log(2, string.Format("公司编号:{0} B2B自动出票未开启\r\n", item));
                            CpyNoList.Remove(item);
                        }
                    }
                }

                PbProject.Logic.Order.Tb_Ticket_OrderBLL     orderMange      = new PbProject.Logic.Order.Tb_Ticket_OrderBLL();
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL passengerManage = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                while (true)
                {
                    try//避免异常跳出循环 2013-6-9添加
                    {
                        //王永磊修改语句
                        string sqlWhere = string.Format(" left(CPCpyNo,12) in({0}) and  cast( isnull(AutoPrintTimes,'0') as int) < 3 and PolicyType=1 and AutoPrintFlag=2 and A10<>1  and OrderStatusCode=3 ", string.Join(",", CpyNoList.ToArray()));
                        List <PbProject.Model.Tb_Ticket_Order> orderList = Manage.CallMethod("Tb_Ticket_Order", "GetList", null, new object[] { sqlWhere }) as List <PbProject.Model.Tb_Ticket_Order>;

                        if (orderList == null || orderList.Count == 0)
                        {
                            Thread.Sleep(1);
                            continue;
                        }

                        if (orderList.Count > 0)
                        {
                            Log(2, "支付宝本票通自动出票开始 订单数:" + orderList.Count + "\r\n");
                            for (int i = 0; i < orderList.Count; i++)
                            {
                                PbProject.Model.Tb_Ticket_Order order = orderList[i];
                                ListParam LPM = LPList.Find(delegate(ListParam _pm)
                                {
                                    return(_pm.CpyNo == order.CPCpyNo.Substring(0, 12));
                                });
                                if (LPM != null)
                                {
                                    AlipayTicketWork(passengerManage, order, LPM, Log);
                                }
                                Thread.Sleep(1);
                            }
                            Log(2, "支付宝本票通自动出票结束 订单数:" + orderList.Count + "\r\n");
                        }
                        Thread.Sleep(m_AlipayRefreshTime * 1000);
                    }
                    catch (Exception ex)
                    {
                        Log(2, "AlipayWork  while发生不可预料的异常:" + ex.Message + "" + "\r\n");
                    }
                }
            }
            catch (Exception ex)
            {
                Log(2, "AlipayWork发生不可预料的异常:" + ex.Message + "" + "\r\n");
            }
        }
Example #3
0
        /// <summary>
        /// 出票流程
        /// </summary>
        private void ChinapnrWork(List <string> CpyNoList, List <ListParam> LPList, B2BShowLog Log)
        {
            try
            {
                List <string> removeList = new List <string>();
                foreach (string CpyNo in CpyNoList)
                {
                    string KonZhiXT = GetGYParameters(CpyNo);
                    if (KonZhiXT != null && !KonZhiXT.Contains("|22|"))//开启B2B自动出票
                    {
                        removeList.Add(CpyNo);
                    }
                }
                if (removeList.Count > 0)
                {
                    foreach (string item in removeList)
                    {
                        if (CpyNoList.Contains(item))
                        {
                            Log(3, string.Format("公司编号:{0} B2B自动出票未开启\r\n", item));
                            CpyNoList.Remove(item);
                        }
                    }
                }
                PbProject.Logic.Order.Tb_Ticket_OrderBLL     orderMange      = new PbProject.Logic.Order.Tb_Ticket_OrderBLL();
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL passengerManage = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();

                ChinaPnrClient client = new ChinaPnrClient(System.Configuration.ConfigurationManager.AppSettings["HuifuAutoIP"]);
                while (true)
                {
                    try
                    {
                        PbProject.Model.definitionParam.BaseSwitch BS = new PbProject.Model.definitionParam.BaseSwitch();

                        string sqlWhere = string.Format(" left(CPCpyNo,12) in({0}) and  cast( isnull(AutoPrintTimes,'0') as int) < 3 and PolicyType=1 and AutoPrintFlag=2  and OrderStatusCode=3 and A10<>1 ", string.Join(",", CpyNoList.ToArray()));
                        List <PbProject.Model.Tb_Ticket_Order> orderList = Manage.CallMethod("Tb_Ticket_Order", "GetList", null, new object[] { sqlWhere }) as List <PbProject.Model.Tb_Ticket_Order>;


                        if (orderList.Count == 0)
                        {
                            Thread.Sleep(m_ChinapnrRefreshTime * 1000);
                            continue;
                        }

                        foreach (PbProject.Model.Tb_Ticket_Order order in orderList)
                        {
                            if (order.CPCpyNo.Length >= 12)
                            {
                                PbProject.Model.User_Company mTopcom = new PbProject.Logic.User.User_CompanyBLL().GetCompany(order.CPCpyNo.Substring(0, 12));
                                PbProject.Logic.ControlBase.Bd_Base_ParametersBLL Bp      = new PbProject.Logic.ControlBase.Bd_Base_ParametersBLL();
                                List <PbProject.Model.Bd_Base_Parameters>         ParList = Bp.GetParametersListByCpyNo(mTopcom.UninCode.ToString());
                                BS = PbProject.WebCommon.Utility.BaseParams.getParams(ParList);
                            }
                            else
                            {
                                continue;
                            }

                            ListParam LPM = LPList.Find(delegate(ListParam _pm)
                            {
                                return(_pm.CpyNo == order.CPCpyNo.Substring(0, 12));
                            });

                            IList <PbProject.Model.Tb_Ticket_Passenger> orderPassenger = passengerManage.GetPasListByOrderID(order.OrderId);
                            decimal faceValue = 0;
                            foreach (PbProject.Model.Tb_Ticket_Passenger passenger in orderPassenger)
                            {
                                faceValue += passenger.PMFee;
                            }

                            //格式:自动出票方式(1,支付宝本票通;2,汇付天下出票窗)^帐号|是否签约(1,已签约;2,未签)^帐号|密码|支付方式(1,信用账户;2,付款账户)
                            if (string.IsNullOrEmpty(BS.AutoPayAccount.Split('^')[3]) || BS.AutoPayAccount.Split('^')[3].Split('|').Length < 3)
                            {
                                string msg = "未绑定汇付天下账号,不能自动出票,该共功能已停止!,订单ID:" + order.OrderId;
                                //StopChinapnrThread(msg);
                                Log(3, msg);
                                continue;
                            }

                            //格式:CA:xxx//xxx^^^CZ:xxx//xxx^^^MU:xxx//xxx
                            string   Acc      = "";
                            string   pwd      = "";
                            string[] CarrList = BS.AutoAccount.Split(new string[] { "^^^" }, StringSplitOptions.RemoveEmptyEntries);//Regex.Split(BS.AutoAccount, "^^^", RegexOptions.IgnoreCase);
                            for (int i = 0; i < CarrList.Length; i++)
                            {
                                if (CarrList[i].Contains(order.CarryCode))
                                {
                                    Acc = CarrList[i].Split(new string[] { "//" }, StringSplitOptions.None)[0].Split(':')[1]; //Regex.Split(CarrList[i].Split(':')[1], "//", RegexOptions.IgnoreCase)[0];
                                    pwd = CarrList[i].Split(new string[] { "//" }, StringSplitOptions.None)[1];               //Regex.Split(CarrList[i].Split(':')[1], "//", RegexOptions.IgnoreCase)[1];
                                    break;
                                }
                            }
                            if (string.IsNullOrEmpty(Acc) || string.IsNullOrEmpty(pwd))
                            {
                                string msg = "航空公司帐号和密码为空,不能自动出票,改为手动出票,订单ID:" + order.OrderId;
                                ChinapnrAutofailed(order, msg, LPM, Log);
                                continue;
                            }

                            //根据订单信息,构造参数实体类ChinaPnrParams,参数构造见接口文档
                            ChinaPnrParams chinaPnrParams = new ChinaPnrParams();
                            chinaPnrParams.PNRNo       = order.BigCode;
                            chinaPnrParams.GUID        = order.OrderId;
                            chinaPnrParams.Airlines    = order.CarryCode.Split('/')[0];
                            chinaPnrParams.FaceValue   = faceValue.ToString();
                            chinaPnrParams.Username    = Acc;
                            chinaPnrParams.B2BPswd     = pwd;
                            chinaPnrParams.CPNROper    = BS.AutoPayAccount.Split('^')[3].Split('|')[0];
                            chinaPnrParams.CPNRPswd    = StringUtils.GetMd5(BS.AutoPayAccount.Split('^')[3].Split('|')[1]);
                            chinaPnrParams.PayType     = BS.AutoPayAccount.Split('^')[3].Split('|')[2];
                            chinaPnrParams.PartnerCode = "63";

                            string data = ChinaPnrParams.ChinaPnrParamsToString(chinaPnrParams);


                            ChinapnrTicketWork(orderMange, client, order, data, Convert.ToInt32(BS.AutoPayAccount.Split('^')[1]), LPM, Log);
                        }

                        //在出票结果会出现在ChinaPnrParams中配置的RetURL链接中,在对应的RetURL里执行返回操作,这里业务逻辑结束
                        Thread.Sleep(m_ChinapnrRefreshTime * 1000);
                    }
                    catch (Exception e)
                    {
                        try
                        {
                            if (e is ThreadAbortException)
                            {
                                return;
                            }
                            // errorLog.Error(e.Message, e);
                            Log(3, e.Message);
                            //ShowChinapnrMsg(string.Format("发生不可预料的异常:{0}该功能暂停,1分钟后重新开始!", e.Message));
                            Log(3, string.Format("发生不可预料的异常:{0}该功能暂停,1分钟后重新开始!", e.Message));
                            Thread.Sleep(60000);
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
            catch (Exception e)
            {
                try
                {
                    if (e is ThreadAbortException)
                    {
                        return;
                    }
                    // errorLog.Error(e.Message, e);
                    // ShowChinapnrMsg(string.Format("发生不可预料的异常:{0}该功能停止,如果继续发生请联系开发人员解决,谢谢!", e.Message));
                    Log(3, "发生不可预料的异常:" + e.Message + "该功能停止,如果继续发生请联系开发人员解决,谢谢!");
                }
                catch (Exception)
                {
                }
            }
        }
    private void GetData()
    {
        string ticketnoinfo = "";

        for (int i = 0; i < Request.Form.Count; i++)
        {
            ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        }
        OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
        string NotifyType      = Request.Form["NotifyType"].ToString();      //通知类型(出票通知;待出票通知)
        string OrderId         = Request.Form["OrderId"].ToString();         //订单Id
        string DrawABillFlag   = Request.Form["DrawABillFlag"].ToString();   //出票状态(0表示出票,1表示取消出票)
        string DrawABillRemark = Request.Form["DrawABillRemark"].ToString(); //取消出票理由
        string TicketNos       = Request.Form["TicketNos"].ToString();       //票号信息(结算码|票号|证件类型|证件号|乘机人姓名)
        string Sign            = Request.Form["Sign"].ToString();            //Sign
        string Pnr             = Request.Form["Pnr"].ToString();             //Pnr
        string NewPnr          = "";

        if (Request.Form["NewPnr"] != null)
        {
            NewPnr = Request.Form["NewPnr"].ToString(); //NewPnr
        }

        //Kevin 2013-05-28 Edit
        //判断当前订单状态,如果不是 已经支付等待出票,则退出
        List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList2 = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + OrderId + "'");

        //Login(OrderUpdateList);
        if (OrderUpdateList2[0].OrderStatusCode != 3) //等待出票状态
        {
            OnErrorNew("外部订单号:" + OrderId + "对应订单状态不为等待出票状态,不做自动复核!", false);
            return;
        }


        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
        StringBuilder sb = new StringBuilder();

        sb.AppendFormat("\r\n\r\n\r\n\r\n\r\n");
        sb.AppendFormat("517出票通知日志记录" + "\r\n");
        sb.AppendFormat("访问IP" + ":" + Page.Request.UserHostAddress + "\r\n");
        sb.AppendFormat("通知类型:" + NotifyType.ToString() + "\r\n");
        sb.AppendFormat("517订单编号:" + OrderId.ToString() + "\r\n");
        if (DrawABillFlag == "0")
        {
            sb.AppendFormat("出票状态:已经出票\r\n");
            string JSMA          = "";
            string TicketNumber  = "";
            string PidType       = "";
            string Pid           = "";
            string PassengerName = "";
            for (int i = 0; i < TicketNos.Split(',').Length; i++)
            {
                JSMA          = JSMA + "," + TicketNos.Split(',')[i].Split('|')[0].ToString();
                JSMA          = JSMA.TrimStart(',').TrimEnd(',');
                TicketNumber  = TicketNumber + "," + TicketNos.Split(',')[i].Split('|')[0].ToString() + "-" + TicketNos.Split(',')[i].Split('|')[1].ToString();
                TicketNumber  = TicketNumber.TrimStart(',').TrimEnd(',');
                PidType       = PidType + "," + TicketNos.Split(',')[i].Split('|')[2].ToString();
                PidType       = PidType.TrimStart(',').TrimEnd(',');
                Pid           = Pid + "," + TicketNos.Split(',')[i].Split('|')[3].ToString();
                Pid           = Pid.TrimStart(',').TrimEnd(',');
                PassengerName = PassengerName + "," + TicketNos.Split(',')[i].Split('|')[4].ToString();
                PassengerName = PassengerName.TrimStart(',').TrimEnd(',');
            }
            if (JSMA != "")
            {
                sb.AppendFormat("结算码:" + JSMA + "\r\n");
                sb.AppendFormat("票号:" + TicketNumber + "\r\n");
                sb.AppendFormat("证件类型:" + PidType + "\r\n");
                sb.AppendFormat("证件号:" + Pid + "\r\n");
                sb.AppendFormat("乘机人姓名:" + PassengerName + "\r\n");
            }
            else
            {
                sb.AppendFormat("票号信息:" + TicketNos.ToString() + "\r\n");
            }
            sb.AppendFormat("效验码:" + Sign + "\r\n");
            #region 更新数据库订单信息

            List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + OrderId + "'");
            //Login(OrderUpdateList);

            if (NewPnr != null && NewPnr != "")
            {
                OrderUpdateList[0].ChangePNR = NewPnr;
            }

            int tcount = 0;
            PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
            List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
            for (int j = 0; j < PassengerList.Count; j++)
            {
                int number = -1;
                for (int k = 0; k < PassengerName.Split(',').Length; k++)
                {
                    if (PassengerName.Split(',')[k].ToString().Replace("CHD", "") == PassengerList[j].PassengerName.Replace("CHD", ""))
                    {
                        number = k;
                        break;
                    }
                }
                if (number != -1)
                {
                    PassengerList[j].TicketNumber = TicketNumber.Split(',')[number];
                    PassengerList[j].TicketStatus = 2;
                    tcount++;
                }
            }

            //如果乘机人和票号数量一致,则更改订单状态
            if (tcount == PassengerList.Count)
            {
                OrderUpdateList[0].OrderStatusCode = 4; //出票状态
            }
            else
            {
                #region 记录操作日志
                //添加操作订单的内容
                PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                OrderLog.id          = Guid.NewGuid();
                OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                OrderLog.OperType    = "修改";
                OrderLog.OperTime    = DateTime.Now;
                OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                OrderLog.WatchType   = 2;
                string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                #endregion
            }

            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
            bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
            if (reuslt)
            {
                sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                #region  票宝开放服务接口异步通知出票

                if (OrderUpdateList[0].OrderSourceType == 5)
                {
                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                    if (pbInterfaceCmd != null)
                    {
                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                    }
                }
                #endregion
            }
            else
            {
                sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
            }
        }
        else
        {
            sb.AppendFormat("出票状态:取消出票\r\n");
            sb.AppendFormat("取消出票理由:" + DrawABillRemark.ToString() + "\r\n");
        }
        #endregion
        OnErrorNew("记录:" + sb.ToString(), false);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        OnErrorNew("进入 ReturnBaiTuoPay.aspx_Load()", false);

        string tmpstr = "";

        string[] sl = Request.QueryString.AllKeys;
        for (int i = 0; i < sl.Length; i++)
        {
            tmpstr += sl[i] + "=" + Request.QueryString[sl[i]].ToString() + "&";
        }

        OnErrorNew(tmpstr, false);


        PbProject.Model.Tb_Ticket_Order            Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(Request.QueryString["portorderid"].ToString());
        PbProject.Model.definitionParam.BaseSwitch BS    = new PbProject.Model.definitionParam.BaseSwitch();
        List <PbProject.Model.Bd_Base_Parameters>  mBP   = new PbProject.Logic.ControlBase.BaseDataManage().
                                                           CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + Order.OwnerCpyNo.Substring(0, 12) + "'" }) as List <PbProject.Model.Bd_Base_Parameters>;

        BS = PbProject.WebCommon.Utility.BaseParams.getParams(mBP);
        //Login(Order);
        PbProject.Logic.PTInterface.PTBybaituo OrderBaiTuoInterface = new PbProject.Logic.PTInterface.PTBybaituo(Order, BS);
        w_BTWebService.BaiTuoWeb BaiTuoWebService = new w_BTWebService.BaiTuoWeb();
        //BaiTuoWebService.BaiTuoWeb BaiTuoWebService = new BaiTuoWebService.BaiTuoWeb();
        //System.Threading.Thread.Sleep(50000);

        if (Request.QueryString["forderformid"] != null && Request.QueryString["messageType"].ToString() == "2")
        {
            #region 出票
            #region 参数接收
            string forderformid = Request.QueryString["forderformid"].ToString();
            string produceType  = Request.QueryString["produceType"].ToString();
            string messageType  = Request.QueryString["messageType"].ToString();
            OnErrorNew("ticketnoinfo内容:" + "messageType:" + messageType + "/forderformid:" + forderformid + "/produceType:" + produceType, false);
            #endregion
            XmlElement xmlElement = OrderBaiTuoInterface.BaiTuoCpSend(forderformid);

            XmlNode xml = BaiTuoWebService.getOrderInfoXml(xmlElement);

            OnErrorNew("取订单XML内容:" + xml.InnerXml, false);
            DataSet      ds  = new DataSet();
            StringReader rea = new StringReader("<ORDER_INFO_RS>" + xml.InnerXml + "</ORDER_INFO_RS>");
            #region 测试数据
            //string sss = "";
            //sss += "<ORDERINFO OrderID=\"f1020\" IssuedDate=\"2008-12-24 10:07:31\" Status=\"4\" Flag=\"1\" Shouldpaid=\"8180.00\" Money=\"8000.00\">";
            //sss += "<TICKETINFO PNR=\"RE566\" personName=\"wangchun2\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"D000028127\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\" >999-789456120</TICKETINFO>";
            //sss += "<TICKETINFO PNR=\"RE567\" personName=\"wangchun3\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\">999-789456121</TICKETINFO>";
            //sss += "<TICKETINFO PNR=\"RE568\" personName=\"wangchun4\" DepartCity=\"PEK\" ArrivalCity=\"SHA\" InsuranceNumber=\"D000028127\" Price=\"450\" AgentPrice=\"440\" InsurancePolicyNO=\"\" EhomeBillno=\"\">999-789456122</TICKETINFO>";
            //sss += "</ORDERINFO>";
            //sss += "<Error Code=\"611001\">出错原因</Error>";
            //StringReader rea = new StringReader("<ORDER_INFO_RS>" + sss + "</ORDER_INFO_RS>");
            #endregion
            XmlTextReader xmlReader = new XmlTextReader(rea);

            ds.ReadXml(xmlReader);
            if (ds.Tables.Count > 1)
            {
                OnErrorNew("订单状态:" + ds.Tables[0].Rows[0]["Status"].ToString(), false);
                if (ds.Tables[0].Rows[0]["Status"].ToString() == "4")
                {
                    if (Order != null)
                    {
                        if (Order.OrderStatusCode == 4)
                        {
                            OnErrorNew("该票号已经出票", false);
                            return;
                        }
                        if (Order.OrderStatusCode == 3)
                        {
                            int tcount = 0;
                            PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                            List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(Order.OrderId);
                            OnErrorNew("开始修改订单状态", false);
                            for (int i = 0; i < PassengerList.Count; i++)
                            {
                                for (int j = 0; j < ds.Tables[1].Rows.Count; j++)
                                {
                                    if (PassengerList[i].PassengerName.Replace("CHD", "") == ds.Tables[1].Rows[j]["personName"].ToString().Replace("CHD", ""))
                                    {
                                        OnErrorNew(PassengerList[i].PassengerName + ":" + ds.Tables[1].Rows[j]["TICKETINFO_TEXT"].ToString(), false);
                                        PassengerList[i].TicketNumber = ds.Tables[1].Rows[j]["TICKETINFO_TEXT"].ToString();
                                        PassengerList[i].TicketStatus = 2;
                                        tcount++;
                                    }
                                }
                            }

                            if (tcount == PassengerList.Count)
                            {
                                Order.OrderStatusCode = 4; //出票状态
                            }
                            else
                            {
                                #region 记录操作日志
                                //添加操作订单的内容
                                PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                                PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                                OrderLog.id          = Guid.NewGuid();
                                OrderLog.OrderId     = Order.OrderId;
                                OrderLog.OperType    = "修改";
                                OrderLog.OperTime    = DateTime.Now;
                                OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                                OrderLog.WatchType   = 2;
                                string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                                sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                                #endregion
                            }


                            bool reuslt = false;
                            List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                           CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                            List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                          CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                            reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(Order, PassengerList, mUser[0], mCompany[0], "");
                            if (reuslt)
                            {
                                OnErrorNew("修改订单完成", false);
                                #region  票宝开放服务接口异步通知出票

                                if (Order.OrderSourceType == 5)
                                {
                                    PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                                    if (pbInterfaceCmd != null)
                                    {
                                        bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(Order);
                                    }
                                }
                                #endregion
                            }
                            else
                            {
                                OnErrorNew("修改订单失败", false);
                            }
                        }
                    }
                }
            }
            #endregion
        }
        else if (Request.QueryString["orderID"] != null && Request.QueryString["messageType"].ToString() == "12")//拒绝退/废票的消息
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["orderID"].ToString())[0];
            //OnErrorNew("百拓退废票失败" + Order.OrderId, false);
            //Order.A40 = "4";
            //#region 记录日志
            //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //OrderLog.PNR = Order.PNR;
            //OrderLog.OrderId = Order.OrderId;
            //if (Order.OrderType == 3)
            //{
            //    OrderLog.OperateType = 14;
            //}
            //else if (Order.OrderType == 4)
            //{
            //    OrderLog.OperateType = 17;
            //}
            //OrderLog.OperateTime = DateTime.Now;
            //OrderLog.Content = "于 " + DateTime.Now + " 百拓平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + Request.QueryString["memo"].ToString();
            //OrderLog.OperateId = "adminys";
            //OrderLog.OperateName = "管理员";
            //OrderLog.OperateCorporationId = 1;
            //OrderLog.A1 = 1;
            //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //#endregion
            //OrderMan.UpdateTb_Ticket_Order(Order);
        }
        else if (Request.QueryString["orderID"] != null && (Request.QueryString["messageType"].ToString() == "13" || Request.QueryString["messageType"].ToString() == "14"))//退废票办理完成,等待供应商退款的消息
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["orderID"].ToString())[0];
            //OnErrorNew("百拓退废票成功" + Order.OrderId, false);
            //Order.A40 = "3";
            //#region 记录日志
            //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //OrderLog.PNR = Order.PNR;
            //OrderLog.OrderId = Order.OrderId;
            //if (Order.OrderType == 3)
            //{
            //    OrderLog.OperateType = 14;
            //}
            //else if (Order.OrderType == 4)
            //{
            //    OrderLog.OperateType = 17;
            //}
            //OrderLog.OperateTime = DateTime.Now;
            //OrderLog.Content = "于 " + DateTime.Now + " 百拓平台供应已退票";
            //OrderLog.OperateId = "adminys";
            //OrderLog.OperateName = "管理员";
            //OrderLog.OperateCorporationId = 1;
            //OrderLog.A1 = 1;
            //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //#endregion
            //OrderMan.UpdateTb_Ticket_Order(Order);
        }
    }
    private void GetData()
    {
        if (Request.QueryString["passengerNames"].ToString() != "")
        {
            string ticketnoinfo = "";
            for (int i = 0; i < Request.QueryString.Count; i++)
            {
                ticketnoinfo = ticketnoinfo + Request.QueryString.Keys[i].ToString() + ":" + Request.QueryString[i].ToString() + "|";
            }
            OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
            string[] passengerNames = Request.QueryString["passengerNames"].ToString().TrimStart(',').TrimEnd(',').Split(',');
            string[] ticketNos      = Request.QueryString["ticketNos"].ToString().TrimStart(',').TrimEnd(',').Split(',');
            string   sequenceNo     = Request.QueryString["sequenceNo"].ToString();
            string   pnrNo          = Request.QueryString["pnrNo"].ToString();
            string   oldPnrNo       = "";
            if (Request.QueryString["oldPnrNo"] != null)
            {
                oldPnrNo = Request.QueryString["oldPnrNo"].ToString(); //oldPnrNo
            }
            StringBuilder sb = new StringBuilder();
            List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + sequenceNo + "'");
            //Login(OrderUpdateList);
            if (OrderUpdateList[0].OrderStatusCode == 3)
            {
                if (oldPnrNo != null && oldPnrNo != "")
                {
                    OrderUpdateList[0].ChangePNR = oldPnrNo;
                }

                int tcount = 0;
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                for (int j = 0; j < PassengerList.Count; j++)
                {
                    for (int i = 0; i < passengerNames.Length; i++)
                    {
                        if (PassengerList[j].PassengerName.Trim().Replace("CHD", "") == passengerNames[i].ToString().Trim().Replace("CHD", ""))
                        {
                            tcount++;
                            PassengerList[j].TicketNumber = ticketNos[i].ToString().Trim();
                            PassengerList[j].TicketStatus = 2;
                        }
                    }
                }

                if (tcount == PassengerList.Count)
                {
                    OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                }
                else
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                    PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                    #endregion
                }

                List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                               CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                              CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                if (reuslt)
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                    #region  票宝开放服务接口异步通知出票

                    if (OrderUpdateList[0].OrderSourceType == 5)
                    {
                        PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                        if (pbInterfaceCmd != null)
                        {
                            bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                        }
                    }
                    #endregion
                }
                else
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                }
            }
            OnErrorNew("记录:" + sb.ToString(), false);
        }
        else if (Request.QueryString["venderRefundTime"].ToString() != "")//退废票通知
        {
            //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
            //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(Request.QueryString["sequenceNo"].ToString())[0];
            //if (Request.QueryString["type"].ToString() == "1")//平台已经退废票
            //{
            //    PiaoBao.Models.User_Company mCompany = PiaoBao.BLLLogic.Factory_System.CreateCompanyManager().SelectUser_CompanyByRoleType()[0];
            //    string strWhere = " pid='" + mCompany.PId + "' and keyno='" + mCompany.KeyNo + "'";
            //    StringBuilder strSql = new StringBuilder();
            //    strSql.Append("select A1 ");
            //    strSql.Append(" FROM Tb_User_Supplier ");
            //    DataSet ds = Maticsoft.DBUtility.DbHelperSQL.Query(strSql.ToString() + "where " + strWhere);
            //    if (ds.Tables[0].Rows[0]["A1"].ToString().Contains("|71|"))//自动退废票开关开启
            //    {
            //        PiaoBao.BLLLogic.Order.Tb_Ticket_PassengerManager PassengerMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_PassengerManager();
            //        IList<PiaoBao.Models.Tb_Ticket_Passenger> PassengerList = PassengerMan.SelectTb_Ticket_PassengerByOrderId(Order.OrderId);
            //        PiaoBao.BLLLogic.Order.Tb_Ticket_SkyWayManager SkyWayManager = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_SkyWayManager();
            //        IList<PiaoBao.Models.Tb_Ticket_SkyWay> SkyWayList = SkyWayManager.SelectTb_Ticket_SkyWayByOrderId(Order.OrderId);
            //        PiaoBao.BLLLogic.Order.OrderTGQ orderTGQ = new PiaoBao.BLLLogic.Order.OrderTGQ();
            //        string ProcessMsg = "";
            //        string TFsxFee = Request.QueryString["refundFee"].ToString();

            //        bool reuslt = orderTGQ.Process(out ProcessMsg, 1, GetTGQFee(PassengerList, TFsxFee), 0, Order.OrderType.ToString(), "", IsProcess(PassengerList), Order, PassengerList, SkyWayList);
            //        Order.A40 = "3";
            //        OrderMan.UpdateTb_Ticket_Order(Order);
            //        string Contents = "";
            //        if (reuslt)
            //        {
            //            OnErrorNew("系统自动退废票成功" + Order.OrderId, false);
            //            Contents = "于 " + DateTime.Now + " 51book平台供应已退票,系统自动退废票成功!";
            //        }
            //        else
            //        {
            //            OnErrorNew("系统自动退废票失败" + Order.OrderId, false);
            //            Contents = "于 " + DateTime.Now + " 51book平台供应已退票,系统自动退废票失败:" + ProcessMsg + "!";
            //        }
            //        #region 记录日志
            //        PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //        PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //        OrderLog.PNR = Order.PNR;
            //        OrderLog.OrderId = Order.OrderId;
            //        if (Order.OrderType == 3)
            //        {
            //            OrderLog.OperateType = 14;
            //        }
            //        else if (Order.OrderType == 4)
            //        {
            //            OrderLog.OperateType = 17;
            //        }
            //        OrderLog.OperateTime = DateTime.Now;
            //        OrderLog.Content = Contents;
            //        OrderLog.OperateId = "adminys";
            //        OrderLog.OperateName = "管理员";
            //        OrderLog.OperateCorporationId = 1;
            //        OrderLog.A1 = 1;
            //        int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //        #endregion
            //    }
            //    else
            //    {
            //        OnErrorNew("开关未开,不走系统自动退废票" + Order.OrderId, false);
            //        Order.A40 = "3";
            //        #region 记录日志
            //        PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //        PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //        OrderLog.PNR = Order.PNR;
            //        OrderLog.OrderId = Order.OrderId;
            //        if (Order.OrderType == 3)
            //        {
            //            OrderLog.OperateType = 14;
            //        }
            //        else if (Order.OrderType == 4)
            //        {
            //            OrderLog.OperateType = 17;
            //        }
            //        OrderLog.OperateTime = DateTime.Now;
            //        OrderLog.Content = "于 " + DateTime.Now + " 51book平台供应已退票";
            //        OrderLog.OperateId = "adminys";
            //        OrderLog.OperateName = "管理员";
            //        OrderLog.OperateCorporationId = 1;
            //        OrderLog.A1 = 1;
            //        int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //        #endregion
            //        OrderMan.UpdateTb_Ticket_Order(Order);
            //    }
            //}
            //else//平台退废票失败
            //{
            //    OnErrorNew("平台退废票失败" + Order.OrderId, false);
            //    Order.A40 = "4";
            //    #region 记录日志
            //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
            //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
            //    OrderLog.PNR = Order.PNR;
            //    OrderLog.OrderId = Order.OrderId;
            //    if (Order.OrderType == 3)
            //    {
            //        OrderLog.OperateType = 14;
            //    }
            //    else if (Order.OrderType == 4)
            //    {
            //        OrderLog.OperateType = 17;
            //    }
            //    OrderLog.OperateTime = DateTime.Now;
            //    OrderLog.Content = "于 " + DateTime.Now + " 51book平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + Request.QueryString["venderRemark"].ToString();
            //    OrderLog.OperateId = "adminys";
            //    OrderLog.OperateName = "管理员";
            //    OrderLog.OperateCorporationId = 1;
            //    OrderLog.A1 = 1;
            //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
            //    #endregion
            //    OrderMan.UpdateTb_Ticket_Order(Order);
            //}
        }
    }
Example #7
0
    private void GetData()
    {
        string ticketnoinfo = "";

        for (int i = 0; i < Request.Form.Count; i++)
        {
            ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        }
        ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));
        OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
        if (GetValue("ticket_no").ToString().Trim() != "")
        {
            OnErrorNew("进入 Request.Form['status'].ToString().Trim() != ''", false);
            if (GetValue("status").ToString().Trim() == "T" && GetValue("service").ToString().Trim() == "order_issue_notify")//出票完成
            {
                bool reuslt = false;
                OnErrorNew("进入出票 Request.Form['status'].ToString().Trim() == 'T'", false);
                StringBuilder sb = new StringBuilder();
                PbProject.Model.Tb_Ticket_Order OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(GetValue("order_no").ToString());
                //Login(OrderUpdateList);
                if (OrderUpdateList.OrderStatusCode == 3)
                {
                    int tcount = 0;
                    //OrderUpdateList.OrderStatusCode = 4; //出票状态

                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList.OrderId);
                    for (int j = 0; j < PassengerList.Count; j++)
                    {
                        string   sss  = HttpUtility.UrlDecode(GetValue("passenger").ToString(), Encoding.GetEncoding("gb2312"));
                        string[] Name = sss.Split('^');
                        for (int i = 0; i < Name.Length; i++)
                        {
                            if (PassengerList[j].PassengerName.Trim().Replace("CHD", "").Trim().Replace(" ", "") == Name[i].Replace("CHD", "").Trim().Replace(" ", ""))
                            {
                                PassengerList[j].TicketNumber = GetValue("ticket_no").ToString().Split('^')[i].ToString();
                                tcount++;
                            }
                        }
                    }

                    if (tcount == PassengerList.Count)
                    {
                        OrderUpdateList.OrderStatusCode = 4; //出票状态
                    }
                    else
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = OrderUpdateList.OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                    reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList, PassengerList, mUser[0], mCompany[0], "");
                    if (reuslt)
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList.OrderId + "信息,更新成功!\r\n");
                        #region  票宝开放服务接口异步通知出票

                        if (OrderUpdateList.OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList.OrderId + "信息,更新失败!\r\n");
                    }
                    OnErrorNew("今日记录:" + sb.ToString(), false);
                }
            }
            else if (GetValue("status").ToString().Trim() == "1" && GetValue("service").ToString().Trim() == "order_refund_notify")
            {
                PbProject.Model.Tb_Ticket_Order Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(GetValue("order_no").ToString());
                OnErrorNew("今日退废票成功" + Order.OrderId, false);
                //Order.A40 = "3";
                //#region 记录日志
                //PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();
                //PbProject.Logic.Log.Log_ErrorBLL OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //OrderLog.PNR = Order.PNR;
                //OrderLog.OrderId = Order.OrderId;
                //if (Order.OrderType == 3)
                //{
                //    OrderLog.OperateType = 14;
                //}
                //else if (Order.OrderType == 4)
                //{
                //    OrderLog.OperateType = 17;
                //}
                //OrderLog.OperateTime = DateTime.Now;
                //OrderLog.Content = "于 " + DateTime.Now + " 今日平台供应已退票";
                //OrderLog.OperateId = "adminys";
                //OrderLog.OperateName = "管理员";
                //OrderLog.OperateCorporationId = 1;
                //OrderLog.A1 = 1;
                //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //#endregion
                //OrderMan.UpdateTb_Ticket_Order(Order);
            }
            else if (GetValue("status").ToString().Trim() == "2" && GetValue("service").ToString().Trim() == "order_refund_notify")
            {
                //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
                //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(GetValue("order_no").ToString())[0];
                //OnErrorNew("今日退废票失败" + Order.OrderId, false);
                //Order.A40 = "4";
                //#region 记录日志
                //PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //OrderLog.PNR = Order.PNR;
                //OrderLog.OrderId = Order.OrderId;
                //if (Order.OrderType == 3)
                //{
                //    OrderLog.OperateType = 14;
                //}
                //else if (Order.OrderType == 4)
                //{
                //    OrderLog.OperateType = 17;
                //}
                //OrderLog.OperateTime = DateTime.Now;
                //OrderLog.Content = "于 " + DateTime.Now + " 今日平台供应已拒绝退废票,请联系平台手动处理 拒绝原因:" + GetValue("remark").ToString();
                //OrderLog.OperateId = "adminys";
                //OrderLog.OperateName = "管理员";
                //OrderLog.OperateCorporationId = 1;
                //OrderLog.A1 = 1;
                //int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //#endregion
                //OrderMan.UpdateTb_Ticket_Order(Order);
            }
        }
    }
Example #8
0
 /// <summary>
 /// 修改票号
 /// </summary>
 /// <param name="passengerInfoList"></param>
 /// <param name="psb"></param>
 /// <param name="psmList"></param>
 private List <PbProject.Model.Tb_Ticket_Passenger> ModifyPassenger(string[] passengerInfoList, PbProject.Logic.Order.Tb_Ticket_PassengerBLL psb, List <PbProject.Model.Tb_Ticket_Passenger> psmList)
 {
     //LogInfo("开始修改票号", false);
     for (int i = 0; i < psmList.Count; i++)
     {
         foreach (string passengerInfo in passengerInfoList)
         {
             if (psmList[i].PassengerName == passengerInfo.Split('+')[1])
             {
                 psmList[i].TicketStatus = 2;
                 psmList[i].TicketNumber = passengerInfo.Split('+')[0];
                 //psb.UpdateTb_Ticket_Passenger(psmList[i]);
                 //LogInfo("修改乘客:【" + psmList[i].PassengerName + "】票号完成", false);
             }
         }
     }
     return(psmList);
     //LogInfo("修改票号完成", false);
 }
Example #9
0
    private void GetData()
    {
        StringBuilder sb         = new StringBuilder();
        string        platform   = Request.Form["platform"].ToString();
        string        type       = Request.Form["type"].ToString();
        string        orderguid  = Request.Form["orderguid"].ToString();
        string        orderstate = Request.Form["orderstate"].ToString();
        string        notifymsg  = Request.Form["notifymsg"].ToString();
        string        key        = Request.Form["key"].ToString();
        string        localKey   = string.Empty;

        if (type == "2")
        {
            localKey = string.Format("$%^{0}{1}|8000YI$8000yi$", orderguid, notifymsg);
        }
        else
        {
            localKey = string.Format("$%^{0}{1}8000YI$8000yi$", orderguid, notifymsg);
        }
        localKey = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(localKey, "MD5");
        if (!key.Equals(localKey))
        {
            OnErrorNew("key错误", false);
        }
        else
        {
            string[] notifyMsgSort = notifymsg.Split('^');
            string   PassengerName = string.Empty, TicketNumber = string.Empty;
            if (type == "2")
            {
                PassengerName = notifyMsgSort[1];
                TicketNumber  = notifyMsgSort[2];

                #region 更新数据库订单信息
                List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + orderguid + "'");

                //Kevin 2013-05-28 判断当前订单状态
                if (OrderUpdateList[0].OrderStatusCode != 3)
                {
                    OnErrorNew("外部订单号:" + orderguid + "对应订单状态不是等待出票状态,不做自动复核!", false);
                    return;
                }

                //Login(OrderUpdateList);
                //OrderUpdateList[0].OrderStatusCode = 4; //出票状态

                int tcount = 0;
                PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                for (int j = 0; j < PassengerList.Count; j++)
                {
                    int number = -1;
                    for (int k = 0; k < PassengerName.Split('|').Length; k++)
                    {
                        if (PassengerName.Split('|')[k].ToString().Replace("CHD", "") == PassengerList[j].PassengerName.Replace("CHD", ""))
                        {
                            number = k;
                            break;
                        }
                    }
                    if (number != -1)
                    {
                        tcount++;
                        PassengerList[j].TicketNumber = TicketNumber.Split('|')[number];
                        PassengerList[j].TicketStatus = 2;
                    }
                }

                if (tcount == PassengerList.Count)
                {
                    OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                }
                else
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                    PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                    #endregion
                }

                List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                               CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                              CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;

                bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                if (reuslt)
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                    #region  票宝开放服务接口异步通知出票

                    if (OrderUpdateList[0].OrderSourceType == 5)
                    {
                        PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                        if (pbInterfaceCmd != null)
                        {
                            bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                        }
                    }
                    #endregion
                }
                else
                {
                    sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                }
                OnErrorNew("记录:" + sb.ToString(), false);
                #endregion
            }
            else if (type == "3" || type == "4")
            {
                //PiaoBao.BLLLogic.Order.Tb_Ticket_OrderManager OrderMan = PiaoBao.BLLLogic.Factory_Air.CreateITb_Ticket_OrderManager();
                //PiaoBao.Models.Tb_Ticket_Order Order = OrderMan.SelectOrderByOutOrderId(orderguid)[0];
                //if (Request.Form["orderstate"].ToString().Contains("已经退票") || Request.Form["orderstate"].ToString().Contains("已经废票"))
                //{
                //    OnErrorNew("8000yi平台退废票成功" + Order.OrderId, false);
                //    Order.A40 = "3";
                //    #region 记录日志
                //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //    OrderLog.PNR = Order.PNR;
                //    OrderLog.OrderId = Order.OrderId;
                //    if (Order.OrderType == 3)
                //    {
                //        OrderLog.OperateType = 14;
                //    }
                //    else if (Order.OrderType == 4)
                //    {
                //        OrderLog.OperateType = 17;
                //    }
                //    OrderLog.OperateTime = DateTime.Now;
                //    OrderLog.Content = "于 " + DateTime.Now + " 8000yi平台供应已退票";
                //    OrderLog.OperateId = "adminys";
                //    OrderLog.OperateName = "管理员";
                //    OrderLog.OperateCorporationId = 1;
                //    OrderLog.A1 = 1;
                //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //    #endregion
                //    OrderMan.UpdateTb_Ticket_Order(Order);
                //}
                //else
                //{
                //    OnErrorNew("8000yi平台退废票失败" + Order.OrderId, false);
                //    Order.A40 = "4";
                //    #region 记录日志
                //    PiaoBao.Models.Log_Tb_AirOrder OrderLog = new PiaoBao.Models.Log_Tb_AirOrder();
                //    PiaoBao.BLLLogic.Order.Log_Tb_AirOrderManager OrderLogManager = PiaoBao.BLLLogic.Factory_Air.CreateILog_Tb_AirOrderManager();
                //    OrderLog.PNR = Order.PNR;
                //    OrderLog.OrderId = Order.OrderId;
                //    if (Order.OrderType == 3)
                //    {
                //        OrderLog.OperateType = 14;
                //    }
                //    else if (Order.OrderType == 4)
                //    {
                //        OrderLog.OperateType = 17;
                //    }
                //    OrderLog.OperateTime = DateTime.Now;
                //    OrderLog.Content = "于 " + DateTime.Now + " 8000yi平台供应已拒绝退废票,请联系平台手动处理 ";
                //    OrderLog.OperateId = "adminys";
                //    OrderLog.OperateName = "管理员";
                //    OrderLog.OperateCorporationId = 1;
                //    OrderLog.A1 = 1;
                //    int Number = OrderLogManager.InsertLog_Tb_AirOrder(OrderLog);
                //    #endregion
                //    OrderMan.UpdateTb_Ticket_Order(Order);
                //}
            }
            OnErrorNew("记录:" + sb.ToString(), false);
        }
    }
Example #10
0
    private void GetData()
    {
        string tmpstr = "";

        string[] sl = HttpContext.Current.Request.Form.AllKeys;//Request.QueryString.AllKeys;
        for (int i = 0; i < sl.Length; i++)
        {
            tmpstr += sl[i] + "=" + HttpContext.Current.Request.Form.Get(i) + "&";//HttpContext.Current.Request.Form.Keys[i] + "&";
        }

        OnErrorNew(HttpUtility.UrlDecode(tmpstr), false);

        //string ticketnoinfo = "";
        //for (int i = 0; i < Request.Form.Count; i++)
        //{
        //    ticketnoinfo = ticketnoinfo + Request.Form.Keys[i].ToString() + ":" + Request.Form[i].ToString() + "|";
        //}
        //ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));
        //OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);

        string NewPnr = "";

        string airId = HttpContext.Current.Request.Form.Get("airId");//Request.QueryString["airId"].ToString().Trim();

        OnErrorNew("判断是否有票号信息,airId=" + airId, false);

        if (HttpContext.Current.Request.Form.Get("airId").Trim() != "")
        {
            OnErrorNew("进入 Request.QueryString['status'].ToString().Trim() != ''", false);
            if (HttpContext.Current.Request.Form.Get("Type").Trim() == "1")//出票完成
            {
                bool reuslt = false;
                OnErrorNew("进入出票 Request.QueryString['status'].ToString().Trim() == 'T'", false);
                StringBuilder sb = new StringBuilder();
                List <PbProject.Model.Tb_Ticket_Order> OrderUpdateList = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetListBySqlWhere(" OutOrderId='" + HttpContext.Current.Request.Form.Get("orderid").Trim() + "'");

                if (OrderUpdateList.Count == 0)
                {
                    OnErrorNew("根据外部订单号未查找到对应订单,外部订单号:" + HttpContext.Current.Request.Form.Get("orderid").Trim(), false);
                }

                if (OrderUpdateList[0].OrderStatusCode != 3)
                {
                    OnErrorNew("订单状态不是待出票状态...", false);
                }

                //Login(OrderUpdateList);
                if (OrderUpdateList[0].OrderStatusCode == 3)
                {
                    //OrderUpdateList.OrderStatusCode = 4; //出票状态
                    if (HttpContext.Current.Request.Form.Get("NewPnr") != null && HttpContext.Current.Request.Form.Get("NewPnr") != "")
                    {
                        OrderUpdateList[0].ChangePNR = HttpContext.Current.Request.Form.Get("NewPnr");
                    }

                    int tcount = 0;
                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL PassengerManager = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   PassengerList    = PassengerManager.GetPasListByOrderID(OrderUpdateList[0].OrderId);
                    for (int j = 0; j < PassengerList.Count; j++)
                    {
                        string sss = HttpUtility.UrlDecode(HttpContext.Current.Request.Form.Get("passengerName"));

                        OnErrorNew("乘机人列表:" + sss, false);

                        string[] Name = sss.Split('^');
                        for (int i = 0; i < Name.Length; i++)
                        {
                            if (PassengerList[j].PassengerName.Trim().Replace("CHD", "").Trim().Replace(" ", "") == Name[i].Replace("CHD", "").Trim().Replace(" ", ""))
                            {
                                PassengerList[j].TicketNumber = HttpContext.Current.Request.Form.Get("airId").Split('^')[i].ToString();
                                tcount++;
                            }
                        }
                    }

                    if (tcount == PassengerList.Count)
                    {
                        OrderUpdateList[0].OrderStatusCode = 4; //出票状态
                    }
                    else
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = OrderUpdateList[0].OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + OrderUpdateList[0].CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;
                    reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(OrderUpdateList[0], PassengerList, mUser[0], mCompany[0], "");
                    if (reuslt)
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新成功!\r\n");
                        #region  票宝开放服务接口异步通知出票

                        if (OrderUpdateList[0].OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(OrderUpdateList[0]);
                            }
                        }
                        #endregion
                    }
                    else
                    {
                        sb.AppendFormat("更新数据库,订单号:" + OrderUpdateList[0].OrderId + "信息,更新失败!\r\n");
                    }
                    OnErrorNew("易行记录:" + sb.ToString(), false);
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //string result = "<?xml version=\"1.0\" encoding=\"gb2312\" ?><orderinfo><pnr>HF5N1R</pnr><code>1</code><message /><orderno></orderno><orderstatus>1</orderstatus><paystatus>1</paystatus><pnrsrcid>0101912051714341204</pnrsrcid ><payprice>543.6</ payprice><tradeno>2012051773929436</tradeno><tickets><ticket><passenger>张平</passenger><tktno>876-2037972475</tktno></ticket></tickets></orderinfo>";
        //System.Threading.Thread.Sleep(50000);
        OnErrorNew("进入 Pay_AutoPayByAlipayNotifyUrl_Load()", true);

        try
        {
            if (Request.Form["ticketnoinfo"] != null && Request.Form["ticketnoinfo"].ToString() != "")
            {
                string ticketnoinfo = Request.Form["ticketnoinfo"].ToString();
                ticketnoinfo = HttpUtility.UrlDecode(ticketnoinfo, Encoding.GetEncoding("gb2312"));

                OnErrorNew("ticketnoinfo内容:" + ticketnoinfo, false);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(ticketnoinfo);
                DataSet      ds  = new DataSet();
                StringReader rea = new StringReader(doc.InnerXml);

                XmlTextReader xmlReader = new XmlTextReader(rea);

                ds.ReadXml(xmlReader);
                PbProject.Model.Tb_Ticket_Order Order = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().GetTicketOrderByOrderId(ds.Tables[0].Rows[0]["pnrsrcid"].ToString());
                //Login(Order);
                if (ticketnoinfo.IndexOf("支付成功后,取票号失败,请您手工操作") > -1)
                {
                    #region 记录操作日志
                    //添加操作订单的内容
                    PbProject.Model.Log_Tb_AirOrder OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                    OrderLog.id          = Guid.NewGuid();
                    OrderLog.OrderId     = Order.OrderId;
                    OrderLog.OperType    = "修改";
                    OrderLog.OperTime    = DateTime.Now;
                    OrderLog.OperContent = "于 " + DateTime.Now + " 航空公司已出票,自动取票号失败,请您手工出票!";
                    OrderLog.WatchType   = 2;
                    string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                    #endregion
                    OnErrorNew("支付成功后,取票号失败,请您手工操作!", false);
                    return;
                }
                if (Order.OrderStatusCode == 4)
                {
                    OnErrorNew("该票号已经出票", false);
                    return;
                }

                int tcount = 0;
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    PbProject.Logic.Order.Tb_Ticket_PassengerBLL psb     = new PbProject.Logic.Order.Tb_Ticket_PassengerBLL();
                    List <PbProject.Model.Tb_Ticket_Passenger>   psmList = psb.GetPasListByOrderID(ds.Tables[0].Rows[0]["pnrsrcid"].ToString());
                    OnErrorNew("开始修改票号", false);
                    for (int i = 0; i < psmList.Count; i++)
                    {
                        for (int j = 0; j < ds.Tables[2].Rows.Count; j++)
                        {
                            if (ds.Tables[2].Rows[j]["tktno"].ToString() != "")
                            {
                                if (psmList[i].PassengerName.ToUpper() == ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper() || psmList[i].PassengerName.ToUpper() == HttpUtility.UrlDecode(ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper(), Encoding.Default) || psmList[i].PassengerName.ToUpper() == HttpUtility.UrlDecode(ds.Tables[2].Rows[j]["passenger"].ToString().ToUpper()))
                                {
                                    psmList[i].TicketStatus = 2;
                                    psmList[i].TicketNumber = ds.Tables[2].Rows[j]["tktno"].ToString().Trim();
                                    tcount++;
                                }
                            }
                        }
                    }

                    if (tcount != psmList.Count)
                    {
                        #region 记录操作日志
                        //添加操作订单的内容
                        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sqlbase  = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                        PbProject.Model.Log_Tb_AirOrder        OrderLog = new PbProject.Model.Log_Tb_AirOrder();

                        OrderLog.id          = Guid.NewGuid();
                        OrderLog.OrderId     = Order.OrderId;
                        OrderLog.OperType    = "修改";
                        OrderLog.OperTime    = DateTime.Now;
                        OrderLog.OperContent = "自动回填票号失败:乘机人与票号不符,需要手动操作!";
                        OrderLog.WatchType   = 2;
                        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

                        sqlbase.ExecuteNonQuerySQLInfo(tempSql);
                        #endregion
                    }

                    decimal payprice = 0;

                    try
                    {
                        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 &&
                            !string.IsNullOrEmpty(ds.Tables[0].Rows[0]["payprice"].ToString()) &&
                            !ds.Tables[0].Rows[0]["payprice"].ToString().Contains("-"))
                        {
                            payprice = payprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["payprice"].ToString());
                        }
                    }
                    catch (Exception)
                    {
                    }

                    if (payprice != 0)
                    {
                        Order.AirPoint = 1 - (payprice - Order.ABFee - Order.FuelFee) / Order.PMFee;
                        Order.AirPoint = Math.Round(Order.AirPoint, 3);
                    }
                    //是否更改订单状态
                    //默认更改状态
                    bool IsUpdateOrderStatus = true;
                    try
                    {
                        foreach (PbProject.Model.Tb_Ticket_Passenger item in psmList)
                        {
                            //婴儿没有回帖票号 不修改状态
                            if (item.PassengerType == 3 && string.IsNullOrEmpty(item.TicketNumber.Trim()))
                            {
                                IsUpdateOrderStatus = false;
                                break;
                            }
                        }
                        if ((IsUpdateOrderStatus) && (tcount == psmList.Count))
                        {
                            Order.OrderStatusCode = 4;
                        }
                    }
                    catch (Exception)
                    {
                    }
                    List <PbProject.Model.User_Company> mCompany = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                   CallMethod("User_Company", "GetList", null, new Object[] { "UninCode='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Company>;

                    List <PbProject.Model.User_Employees> mUser = new PbProject.Logic.ControlBase.BaseDataManage().
                                                                  CallMethod("User_Employees", "GetList", null, new Object[] { " IsAdmin=0 and CpyNo='" + Order.CPCpyNo + "'" }) as List <PbProject.Model.User_Employees>;

                    bool reuslt = new PbProject.Logic.Order.Tb_Ticket_OrderBLL().OperOrderCP(Order, psmList, mUser[0], mCompany[0], (IsUpdateOrderStatus ? "B2B自动出票" : "B2B自动出票【婴儿票请手动处理】"));
                    if (reuslt)
                    {
                        //零时改回状态
                        BaseDataManage manage = new BaseDataManage();
                        manage.ExecuteNonQuerySQLInfo("update Tb_Ticket_Order set OrderStatusCode=" + Order.OrderStatusCode + " where OrderId='" + Order.OrderId + "'");

                        #region  票宝开放服务接口异步通知出票

                        if (Order.OrderSourceType == 5)
                        {
                            PbProject.Logic.PTInterface.PbInterfaceNotify pbInterfaceCmd = new PbProject.Logic.PTInterface.PbInterfaceNotify();
                            if (pbInterfaceCmd != null)
                            {
                                bool pbNotifyResult = pbInterfaceCmd.NotifyTicketNo(Order);
                            }
                        }
                        #endregion
                        OnErrorNew(string.Format("出票成功.订单号:{0},PNR:{1}", Order.OrderId, Order.PNR), false);
                    }
                    else
                    {
                        OnErrorNew(string.Format("出票失败.订单号:{0},PNR:{1}", Order.OrderId, Order.PNR), false);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            #region 记录数据日志
            try
            {
                OnErrorNew("报错:" + ex.Message, false);
            }
            catch { }
            #endregion
        }
    }