Esempio n. 1
0
        public static string GetForumFeedBack(int accId)
        {
            List <Dictionary <string, string> > list = new List <Dictionary <string, string> >();

            List <Sys_TaskDailyInfo> data = Sys_TaskDailyBLL.GetUserForumFeedBack(accId);

            foreach (var item in data)
            {
                Dictionary <string, string> dicData = new Dictionary <string, string>()
                {
                    { "content", "" },
                    { "time", "" },
                    { "url", "" }
                };

                dicData["content"] = item.t_mk;
                dicData["time"]    = item.inertTime.ToString();
                dicData["url"]     = item.dt_remark.Substring(item.dt_remark.IndexOf('(') + 1,
                                                              item.dt_remark.IndexOf(')') - item.dt_remark.IndexOf('(') - 1);

                list.Add(dicData);
            }

            return(CommonLib.Helper.JsonSerializeObject(list, "yyyy-MM-dd HH:mm:ss"));
        }
Esempio n. 2
0
        /// <summary>
        /// 添加客服回访信息
        /// </summary>
        /// <param name="uName"></param>
        /// <param name="content"></param>
        /// <param name="accId"></param>
        /// <param name="sourceMark">反馈来源信息</param>
        /// <returns></returns>
        public static int AddCustomCareFeedBack(string uName, string content, int accId, int sourceMark = 0)
        {
            Sys_TaskDailyInfo model = new Sys_TaskDailyInfo();

            string source = "";

            switch (sourceMark)
            {
            case 0:
                source = "客服反馈";
                break;

            case 1:
                source = "推广建议";
                break;

            default:
                source = "客服反馈";
                break;
            }

            if (Sys_TaskDailyBLL.CheckTaskDailyExist(content))
            {
                return(2);
            }

            try
            {
                model.t_mk    = content;
                model.dt_Time = DateTime.Now;

                model.accountid = accId;

                model.inertTime = DateTime.Now;
                model.dt_Level  = 9;
                model.dt_Status = 99;

                model.insetName = uName;
                model.dt_remark = "";
                model.dt_logUid = 0;
                model.dt_Source = source;

                if (Sys_TaskDailyBLL.AddModel(model) > 0)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("添加" + source + "出错!", ex);
                return(0);
            }
        }
Esempio n. 3
0
        public static string AddNewReqModel(int accId, int refId, int cateId, int reqType, string desc, int op, string originDesc, int device, int val, int diff)
        {
            Model.RequirementManage model = new Model.RequirementManage();

            model.AccId           = accId.ToString();
            model.RefId           = refId;
            model.CategoryId      = cateId;
            model.RequirementType = reqType;
            model.Description     = desc;
            model.Operator        = op;
            model.Status          = 0;
            model.OriginDesc      = originDesc;

            model.Terminal  = device;
            model.UserVal   = val;
            model.Difficult = diff;

            int reqId = RequirementManageBLL.AddNewModel(model);

            if (reqId != 0)
            {
                if (Sys_TaskDailyBLL.UpdateReqId(reqId, refId) != 0)
                {
                    try
                    {
                        #region Kafka Message 反馈转为需求后

                        AfterImportReq iModel = new AfterImportReq();
                        iModel.EventId = 6;
                        iModel.AccId   = accId;

                        iModel.RequirementDesc = desc;

                        string specModel = CommonLib.Helper.JsonSerializeObject(iModel);

                        KafkaMessage mSend = new KafkaMessage();
                        mSend.SendMsg(6, specModel);

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("反馈转为需求后推送模板消息错误", ex);
                    }

                    return("添加成功!");
                }
                else
                {
                    return("添加关联信息出错!请联系技术~");
                }
            }
            else
            {
                return("添加新的需求记录出错!请联系技术~");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 得到列表信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="status">状态</param>
        /// <param name="startlevel">开始重要性</param>
        /// <param name="endlevel">结束重要性</param>
        /// <param name="source">来源</param>
        /// <returns></returns>
        public static Dictionary <string, object> GetList(int pageIndex, int pageSize, int status, int startlevel = 0, int endlevel = 0, string source = "")
        {
            Dictionary <string, object> list         = new Dictionary <string, object>();
            List <DapperWhere>          dapperWheres = new List <DapperWhere>();

            dapperWheres.Add(new DapperWhere("dt_Status", status));
            if (startlevel > 0)
            {
                dapperWheres.Add(new DapperWhere("startLevel", startlevel, " dt_Level<@startLevel "));
            }
            if (endlevel > 0)
            {
                dapperWheres.Add(new DapperWhere("endLevel", endlevel, " dt_Level>=@endLevel "));
            }
            if (source.Length > 0)
            {
                dapperWheres.Add(new DapperWhere("dt_Source", source));
            }

            if (pageSize < 1)
            {
                pageSize = 20;
            }

            int rowCount = 0;

            if (pageIndex == 1)
            {
                rowCount = BLL.Base.Sys_TaskDailyBaseBLL.GetCount(dapperWheres);
            }
            int maxPage = 0;

            if (rowCount > 0)
            {
                maxPage = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(rowCount) / pageSize));
            }

            List <Sys_TaskDailyInfo> data = Sys_TaskDailyBLL.GetList(pageIndex, pageSize, dapperWheres,
                                                                     " dt_Level asc,id desc");

            foreach (var item in data)
            {
                if (item.dt_remark.IndexOf('@') == 0)
                {
                    item.forumUrl = item.dt_remark.Substring(item.dt_remark.IndexOf('(') + 1,
                                                             item.dt_remark.IndexOf(')') - item.dt_remark.IndexOf('(') - 1);
                }
            }

            list["rowCount"]  = rowCount;
            list["maxPage"]   = maxPage;
            list["pageIndex"] = pageIndex;
            list["listData"]  = data;

            return(list);
        }
Esempio n. 5
0
        public static string GetShopSimpleVisitTasks(int accId)
        {
            var model = Sys_TaskDailyBLL.GetShopSimpleVisitTasks(accId);

            if (model != null)
            {
                return(CommonLib.Helper.JsonSerializeObject(model));
            }
            else
            {
                return("");
            }
        }
Esempio n. 6
0
 /// <summary>
 /// 处理回访其他事件
 /// </summary>
 /// <param name="accid"></param>
 /// <param name="vid"></param>
 /// <param name="insertName"></param>
 /// <param name="tags"></param>
 /// <param name="taskid"></param>
 public static void AddVisitInfoOtherDispose(int accid, int vid, string insertName, string tags, int taskid)
 {
     //处理 日常任务记录为处理成功
     if (taskid > 0)
     {
         Sys_TaskDailyBLL.UpdateWorkOut(taskid, insertName, vid);
     }
     //增加标签
     if (tags.Length > 0)
     {
         foreach (string item in tags.Split(','))
         {
             int tagid = 0;
             if (int.TryParse(item, out tagid))
             {
                 Sys_VisitTagNexusBLL.Add(vid, tagid, insertName);
                 Thread.Sleep(100);
             }
         }
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 获取首页显示的五条回访数据
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="status"></param>
        /// <param name="startlevel">小于 30 为非常紧急</param>
        /// <returns></returns>
        public static List <Sys_TaskDailyInfo> IndexDailyTaskInfo(int pageIndex = 1, int pageSize = 5, int status = 0, int startlevel = 30)
        {
            List <DapperWhere> dapperWheres = new List <DapperWhere>();

            dapperWheres.Add(new DapperWhere("dt_Status", status));
            if (startlevel > 0)
            {
                dapperWheres.Add(new DapperWhere("startLevel", startlevel, " dt_Level<@startLevel "));
            }

            List <Sys_TaskDailyInfo> list = Sys_TaskDailyBLL.GetList(pageIndex, pageSize, dapperWheres, " inertTime desc");

            foreach (var item in list)
            {
                if (item.dt_remark.IndexOf('@') == 0)
                {
                    item.forumUrl = item.dt_remark.Substring(item.dt_remark.IndexOf('(') + 1,
                                                             item.dt_remark.IndexOf(')') - item.dt_remark.IndexOf('(') - 1);
                }
            }

            return(list);
        }
Esempio n. 8
0
 public static Dictionary <string, string> GetFeedbackSummary(DateTime stDate, DateTime edDate)
 {
     return(Sys_TaskDailyBLL.GetFeedbackSummary(stDate, edDate));
 }
Esempio n. 9
0
 public static Dictionary <string, string> GetFeedbackList(int pageIndex, int accId, DateTime start, DateTime end, int visitStatus, int feedType, string content)
 {
     return(Sys_TaskDailyBLL.GetFeedbackList(pageIndex, accId, start, end, visitStatus, feedType, content));
 }
Esempio n. 10
0
        /// <summary>
        /// 插入论坛建议反馈
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static string GetForumFeedBack(string url, string uName, string remark)
        {
            if (url.IndexOf("www.i200.cn/bbs") < 0)
            {
                return("");//不是合法地址
            }
            //制定编码格式
            var encoding = Encoding.GetEncoding("utf-8");
            //url的设置
            var request = (HttpWebRequest)WebRequest.Create(url);

            //设置请求的方式
            request.Method = "Get";
            //设置Content-Type 的值
            //request.ContentType = "application/x-www-form-urlencoded";

            //request.ContentLength = data.Length;
            //var outStream = request.GetRequestStream();
            //outStream.Write(data, 0, data.Length);
            //outStream.Close();
            var response  = (HttpWebResponse)request.GetResponse();
            var srContent = new System.IO.StreamReader(response.GetResponseStream(), encoding);
            //获取抓取下来的页面内容
            var strPage = srContent.ReadToEnd();

            response.Close();
            srContent.Close();

            //获取帖子标题
            Regex           regTitle = new Regex(@"(?i)(?<=<a.*?id=""thread_subject"".*?>)[^<]+(?=</a>)");
            MatchCollection mcTitle  = regTitle.Matches(strPage);

            //获取帖子发表时间
            Regex           regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于)[^<]+(?=</em>)");
            MatchCollection mcTime  = regTime.Matches(strPage);

            if (mcTime.Count == 0)
            {
                regTime = new Regex(@"(?i)(?<=<em.*?id=""authorposton.*?>发表于.*<span.*title="")[^<]+(?="">)");
                mcTime  = regTime.Matches(strPage);
            }

            string postUser = strPage.Substring(strPage.IndexOf("class=\"pi\""), 300);

            //获取发帖人
            Regex           regUser = new Regex(@"(?i)(?<=<a.*?uid=)[^<]+(?="".*?target)");
            MatchCollection mcUser  = regUser.Matches(postUser);

            if (mcUser.Count == 0)
            {
                regUser = new Regex(@"(?i)(?<=匿名.*?<em>)[^<]+(?=</em>)");
                mcUser  = regUser.Matches(postUser);
            }

            Sys_TaskDailyInfo model = new Sys_TaskDailyInfo();

            try
            {
                model.t_mk    = mcTitle[0].Groups[0].ToString();
                model.dt_Time = Convert.ToDateTime(mcTime[0].Groups[0].ToString());
                if (mcUser[0].Groups[0].ToString().IndexOf('.') >= 0)
                {
                    model.accountid = 0;
                }
                else
                {
                    try
                    {
                        model.accountid = T_AccountBLL.GetAccIdBybbsId(Convert.ToInt32(mcUser[0].Groups[0].ToString()));
                    }
                    catch (Exception ex)
                    {
                        Logger.Error("转换论坛ID出错!", ex);
                        model.accountid = 0;
                    }
                }

                model.inertTime = DateTime.Now;
                model.dt_Level  = 9;
                model.dt_Status = 99;

                model.insetName = uName;
                model.dt_remark = "@(" + url + ")" + remark;
                model.dt_logUid = 0;
                model.dt_Source = "论坛反馈";

                if (Sys_TaskDailyBLL.CheckForumUrl(url))
                {
                    return("已经存在该条反馈!");
                }
                else
                {
                    if (Sys_TaskDailyBLL.AddModel(model) > 0)
                    {
                        return("添加成功!");
                    }
                    else
                    {
                        return("添加出错!");
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error("添加论坛反馈出错!", ex);
                return("添加反馈出错!");
            }

            //return mcTitle[0].Groups[0].ToString() + "  " + mcTime[0].Groups[0].ToString() + "  " + mcUser[0].Groups[0].ToString();
            //foreach (Match m in mc)
            //{
            //    Console.WriteLine(m.Groups[0].ToString());
            //}

            //return strPage;
        }