Exemplo n.º 1
0
        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();
                string loginid = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                List<ProductConfig> list = trade.GetProductConfig(loginid);

                StringBuilder strb = new StringBuilder();
                foreach (ProductConfig pcg in list)
                {
                    strb.Append("<Product>");
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", pcg.ProductCode);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", pcg.ProductName);
                    strb.AppendFormat("<GoodsCode>{0}</GoodsCode>", pcg.GoodsCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", pcg.PriceCode);
                    strb.AppendFormat("<AdjustBase>{0}</AdjustBase>", pcg.AdjustBase);
                    strb.AppendFormat("<AdjustCount>{0}</AdjustCount>", pcg.AdjustCount);
                    strb.AppendFormat("<PriceDot>{0}</PriceDot>", pcg.PriceDot);
                    strb.AppendFormat("<ValueDot>{0}</ValueDot>", pcg.ValueDot);
                    strb.AppendFormat("<SetBase>{0}</SetBase>", pcg.SetBase);
                    strb.AppendFormat("<HoldBase>{0}</HoldBase>", pcg.HoldBase);
                    strb.AppendFormat("<OrdeMoney>{0}</OrdeMoney>", pcg.OrderMoney);
                    strb.AppendFormat("<MaxPrice>{0}</MaxPrice>", pcg.MaxPrice);
                    strb.AppendFormat("<MinPrice>{0}</MinPrice>", pcg.MinPrice);
                    strb.AppendFormat("<MaxTime>{0}</MaxTime>", pcg.MaxTime);
                    strb.AppendFormat("<State>{0}</State>", pcg.State);
                    strb.AppendFormat("<Unit>{0}</Unit>", pcg.Unit);
                    strb.Append("</Product>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Products>{0}</Products></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 2
0
        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();
                string               loginid = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                List <ProductConfig> list    = trade.GetProductConfig(loginid);

                StringBuilder strb = new StringBuilder();
                foreach (ProductConfig pcg in list)
                {
                    strb.Append("<Product>");
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", pcg.ProductCode);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", pcg.ProductName);
                    strb.AppendFormat("<GoodsCode>{0}</GoodsCode>", pcg.GoodsCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", pcg.PriceCode);
                    strb.AppendFormat("<AdjustBase>{0}</AdjustBase>", pcg.AdjustBase);
                    strb.AppendFormat("<AdjustCount>{0}</AdjustCount>", pcg.AdjustCount);
                    strb.AppendFormat("<PriceDot>{0}</PriceDot>", pcg.PriceDot);
                    strb.AppendFormat("<ValueDot>{0}</ValueDot>", pcg.ValueDot);
                    strb.AppendFormat("<SetBase>{0}</SetBase>", pcg.SetBase);
                    strb.AppendFormat("<HoldBase>{0}</HoldBase>", pcg.HoldBase);
                    strb.AppendFormat("<OrdeMoney>{0}</OrdeMoney>", pcg.OrderMoney);
                    strb.AppendFormat("<MaxPrice>{0}</MaxPrice>", pcg.MaxPrice);
                    strb.AppendFormat("<MinPrice>{0}</MinPrice>", pcg.MinPrice);
                    strb.AppendFormat("<MaxTime>{0}</MaxTime>", pcg.MaxTime);
                    strb.AppendFormat("<State>{0}</State>", pcg.State);
                    strb.AppendFormat("<Unit>{0}</Unit>", pcg.Unit);
                    strb.Append("</Product>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Products>{0}</Products></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 3
0
        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();

                string LoginId      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;

                List <TradeHoldOrder> list = trade.GetTradeHoldOrder(LoginId);

                StringBuilder strb = new StringBuilder();
                foreach (TradeHoldOrder td in list)
                {
                    strb.Append("<HoldOrder>");
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<HoldOrderId>{0}</HoldOrderId>", td.HoldOrderID);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<HoldPrice>{0}</HoldPrice>", td.HoldPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", td.FrozenMoney);
                    strb.AppendFormat("<ValidTime>{0}</ValidTime>", td.ValidTime.ToString(Const.dateformat));
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.Append("<CancelTime></CancelTime>");
                    strb.Append("</HoldOrder>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><HoldOrders>{0}</HoldOrders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 4
0
        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();

                string LoginId = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;

                List<TradeHoldOrder> list = trade.GetTradeHoldOrder( LoginId);

                StringBuilder strb = new StringBuilder();
                foreach (TradeHoldOrder td in list)
                {
                    strb.Append("<HoldOrder>");
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<HoldOrderId>{0}</HoldOrderId>", td.HoldOrderID);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<HoldPrice>{0}</HoldPrice>", td.HoldPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", td.FrozenMoney);
                    strb.AppendFormat("<ValidTime>{0}</ValidTime>", td.ValidTime.ToString(Const.dateformat));
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.Append("<CancelTime></CancelTime>");
                    strb.Append("</HoldOrder>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><HoldOrders>{0}</HoldOrders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 5
0
        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();

                int NType = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/NewsType").InnerText);
                NewsLqc Lqc = new NewsLqc();
                Lqc.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                Lqc.StartTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/StartTime").InnerText);
                Lqc.EndTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/EndTime").InnerText);
                Lqc.NType = (NewsType)NType;
                int pageindex = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageIndex").InnerText);
                int pagesize = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageSize").InnerText);
                int page = 0;
                TradeNewsInfo newsinfo = trade.GetTradeNewsInfoWithPage(Lqc, pageindex, pagesize, ref page);
                StringBuilder strb = new StringBuilder();
                foreach (TradeNews tn in newsinfo.TradeNewsInfoList)
                {
                    strb.Append("<News>");
                    strb.AppendFormat("<NewsId>{0}</NewsId>", tn.ID);
                    strb.AppendFormat("<Title>{0}</Title>", tn.NewsTitle);
                    strb.AppendFormat("<NewsType>{0}</NewsType>", (int)tn.NType);
                    strb.AppendFormat("<Detail>{0}</Detail>", tn.NewsContent.Replace("src=\"/", string.Format("src=\"http://{0}/", ComFunction.NewsHostAddr)));
                    strb.AppendFormat("<Time>{0}</Time>", tn.PubTime.ToString(Const.dateformat));
                    strb.AppendFormat("<Publisher>{0}</Publisher>", tn.PubPerson);
                    strb.AppendFormat("<Status>{0}</Status>", (int)tn.Status);
                    strb.Append("</News>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><PageCount>{0}</PageCount><AllNews>{1}</AllNews></DataBody>", page, strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 6
0
        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();

                int     NType = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/NewsType").InnerText);
                NewsLqc Lqc   = new NewsLqc();
                Lqc.LoginID   = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                Lqc.StartTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/StartTime").InnerText);
                Lqc.EndTime   = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/EndTime").InnerText);
                Lqc.NType     = (NewsType)NType;
                int           pageindex = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageIndex").InnerText);
                int           pagesize  = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageSize").InnerText);
                int           page      = 0;
                TradeNewsInfo newsinfo  = trade.GetTradeNewsInfoWithPage(Lqc, pageindex, pagesize, ref page);
                StringBuilder strb      = new StringBuilder();
                foreach (TradeNews tn in newsinfo.TradeNewsInfoList)
                {
                    strb.Append("<News>");
                    strb.AppendFormat("<NewsId>{0}</NewsId>", tn.ID);
                    strb.AppendFormat("<Title>{0}</Title>", tn.NewsTitle);
                    strb.AppendFormat("<NewsType>{0}</NewsType>", (int)tn.NType);
                    strb.AppendFormat("<Detail>{0}</Detail>", tn.NewsContent.Replace("src=\"/", string.Format("src=\"http://{0}/", ComFunction.NewsHostAddr)));
                    strb.AppendFormat("<Time>{0}</Time>", tn.PubTime.ToString(Const.dateformat));
                    strb.AppendFormat("<Publisher>{0}</Publisher>", tn.PubPerson);
                    strb.AppendFormat("<Status>{0}</Status>", (int)tn.Status);
                    strb.Append("</News>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><PageCount>{0}</PageCount><AllNews>{1}</AllNews></DataBody>", page, strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 7
0
        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);
                //获取账号
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                //获取密码并解码
                string TradePwd = com.individual.helper.RsaHelper.Decrypt(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradePwd").InnerText, RsaPrivateKey);
                //获取MAC地址
                string Mac = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/Mac").InnerText;

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

                Trade.CTrade trade = new Trade.CTrade();
                Loginfo      lg    = trade.GetLogin(TradeAccount, TradePwd, Mac);

                if ("-1" == lg.LoginID)
                {
                    //登陆失败
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL002, ResCode.UL002Desc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder UserLimitInfo = new StringBuilder();
                    UserLimitInfo.AppendFormat("<MinTrade>{0}</MinTrade>", lg.TdUser.MinTrade);
                    UserLimitInfo.AppendFormat("<OrderUnit>{0}</OrderUnit>", lg.TdUser.OrderUnit);
                    UserLimitInfo.AppendFormat("<MaxTrade>{0}</MaxTrade>", lg.TdUser.MaxTrade);
                    UserLimitInfo.AppendFormat("<PermitRcash>{0}</PermitRcash>", lg.TdUser.PermitRcash ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitCcash>{0}</PermitCcash>", lg.TdUser.PermitCcash ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitDhuo>{0}</PermitDhuo>", lg.TdUser.PermitDhuo ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitHshou>{0}</PermitHshou>", lg.TdUser.PermitHshou ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitRstore>{0}</PermitRstore>", lg.TdUser.PermitRstore ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitDelOrder>{0}</PermitDelOrder>", lg.TdUser.PermitDelOrder ? 1 : 0);
                    //响应消息体
                    string DataBody = string.Format("<DataBody><LoginId>{0}</LoginId><QuotesAddressIP>{1}</QuotesAddressIP><QuotesPort>{2}</QuotesPort><UserLimitInfo>{3}</UserLimitInfo></DataBody>",
                                                    lg.LoginID, lg.QuotesAddressIP, lg.QuotesPort, UserLimitInfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL001, ResCode.UL001Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 8
0
        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);
                //获取账号
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                //获取密码并解码
                string TradePwd = com.individual.helper.RsaHelper.Decrypt(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradePwd").InnerText, RsaPrivateKey);
                //获取MAC地址
                string Mac = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/Mac").InnerText;

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

                Trade.CTrade trade = new Trade.CTrade();
                Loginfo lg = trade.GetLogin(TradeAccount, TradePwd, Mac);

                if ("-1" == lg.LoginID)
                {
                    //登陆失败
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL002, ResCode.UL002Desc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder UserLimitInfo = new StringBuilder();
                    UserLimitInfo.AppendFormat("<MinTrade>{0}</MinTrade>", lg.TdUser.MinTrade);
                    UserLimitInfo.AppendFormat("<OrderUnit>{0}</OrderUnit>", lg.TdUser.OrderUnit);
                    UserLimitInfo.AppendFormat("<MaxTrade>{0}</MaxTrade>", lg.TdUser.MaxTrade);
                    UserLimitInfo.AppendFormat("<PermitRcash>{0}</PermitRcash>", lg.TdUser.PermitRcash ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitCcash>{0}</PermitCcash>", lg.TdUser.PermitCcash ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitDhuo>{0}</PermitDhuo>", lg.TdUser.PermitDhuo ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitHshou>{0}</PermitHshou>", lg.TdUser.PermitHshou ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitRstore>{0}</PermitRstore>", lg.TdUser.PermitRstore ? 1 : 0);
                    UserLimitInfo.AppendFormat("<PermitDelOrder>{0}</PermitDelOrder>", lg.TdUser.PermitDelOrder ? 1 : 0);
                    //响应消息体
                    string DataBody = string.Format("<DataBody><LoginId>{0}</LoginId><QuotesAddressIP>{1}</QuotesAddressIP><QuotesPort>{2}</QuotesPort><UserLimitInfo>{3}</UserLimitInfo></DataBody>",
                        lg.LoginID, lg.QuotesAddressIP, lg.QuotesPort, UserLimitInfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL001, ResCode.UL001Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 9
0
        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();
                //string loginid = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string PriceCode = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/PriceCode").InnerText;
                string WeekFlg   = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/WeekFlg").InnerText;

                List <HisData> list = trade.GetHisData(PriceCode, WeekFlg);

                StringBuilder strb = new StringBuilder();
                foreach (HisData his in list)
                {
                    strb.Append("<NewQuotationEntity>");
                    strb.AppendFormat("<time>{0}</time>", his.weektime);
                    strb.AppendFormat("<open>{0}</open>", his.openprice);
                    strb.AppendFormat("<hight>{0}</hight>", his.highprice);
                    strb.AppendFormat("<lower>{0}</lower>", his.lowprice);
                    strb.AppendFormat("<close>{0}</close>", his.closeprice);
                    strb.AppendFormat("<count>{0}</count>", his.volnum);
                    strb.Append("</NewQuotationEntity>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><NewQuotationEntitys>{0}</NewQuotationEntitys></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 10
0
        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();
                //string loginid = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string PriceCode = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/PriceCode").InnerText;
                string WeekFlg = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/WeekFlg").InnerText;

                List<HisData> list = trade.GetHisData(PriceCode,WeekFlg);

                StringBuilder strb = new StringBuilder();
                foreach (HisData his in list)
                {
                    strb.Append("<NewQuotationEntity>");
                    strb.AppendFormat("<time>{0}</time>", his.weektime);
                    strb.AppendFormat("<open>{0}</open>", his.openprice);
                    strb.AppendFormat("<hight>{0}</hight>", his.highprice);
                    strb.AppendFormat("<lower>{0}</lower>", his.lowprice);
                    strb.AppendFormat("<close>{0}</close>", his.closeprice);
                    strb.AppendFormat("<count>{0}</count>", his.volnum);
                    strb.Append("</NewQuotationEntity>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><NewQuotationEntitys>{0}</NewQuotationEntitys></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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;
        }
Exemplo n.º 13
0
        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();

                string LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;

                TradeSetInfo  setinfo = trade.GetTradeSetInfo(LoginID);
                StringBuilder strb    = new StringBuilder();
                foreach (TradeSet st in setinfo.TdSetList)
                {
                    strb.Append("<Configuration>");
                    strb.AppendFormat("<Key>{0}</Key>", st.ObjCode);
                    strb.AppendFormat("<Value>{0}</Value>", st.ObjValue);
                    strb.Append("</Configuration>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Configurations>{0}</Configurations></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 14
0
        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();

                string LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;

                TradeSetInfo setinfo = trade.GetTradeSetInfo(LoginID);
                StringBuilder strb = new StringBuilder();
                foreach (TradeSet st in setinfo.TdSetList)
                {
                    strb.Append("<Configuration>");
                    strb.AppendFormat("<Key>{0}</Key>", st.ObjCode);
                    strb.AppendFormat("<Value>{0}</Value>", st.ObjValue);
                    strb.Append("</Configuration>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Configurations>{0}</Configurations></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 15
0
        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();

                string UserName     = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/UserName").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/TradeAccount").InnerText;
                string TradePwd     = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/TradePwd").InnerText;
                string PhoneNum     = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/PhoneNum").InnerText;
                string Email        = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/Email").InnerText;
                string CardNum      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/CardNum").InnerText;

                ResultDesc rdsc = trade.RegTestTradeUser(UserName, TradeAccount, TradePwd, PhoneNum, Email, CardNum);

                if (!rdsc.Result)
                {
                    string CodeDesc   = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(rdsc.ReturnCode, rdsc.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 16
0
        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();

                string UserName = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/UserName").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/TradeAccount").InnerText;
                string TradePwd = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/TradePwd").InnerText;
                string PhoneNum = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/PhoneNum").InnerText;
                string Email = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/Email").InnerText;
                string CardNum = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/RegInfo/CardNum").InnerText;

                ResultDesc rdsc = trade.RegTestTradeUser(UserName, TradeAccount, TradePwd, PhoneNum, Email, CardNum);

                if (!rdsc.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(rdsc.ReturnCode,rdsc.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 17
0
        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();
                MarketLnEnter orderln = new MarketLnEnter();

                orderln.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/CurrentTime").InnerText);
                orderln.OrderId = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/OrderId").InnerText;
                //可以不设置止盈止损价 如果为空 不能直接转换
                string ProfitPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/ProfitPrice").InnerText;
                string LossPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/LossPrice").InnerText;
                orderln.ProfitPrice = Convert.ToDouble(string.IsNullOrEmpty(ProfitPrice) ? "0" : ProfitPrice);
                orderln.LossPrice = Convert.ToDouble(string.IsNullOrEmpty(LossPrice) ? "0" : LossPrice);

                Marketorders orders = trade.ModifyMarketorders(orderln);

                if (!orders.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode,orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", orders.TradeOrder.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", orders.TradeOrder.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeOrder.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", orders.TradeOrder.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", orders.TradeOrder.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeOrder.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", orders.TradeOrder.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", orders.TradeOrder.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeOrder.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", orders.TradeOrder.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", orders.TradeOrder.StorageFee);
                    strb.AppendFormat("<TotalWeight></TotalWeight>");
                    strb.Append("</Order>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 18
0
        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();

                string LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;

             //   int UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户

                List<TradeOrder> list = trade.GetTradeOrder(LoginID);
                StringBuilder strb = new StringBuilder();
                foreach (TradeOrder td in list)
                {
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", td.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", td.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", td.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", td.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", td.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", td.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", td.StorageFee);
                    strb.AppendFormat("<TotalWeight>{0}</TotalWeight>", td.TotalWeight);
                    strb.Append("</Order>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 19
0
        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();

                string    Ltype     = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/Ltype").InnerText;
                int       pageindex = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageIndex").InnerText);
                int       pagesize  = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageSize").InnerText);;
                int       page      = 0;
                LQueryCon Lcn       = new LQueryCon();
                Lcn.LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                Lcn.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                //   Lcn.UserType = 0;//客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                Lcn.StartTime   = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/StartTime").InnerText);
                Lcn.EndTime     = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/EndTime").InnerText);
                Lcn.OrderType   = "ALL";
                Lcn.ProductName = "ALL";
                List <LTradeOrder> list = trade.GetLTradeOrder(Lcn, Ltype, pageindex, pagesize, ref page);
                StringBuilder      strb = new StringBuilder();
                foreach (LTradeOrder td in list)
                {
                    strb.Append("<HistoryOrder>");
                    strb.AppendFormat("<HistoryOrderId>{0}</HistoryOrderId>", td.HistoryOrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", td.OrderPrice);
                    strb.AppendFormat("<OverType>{0}</OverType>", td.OverType);
                    strb.AppendFormat("<OverPrice>{0}</OverPrice>", td.OverPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<ProfitValue>{0}</ProfitValue>", td.ProfitValue);
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", td.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", td.StorageFee);
                    strb.AppendFormat("<OverTime>{0}</OverTime>", td.OverTime.ToString(Const.dateformat));
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<OrderId>{0}</OrderId>", td.OrderId);
                    strb.AppendFormat("<ProductMoney>{0}</ProductMoney>", td.ProductMoney);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.Append("</HistoryOrder>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><PageCount>{0}</PageCount><HistoryOrders>{1}</HistoryOrders></DataBody>", page, strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 20
0
        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();
                DeliveryEnter orderln = new DeliveryEnter();

                orderln.LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime  = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/CurrentTime").InnerText);
                orderln.Orderid      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/OrderId").InnerText;
                orderln.Quantity     = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/Quantity").InnerText);
                orderln.RtimePrices  = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/RtimePrices").InnerText);

                string MaxPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/MaxPrice").InnerText;
                orderln.MaxPrice = Convert.ToDouble(string.IsNullOrEmpty(MaxPrice) ? "0" : MaxPrice);

                //  orderln.UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户

                Marketorders orders = trade.DelOrder(orderln);

                if (!orders.Result)
                {
                    string CodeDesc   = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode, orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", orders.TradeOrder.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", orders.TradeOrder.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeOrder.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", orders.TradeOrder.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", orders.TradeOrder.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeOrder.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", orders.TradeOrder.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", orders.TradeOrder.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeOrder.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", orders.TradeOrder.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", orders.TradeOrder.StorageFee);
                    strb.AppendFormat("<TotalWeight></TotalWeight>");
                    strb.Append("</Order>");
                    StringBuilder fundinfo = new StringBuilder();
                    fundinfo.Append("<FundInfo>");
                    fundinfo.AppendFormat("<Money>{0}</Money>", orders.MoneyInventory.FdInfo.Money);
                    fundinfo.AppendFormat("<OccMoney>{0}</OccMoney>", orders.MoneyInventory.FdInfo.OccMoney);
                    fundinfo.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.MoneyInventory.FdInfo.FrozenMoney);
                    fundinfo.Append("</FundInfo>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders>{1}</DataBody>", strb.ToString(), fundinfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 21
0
        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();

                string LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                MoneyInventory miy = trade.GetMoneyInventory(LoginID);
                if (!miy.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(miy.ReturnCode, miy.Desc,ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<FundInfo>");
                    strb.AppendFormat("<CashUser>{0}</CashUser>", miy.FdInfo.CashUser);
                    strb.AppendFormat("<SubUser>{0}</SubUser>", miy.FdInfo.SubUser);
                    strb.AppendFormat("<TanUser>{0}</TanUser>", miy.FdInfo.TanUser);
                    strb.AppendFormat("<State>{0}</State>", miy.FdInfo.State);
                    strb.AppendFormat("<Money>{0}</Money>", miy.FdInfo.Money);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", miy.FdInfo.OccMoney);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", miy.FdInfo.FrozenMoney);
                    strb.AppendFormat("<ConBankType>{0}</ConBankType>", miy.FdInfo.ConBankType);
                    strb.AppendFormat("<OpenBank>{0}</OpenBank>", miy.FdInfo.OpenBank);
                    strb.AppendFormat("<BankAccount>{0}</BankAccount>", miy.FdInfo.BankAccount);
                    strb.AppendFormat("<AccountName>{0}</AccountName>", miy.FdInfo.AccountName);
                    strb.Append("</FundInfo>");

                    strb.Append("<Storages>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XAU</Key>");
                    //strb.Append("<Name>黄金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xau);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XAG</Key>");
                    //strb.Append("<Name>白银</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xag);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XPT</Key>");
                    //strb.Append("<Name>铂金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xpt);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XPD</Key>");
                    //strb.Append("<Name>钯金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xpd);
                    //strb.Append("</Storage>");

                    strb.Append("</Storages>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody>{0}</DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 22
0
        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();
                OrdersLncoming orderln = new OrdersLncoming();

                orderln.Mac          = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/Mac").InnerText;
                orderln.LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime  = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/CurrentTime").InnerText);

                //可以不设置止盈止损价 如果为空 不能直接转换
                string ProfitPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ProfitPrice").InnerText;
                string LossPrice   = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/LossPrice").InnerText;
                orderln.ProfitPrice = Convert.ToDouble(string.IsNullOrEmpty(ProfitPrice) ? "0" : ProfitPrice);
                orderln.LossPrice   = Convert.ToDouble(string.IsNullOrEmpty(LossPrice) ? "0" : LossPrice);

                orderln.OrderType   = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/OrderType").InnerText;
                orderln.ProductCode = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ProductCode").InnerText;
                orderln.HoldPrice   = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/HoldPrice").InnerText);
                orderln.Quantity    = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/Quantity").InnerText);
                orderln.RtimePrices = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/RtimePrices").InnerText);
                orderln.ValidTime   = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ValidTime").InnerText); //ValidTime

                orderln.UserType   = 0;                                                                                                                //客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                orderln.OrderMoney = 0;                                                                                                                //客户端没有传递这个值 这个值本身也没有使用 随便赋个值
                Orders orders = trade.GetOrders(orderln);

                if (!orders.Result)
                {
                    string CodeDesc   = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode, orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    //返回的结构不一样 不能直接转换
                    //string holdorder = XmlUtil.SerializeObjToXml(typeof(TradeHoldOrder), orders.TradeHoldOrder);

                    StringBuilder strb = new StringBuilder();
                    strb.AppendFormat("<HoldOrderId>{0}</HoldOrderId>", orders.TradeHoldOrder.HoldOrderID);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeHoldOrder.ProductCode);
                    strb.AppendFormat("<HoldPrice>{0}</HoldPrice>", orders.TradeHoldOrder.HoldPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeHoldOrder.Quantity);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.TradeHoldOrder.FrozenMoney);
                    strb.AppendFormat("<ValidTime>{0}</ValidTime>", orders.TradeHoldOrder.ValidTime.ToString(Const.dateformat));
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeHoldOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeHoldOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeHoldOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeHoldOrder.OrderTime.ToString(Const.dateformat));
                    strb.Append("<CancelTime></CancelTime>");
                    StringBuilder fundinfo = new StringBuilder();
                    fundinfo.Append("<FundInfo>");
                    fundinfo.AppendFormat("<Money>{0}</Money>", orders.MoneyInventory.FdInfo.Money);
                    fundinfo.AppendFormat("<OccMoney>{0}</OccMoney>", orders.MoneyInventory.FdInfo.OccMoney);
                    fundinfo.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.MoneyInventory.FdInfo.FrozenMoney);
                    fundinfo.Append("</FundInfo>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><HoldOrders><HoldOrder>{0}</HoldOrder></HoldOrders>{1}</DataBody>", strb.ToString(), fundinfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 23
0
        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();
                OrdersLncoming orderln = new OrdersLncoming();

                orderln.Mac = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/Mac").InnerText;
                orderln.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/CurrentTime").InnerText);

                //可以不设置止盈止损价 如果为空 不能直接转换
                string ProfitPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ProfitPrice").InnerText;
                string LossPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/LossPrice").InnerText;
                orderln.ProfitPrice = Convert.ToDouble(string.IsNullOrEmpty(ProfitPrice) ? "0" : ProfitPrice);
                orderln.LossPrice = Convert.ToDouble(string.IsNullOrEmpty(LossPrice) ? "0" : LossPrice);

                orderln.OrderType = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/OrderType").InnerText;
                orderln.ProductCode = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ProductCode").InnerText;
                orderln.HoldPrice = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/HoldPrice").InnerText);
                orderln.Quantity = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/Quantity").InnerText);
                orderln.RtimePrices = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/RtimePrices").InnerText);
                orderln.ValidTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/HoldOrders/HoldOrder/ValidTime").InnerText);//ValidTime

                orderln.UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                orderln.OrderMoney = 0; //客户端没有传递这个值 这个值本身也没有使用 随便赋个值
                Orders orders = trade.GetOrders(orderln);

                if (!orders.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode,orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    //返回的结构不一样 不能直接转换
                    //string holdorder = XmlUtil.SerializeObjToXml(typeof(TradeHoldOrder), orders.TradeHoldOrder);

                    StringBuilder strb = new StringBuilder();
                    strb.AppendFormat("<HoldOrderId>{0}</HoldOrderId>", orders.TradeHoldOrder.HoldOrderID);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeHoldOrder.ProductCode);
                    strb.AppendFormat("<HoldPrice>{0}</HoldPrice>", orders.TradeHoldOrder.HoldPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeHoldOrder.Quantity);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.TradeHoldOrder.FrozenMoney);
                    strb.AppendFormat("<ValidTime>{0}</ValidTime>", orders.TradeHoldOrder.ValidTime.ToString(Const.dateformat));
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeHoldOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeHoldOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeHoldOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeHoldOrder.OrderTime.ToString(Const.dateformat));
                    strb.Append("<CancelTime></CancelTime>");
                    StringBuilder fundinfo = new StringBuilder();
                    fundinfo.Append("<FundInfo>");
                    fundinfo.AppendFormat("<Money>{0}</Money>", orders.MoneyInventory.FdInfo.Money);
                    fundinfo.AppendFormat("<OccMoney>{0}</OccMoney>", orders.MoneyInventory.FdInfo.OccMoney);
                    fundinfo.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.MoneyInventory.FdInfo.FrozenMoney);
                    fundinfo.Append("</FundInfo>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><HoldOrders><HoldOrder>{0}</HoldOrder></HoldOrders>{1}</DataBody>", strb.ToString(), fundinfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 24
0
        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();

                string Ltype = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/Ltype").InnerText;
                int pageindex = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageIndex").InnerText);
                int pagesize = Convert.ToInt32(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/PageSize").InnerText); ;
                int page = 0;
                LQueryCon Lcn = new LQueryCon();
                Lcn.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                Lcn.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
             //   Lcn.UserType = 0;//客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                Lcn.StartTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/StartTime").InnerText);
                Lcn.EndTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Lqc/EndTime").InnerText);
                Lcn.OrderType = "ALL";
                Lcn.ProductName = "ALL";
                List<LTradeOrder> list = trade.GetLTradeOrder(Lcn, Ltype, pageindex, pagesize, ref page);
                StringBuilder strb = new StringBuilder();
                foreach (LTradeOrder td in list)
                {
                    strb.Append("<HistoryOrder>");
                    strb.AppendFormat("<HistoryOrderId>{0}</HistoryOrderId>", td.HistoryOrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", td.OrderPrice);
                    strb.AppendFormat("<OverType>{0}</OverType>", td.OverType);
                    strb.AppendFormat("<OverPrice>{0}</OverPrice>", td.OverPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<ProfitValue>{0}</ProfitValue>", td.ProfitValue);
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", td.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", td.StorageFee);
                    strb.AppendFormat("<OverTime>{0}</OverTime>", td.OverTime.ToString(Const.dateformat));
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<OrderId>{0}</OrderId>", td.OrderId);
                    strb.AppendFormat("<ProductMoney>{0}</ProductMoney>", td.ProductMoney);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.Append("</HistoryOrder>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><PageCount>{0}</PageCount><HistoryOrders>{1}</HistoryOrders></DataBody>", page, strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }

            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 25
0
        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();
                MarOrdersLn orderln = new MarOrdersLn();

                orderln.Mac = xmldoc.SelectSingleNode("JTW91G/MsgData/ReqHeader/Mac").InnerText;
                orderln.LoginID = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/CurrentTime").InnerText);

                //可以不设置止盈止损价 如果为空 不能直接转换
                string ProfitPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/ProfitPrice").InnerText;
                string LossPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/LossPrice").InnerText;
                orderln.ProfitPrice = Convert.ToDouble(string.IsNullOrEmpty(ProfitPrice) ? "0" : ProfitPrice);
                orderln.LossPrice = Convert.ToDouble(string.IsNullOrEmpty(LossPrice) ? "0" : LossPrice);

                string MaxPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/MaxPrice").InnerText;
                orderln.MaxPrice = Convert.ToDouble(string.IsNullOrEmpty(MaxPrice) ? "0" : MaxPrice);

                orderln.OrderType = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/OrderType").InnerText;
                orderln.ProductCode = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/ProductCode").InnerText;
                orderln.Quantity = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/Quantity").InnerText);
                orderln.RtimePrices = Convert.ToDouble(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/RtimePrices").InnerText);

             //   orderln.UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户
                orderln.OrderMoney = 0; //客户端没有传递这个值 这个值本身也没有使用 随便赋个值
                Marketorders orders = trade.GetMarketorders(orderln);

                if (!orders.Result)
                {
                    string CodeDesc = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode,orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", orders.TradeOrder.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", orders.TradeOrder.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeOrder.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", orders.TradeOrder.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", orders.TradeOrder.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeOrder.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", orders.TradeOrder.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", orders.TradeOrder.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeOrder.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", orders.TradeOrder.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", orders.TradeOrder.StorageFee);
                    strb.AppendFormat("<TotalWeight>{0}</TotalWeight>", orders.TradeOrder.TotalWeight);
                    strb.Append("</Order>");
                    StringBuilder fundinfo = new StringBuilder();
                    fundinfo.Append("<FundInfo>");
                    fundinfo.AppendFormat("<Money>{0}</Money>", orders.MoneyInventory.FdInfo.Money);
                    fundinfo.AppendFormat("<OccMoney>{0}</OccMoney>", orders.MoneyInventory.FdInfo.OccMoney);
                    fundinfo.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", orders.MoneyInventory.FdInfo.FrozenMoney);
                    fundinfo.Append("</FundInfo>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders>{1}</DataBody>", strb.ToString(), fundinfo.ToString());

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return ResXml;
        }
Exemplo n.º 26
0
        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();

                string         LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string         TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                MoneyInventory miy          = trade.GetMoneyInventory(LoginID);
                if (!miy.Result)
                {
                    string CodeDesc   = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(miy.ReturnCode, miy.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<FundInfo>");
                    strb.AppendFormat("<CashUser>{0}</CashUser>", miy.FdInfo.CashUser);
                    strb.AppendFormat("<SubUser>{0}</SubUser>", miy.FdInfo.SubUser);
                    strb.AppendFormat("<TanUser>{0}</TanUser>", miy.FdInfo.TanUser);
                    strb.AppendFormat("<State>{0}</State>", miy.FdInfo.State);
                    strb.AppendFormat("<Money>{0}</Money>", miy.FdInfo.Money);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", miy.FdInfo.OccMoney);
                    strb.AppendFormat("<FrozenMoney>{0}</FrozenMoney>", miy.FdInfo.FrozenMoney);
                    strb.AppendFormat("<ConBankType>{0}</ConBankType>", miy.FdInfo.ConBankType);
                    strb.AppendFormat("<OpenBank>{0}</OpenBank>", miy.FdInfo.OpenBank);
                    strb.AppendFormat("<BankAccount>{0}</BankAccount>", miy.FdInfo.BankAccount);
                    strb.AppendFormat("<AccountName>{0}</AccountName>", miy.FdInfo.AccountName);
                    strb.Append("</FundInfo>");

                    strb.Append("<Storages>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XAU</Key>");
                    //strb.Append("<Name>黄金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xau);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XAG</Key>");
                    //strb.Append("<Name>白银</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xag);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XPT</Key>");
                    //strb.Append("<Name>铂金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xpt);
                    //strb.Append("</Storage>");

                    //strb.Append("<Storage>");
                    //strb.Append("<Key>XPD</Key>");
                    //strb.Append("<Name>钯金</Name>");
                    //strb.AppendFormat("<Value>{0}</Value>", miy.StorageQuantity.xpd);
                    //strb.Append("</Storage>");

                    strb.Append("</Storages>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody>{0}</DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 27
0
        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();
                MarketLnEnter orderln = new MarketLnEnter();

                orderln.LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                orderln.TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;
                orderln.CurrentTime  = Convert.ToDateTime(xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/CurrentTime").InnerText);
                orderln.OrderId      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/OrderId").InnerText;
                //可以不设置止盈止损价 如果为空 不能直接转换
                string ProfitPrice = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/ProfitPrice").InnerText;
                string LossPrice   = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/Orders/Order/LossPrice").InnerText;
                orderln.ProfitPrice = Convert.ToDouble(string.IsNullOrEmpty(ProfitPrice) ? "0" : ProfitPrice);
                orderln.LossPrice   = Convert.ToDouble(string.IsNullOrEmpty(LossPrice) ? "0" : LossPrice);

                Marketorders orders = trade.ModifyMarketorders(orderln);

                if (!orders.Result)
                {
                    string CodeDesc   = ResCode.UL005Desc;
                    string ReturnCode = GssGetCode.GetCode(orders.ReturnCode, orders.Desc, ref CodeDesc);
                    ResXml = GssResXml.GetResXml(ReqCode, ReturnCode, CodeDesc, string.Format("<DataBody></DataBody>"));
                }
                else
                {
                    StringBuilder strb = new StringBuilder();
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", orders.TradeOrder.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", orders.TradeOrder.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", orders.TradeOrder.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", orders.TradeOrder.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", orders.TradeOrder.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", orders.TradeOrder.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", orders.TradeOrder.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", orders.TradeOrder.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", orders.TradeOrder.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", orders.TradeOrder.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", orders.TradeOrder.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", orders.TradeOrder.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", orders.TradeOrder.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", orders.TradeOrder.StorageFee);
                    strb.AppendFormat("<TotalWeight></TotalWeight>");
                    strb.Append("</Order>");
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }
Exemplo n.º 28
0
        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();

                string LoginID      = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/LoginId").InnerText;
                string TradeAccount = xmldoc.SelectSingleNode("JTW91G/MsgData/DataBody/TradeAccount").InnerText;

                //   int UserType = 0; //客户端没有传递这个值 内部调用默认赋值0 表示普通用户

                List <TradeOrder> list = trade.GetTradeOrder(LoginID);
                StringBuilder     strb = new StringBuilder();
                foreach (TradeOrder td in list)
                {
                    strb.Append("<Order>");
                    strb.AppendFormat("<OrderId>{0}</OrderId>", td.OrderId);
                    strb.AppendFormat("<ProductName>{0}</ProductName>", td.ProductName);
                    strb.AppendFormat("<ProductCode>{0}</ProductCode>", td.ProductCode);
                    strb.AppendFormat("<PriceCode>{0}</PriceCode>", td.PriceCode);
                    strb.AppendFormat("<OrderPrice>{0}</OrderPrice>", td.OrderPrice);
                    strb.AppendFormat("<Quantity>{0}</Quantity>", td.Quantity);
                    strb.AppendFormat("<UseQuantity>{0}</UseQuantity>", td.UseQuantity);
                    strb.AppendFormat("<OccMoney>{0}</OccMoney>", td.OccMoney);
                    strb.AppendFormat("<LossPrice>{0}</LossPrice>", td.LossPrice);
                    strb.AppendFormat("<ProfitPrice>{0}</ProfitPrice>", td.ProfitPrice);
                    strb.AppendFormat("<OrderType>{0}</OrderType>", td.OrderType);
                    strb.AppendFormat("<OrderTime>{0}</OrderTime>", td.OrderTime.ToString(Const.dateformat));
                    strb.AppendFormat("<TradeFee>{0}</TradeFee>", td.TradeFee);
                    strb.AppendFormat("<StorageFee>{0}</StorageFee>", td.StorageFee);
                    strb.AppendFormat("<TotalWeight>{0}</TotalWeight>", td.TotalWeight);
                    strb.Append("</Order>");
                }
                if (strb.Length > 0)
                {
                    //响应消息体
                    string DataBody = string.Format("<DataBody><Orders>{0}</Orders></DataBody>", strb);

                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL004, ResCode.UL004Desc, DataBody);
                }
                else
                {
                    ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL034, ResCode.UL034Desc, string.Format("<DataBody></DataBody>"));
                }
            }
            catch (Exception ex)
            {
                com.individual.helper.LogNet4.WriteErr(ex);

                //业务处理失败
                ResXml = GssResXml.GetResXml(ReqCode, ResCode.UL005, ResCode.UL005Desc, string.Format("<DataBody></DataBody>"));
            }
            return(ResXml);
        }