예제 #1
0
        /// <summary>
        /// 推送(炒股大赛)
        /// </summary>
        public void SsoPushStockContest(StockContestData scd)
        {
            SsoOutWindowBLL ssoOutWindowBll = Factory.BusinessFactory.CreateBll <SsoOutWindowBLL>();
            string          msgTitle        = string.Format(ConfigurationManager.AppSettings["StockContestMobileMsg"], scd.OperateUserName, scd.OperateType, scd.StockName, scd.Price);

            //pc端推送
            string parameter = GetAddOutWindowParameter(scd);
            string res       = RequestHelper.WebRequest(AddOutWindow, "post", parameter, "UTF-8", false);

            if (!string.IsNullOrEmpty(res))
            {
                res = new EncDecUtil().decyptData(res, accesskey);
                SsoRes ssoRes = JsonHelper.DeserializeJson <SsoRes>(res);

                // 调用接口状态码,0:成功,1:该消息id 已存在,2:链接地址不存在,3:用户群组不存在,4:开始时间与结束时间不匹配,9:其它异常
                if (ssoRes.error != 0)
                {
                    Loger.Error("[炒股大赛]  SSO数据推送返回失败, 返回:" + res + "\r\n相关参数:" + JsonHelper.ToJson(scd));
                }
            }
            else
            {
                Loger.Error("SSO接口调用返回空=====error=====(一般情况不会出现, 出现在超时或者无法调用)");
            }

            Loger.Info("[炒股大赛] id=" + scd.Id + "  SSO数据推送返回结果: " + res + "\r\n相关参数:" + JsonHelper.ToJson(scd) + "\r\n手机推送中...");
            //入手机端推送表
            int num = ssoOutWindowBll.UpDataTB_MOBPUSH_USERINFO_StockContest(scd, msgTitle);

            Loger.Info("[炒股大赛] id=" + scd.Id + "  手机推送表更新数:" + num);
        }
예제 #2
0
        /// <summary>
        /// 更新Oracle移动终端推送信息表
        /// </summary>
        private void UpDataMoveData(PopupMsgPlan popupMsgPlan, List <CustomerGroup> userName)
        {
            try
            {
                DateTime b1 = DateTime.Now;
                Loger.Info("[移动终端][开始] 移动终端推送信息表更新中...");
                NewsBLL         newsBll         = Factory.BusinessFactory.CreateBll <NewsBLL>();
                News            news            = newsBll.GetNewsInfo(popupMsgPlan.NewsId ?? 0);
                SsoOutWindowBLL ssoOutWindowBll = Factory.BusinessFactory.CreateBll <SsoOutWindowBLL>();
                int             upDataNum       = 0;

                if (String.Compare(popupMsgPlan.Receiver, "UP所有用户", true) == 0)
                {
                    upDataNum = ssoOutWindowBll.UpDataTB_MOBPUSH_USERINFO(popupMsgPlan, news);
                }
                else
                {
                    StringBuilder sb      = new StringBuilder();
                    List <string> sqlList = new List <string>();

                    for (int i = 0; i < userName.Count; i++)
                    {
                        sb.Append("," + userName[i].CustomerId);
                        if (i != 0 && (i % 990 == 0 || i == userName.Count - 1))
                        {
                            sqlList.Add(sb.ToString().Substring(1, sb.Length - 1));
                            sb.Remove(0, sb.Length);
                        }
                    }

                    //int myNum = 1;
                    foreach (var item in sqlList)
                    {
                        //DateTime b = DateTime.Now;
                        upDataNum += ssoOutWindowBll.UpDataTB_MOBPUSH_USERINFO(popupMsgPlan, news, item);
                        //Loger.Debug("第 " + myNum++ + " 次 " + (int)(DateTime.Now - b).TotalMilliseconds + " 毫秒");
                    }
                }
                Loger.Info("[移动终端] 移动终端推送信息表更新完毕, 更新数据: " + upDataNum + " 条, 用时: " + (int)(DateTime.Now - b1).TotalSeconds + " 秒");
                ssoOutWindowBll.AddTB_PUSH_INFO(news, popupMsgPlan.PushColumn, popupMsgPlan);
                Loger.Info("[移动终端][结束] 资讯入库完毕");
            }
            catch (Exception ex)
            {
                Loger.Error(ex, "更新Oracle移动终端推送信息表异常: ");
            }
        }