/// <summary> /// 添加回复 /// </summary> /// <param name="vi_id">回访ID</param> /// <param name="accid">店铺ID</param> /// <param name="vr_Content">回访内容</param> /// <param name="vr_Stat">回访状态</param> /// <param name="vr_Name">回访人</param> /// <param name="reply_Stat">查看状态</param> /// <returns></returns> public static int AddVisitReply(int vi_id, int accid, string vr_Content, int vr_Stat, string vr_Name, int reply_Stat = 1) { Sys_VisitReply model = new Sys_VisitReply(); model.vi_id = vi_id; model.accid = accid; model.vr_Content = vr_Content; model.vr_Stat = vr_Stat; model.vr_Name = vr_Name; model.reply_Stat = reply_Stat; model.vr_Time = DateTime.Now; int aId = BLL.Base.Sys_VisitReplyBaseBLL.Add(model); if (aId > 0) { Sys_VisitInfoBLL.UpdateVisitStat(vi_id, vr_Stat); return(1); } else { return(0); } }
/// <summary> /// 得到事件列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="dapperWhere"></param> /// <param name="filedOrder"></param> /// <returns></returns> public static Dictionary <string, object> GetCaseList(int pageIndex, int dataType, int classType, string revisitName, DateTime?statTime = null, DateTime?endTime = null) { List <DapperWhere> dapperWhere = new List <DapperWhere>(); Dictionary <string, object> list = new Dictionary <string, object>(); int pageSize = 15; if (dataType == 1) { dapperWhere.Add(new DapperWhere("insertTime", DateTime.Now, "insertTime between CAST(@insertTime as DATE) and @insertTime")); dapperWhere.Add(new DapperWhere("handleStat", 1, " handleStat!=@handleStat")); } else if (dataType == 2) { dapperWhere.Add(new DapperWhere("insertTime", DateTime.Now.Date, "insertTime < @insertTime")); dapperWhere.Add(new DapperWhere("handleStat", 1, " handleStat!=@handleStat")); } else { dapperWhere.Add(new DapperWhere("handleStat", 1)); if (classType != -1) { //分类筛选 dapperWhere.Add(new DapperWhere("vr_Threeid", classType)); } if (revisitName != "") { //回访人员 revisitName = "%" + revisitName + "%"; dapperWhere.Add(new DapperWhere("insertName", revisitName, " insertName like @insertName")); } } if (statTime != null) { dapperWhere.Add(new DapperWhere("bgDate", Convert.ToDateTime(statTime).Date, "insertTime >= @bgDate")); } if (endTime != null) { dapperWhere.Add(new DapperWhere("edDate", Convert.ToDateTime(endTime).Date.Add(new TimeSpan(23, 59, 59)), "insertTime <= @edDate")); } int rowCount = 0; if (pageIndex == 1) { rowCount = BLL.Base.Sys_VisitInfoBaseBLL.GetCount(dapperWhere); } int maxPage = 0; if (rowCount > 0) { maxPage = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(rowCount) / pageSize)); } list["rowCount"] = rowCount; list["maxPage"] = maxPage; list["pageIndex"] = pageIndex; list["listData"] = Sys_VisitInfoBLL.GetCaseList(pageIndex, pageSize, dapperWhere, " id desc"); return(list); }
/// <summary> /// 得到一个详情的信息 /// </summary> /// <param name="id"></param> /// <returns></returns> public static SysVisitParticularModel GetParticularModel(int id) { return(Sys_VisitInfoBLL.GetParticularModel(id)); }
/// <summary> /// 得到列表 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="dapperWheres"></param> /// <param name="filedOrder"></param> /// <returns></returns> public static Dictionary <string, object> GetList(int pageIndex, int pageSize, int status = -1, int manner = 0, DateTime?starttime = null, DateTime?endtime = null, int accid = 0, string insertname = "", string tag = "", int recordType = 0, string keyword = "") { Dictionary <string, object> list = new Dictionary <string, object>(); List <DapperWhere> dapperWheres = new List <DapperWhere>(); if (recordType == 0) { dapperWheres.Add(new DapperWhere("rt_Maxid", 3, "rt_Maxid<@rt_Maxid")); } else { dapperWheres.Add(new DapperWhere("rt_Maxid", 3)); } if (accid > 0) { dapperWheres.Add(new DapperWhere("accid", accid)); } if (status > -1) { dapperWheres.Add(new DapperWhere("handleStat", status)); } if (manner > 0) { dapperWheres.Add(new DapperWhere("vm_id", manner)); } if (starttime != null) { dapperWheres.Add(new DapperWhere("startTime", Convert.ToDateTime(starttime).Date, "insertTime>=@startTime")); } if (endtime != null) { dapperWheres.Add(new DapperWhere("endTime", Convert.ToDateTime(endtime).Date.Add(new TimeSpan(23, 59, 59)), "insertTime<=@endTime")); } if (insertname.Length > 0) { dapperWheres.Add(new DapperWhere("insertName", insertname.Trim())); } if (keyword.Length > 0) { dapperWheres.Add(new DapperWhere("vi_Content", keyword, "vi_Content like '%" + keyword + "%'")); } if (tag.Length > 0) { string tagList = ""; int count = 0; foreach (string item in tag.Split(',')) { int tagid = 0; if (int.TryParse(item, out tagid)) { tagList += "," + item; } count++; } if (tagList.Length > 0) { dapperWheres.Add(new DapperWhere("taglist", tagList, "id in(select vid from Sys_VisitTagNexus where tid in (" + tagList.Trim(',') + ") group by vid having count(*)=" + count + ")")); } } if (pageSize < 1) { pageSize = 20; } int rowCount = 0; if (pageIndex == 1) { rowCount = BLL.Base.Sys_VisitInfoBaseBLL.GetCount(dapperWheres); } int maxPage = 0; if (rowCount > 0) { maxPage = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(rowCount) / pageSize)); } List <Sys_VisitInfoBase> dataList = Sys_VisitInfoBLL.GetList(pageIndex, pageSize, dapperWheres, " id desc"); dataList = dataList.OrderByDescending(x => x.insertTime).ToList(); //foreach (Sys_VisitInfoBase item in dataList) //{ // string content = item.vi_Content; // if (content.Contains('{')) // { // string filterContent = "反馈问题:"; // filterContent += content.Substring(content.IndexOf('{'), content.IndexOf('【')) + "<br/>回访记录:"; // filterContent += content.Substring(content.IndexOf('}'), content.Length); // item.vi_Content = filterContent; // } //} list["rowCount"] = rowCount; list["maxPage"] = maxPage; list["pageIndex"] = pageIndex; list["listData"] = dataList; return(list); }
public static VisitPeriodModel GetVisitPeriod(int accid) { return(Sys_VisitInfoBLL.GetVisitPeriod(accid)); }
/// <summary> /// 得到需要回访的回访列表 /// </summary> /// <param name="accid"></param> /// <returns></returns> public static List <SysNeedVisitModel> GetNeedVisitList(int accid) { var list = Sys_VisitInfoBLL.GetNeedVisitList(accid); return(list); }