public void ProcessRequest(HttpContext context) { string type = context.Request["type"]; UserExpandType nType = new UserExpandType(); if (!Enum.TryParse(type, out nType)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "类型格式不能识别"; bllUserEx.ContextResponse(context, apiResp); return; } UserExpand ex = bllUserEx.GetUserExpand(nType, CurrentUserInfo.UserID); if (ex == null) { ex = new UserExpand(); } apiResp.result = new { value = ex.DataValue, ex1 = ex.Ex1, ex2 = ex.Ex2, ex3 = ex.Ex3, ex4 = ex.Ex4, ex5 = ex.Ex5, ex6 = ex.Ex6, ex7 = ex.Ex7, ex8 = ex.Ex8, ex9 = ex.Ex9, ex10 = ex.Ex10 }; apiResp.msg = "获取完成"; apiResp.status = true; apiResp.code = (int)APIErrCode.IsSuccess; bllUserEx.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string type = context.Request["type"]; string value = context.Request["value"]; string ex1 = context.Request["ex1"]; string ex2 = context.Request["ex2"]; string ex3 = context.Request["ex3"]; string ex4 = context.Request["ex4"]; string ex5 = context.Request["ex5"]; string ex6 = context.Request["ex6"]; string ex7 = context.Request["ex7"]; string ex8 = context.Request["ex8"]; string ex9 = context.Request["ex9"]; string ex10 = context.Request["ex10"]; UserExpandType nType = new UserExpandType(); if (!Enum.TryParse(type, out nType)) { apiResp.code = (int)APIErrCode.IsNotFound; apiResp.msg = "类型格式不能识别"; bllUserEx.ContextResponse(context, apiResp); return; } if (bllUserEx.UpdateUserExpand(nType, CurrentUserInfo.UserID, value, ex1, ex2, ex3, ex4, ex5, ex6, ex7, ex8, ex9, ex10)) { apiResp.msg = "修改完成"; apiResp.status = true; apiResp.code = (int)APIErrCode.IsSuccess; } else { apiResp.msg = "修改失败"; apiResp.code = (int)APIErrCode.OperateFail; } bllUserEx.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { string type = context.Request["type"]; string member = context.Request["member"]; string websiteOwner = bllUser.WebsiteOwner; string userIds = ""; UserExpandType nType = new UserExpandType(); if (!Enum.TryParse(type, out nType)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "类型格式不能识别"; bllUserEx.ContextResponse(context, apiResp); return; } string tname = BLLUserExpand.dicTypes[type]; if (!string.IsNullOrWhiteSpace(member)) { userIds = bllUser.GetSpreadUserIds(member, websiteOwner); } List <UserExpand> list = bllUserEx.GetExpandList(int.MaxValue, 1, nType, userIds); DataTable dt = new DataTable(); dt.Columns.Add("会员编号", typeof(int)); dt.Columns.Add("会员手机", typeof(string)); dt.Columns.Add("会员姓名", typeof(string)); if (BLLUserExpand.dicColumns.ContainsKey(type)) { foreach (var item in BLLUserExpand.dicColumns[type]) { dt.Columns.Add(item.name, typeof(string)); } } if (list.Count > 0) { string uIds = ZentCloud.Common.MyStringHelper.ListToStr(list.Select(p => p.UserId).ToList(), "'", ","); List <UserInfo> uList = bllUser.GetColMultListByKey <UserInfo>(int.MaxValue, 1, "UserID", uIds, "AutoID,WXNickname,TrueName,Phone,UserID", websiteOwner: websiteOwner); foreach (var item in list) { UserInfo u = uList.FirstOrDefault(p => p.UserID == item.UserId); DataRow dr = dt.NewRow(); dr["会员编号"] = u == null ? 0 : u.AutoID; dr["会员手机"] = u == null ? "" : u.Phone; dr["会员姓名"] = u == null ? "" : bllUser.GetUserDispalyName(u); if (BLLUserExpand.dicColumns.ContainsKey(type)) { JObject jOb = JObject.FromObject(item); foreach (var col in BLLUserExpand.dicColumns[type]) { if (!string.IsNullOrWhiteSpace(col.mfield)) { dr[col.name] = jOb[col.mfield]; } } } dt.Rows.Add(dr); } dt.TableName = tname; dt.AcceptChanges(); } MemoryStream ms = Web.DataLoadTool.NPOIHelper.Export(dt, tname); ExportCache exCache = new ExportCache() { FileName = string.Format("{0}.xls", tname), Stream = ms }; string cache = Guid.NewGuid().ToString("N").ToUpper(); RedisHelper.RedisHelper.StringSetSerialize(cache, exCache, TimeSpan.FromMinutes(5)); apiResp.status = true; apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsSuccess; apiResp.msg = "生成完成"; apiResp.result = new { cache = cache }; bllUser.ContextResponse(context, apiResp); }
public void ProcessRequest(HttpContext context) { int rows = Convert.ToInt32(context.Request["rows"]); int page = Convert.ToInt32(context.Request["page"]); string type = context.Request["type"]; string member = context.Request["member"]; string websiteOwner = bllUser.WebsiteOwner; string userIds = ""; UserExpandType nType = new UserExpandType(); if (!Enum.TryParse(type, out nType)) { apiResp.code = (int)APIErrCode.OperateFail; apiResp.msg = "类型格式不能识别"; bllUserEx.ContextResponse(context, apiResp); return; } if (!string.IsNullOrWhiteSpace(member)) { userIds = bllUser.GetSpreadUserIds(member, websiteOwner); } int total = bllUserEx.GetExpandListCount(nType, userIds); List <dynamic> rlist = new List <dynamic>(); if (total > 0) { List <UserExpand> list = bllUserEx.GetExpandList(rows, page, nType, userIds); if (list.Count > 0) { string uIds = ZentCloud.Common.MyStringHelper.ListToStr(list.Select(p => p.UserId).ToList(), "'", ","); List <UserInfo> uList = bllUser.GetColMultListByKey <UserInfo>(int.MaxValue, 1, "UserID", uIds, "AutoID,WXNickname,TrueName,Phone,UserID", websiteOwner: websiteOwner); foreach (var item in list) { UserInfo u = uList.FirstOrDefault(p => p.UserID == item.UserId); rlist.Add(new { id = u == null ? 0 : u.AutoID, userid = u == null ? "" : u.UserID, nickname = u == null ? "" : bllUser.GetUserDispalyName(u), phone = u == null ? "" : u.Phone, value = item.DataValue, ex1 = item.Ex1, ex2 = item.Ex2, ex3 = item.Ex3, ex4 = item.Ex4, ex5 = item.Ex5, ex6 = item.Ex6, ex7 = item.Ex7, ex8 = item.Ex8, ex9 = item.Ex9, ex10 = item.Ex10 }); } } } apiResp.result = new { totalcount = total, list = rlist }; apiResp.status = true; apiResp.msg = "查询扩展信息"; apiResp.code = (int)APIErrCode.IsSuccess; bllUserEx.ContextResponse(context, apiResp); }