public String AnalysisXml(string ReqXml)
        {
            string ResXml = string.Empty;
            string ReqCode = string.Empty;
            try
            {
                System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
                xmldoc.LoadXml(ReqXml);

                //请求指令
                ReqCode = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/ReqCode").InnerText;

                Trade.CTrade trade = new Trade.CTrade();
                DelHoldInfo DhInfo = new DelHoldInfo();

                DhInfo.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                DhInfo.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                DhInfo.CurrentTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/CurrentTime").InnerText);
                DhInfo.HoldOrderID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/HoldOrderId").InnerText;

                DhInfo.UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                DhInfo.ReasonType = "1"; //手动取消
                MarDelivery mdy = trade.DelHoldOrder(DhInfo);

                if (!mdy.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(mdy.ReturnCode,mdy.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder fundinfo = new StringBuilder();
                    fundinfo.Append("<FundInfo>");
                    fundinfo.AppendFormat("<Money>{0}</Money>", mdy.MoneyInventory.FdInfo.Money);
                    fundinfo.AppendFormat("<OccMoney>{0}</OccMoney>", mdy.MoneyInventory.FdInfo.OccMoney);
                    fundinfo.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", mdy.MoneyInventory.FdInfo.FrozenMoney);
                    fundinfo.Append("</FundInfo>");
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, string.Format("<DataBody>{0}</DataBody>", fundinfo.ToString()));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
        /// <summary>
        /// 挂单取消
        /// </summary>
        /// <param name="DhInfo">取消信息</param>
        /// <returns>取消结果</returns>
        public MarDelivery DelHoldOrder(DelHoldInfo DhInfo)
        {
            MarDelivery ctpOrder = new MarDelivery();
            ctpOrder.MoneyInventory = new MoneyInventory();
            DateTime dt = DateTime.Now;//服务器当前本地时间
            TradeHoldOrder tradeholdorder = new TradeHoldOrder();
            ProductConfig ptc = new ProductConfig();
            TradeUser TdUser = new TradeUser();
            //从挂单表中查询出的用户ID IP MAC
            string hold_userid = string.Empty;
            string hold_ip = string.Empty;
            string hold_mac = string.Empty;
            string userId = string.Empty;
            string operUser = DhInfo.TradeAccount;
            string ipmac = string.Empty;
            try
            {
                #region 判断用户登陆标识是否过期

                if (!ComFunction.ExistUserLoginID(DhInfo.LoginID,ref TdUser))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL003;
                    ctpOrder.Desc = ResCode.UL003Desc;
                    return ctpOrder;
                }
                operUser = TdUser.Account;
                ipmac = ComFunction.GetIpMac(TdUser.Ip, TdUser.Mac);

                if (UserType.NormalType == TdUser.UType)
                {
                    userId = TdUser.UserID;
                }
                else
                {
                    userId = ComFunction.GetUserId(DhInfo.TradeAccount);
                }
                #endregion

                #region 根据挂单ID获取挂单信息
                tradeholdorder = ComFunction.GetTradeHoldOrder(DhInfo.HoldOrderID, ref hold_userid, ref hold_ip, ref hold_mac);
                if (string.IsNullOrEmpty(tradeholdorder.ProductCode))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL028;
                    ctpOrder.Desc = ResCode.UL028Desc;
                    return ctpOrder;
                }
                #endregion

                #region 获取商品信息
                ptc = ComFunction.GetProductInfo(tradeholdorder.ProductCode);
                //挂单类型(0买、1卖)
                //未能获取商品状态
                if (string.IsNullOrEmpty(ptc.State))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL024;
                    ctpOrder.Desc = ResCode.UL024Desc;
                    return ctpOrder;
                }
                #endregion

                #region 判断当前时间是否允许交易
                if (!ComFunction.GetDateset(ptc.PriceCode, dt))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL022;
                    ctpOrder.Desc = ResCode.UL022Desc;
                    return ctpOrder;
                }
                #endregion

                #region 判断商品是否处于交易时段
                if (!ComFunction.ProductCanTrade(ptc.Starttime, ptc.Endtime))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL025;
                    ctpOrder.Desc = ResCode.UL025Desc;
                    return ctpOrder;
                }
                #endregion

                #region 最大交易时间差判断
                //当前客户端实时报价时间+允许最大交易时间差>=服务器时间
                if (!(DhInfo.CurrentTime.AddSeconds(ptc.MaxTime) >= dt))
                {
                    ctpOrder.Result = false;
                    ctpOrder.ReturnCode = ResCode.UL014;
                    ctpOrder.Desc = ResCode.UL014Desc;
                    return ctpOrder;
                }
                #endregion

                ctpOrder.MoneyInventory = ComFunction.GetMoneyInventoryByUserId(userId);
                if (!ctpOrder.MoneyInventory.Result)
                {
                    ctpOrder.Result = false;
                    ctpOrder.Desc = "未能获取资金库存";
                    return ctpOrder;
                }
                #region 数据库事务处理

                /*
                List<string> sqlList = new List<string>();
                sqlList.Add(string.Format("delete from Trade_HoldOrder where holdorderid='{0}'", DhInfo.HoldOrderID));

                sqlList.Add(string.Format("INSERT INTO L_Trade_HoldOrder([userId],[HoldOrderID],[productCode],[quantity],[OrderType],[HoldPrice],[lossPrice],[profitPrice],[frozenMoney],[validtime],[ordertime],[IsTrade],[tradetime],[OrderID],[failreason],[ip],[mac]) VALUES('{0}','{1}','{2}',{3},{4},{5},{6},{7},{8},'{9}','{10}',{11},'{12}','{13}','{14}','{15}','{16}')",
                    hold_userid, tradeholdorder.HoldOrderID, tradeholdorder.ProductCode, tradeholdorder.Quantity,
                    tradeholdorder.OrderType, tradeholdorder.HoldPrice, tradeholdorder.LossPrice, tradeholdorder.ProfitPrice,
                    tradeholdorder.FrozenMoney, tradeholdorder.ValidTime.ToString("yyyy-MM-dd HH:mm:ss.fff"), tradeholdorder.OrderTime.ToString("yyyy-MM-dd HH:mm:ss.fff"), 1, dt.ToString("yyyy-MM-dd HH:mm:ss.fff"),
                   ComFunction.GetOrderId(ComFunction.Hold_His), DhInfo.ReasonType, hold_ip, hold_mac));
                double ResultfrozenMoney = ctpOrder.MoneyInventory.FdInfo.FrozenMoney - tradeholdorder.FrozenMoney;
                if (ResultfrozenMoney < ComFunction.dzero)
                {
                    ResultfrozenMoney = 0;
                }
                sqlList.Add(string.Format("update Trade_FundInfo set frozenMoney={0} where userid='{1}' and [state]<>'4'", ResultfrozenMoney, userId));

                //添加操作记录
                sqlList.Add(string.Format("insert into Base_OperrationLog([OperTime],[Account],[UserType],[Remark]) values('{0}','{1}',{2},'{3}')", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), operUser, (int)TdUser.UType, string.Format("{1}撤销委托订单{0}", DhInfo.HoldOrderID,ipmac)));

                if (!ComFunction.SqlTransaction(sqlList))
                {
                    ctpOrder.Result = false;
                    ctpOrder.Desc = "挂单取消时数据库事务处理出错";
                    return ctpOrder;
                }
                */
                //改用存储过程实现
                int result = ComFunction.DoHoldTradeOrder(DhInfo.HoldOrderID, 1, 0);
                #endregion

                if (99 == result)
                {
                    ctpOrder.Result = false;
                    ctpOrder.Desc = "挂单取消失败!";
                    return ctpOrder;
                }

                #region 给返回对象赋值

                ctpOrder.MoneyInventory.FdInfo.FrozenMoney -= tradeholdorder.FrozenMoney;
                ctpOrder.Result = true;
                switch (result)//99失败,100成功,0挂单已被自动撤销 1挂单已被手动撤销 2挂单已经自动转换为订单
                {
                    case 0: ctpOrder.Desc = "挂单已被自动撤销";
                        break;
                    case 1: ctpOrder.Desc = "挂单已被手动撤销";
                        break;
                    case 2: ctpOrder.Desc = "挂单已经自动转换为订单";
                        break;
                    default: ctpOrder.Desc = "挂单取消成功";
                        break;
                }
                #endregion
            }
            catch (Exception ex)
            {
                ComFunction.WriteErr(ex);
                ctpOrder.Result = false;
                ctpOrder.Desc = "挂单取消失败";

            }

            return ctpOrder;
        }