Exemplo n.º 1
0
        //取消订单
        public override void Delete(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            var u = AuthLogin.GetUserInfo(Username);

            var orderID            = parames["orderid"];
            var pnr                = parames["pnr"];
            Tb_Ticket_OrderBLL bll = new Tb_Ticket_OrderBLL();
            var order              = bll.GetTicketOrderByOrderId(orderID);

            if (order.PNR != pnr)
            {
                writer.WriteEx(541, "this Pnr is not match with order", "PNR编码与订单号不匹配");
            }
            else
            {
                string msg = string.Format(" 取消订单  订单号:{0}", orderID);

                if (bll.CancelOrder(order, u.User, u.Company, msg))
                {
                    writer.Write("取消成功");
                }
                else
                {
                    writer.WriteEx(541, "Cancel order operation failure", "取消订单操作失败");
                }
            }
        }
Exemplo n.º 2
0
        //查询实时政策 http://ip/api/policy?orderId=...
        public override void Query(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            UserLoginInfo user = AuthLogin.GetUserInfo(Username);

            PbProject.Logic.ControlBase.BaseDataManage baseDataManage = new PbProject.Logic.ControlBase.BaseDataManage();
            string orderId = parames["orderId"];
            List <Tb_Ticket_Order> reList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { string.Format("orderID='{0}'", orderId) }) as List <Tb_Ticket_Order>;

            if (reList == null && reList.Count == 0)
            {
                writer.WriteEx(541, "Can't Found Order by OrderID", "通过OrderID找不到订单信息");
            }
            else
            {
                Tb_Ticket_Order order = reList[0];
                PolicyMatch     pm    = new PolicyMatch();
                Regex           reg   = new Regex(@"(\w{3})-(\w{3})(/\2-(\w{3}))?");
                if (reg.IsMatch(order.TravelCode))
                {
                    var ma    = reg.Match(order.TravelCode);
                    var fcity = ma.Groups[1].Value;
                    var mcity = ma.Groups[3].Success ? ma.Groups[2].Value : "";
                    var tcity = ma.Groups[3].Success ? ma.Groups[4].Value : ma.Groups[2].Value;

                    OrderInputParam    InputParam = new OrderInputParam();
                    string             ErrMsg     = "";
                    Tb_Ticket_OrderBLL orderBLL   = new Tb_Ticket_OrderBLL();
                    InputParam = orderBLL.GetOrder(orderId, InputParam, out ErrMsg);
                    PbProject.Logic.Buy.AirQurey airqurey = new PbProject.Logic.Buy.AirQurey(user.BaseParametersList, user.User, user.Company);
                    var catchID = airqurey.SkyListSaveCache(InputParam, "0");//PNR导入不能确定舱位是否是特价舱位,暂时默认写死为普通 YYY 2013-05-22
                    var swList  = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { string.Format("orderID='{0}'", orderId) }) as List <Tb_Ticket_SkyWay>;

                    if (swList == null && swList.Count == 0)
                    {
                        writer.WriteEx(541, "Can't Found Ticket_SkyWay by OrderID", "通过OrderID找不到航程信息");
                    }
                    swList = swList.OrderBy(p => p.FromDate).ToList();


                    var policy = pm.getMatchingPolicy(user.Company.UninCode, fcity, mcity, tcity, swList[0].FromDate.ToString(), swList.Count > 1 ? swList[1].FromDate.ToString() : swList[0].ToDate.ToString(), order.TravelType.ToString(), catchID, false, user.Company.GroupId, orderId, user.User, order.IsChdFlag, order.HaveBabyFlag, false);

                    var lst = dataSetToList(policy, true);



                    writer.Write(lst);
                }
                else
                {
                    writer.WriteEx(541, "Error:TravelCode's format have error", "航班Code格式错误");
                }
            }
        }
Exemplo n.º 3
0
        //支付订单
        public override void Update(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            var u = AuthLogin.GetUserInfo(Username);

            var orderID            = parames["orderid"];
            var pnr                = parames["pnr"];
            Tb_Ticket_OrderBLL bll = new Tb_Ticket_OrderBLL();
            var order              = bll.GetTicketOrderByOrderId(orderID);

            if (order.PNR != pnr)
            {
                writer.WriteEx(541, "this Pnr is not match with order", "PNR编码与订单号不匹配");
            }
            else if (string.IsNullOrEmpty(order.CPCpyNo))
            {
                writer.WriteEx(541, "this Order is not match with policy", "订单未匹配政策,请先确认订单");
            }
            else
            {
                if (order.PayWay != 14)
                {
                    order.PayWay = 14;

                    var result = new PbProject.Logic.Pay.Bill().UpdateOrderAndTicketPayDetail(order);
                    if (!result)
                    {
                        writer.WriteEx(542, "cutover pay method failure", "切换支付方式时失败");
                    }
                }
                PbProject.Logic.Pay.VirtualPay virtualPay = new PbProject.Logic.Pay.VirtualPay();
                string msgShow = "";
                if (virtualPay.DepositPay(order, u.User, out msgShow))
                {
                    writer.Write("支付成功");
                }
                else
                {
                    if (string.IsNullOrEmpty(msgShow))
                    {
                        msgShow = "支付失败";
                    }
                    writer.WriteEx(541, "Pay failure", msgShow);
                }
            }
        }
Exemplo n.º 4
0
        public override void Query(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            UserLoginInfo  userInfo       = AuthLogin.GetUserInfo(Username);
            AirQueryCommon airQueryCommon = new AirQueryCommon();

            try
            {
                #region 参数赋值

                string startCity            = CommonMethod.GetFomartString(parames["startCity"]);
                string midCity              = CommonMethod.GetFomartString(parames["midCity"]);
                string endCity              = CommonMethod.GetFomartString(parames["endCity"]);
                string startDate            = CommonMethod.GetFomartDate(CommonMethod.GetFomartString(parames["startDate"]));
                string midDate              = CommonMethod.GetFomartDate(CommonMethod.GetFomartString(parames["midDate"]));
                string cairry               = CommonMethod.GetFomartString(parames["cairry"]);
                bool   isQueryShareFlight   = CommonMethod.GetFomartString(parames["isQueryShareFlight"]).Equals("1") ? true : false;
                bool   isQuerySpecialFlight = CommonMethod.GetFomartString(parames["isQuerySpecialFlight"]).Equals("1") ? true : false;

                #endregion

                //获取航班JSon
                AirInfoCollectionList list = airQueryCommon.GetAirQueryJSon(
                    userInfo,
                    startCity,
                    midCity,
                    endCity,
                    startDate,
                    midDate,
                    AirTravelType.ConnWay,
                    cairry,
                    isQueryShareFlight,
                    isQuerySpecialFlight
                    );
                writer.Write(list);
            }
            catch (Exception ex)
            {
                writer.WriteEx(547, "params type err", ex.Message);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 退废改签
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parames"></param>
        public override void Update(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            UserLoginInfo userInfo = AuthLogin.GetUserInfo(Username);

            KongZhiXiTong = BaseParams.getParams(userInfo.SupParameters).KongZhiXiTong;

            PbProject.Logic.Order.Tb_Ticket_OrderBLL orderBll = new PbProject.Logic.Order.Tb_Ticket_OrderBLL();
            string sqlWhere = " OrderID='" + CommonMethod.GetFomartString(parames["OrderID"]) + "' ";

            List <Tb_Ticket_Order> OrderList = baseDataManage.CallMethod("Tb_Ticket_Order", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Order>;
            Tb_Ticket_Order        Order     = OrderList != null && OrderList.Count > 0 ? OrderList[0] : null;

            if (Order == null)
            {
                writer.WriteEx(546, "order num err", "订单编号错误");
            }
            else
            {
                sqlWhere = " OrderId='" + Order.OrderId + "' ";
                List <Tb_Ticket_Passenger> PassengerList = baseDataManage.CallMethod("Tb_Ticket_Passenger", "GetList", null, new Object[] { sqlWhere }) as List <Tb_Ticket_Passenger>;
                List <Tb_Ticket_SkyWay>    NewSkyWayList = baseDataManage.CallMethod("Tb_Ticket_SkyWay", "GetList", null, new Object[] { sqlWhere + " order by FromDate " }) as List <Tb_Ticket_SkyWay>;
                //提示信息
                string msg = "";

                try
                {
                    //申请类型3退票申请 4废票申请 5改签申请
                    string ApplayType = CommonMethod.GetFomartString(parames["ApplayType"]);
                    //扩展参数
                    ParamEx pe = new ParamEx();
                    pe.UsePIDChannel = this.KongZhiXiTong != null && this.KongZhiXiTong.Contains("|48|") ? 2 : 0;
                    //发送指令管理类
                    SendInsManage SendIns = new SendInsManage(userInfo.User.LoginName, userInfo.Company.UninCode, pe, userInfo.Configparam);
                    //订单日志
                    StringBuilder orderLog = new StringBuilder();

                    #region

                    //选择的乘客信息
                    List <HashObject> pasList = GetPassengerInfo(Order, PassengerList, CommonMethod.GetFomartString(parames["pasList"]));
                    //选中的 成人 儿童 婴儿
                    int AdultCount = 0, CHDCount = 0, INFCount = 0;
                    //没选中的 成人 儿童 婴儿
                    int NoSelAdultCount = 0, NoSelCHDCount = 0, NoSelINFCount = 0;
                    //选择的乘机人
                    List <HashObject> selList = new List <HashObject>();
                    foreach (HashObject param in pasList)
                    {
                        if (param["pasIsBack"].ToString() == "0") //获取没有提交的用户
                        {
                            //选择的乘客数
                            if (param["IsChecked"].ToString() == "1")
                            {
                                if (param["pasPType"].ToString() == "1")
                                {
                                    AdultCount++;
                                }
                                else if (param["pasPType"].ToString() == "2")
                                {
                                    CHDCount++;
                                }
                                else if (param["pasPType"].ToString() == "3")
                                {
                                    INFCount++;
                                }
                                selList.Add(param);
                            }
                            else
                            {
                                if (param["pasPType"].ToString() == "1")
                                {
                                    NoSelAdultCount++;
                                }
                                else if (param["pasPType"].ToString() == "2")
                                {
                                    NoSelCHDCount++;
                                }
                                else if (param["pasPType"].ToString() == "3")
                                {
                                    NoSelINFCount++;
                                }
                            }
                        }
                    }

                    #endregion

                    //航段信息
                    List <HashObject> skyList = GetSkyInfo(Order, NewSkyWayList, CommonMethod.GetFomartString(parames["skywayList"]));

                    #region
                    if (ApplayType != "5")//退废票
                    {
                        //行程单状态判断
                        if (!KongZhiXiTong.Contains("|68|"))
                        {
                            if (string.IsNullOrEmpty(msg))
                            {
                                //行程单状态判断
                                if (!TripIsVoid(userInfo, pasList, SendIns, out msg))
                                {
                                    msg = (string.IsNullOrEmpty(msg)) ? "不能提交,行程单状态异常!" : msg;
                                }
                            }
                        }
                        if (string.IsNullOrEmpty(msg))
                        {
                            //票号状态判断
                            if (!KongZhiXiTong.Contains("|69|"))
                            {
                                if (string.IsNullOrEmpty(msg))
                                {
                                    //票号状态判断
                                    if (!PassengerTicketIsOpen(pasList, skyList, SendIns, out msg))
                                    {
                                        msg = (string.IsNullOrEmpty(msg)) ? "不能提交,票号状态异常!" : msg;
                                    }
                                }
                            }
                        }
                        if (string.IsNullOrEmpty(msg))
                        {
                            //废票 飞机起飞两个半小时内不能提交废票操作,只能走退票通道
                            if (ApplayType == "4" && skyList.Count > 0)
                            {
                                //是否可以提交废票 1可以 0不可以
                                HashObject strArr = skyList[0] as HashObject;

                                if (strArr.Count == 11 && strArr["IsFP"].ToString() == "0")
                                {
                                    if (KongZhiXiTong != null && !KongZhiXiTong.Contains("|16|"))
                                    {
                                        msg = "飞机起飞两个半小时内不能提交废票操作,只能走退票通道";
                                    }
                                }
                            }
                        }
                    }

                    #endregion

                    if (string.IsNullOrEmpty(msg))
                    {
                        msg = TimeIsCommit(ApplayType, Order);
                    }

                    if (string.IsNullOrEmpty(msg))
                    {
                        //含有没有提交的婴儿并且没有成人时 不可以提交
                        if (NoSelINFCount > 0 && NoSelAdultCount == 0)
                        {
                            msg = "婴儿订单必须有成人陪同!";
                            orderLog.Append("成人带婴儿订单,需要手动处理编码!");
                        }
                    }

                    if (string.IsNullOrEmpty(msg))
                    {
                        string divMsg = "";
                        if (Order.OrderSourceType == 1)//白屏预订
                        {
                            //退费票且没有婴儿
                            if (ApplayType != "5" && (AdultCount > 0 || CHDCount > 0))
                            {
                                //开启退废票(分离、取消)编码
                                if (KongZhiXiTong.Contains("|32|"))
                                {
                                    ////退废处理 判断 分离编码 和 取消编码
                                    divMsg = PnrHandle(Order, SendIns, orderLog, selList, INFCount);
                                }
                            }
                        }
                        if (divMsg != "" && INFCount == 0)
                        {
                        }
                        else
                        {
                            //处理退改签
                            msg = TGQ(userInfo, Order, NewSkyWayList, skyList, PassengerList, pasList,
                                      CommonMethod.GetFomartString(parames["remark"]),
                                      CommonMethod.GetFomartString(parames["quitReasonType"]),
                                      CommonMethod.GetFomartString(parames["reason"]));
                        }
                    }
                    else
                    {
                    }
                }
                catch (Exception)
                {
                }
                finally
                {
                    //解锁
                    orderBll.LockOrder(false, Order.id.ToString(), userInfo.User, userInfo.Company);
                    writer.Write(msg);
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 确认订单
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parames"></param>
        public override void Create(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            var    userLogin       = AuthLogin.GetUserInfo(Username);
            string adultOrderId    = parames["adultOrderId"];
            string childOrderId    = parames["childOrderId"];
            string adultPolicyGuid = parames["adultPolicyGuid"]; //成人政策guid
            string childPolicyGuid = parames["childPolicyGuid"]; //婴儿政策guid
            string remark          = parames["remark"];



            var                adultPolicy = PolicyCacheManager.Get(adultPolicyGuid) as PolicyParamForAPI;
            var                childPolicy = PolicyCacheManager.Get(childPolicyGuid) as PolicyParamForAPI;
            OrderInputParam    InputParam  = createOrderInputParam(adultOrderId, childOrderId);
            Tb_Ticket_OrderBLL orderBLL    = new Tb_Ticket_OrderBLL();

            if (adultPolicy == null)
            {
                writer.WriteEx(554, "Cache is disabled", "政策缓存已失效,请重新操作");
            }
            else
            {
                #region 更新订单 主要修改价格,政策和添加订单账单明细
                Bill bill = new Bill();

                Data d = new Data(userLogin.Company.UninCode);//采购佣金进舍规则: 0.舍去佣金保留到元、1.舍去佣金保留到角、2.舍去佣金保留到分

                string ErrMsg = "";
                bool   IsSuc  = false;
                //扩展参数
                ParamEx pe = new ParamEx();
                pe.UsePIDChannel = userLogin.FQP.KongZhiXiTong != null && userLogin.FQP.KongZhiXiTong.Contains("|48|") ? 2 : 0;
                //发送指令管理类
                SendInsManage SendIns = new SendInsManage(userLogin.User.LoginName, userLogin.Company.UninCode, pe, userLogin.Configparam);
                //提示
                StringBuilder sbTip = new StringBuilder();
                try
                {
                    AjaxPolicyMatchOutData APM = new AjaxPolicyMatchOutData();
                    APM.OutPutPolicyList.Add(adultPolicy);
                    APM.OutPutPolicyList.Add(childPolicy);
                    //供应商Office
                    string GYOffice = userLogin.Configparam != null?userLogin.Configparam.Office.ToUpper() : "";

                    if (InputParam != null && APM != null && APM.OutPutPolicyList != null && APM.OutPutPolicyList.Count > 0)
                    {
                        AjAxPolicyParam AdultPolicy = adultPolicy;
                        AjAxPolicyParam ChildPolicy = childPolicy;

                        //至少选择一条政策 成人或者儿童
                        if (AdultPolicy == null && ChildPolicy == null)
                        {
                            writer.WriteEx(567, "choose one policy at least", "请选择一条政策数据");
                        }

                        else
                        {
                            PatInfo INFPrice = null;

                            if (HasBaby(InputParam))
                            {
                                //婴儿价格
                                INFPrice = GetINFPAT();
                            }
                            //订单实体需要更改数据的字段名
                            List <string> UpdateOrderFileds = new List <string>();
                            //订单修改字段
                            UpdateOrderFileds.AddRange(new string[] { "OldRerurnMoney", "OldPolicyPoint", "OutOrderPayMoney", "A7", "A13", "A1", "A11", "PrintOffice", "CPCpyNo", "YDRemark", "PolicyId", "AirPoint", "PolicyPoint", "ReturnPoint", "PolicyMoney", "PolicyCancelTime", "PolicyReturnTime",
                                                                      "DiscountDetail", "PolicyType", "PolicySource", "AutoPrintFlag", "PolicyRemark", "PMFee", "ABFee", "FuelFee", "BabyFee", "PayMoney", "OrderMoney" });
                            //航段实体需要更改数据的字段名
                            List <string> UpdateSkyWayFileds = new List <string>();
                            //航段修改字段
                            UpdateSkyWayFileds.AddRange(new string[] { "SpacePrice", "ABFee", "FuelFee", "Discount" });
                            //乘客实体需要更改数据的字段名
                            List <string> UpdatePasFileds = new List <string>();
                            //修改乘机人
                            UpdatePasFileds.AddRange(new string[] { "PMFee", "ABFee", "FuelFee" });
                            //承运人二字码
                            string CarrayCode = string.Empty;
                            string orderIDs   = "";
                            //婴儿与编码中的婴儿个数是否不一致 true不一致 false一致
                            bool IsINFCheck = false;
                            //婴儿与编码中的婴儿个数是否不一致提示
                            string INFCountCheckMsg = "<b class=\"red\">编码中婴儿个数与预订婴儿个数不一致,请手动补全编码中婴儿!</b>";
                            //Bill返回有无SQL
                            bool IsBillOK = false;

                            //修改实体相关的值后更新即可
                            for (int i = 0; i < InputParam.OrderParamModel.Count; i++)
                            {
                                OrderMustParamModel item = InputParam.OrderParamModel[i];
                                //承运人二字码
                                CarrayCode = item.Order.CarryCode.Split('/')[0].ToUpper().Trim();

                                if (orderIDs.Contains(item.Order.OrderId))
                                {
                                    continue;
                                }
                                else
                                {
                                    orderIDs += item.Order.OrderId + "|";
                                }

                                #region 设置需要更改数据的字段名集合
                                item.UpdateOrderFileds     = UpdateOrderFileds;
                                item.UpdateSkyWayFileds    = UpdateSkyWayFileds;
                                item.UpdatePassengerFileds = UpdatePasFileds;
                                #endregion

                                #region 实体处理
                                //订单中的总价
                                decimal TotalPMPrice = 0m, TotalABFare = 0, TotalRQFare = 0m;


                                //item.Order.YDRemark = remark;

                                //预订备注信息
                                item.Order.YDRemark = remark;

                                //订单处理 成人订单政策
                                if (!item.Order.IsChdFlag && AdultPolicy != null)
                                {
                                    #region 成人或者婴儿实体价格赋值

                                    //检测白屏预订婴儿个数与编码中的婴儿个数
                                    if (item.Order.OrderSourceType == 1 || item.Order.OrderSourceType == 5)
                                    {
                                        IsINFCheck = yudingINFCheck(InputParam.PnrInfo, item.PasList);
                                    }

                                    //婴儿价格
                                    decimal INFPMFee = 0m, INFABFare = 0m, INFRQFare = 0m;
                                    if (INFPrice != null)
                                    {
                                        decimal.TryParse(INFPrice.Fare, out INFPMFee);
                                        decimal.TryParse(INFPrice.TAX, out INFABFare);
                                        decimal.TryParse(INFPrice.RQFare, out INFRQFare);
                                    }
                                    //成人价格
                                    decimal PMFee = AdultPolicy.SeatPrice, ABFare = AdultPolicy.ABFare, RQFare = AdultPolicy.RQFare;

                                    #region 特价缓存处理
                                    //特价时特价缓存处理  为特价且PAT内容不为空
                                    if (AdultPolicy.PolicyKind == 2 && item.SkyList[0].Pat.Trim() != "")
                                    {
                                        //白屏和PNR导入
                                        if (item.Order.OrderSourceType == 1 || item.Order.OrderSourceType == 2 || item.Order.OrderSourceType == 6 || item.Order.OrderSourceType == 10)
                                        {
                                            //特价缓存
                                            SpecialCabinPriceInfoBLL SpBll     = new SpecialCabinPriceInfoBLL();
                                            PnrAnalysis.FormatPNR    pnrformat = new PnrAnalysis.FormatPNR();
                                            string errMsg            = "";
                                            PnrAnalysis.PatModel Pat = pnrformat.GetPATInfo(item.SkyList[0].Pat.Trim(), out errMsg);
                                            if (Pat.UninuePatList.Count > 0)
                                            {
                                                decimal m_Fare   = 0m;
                                                decimal m_TAX    = 0m;
                                                decimal m_RQFare = 0m;
                                                decimal.TryParse(Pat.UninuePatList[0].Fare, out m_Fare);
                                                decimal.TryParse(Pat.UninuePatList[0].TAX, out m_TAX);
                                                decimal.TryParse(Pat.UninuePatList[0].RQFare, out m_RQFare);
                                                //价格不相等
                                                if (m_Fare != PMFee)
                                                {
                                                    //存入缓存
                                                    SpBll.SaveSpPrice(item.SkyList[0].CarryCode.ToUpper(), item.SkyList[0].FlightCode, item.SkyList[0].FromDate, item.SkyList[0].FromCityCode, item.SkyList[0].ToCityCode, item.SkyList[0].Space, m_Fare, m_TAX, m_RQFare);
                                                }
                                            }
                                        }
                                    }
                                    #endregion


                                    //乘机人实体处理
                                    for (int j = 0; j < item.PasList.Count; j++)
                                    {
                                        if (item.PasList[j].PassengerType == 1)
                                        {
                                            //成人
                                            item.PasList[j].PMFee   = PMFee;
                                            item.PasList[j].ABFee   = ABFare;
                                            item.PasList[j].FuelFee = RQFare;
                                        }
                                        else
                                        {
                                            //婴儿
                                            if (item.PasList[j].PassengerType == 3 && INFPrice != null)
                                            {
                                                item.PasList[j].PMFee   = INFPMFee;
                                                item.PasList[j].ABFee   = INFABFare;
                                                item.PasList[j].FuelFee = INFRQFare;
                                            }
                                        }
                                        if (item.PasList[j].PassengerType == 1 || item.PasList[j].PassengerType == 3)
                                        {
                                            //订单价格
                                            TotalPMPrice += item.PasList[j].PMFee;
                                            TotalABFare  += item.PasList[j].ABFee;
                                            TotalRQFare  += item.PasList[j].FuelFee;
                                        }
                                    }
                                    //航段实体处理
                                    //string Discount = "0";
                                    for (int k = 0; k < item.SkyList.Count; k++)
                                    {
                                        item.SkyList[k].ABFee   = ABFare;
                                        item.SkyList[k].FuelFee = RQFare;
                                        //只是单程才重新赋值
                                        if (item.SkyList.Count == 1)
                                        {
                                            item.SkyList[k].SpacePrice = PMFee;
                                        }
                                        //item.SkyList[k].Discount = AdultPolicy.DiscountRate.ToString();
                                        //if (Discount.Length > 10)
                                        //{
                                        //    Discount = Discount.Substring(0, 10);
                                        //}
                                        //item.SkyList[k].Discount = Discount;
                                    }
                                    //成人订单(含有婴儿) 赋值
                                    item.Order.PMFee   = TotalPMPrice;
                                    item.Order.ABFee   = TotalABFare;
                                    item.Order.FuelFee = TotalRQFare;
                                    if (INFPrice != null)
                                    {
                                        //婴儿票面价
                                        item.Order.BabyFee = INFPMFee;
                                    }
                                    item.Order.PolicyId         = AdultPolicy.PolicyId;
                                    item.Order.PolicyPoint      = AdultPolicy.PolicyPoint;
                                    item.Order.ReturnMoney      = AdultPolicy.PolicyReturnMoney;
                                    item.Order.AirPoint         = AdultPolicy.AirPoint;
                                    item.Order.ReturnPoint      = AdultPolicy.ReturnPoint;
                                    item.Order.LaterPoint       = AdultPolicy.LaterPoint;
                                    item.Order.PolicyMoney      = AdultPolicy.PolicyYongJin;
                                    item.Order.DiscountDetail   = AdultPolicy.DiscountDetail;
                                    item.Order.PolicyType       = int.Parse(AdultPolicy.PolicyType);
                                    item.Order.PolicySource     = int.Parse(AdultPolicy.PolicySource);
                                    item.Order.AutoPrintFlag    = int.Parse(AdultPolicy.AutoPrintFlag);
                                    item.Order.PolicyCancelTime = AdultPolicy.FPGQTime;
                                    item.Order.PolicyReturnTime = AdultPolicy.PolicyReturnTime;
                                    //出票公司编号
                                    string CPCpyNo = string.IsNullOrEmpty(AdultPolicy.CPCpyNo) ? userLogin.mSupCompany.UninCode : AdultPolicy.CPCpyNo;
                                    item.Order.CPCpyNo = CPCpyNo.Length > 12 ? CPCpyNo.Substring(0, 12) : CPCpyNo;

                                    item.Order.PolicyRemark = AdultPolicy.PolicyRemark;//政策备注
                                    //原始政策返点
                                    item.Order.OldPolicyPoint = AdultPolicy.OldPolicyPoint;
                                    //原始政策现返
                                    item.Order.OldReturnMoney = AdultPolicy.OldPolicyReturnMoney;

                                    item.Order.A1  = 1;                      //已确认
                                    item.Order.A2  = AdultPolicy.PolicyKind; //政策种类
                                    item.Order.A7  = AdultPolicy.AirPoint;   //航空公司返点
                                    item.Order.A11 = AdultPolicy.PatchPonit; //补点


                                    ////计算订单金额
                                    //item.Order.PayMoney = d.CreateOrderPayMoney(item.Order, item.PasList);
                                    ////出票方收款金额
                                    //item.Order.OrderMoney = d.CreateOrderOrderMoney(item.Order, item.PasList);

                                    bill.CreateOrderAndTicketPayDetailNew(item.Order, item.PasList);


                                    //出票Office
                                    if (AdultPolicy.PolicyOffice != "")
                                    {
                                        item.Order.PrintOffice = AdultPolicy.PolicyOffice;
                                    }
                                    if ((item.Order.OrderSourceType == 1 || item.Order.OrderSourceType == 2))
                                    {
                                        //自动授权Office
                                        if (AdultPolicy.PolicyOffice.Trim().Length == 6 && !GYOffice.Contains(AdultPolicy.PolicyOffice.Trim().ToUpper()))
                                        {
                                            SendIns.AuthToOffice(item.Order.PNR, AdultPolicy.PolicyOffice, item.Order.Office, out ErrMsg);
                                        }
                                        //备注HU的A舱要添加一个指令才能入库,OSI HU CKIN SSAC/S1
                                        if (AdultPolicy.PolicySource == "1" && AdultPolicy.PolicyType == "1" && AdultPolicy.AutoPrintFlag == "2" && item.Order.PNR.Trim().Length == 6 && item.Order.CarryCode.ToUpper().Trim() == "HU" && item.Order.Space.ToUpper().Trim() == "A")
                                        {
                                            string Office = item.Order.Office, Cmd = string.Format("RT{0}|OSI HU CKIN SSAC/S1^\\", item.Order.PNR.Trim());
                                            SendIns.Send(Cmd, ref Office, 10);
                                        }
                                    }
                                    if (item.Order.PolicySource <= 2)
                                    {
                                        //本地政策提示
                                        sbTip.Append("</br><ul><li>1.请于一小时内支付此订单,未支付将自动取消</li><li>2.编码内容中必须存在证件内容一项</li><li>3.PNR需要包含证件号</li><li>" + (IsINFCheck ? "4." + INFCountCheckMsg : "") + "</li></ul>");
                                    }
                                    else
                                    {
                                        //接口和共享政策提示
                                        if (AdultPolicy.PolicyOffice.Trim().Length == 6)
                                        {
                                            sbTip.Append("</br><ul><li>1.编码内容中必须存在证件内容一项</li><li>2.PNR需要包含证件号</li><li>3.请授权,授权指令:RMK TJ AUTH " + AdultPolicy.PolicyOffice + "</li>" + (IsINFCheck ? "4." + INFCountCheckMsg : "") + "</ul>");
                                        }
                                        else
                                        {
                                            sbTip.Append("<ul ><li>1.编码内容中必须存在证件内容一项!</li><li>2.PNR需要包含证件号!</li>" + (IsINFCheck ? "3." + INFCountCheckMsg : "") + "</ul>");
                                        }
                                    }

                                    #endregion
                                }
                                else
                                {
                                    if (ChildPolicy != null)
                                    {
                                        #region 儿童实体赋值
                                        //儿童订单政策

                                        //儿童价格
                                        decimal PMFee = ChildPolicy.SeatPrice, ABFare = ChildPolicy.ABFare, RQFare = ChildPolicy.RQFare;
                                        //乘机人实体处理
                                        for (int j = 0; j < item.PasList.Count; j++)
                                        {
                                            if (item.PasList[j].PassengerType == 2)
                                            {
                                                //儿童
                                                item.PasList[j].PMFee   = PMFee;
                                                item.PasList[j].ABFee   = ABFare;
                                                item.PasList[j].FuelFee = RQFare;
                                                //订单价格
                                                TotalPMPrice += item.PasList[j].PMFee;
                                                TotalABFare  += item.PasList[j].ABFee;
                                                TotalRQFare  += item.PasList[j].FuelFee;
                                            }
                                        }
                                        //航段实体处理
                                        //string Discount = "0";
                                        for (int k = 0; k < item.SkyList.Count; k++)
                                        {
                                            item.SkyList[k].ABFee   = ABFare;
                                            item.SkyList[k].FuelFee = RQFare;
                                            //只是单程才重新赋值
                                            if (item.SkyList.Count == 1)
                                            {
                                                item.SkyList[k].SpacePrice = PMFee;
                                            }
                                            //Discount = ChildPolicy.DiscountRate.ToString();
                                            //if (Discount.Length > 10)
                                            //{
                                            //    Discount = Discount.Substring(0, 10);
                                            //}
                                            //item.SkyList[k].Discount = Discount;
                                        }
                                        //儿童订单赋值
                                        item.Order.PMFee   = TotalPMPrice;
                                        item.Order.ABFee   = TotalABFare;
                                        item.Order.FuelFee = TotalRQFare;
                                        //出票公司编号
                                        string CPCpyNo = string.IsNullOrEmpty(ChildPolicy.CPCpyNo) ? userLogin.mSupCompany.UninCode : ChildPolicy.CPCpyNo;
                                        item.Order.CPCpyNo          = CPCpyNo.Length > 12 ? CPCpyNo.Substring(0, 12) : CPCpyNo;
                                        item.Order.PolicyId         = ChildPolicy.PolicyId;
                                        item.Order.AirPoint         = ChildPolicy.AirPoint;
                                        item.Order.PolicyPoint      = ChildPolicy.PolicyPoint;
                                        item.Order.ReturnPoint      = ChildPolicy.ReturnPoint;
                                        item.Order.LaterPoint       = ChildPolicy.LaterPoint;
                                        item.Order.ReturnMoney      = ChildPolicy.PolicyReturnMoney;
                                        item.Order.PolicyMoney      = ChildPolicy.PolicyYongJin;
                                        item.Order.DiscountDetail   = ChildPolicy.DiscountDetail;
                                        item.Order.PolicyType       = int.Parse(ChildPolicy.PolicyType);
                                        item.Order.PolicySource     = int.Parse(ChildPolicy.PolicySource);
                                        item.Order.AutoPrintFlag    = int.Parse(ChildPolicy.AutoPrintFlag);
                                        item.Order.PolicyCancelTime = ChildPolicy.FPGQTime;
                                        item.Order.PolicyReturnTime = ChildPolicy.PolicyReturnTime;
                                        item.Order.PolicyRemark     = ChildPolicy.PolicyRemark;//政策备注
                                        //原始政策返点
                                        item.Order.OldPolicyPoint = ChildPolicy.OldPolicyPoint;
                                        //原始政策现返
                                        item.Order.OldReturnMoney = ChildPolicy.OldPolicyReturnMoney;

                                        item.Order.A1 = 1;                    //已确认
                                        item.Order.A7 = ChildPolicy.AirPoint; //航空公司返点
                                        //政策种类
                                        item.Order.A2 = ChildPolicy.PolicyKind;

                                        ////计算订单金额;
                                        //item.Order.PayMoney = d.CreateOrderPayMoney(item.Order, item.PasList);
                                        ////出票方收款金额
                                        //item.Order.OrderMoney = d.CreateOrderOrderMoney(item.Order, item.PasList);

                                        bill.CreateOrderAndTicketPayDetailNew(item.Order, item.PasList);

                                        //出票Office
                                        if (ChildPolicy.PolicyOffice != "")
                                        {
                                            item.Order.PrintOffice = ChildPolicy.PolicyOffice;
                                        }
                                        //---------------------------------------

                                        #endregion
                                    }
                                }

                                //代付返点,金额
                                if (item.Order.PolicySource > 2)
                                {
                                    // 接口 取原始政策
                                    item.Order.A7 = item.Order.OldPolicyPoint;
                                    item.Order.OutOrderPayMoney = d.CreateOrderIntfacePrice(item.Order, item.PasList);
                                }
                                else
                                {
                                    //本地 取航空公司政策
                                    decimal tempOldPolicyPoint = item.Order.OldPolicyPoint;

                                    item.Order.OldPolicyPoint   = item.Order.A7;
                                    item.Order.OutOrderPayMoney = d.CreateOrderIntfacePrice(item.Order, item.PasList);
                                    item.Order.OldPolicyPoint   = tempOldPolicyPoint;
                                }

                                item.Order.A13 = d.CreateOrderIntfacePrice(item.Order, item.PasList);// 后返金额

                                #endregion

                                #region 添加订单账单明细sql
                                List <string> sqlList = bill.CreateOrderAndTicketPayDetailNew(item.Order, item.PasList);
                                if (sqlList != null && sqlList.Count > 0)
                                {
                                    IsBillOK = true;
                                    InputParam.ExecSQLList.AddRange(sqlList.ToArray());
                                }
                                #endregion
                            }//For结束
                            //订单金额是否有误
                            bool IsOrderPayZero = false;
                            foreach (OrderMustParamModel item in InputParam.OrderParamModel)
                            {
                                //判断金额是否正确
                                if (item.Order.PayMoney <= 0 || ((item.Order.PayMoney + item.Order.PayMoney * 0.003M) < item.Order.OrderMoney))
                                {
                                    IsOrderPayZero = true;
                                    PbProject.WebCommon.Log.Log.RecordLog("OrderServices", "PayMoneyError|" + ErrMsg + "订单:PayMoney=" + item.Order.PayMoney + " OrderMoney=" + item.Order.OrderMoney + "SQL:" + string.Join("\r\n  ", InputParam.ExecSQLList.ToArray()), true, HttpContext.Current.Request);
                                    //  DataBase.LogCommon.Log.Error("OrderServices", new Exception(ErrMsg + "订单:PayMoney=" + item.Order.PayMoney + " OrderMoney=" + item.Order.OrderMoney + "SQL:" + string.Join("\r\n  ", InputParam.ExecSQLList.ToArray())));
                                    break;
                                }
                            }
                            #region 验证和修改订单
                            if (!IsBillOK)
                            {
                                ErrMsg = "订单生成失败!!";
                                PbProject.WebCommon.Log.Log.RecordLog("OrderServices", "时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\t" + ErrMsg + "SQL:" + string.Join("\r\n  ", InputParam.ExecSQLList.ToArray()), true, HttpContext.Current.Request);
                            }
                            else
                            {
                                if (!IsOrderPayZero)
                                {
                                    //修改订单有关实体信息
                                    IsSuc = orderBLL.UpdateOrder(ref InputParam, out ErrMsg);
                                    if (IsSuc)
                                    {
                                        ErrMsg = "订单生成成功!" + sbTip.ToString();
                                    }
                                    else
                                    {
                                        PbProject.WebCommon.Log.Log.RecordLog("OrderServices", "时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\t" + ErrMsg + "SQL:" + string.Join("\r\n  ", InputParam.ExecSQLList.ToArray()), true, HttpContext.Current.Request);
                                        ErrMsg = "订单生成失败!";
                                    }
                                }
                                else
                                {
                                    PbProject.WebCommon.Log.Log.RecordLog("OrderServices", "时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\t" + ErrMsg + "SQL:" + string.Join("\r\n  ", InputParam.ExecSQLList.ToArray()), true, HttpContext.Current.Request);
                                    ErrMsg = "订单金额错误,生成订单失败!";
                                }
                            }
                            #endregion
                        }
                    }
                    else
                    {
                        ErrMsg = "未获取到政策数据,生成订单失败!";
                    }
                }
                catch (Exception ex)
                {
                    PbProject.WebCommon.Log.Log.RecordLog("OrderServices", "时间:" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\t" + ErrMsg, true, HttpContext.Current.Request);
                    ErrMsg = "订单生成异常," + ex.Message;
                    DataBase.LogCommon.Log.Error("OrderServices" + userLogin.User.id.ToString(), ex);
                }
                finally
                {
                    if (IsSuc)
                    {
                        writer.Write("ok");
                    }
                    else
                    {
                        writer.WriteEx(567, "confirm Order Error", ErrMsg);
                    }
                }
                #endregion
            }
        }
Exemplo n.º 7
0
        public override void Query(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            userInfo = AuthLogin.GetUserInfo(Username);

            AirQueryCommon airQuery = new AirQueryCommon();


            string cacheNameGuid = parames["cacheNameGuid"];
            string fullFlightNo  = parames["fullFlightNo"]; //航班号如3U8881
            string cairrGuid     = parames["cairrGuid"];    //航班唯一编号
            string policyGuid    = parames["policyGuid"];   //政策唯一编号

            #region 取基础航班信息
            PbProject.WebCommon.Utility.Cache.CacheByNet pwucc = new PbProject.WebCommon.Utility.Cache.CacheByNet();
            DataSet dsCacheData = pwucc.GetCacheData(cacheNameGuid);
            if (dsCacheData == null)
            {
                writer.WriteEx(541, "cache timeout", "缓存过期");
            }
            var dr = dsCacheData.Tables[fullFlightNo].Select("guid='" + cairrGuid + "'").FirstOrDefault();
            if (dr == null)
            {
                writer.WriteEx(541, "not found filght", "没有找到航班信息");
            }
            string CarrCode      = (string)dr["CarrCode"];      //承运人
            string FlightNo      = (string)dr["FlightNo"];      //航班号
            string StartCityCode = (string)dr["StartCityCode"]; //起飞城市
            string ToCityCode    = (string)dr["ToCityCode"];    //抵达城市
            string StartTime     = (string)dr["StartTime"];     //起飞时间
            string EndTime       = (string)dr["EndTime"];       //抵达时间
            string StartDate     = (string)dr["StartDate"];     //起飞日期
            string Space         = (string)dr["Space"];         //舱位
            string ABFare        = (string)dr["ABFee"];         //机建
            string RQFare        = (string)dr["FuelAdultFee"];  //燃油
            string XSFee         = (string)dr["XSFee"];         //舱位价格

            #endregion
            #region 取政策
            string DownPoint, DownReturnMoney, SpacePrice;
            List <Tb_Ticket_Policy> objList = Manage.CallMethod("Tb_Ticket_Policy", "GetList", null, new object[] { "id='" + policyGuid + "'" }) as List <Tb_Ticket_Policy>;
            if (objList.Count() == 0)
            {
                List <Tb_Ticket_BookPolicy> bList = Manage.CallMethod("Tb_Ticket_BookPolicy", "GetList", null, new object[] { "PolicyId='" + policyGuid + "'" }) as List <Tb_Ticket_BookPolicy>;
                if (bList.Count() == 0)
                {
                    writer.WriteEx(564, "not found policy", "没有找到政策:" + policyGuid);
                    return;
                }
                else
                {
                    var pi = bList[0];
                    DownPoint       = (pi.PReturn * 100).ToString();
                    DownReturnMoney = "0";
                    SpacePrice      = "0";
                }
            }
            else
            {
                var policyInfo = objList[0];
                DownPoint       = policyInfo.DownPoint.ToString();       //政策
                DownReturnMoney = policyInfo.DownReturnMoney.ToString(); //现返
                SpacePrice      = policyInfo.SpacePrice.ToString();      //固定特价
            }
            #endregion
            bool isGuding = false;


            if (airQuery.IsSpecialSpace(userInfo, Space, CarrCode))
            {
                SpecialPrice sp = PlyMatch(userInfo, StartCityCode, ToCityCode, StartTime, EndTime,
                                           StartDate, Space, CarrCode, FlightNo, DownPoint, DownReturnMoney, cairrGuid, SpacePrice,
                                           ABFare, RQFare, isGuding, XSFee);
                if (sp == null)
                {
                    writer.WriteEx(580, "get data error", "未查询到特价");
                }
                else
                {
                    writer.Write(sp);
                }
            }
            else
            {
                writer.WriteEx(570, "not a special space", "该舱位不是特价舱位");
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 创建PNR时 生成一个没有政策的订单信息
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="parames"></param>
        public override void Create(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            List <Tb_Ticket_Passenger> pList      = new List <Tb_Ticket_Passenger>();
            List <Tb_Ticket_SkyWay>    skywaylist = new List <Tb_Ticket_SkyWay>();

            #region 取提交的参数信息

            string adultPnr      = parames["adultPnr"];                         //只是儿童时需要备注的成人编码
            string pListStr      = parames["pList"];                            //乘机人信息 名称,类型,证件ID,儿童生日/名称,类型,证件ID,儿童生日
            string skywaylistStr = parames["skywaylist"];                       //航段信息 承运人,航班号,起飞日期,到达日期,起飞三字码,到达三字码,起飞城市,到达城市,舱位,折扣/航段信息 承运人,航班号,起飞日期,到达日期,起飞三字码,到达三字码,起飞城市,到达城市,舱位,折扣
            allowChangePNRFlag         = parames["allowChangePNRFlag"] == "1";  //是否允许换编码出票
            isAsAdultOrder             = parames["isAsAdultOrder"] == "1";      //是否关联成人订单号
            cHDAssociationAdultOrderId = parames["cHDAssociationAdultOrderId"]; //关联成人定单号
            isCHDToAudltTK             = parames["isCHDToAudltTK"] == "1";      //儿童票出成人票
            linkMan      = parames["linkMan"];                                  //联系人
            linkManPhone = parames["linkManPhone"];                             //联系人电话
            travelType   = parames["travelType"];                               //航班类型  1=单程,2=往返,3=中转联程 4=多程
            foreach (var pStr in pListStr.Split('/'))
            {
                var ps = pStr.Split(',');
                if (ps[1] == "2" && ps.Count() == 4)
                {
                    pList.Add(new Tb_Ticket_Passenger()
                    {
                        PassengerName = ps[0],
                        PassengerType = int.Parse(ps[1]),
                        Cid           = ps[2],
                        A7            = ps[3]
                    });
                }
                else if (ps[1] != "2")
                {
                    pList.Add(new Tb_Ticket_Passenger()
                    {
                        PassengerName = ps[0],
                        PassengerType = int.Parse(ps[1]),
                        Cid           = ps[2]
                    });
                }

                else
                {
                    writer.WriteEx(550, "passenger format error", "乘机人格式有误");
                }
            }
            foreach (var kStr in skywaylistStr.Split('/'))
            {
                var ks = kStr.Split(',');
                if (ks.Count() == 10)
                {
                    skywaylist.Add(new Tb_Ticket_SkyWay()
                    {
                        CarryCode    = ks[0],
                        FlightCode   = ks[1],
                        FromDate     = DateTime.Parse(ks[2]),
                        ToDate       = DateTime.Parse(ks[3]),
                        FromCityCode = ks[4],
                        ToCityCode   = ks[5],
                        FromCityName = ks[6],
                        ToCityName   = ks[7],
                        Space        = ks[8],
                        Discount     = ks[9]
                    });
                }
                else
                {
                    writer.WriteEx(550, "skyway format error", "航段格式有误");
                }
            }
            #endregion

            UserLoginInfo     userLogin = AuthLogin.GetUserInfo(Username);
            List <IPassenger> pasList   = new List <IPassenger>();
            List <ISkyLeg>    skyList   = new List <ISkyLeg>();
            SendNewPID        pid       = new SendNewPID();
            PnrParamObj       PnrParam  = new PnrParamObj();
            //必填项 是否开启新版PID发送指令
            PnrParam.UsePIDChannel = userLogin.FQP.KongZhiXiTong != null && userLogin.FQP.KongZhiXiTong.Contains("|48|") ? 2 : 0;  //2;
            PnrParam.ServerIP      = userLogin.Configparam.WhiteScreenIP;
            PnrParam.ServerPort    = int.Parse(string.IsNullOrEmpty(userLogin.Configparam.WhiteScreenPort) ? "0" : userLogin.Configparam.WhiteScreenPort);
            PnrParam.Office        = userLogin.Configparam.Office;
            PnrParam.CarryCode     = skywaylist[0].CarryCode;
            PnrParam.PasList       = pasList;
            PnrParam.SkyList       = skyList;
            //只是儿童时需要备注的成人编码
            PnrParam.AdultPnr = adultPnr;
            //是否儿童出成人票
            PnrParam.ChildIsAdultEtdz = isCHDToAudltTK ? "1" : "0";;
            //可选项
            PnrParam.UserName = Username;



            //输入的手机号码 预订编码CT项电话
            if (userLogin.FQP.KongZhiXiTong == null || !userLogin.FQP.KongZhiXiTong.Contains("|19|"))
            {
                PnrParam.CTTel     = userLogin.User != null ? userLogin.User.Tel : "";
                PnrParam.CTCTPhone = linkManPhone != "" ? linkManPhone : (userLogin.Company != null && userLogin.Company.ContactTel.Trim() != "" ? userLogin.Company.ContactTel.Trim() : "");
            }
            else
            {
                PnrParam.CTTel     = userLogin.mSupCompany.Tel != null ? userLogin.mSupCompany.Tel : "";
                PnrParam.CTCTPhone = linkManPhone != "" ? linkManPhone : (userLogin.mSupCompany != null && userLogin.mSupCompany.ContactTel.Trim() != "" ? userLogin.mSupCompany.ContactTel.Trim() : "");
            }

            //关闭生成订单联系人默认值   生成订单时,联系人不需要默认值,让用户自己填写
            if (userLogin.FQP.KongZhiXiTong != null && userLogin.FQP.KongZhiXiTong.Contains("|55|"))
            {
                PnrParam.CTTel     = userLogin.User != null ? userLogin.User.Tel : "";
                PnrParam.CTCTPhone = linkManPhone;
            }


            PnrParam.PID   = userLogin.Configparam.Pid;
            PnrParam.KeyNo = userLogin.Configparam.KeyNo;
            //乘机人
            foreach (Tb_Ticket_Passenger pas in pList)
            {
                IPassenger p1 = new IPassenger();
                pasList.Add(p1);
                p1.PassengerName = pas.PassengerName;
                p1.PassengerType = pas.PassengerType;
                p1.PasSsrCardID  = pas.Cid;
                p1.ChdBirthday   = pas.A7;
            }
            //航段
            foreach (Tb_Ticket_SkyWay skyway in skywaylist)
            {
                ISkyLeg leg1 = new ISkyLeg();
                skyList.Add(leg1);
                leg1.CarryCode    = skyway.CarryCode;
                leg1.FlightCode   = skyway.FlightCode;
                leg1.FlyStartTime = skyway.FromDate.ToString("HHmm");
                leg1.FlyEndTime   = skyway.ToDate.ToString("HHmm");
                leg1.FlyStartDate = skyway.FromDate.ToString("yyyy-MM-dd");
                leg1.fromCode     = skyway.FromCityCode;
                leg1.toCode       = skyway.ToCityCode;
                leg1.Space        = skyway.Space;
                leg1.Discount     = skyway.Discount;
            }
            RePnrObj pObj = pid.ISendIns(PnrParam);
            string   msg  = "";
            if (GenerationOrder(userLogin, skywaylist, pList, pObj, out msg))
            {
                writer.Write(new { pnr = pObj, orderID = msg });
            }
            else
            {
                writer.WriteEx(565, "create order error", "创建空白定单失败:" + msg);
            }
        }
Exemplo n.º 9
0
        private string SelWhere(System.Collections.Specialized.NameValueCollection parames)
        {
            var           loginUser = AuthLogin.GetUserInfo(Username);
            StringBuilder StrWhere  = new StringBuilder(" A1=1 ");

            if (loginUser.Company.RoleType == 1)
            {
                if (parames["GYList"] != "")                                                                          //出票公司编码
                {
                    StrWhere.AppendFormat(" and (CPCpyNo='{0}' or left(OwnerCpyNo,12)= '{0}' ) ", parames["GYList"]); //可查询共享
                }
            }
            else if (loginUser.Company.RoleType == 2)
            {
                StrWhere.Append(" and (CPCpyNo='" + loginUser.User.CpyNo + "' or left(OwnerCpyNo,12)= '" + loginUser.User.CpyNo + "' ) "); //可查询共享
            }
            else if (loginUser.Company.RoleType == 3)
            {
                StrWhere.Append(" and CPCpyNo='" + loginUser.User.CpyNo + "' ");
            }
            else if (loginUser.Company.RoleType == 4 || loginUser.Company.RoleType == 5)
            {
                StrWhere.Append(" and OwnerCpyNo='" + loginUser.User.CpyNo + "' ");
            }
            try
            {
                //订单号或者票号
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["orderid"])))
                {
                    string OrderIdAndTicketNumber = CommonManage.TrimSQL(parames["orderid"]);
                    string pattern = @"^\d{3,4}(\-?|\s+)\d{10}$";
                    if (Regex.Match(OrderIdAndTicketNumber, pattern, RegexOptions.IgnoreCase).Success)
                    {
                        //票号
                        StrWhere.AppendFormat(" and  dbo.GetTicketNumber(OrderId) like '%|{0}|%' ", OrderIdAndTicketNumber);
                    }
                    else
                    {
                        //订单号
                        StrWhere.AppendFormat(" and OrderId='{0}' ", OrderIdAndTicketNumber);
                    }
                }
                //pnr
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["pnr"])))
                {
                    StrWhere.Append(" and PNR='" + CommonManage.TrimSQL(parames["pnr"]) + "' ");
                }
                //乘机人
                if (!string.IsNullOrEmpty(parames["passengerName"]))
                {
                    StrWhere.Append(" and PassengerName like'%" + CommonManage.TrimSQL(parames["passengerName"]) + "%' ");
                }
                //客户名称
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["corporationName"])))
                {
                    StrWhere.Append(" and CreateCpyName like'%" + CommonManage.TrimSQL(parames["corporationName"]) + "%' ");
                }
                //航班号
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["flightCode"])))
                {
                    StrWhere.Append(" and FlightCode ='" + CommonManage.TrimSQL(parames["flightCode"]) + "' ");
                }
                //航空公司
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["airCode"])))
                {
                    StrWhere.Append(" and CarryCode ='" + CommonManage.TrimSQL(parames["airCode"]) + "' ");
                }

                //订单状态
                if (!string.IsNullOrEmpty(parames["status"]) && parames["status"] != "0")
                {
                    StrWhere.Append(" and OrderStatusCode= " + CommonManage.TrimSQL(parames["status"]));
                }


                //乘机日期
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["airFTimeDate"])))
                {
                    StrWhere.Append(" and AirTime >'" + CommonManage.TrimSQL(parames["airFTimeDate"]) + " 00:00:00'");
                }
                //乘机日期
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["airETimeDate"])))
                {
                    StrWhere.Append(" and AirTime <'" + CommonManage.TrimSQL(parames["airETimeDate"]) + " 23:59:59'");
                }

                //创建日期
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["createFTimeDate"])))
                {
                    StrWhere.Append(" and CreateTime >'" + CommonManage.TrimSQL(parames["createFTimeDate"]) + " 00:00:00'");
                }
                //创建日期
                if (!string.IsNullOrEmpty(CommonManage.TrimSQL(parames["createETimeDate"])))
                {
                    StrWhere.Append(" and CreateTime <'" + CommonManage.TrimSQL(parames["createETimeDate"]) + " 23:59:59'");
                }

                ////城市控件
                //if (txtFromCity.Value.Trim() != "" && txtFromCity.Value.Trim() != "中文/拼音" && txtFromCity.Value.Trim() != "中文/英文")
                //    StrWhere.Append(" and Travel like '" + CommonManage.TrimSQL(txtFromCity.Value.Trim()) + "%'");
                //if (txtToCity.Value.Trim() != "" && txtToCity.Value.Trim() != "中文/拼音" && txtToCity.Value.Trim() != "中文/英文")
                //    StrWhere.Append(" and Travel like '%" + CommonManage.TrimSQL(txtToCity.Value.Trim()) + "'");

                ////城市控件
                if (!string.IsNullOrEmpty(parames["fcity"]))
                {
                    StrWhere.Append(" and TravelCode like '" + CommonManage.TrimSQL(parames["fcity"]) + "%'");
                }
                if (!string.IsNullOrEmpty(parames["tcity"]))
                {
                    StrWhere.Append(" and TravelCode like '%" + CommonManage.TrimSQL(parames["tcity"]) + "'");
                }
            }
            catch (Exception)
            {
            }
            return(StrWhere.ToString());
        }
Exemplo n.º 10
0
        public override void Query(ResponseWriter writer, System.Collections.Specialized.NameValueCollection parames)
        {
            var user = AuthLogin.GetUserInfo(Username);

            writer.Write("GET提交 查询资源");
        }