Esempio n. 1
0
        /// <summary>
        /// 参数实例
        /// </summary>
        /// <param name="Order"></param>
        /// <param name="mUser">买家帐号</param>
        public PTByYeeXing(PbProject.Model.Tb_Ticket_Order Order, PbProject.Model.User_Employees mUser, PbProject.Model.User_Company mTopcom, PbProject.Model.User_Company mCom)
        {
            _mTopcom = mTopcom;

            _mCom = mCom;

            _mUser = mUser;

            _order = Order;

            PbProject.Model.definitionParam.BaseSwitch BS = new Model.definitionParam.BaseSwitch();

            PbProject.Logic.ControlBase.Bd_Base_ParametersBLL Bp      = new ControlBase.Bd_Base_ParametersBLL();
            List <PbProject.Model.Bd_Base_Parameters>         ParList = Bp.GetParametersListByCpyNo(_mTopcom.UninCode.ToString());

            BS = WebCommon.Utility.BaseParams.getParams(ParList);

            _yeeXingService = new w_YeeXingService.YeeXingSerivceSoapClient();

            _yeeXingAccout = BS.JieKouZhangHao.Split('|')[6].Split('^')[0];

            _yeeXingAccout2 = BS.JieKouZhangHao.Split('|')[6].Split('^')[1];

            _QXValue = BS.KongZhiXiTong;
            //BS.GongYingKongZhiFenXiao
        }
Esempio n. 2
0
        /// <summary>
        /// 参数实例
        /// </summary>
        /// <param name="Order"></param>
        /// <param name="mUser">买家帐号</param>
        public PTBy517(PbProject.Model.Tb_Ticket_Order Order, PbProject.Model.User_Employees mUser, PbProject.Model.User_Company mTopcom, PbProject.Model.User_Company mCom)
        {
            _mTopcom = mTopcom;

            _mCom = mCom;

            _order = Order;

            PbProject.Model.definitionParam.BaseSwitch BS = new Model.definitionParam.BaseSwitch();
            _517Service = new w_517WebService._517WebServiceSoapClient();

            PbProject.Logic.ControlBase.Bd_Base_ParametersBLL Bp      = new ControlBase.Bd_Base_ParametersBLL();
            List <PbProject.Model.Bd_Base_Parameters>         ParList = Bp.GetParametersListByCpyNo(_mTopcom.UninCode.ToString());

            BS = WebCommon.Utility.BaseParams.getParams(ParList);

            _517Accout = BS.JieKouZhangHao.Split('|')[0].Split('^')[0];

            _517Password = BS.JieKouZhangHao.Split('|')[0].Split('^')[1];
            _517Ag       = BS.JieKouZhangHao.Split('|')[0].Split('^')[2];

            //_517Accout = "cdqmkjt";

            //_517Password = "******";
            //_517Ag = "4b9e9902f1c34ed08cefd84f2388e7e0";



            _QXValue = BS.KongZhiXiTong;
            //BS.GongYingKongZhiFenXiao
        }
Esempio n. 3
0
        /// <summary>
        /// 参数实例
        /// </summary>
        /// <param name="Order"></param>
        /// <param name="mUser">买家帐号</param>
        public PTBy8000yi(PbProject.Model.Tb_Ticket_Order Order, PbProject.Model.User_Employees mUser, PbProject.Model.User_Company mTopcom, PbProject.Model.User_Company mCom)
        {
            _mTopcom = mTopcom;

            _mCom = mCom;

            _order = Order;

            PbProject.Model.definitionParam.BaseSwitch BS = new Model.definitionParam.BaseSwitch();

            PbProject.Logic.ControlBase.Bd_Base_ParametersBLL Bp      = new ControlBase.Bd_Base_ParametersBLL();
            List <PbProject.Model.Bd_Base_Parameters>         ParList = Bp.GetParametersListByCpyNo(_mTopcom.UninCode.ToString());

            BS = WebCommon.Utility.BaseParams.getParams(ParList);

            _8000yiAccout = BS.JieKouZhangHao.Split('|')[5].Split('^')[0];

            _8000yiPassword   = BS.JieKouZhangHao.Split('|')[5].Split('^')[1];
            _8000yiAlipaycode = BS.JieKouZhangHao.Split('|')[5].Split('^')[2];



            _QXValue = BS.KongZhiXiTong;
            //BS.GongYingKongZhiFenXiao
        }
Esempio n. 4
0
 /// <summary>
 /// 修改订单
 /// </summary>
 /// <param name="order"></param>
 private PbProject.Model.Tb_Ticket_Order ModifyOrder(PbProject.Model.Tb_Ticket_Order order)
 {
     LogInfo("开始修改订单", false);
     order.AirPoint        = 1 - (Convert.ToDecimal(m_OrderAmt) - order.ABFee - order.FuelFee) / order.PMFee;
     order.AirPoint        = Math.Round(order.AirPoint, 3);
     order.OrderStatusCode = 4;
     return(order);
 }
Esempio n. 5
0
        //不能自动出票,设置为手动
        private void ChinapnrAutofailed(PbProject.Model.Tb_Ticket_Order order, string msg, ListParam LPM, B2BShowLog Log)
        {
            string SQL = " update Tb_Ticket_Order set A10=2,AutoPrintFlag=0 where OrderId='" + order.OrderId + "'";

            PbProject.Logic.SQLEXBLL.SQLEXBLL_Base ss = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
            ss.ExecuteNonQuerySQLInfo(SQL);
            // ShowChinapnrMsg(msg);
            //infoLog.Info(msg);
            Log(3, msg);
        }
Esempio n. 6
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"));//返回成功
    }
Esempio n. 7
0
 /// <summary>
 /// 还原订单状态,改为手动出票
 /// </summary>
 /// <param name="order"></param>
 private void RollBackTicketOrderState(PbProject.Model.Tb_Ticket_Order order, string msg)
 {
     try
     {
         string SQL = " update Tb_Ticket_Order set A1=2,AutoPrintFlag=0 where OrderId='" + order.OrderId + "'";
         FailedLogToDb(order, msg);
         PbProject.Logic.SQLEXBLL.SQLEXBLL_Base ss = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
         ss.ExecuteNonQuerySQLInfo(SQL);
         //LogInfo(string.Format("{0},已改为手动方式,订单号:{1}", msg, order.OrderId), false);
     }
     catch (Exception e)
     {
         LogInfo("出票失败,改为手动方式失败.原因:" + e.Message, false);
     }
 }
Esempio n. 8
0
    /// <summary>
    /// 记录失败日志到数据库
    /// </summary>
    /// <param name="order"></param>
    /// <param name="content"></param>
    private void FailedLogToDb(PbProject.Model.Tb_Ticket_Order order, string content)
    {
        #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 + "," + content;
        OrderLog.WatchType   = 2;
        string tempSql = PbProject.Dal.Mapping.MappingHelper <PbProject.Model.Log_Tb_AirOrder> .CreateInsertModelSql(OrderLog);

        #endregion
    }
    public void Login(PbProject.Model.Tb_Ticket_Order order)
    {
        OnErrorNew("开始Login", false);
        string sql = "select LoginName,LoginPassWord from User_Employees where CpyNo='" + order.OwnerCpyNo.Substring(0, 12) + "' and IsAdmin=0";

        PbProject.Logic.SQLEXBLL.SQLEXBLL_Base sq = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
        OnErrorNew("开始查询", false);
        DataTable tb = sq.ExecuteStrSQL(sql);

        OnErrorNew("结束查询", false);
        string msg = "";

        PbProject.Logic.Login LoginManage = new PbProject.Logic.Login();
        DataTable[]           tableArr    = null;
        bool IsSuc = LoginManage.GetByName(tb.Rows[0][0].ToString(), tb.Rows[0][1].ToString(), false, Page.Request.UserHostAddress, out tableArr, out msg, 1);

        OnErrorNew("结束Login", false);
    }
Esempio n. 10
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");
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 出票Socket调用
        /// </summary>
        /// <param name="orderMange"></param>
        /// <param name="client"></param>
        /// <param name="order"></param>
        /// <param name="comModel"></param>
        /// <param name="data"></param>
        private void ChinapnrTicketWork(PbProject.Logic.Order.Tb_Ticket_OrderBLL orderMange, ChinaPnrClient client, PbProject.Model.Tb_Ticket_Order order, string data, int AutoCount, ListParam Pm, B2BShowLog Log)
        {
            int times = AutoCount;          //至少一次

            for (int i = 0; i < times; i++) //调用次数
            {
                //调用ChinaPnrClient对象的Send方法,获取发送结果
                string result = client.Send(data);//合法请求:0011QUERY_VALID;非法请求:0021QUERY_INVALID 错误描述。
                if (result.Contains("0011QUERY_VALID"))
                {
                    order.A10 = "1";//标识出票成功
                    string SQL = " update Tb_Ticket_Order set A10=1 where OrderId='" + order.OrderId + "'";

                    PbProject.Logic.SQLEXBLL.SQLEXBLL_Base ss = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base();
                    ss.ExecuteNonQuerySQLInfo(SQL);

                    //ShowChinapnrMsg("出票请求成功,订单ID:" + order.OrderId);
                    //infoLog.Info("出票请求成功,订单ID:" + order.OrderId);
                    Log(3, "出票请求成功,订单ID:" + order.OrderId);
                    break;
                }
                else
                {
                    string logDbMsg = "";
                    if (string.IsNullOrEmpty(result))
                    {
                        logDbMsg = "出票请求失败。原因:服务器响应超时";
                        string msg = string.Format("出票请求失败。原因:服务器响应超时,订单ID:{0}", order.OrderId);
                        //ShowChinapnrMsg(msg);
                        //infoLog.Info(msg);
                        Log(3, msg);
                    }
                    else
                    {
                        string errorStr = result.Substring(17, result.Length - 17).Trim();
                        if (errorStr.ToLower().IndexOf("airlines") > 0)
                        {
                            logDbMsg = string.Format("出票请求失败。原因:{0},航空公司二字码:{1}", errorStr, order.CarryCode);
                            string msg = string.Format("出票请求失败。原因:{0},航空公司二字码:{1},订单ID:{2}", errorStr, order.CarryCode, order.OrderId);
                            //ShowChinapnrMsg(msg);
                            //infoLog.Info(msg);
                            Log(3, msg);
                        }
                        else
                        {
                            logDbMsg = string.Format("出票请求失败。原因:{0}", errorStr);
                            string msg = string.Format("出票请求失败。原因:{0},订单ID:{1}", errorStr, order.OrderId);
                            //ShowChinapnrMsg(msg);
                            //infoLog.Info(msg);
                            Log(3, msg);
                        }
                    }
                    if (i == times - 1)
                    {
                        string msg = string.Format("已达到最大失败次数,已改为手动出票,订单ID:{0}", order.OrderId);
                        ChinapnrAutofailed(order, msg, Pm, Log);
                        //FailedLogToDb(order, logDbMsg + ",已改为手动出票");
                        OrderLog(order.OrderId, logDbMsg + ",已改为手动出票", Pm, "2");
                    }
                }
                Thread.Sleep(3000);
            }
        }