diff --git a/Mini.Common/Utility.cs b/Mini.Common/Utility.cs index 178f458..8eb945e 100644 --- a/Mini.Common/Utility.cs +++ b/Mini.Common/Utility.cs @@ -23,6 +23,31 @@ namespace Mini.Common { return ConfigHelper.GetSectionValue(key); } + public static string PostAjaxData(string url, string param, Encoding encoding, Dictionary header, int timeout = 20000) + { + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + request.Method = "POST"; + request.ContentType = "application/json;charet=utf-8"; + request.Headers.Add("dataType", "json"); + request.Headers.Add("type", "post"); + request.Timeout = timeout; + foreach (var head in header) + { + request.Headers.Add(head.Key, head.Value); + } + byte[] data = encoding.GetBytes(param); + + using (BinaryWriter reqStream = new BinaryWriter(request.GetRequestStream())) + { + reqStream.Write(data, 0, data.Length); + } + using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + { + StreamReader reader = new StreamReader(response.GetResponseStream(), encoding); + string result = reader.ReadToEnd(); + return result; + } + } /// /// 获取时间戳 diff --git a/Mini.Model/ViewModel/Wx_ExuserModel.cs b/Mini.Model/ViewModel/Wx_ExuserModel.cs index 56c6488..468dae7 100644 --- a/Mini.Model/ViewModel/Wx_ExuserModel.cs +++ b/Mini.Model/ViewModel/Wx_ExuserModel.cs @@ -35,5 +35,11 @@ namespace Mini.Model.ViewModel public string deptname { get; set; } public int? deptid { get; set; } } + public class Wx_isDealDTO + { + public List extuseridList { get; set; } + public List residList { get; set; } + public List eidList { get; set; } + } } diff --git a/Mini.Web/Areas/Admin/Controllers/OutHHuserController.cs b/Mini.Web/Areas/Admin/Controllers/OutHHuserController.cs index 8cd60eb..85db4b0 100644 --- a/Mini.Web/Areas/Admin/Controllers/OutHHuserController.cs +++ b/Mini.Web/Areas/Admin/Controllers/OutHHuserController.cs @@ -758,6 +758,88 @@ namespace Mini.Web.Areas.Admin.Controllers return View(); } + public bool CheckFlag(string ext_flag) + { + return true; + //ext_flag = Utility.Decrypt(ext_flag); + //if (Utility.ConvertStringToDateTime(ext_flag).AddHours(2) >= DateTime.Now) + //{ + // return true; + //} + //return false; + } + /// + /// 聊天记录列表 from 合规系统 + /// + [Area("Admin")] + public ActionResult User_extuserList3(string exuserid, string isHg, string showstyle, string resid, string ext_flag, string eid) + { + List list = new List(); + try + { + if (!CheckFlag(ext_flag)) + { + return Content("验证失败或链接超时"); + } + if (!string.IsNullOrEmpty(exuserid)) + { + list = _iww_hhuser_service.Extuser_GetAllUser(exuserid); + foreach (var item in list) + { + item.name = ManagerPhoneHelper.FormatPhoneUserName(string.Format("{0}", item.name)); + } + } + } + catch (Exception e) + { + LogHelper.Error(e.ToString()); + } + List roomeCList = new List(); + try + { + string notShowGroup = _bas_parameter.GetParameterValue(ParameterEnums.NotShowGroupCorp); + List roomlist = list.GroupBy(m => new { m.corpid, m.extuserid }).Select(m => new RoomParam { corpid = m.Key.corpid, extuserid = m.Key.extuserid }).ToList(); + foreach (RoomParam item in roomlist) + { + if (notShowGroup.IndexOf($"[{item.corpid}]") > -1) + { + continue; + } + List roomeCList2 = _iww_hhuser_service.GetRoomListByChengYuan(item.corpid, item.extuserid); + foreach (Ww_MsgRoom ww in roomeCList2) + { + if (roomeCList.Where(m => m.roomid == ww.roomid).Count() == 0) + { + Ww_MsgRoom room = new Ww_MsgRoom + { + corp = ww.corp, + roomid = ww.roomid, + ctime = ww.ctime, + ctimestr = ww.ctimestr, + roomname = ww.roomname, + userlist = ww.userlist + }; + room.ctimestr = room.ctime.HasValue ? room.ctime.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""; + roomeCList.Add(room); + } + } + } + roomeCList = roomeCList.OrderByDescending(m => m.ctime).ToList(); + } + catch (Exception e) + { + LogHelper.Error("错误:" + e.ToString()); + } + //BuildExuserInfo(list); + //Extuser_AddDeal(list, resid); + ViewBag.data = Common.JsonHelper.ObjDivertToJson(list); + ViewBag.roomData = Common.JsonHelper.ObjDivertToJson(roomeCList);//群的列表 + ViewBag.isHg = isHg; + ViewBag.eid = eid; + // SetBuriedLog(new Ww_Buried_Log { eid = eid, buried_type = "企微聊天记录列表" }); + return View(); + } + [Area("Admin")] public ActionResult OneMessage(string corpid, string name, string extuserid, string uname, string userid) @@ -815,7 +897,7 @@ namespace Mini.Web.Areas.Admin.Controllers j = JsonConvert.SerializeObject(new saledsleadDesDto { appid = $"{corp}_1", appuserid = customer, deptid = deptid, eid = eid, employeeid = eid, employee_id = eid, employee = eid, ext_flag = ext_flag }); content = Utility.encyptDataByConfig("saleclue", Newtonsoft.Json.JsonConvert.SerializeObject ( - new { account = "account", password = "password", appid = $"{corp}_1", appuserid = customer, employee_id = eid, time = Utility.GetTimeStamp() } + new { account = "account", password = "password", appid = $"{corp}_1", appuserid = customer, employee_id = eid,eid=eid, time = Utility.GetTimeStamp() } ) ); ViewBag.content = System.Web.HttpUtility.UrlEncode(content); diff --git a/Mini.Web/Areas/Admin/Views/OutHHuser/User_extuserList3.cshtml b/Mini.Web/Areas/Admin/Views/OutHHuser/User_extuserList3.cshtml new file mode 100644 index 0000000..0d077f3 --- /dev/null +++ b/Mini.Web/Areas/Admin/Views/OutHHuser/User_extuserList3.cshtml @@ -0,0 +1,106 @@ +@{ + ViewData["Title"] = "User_extuserList"; + Layout = "~/Areas/Admin/Views/Shared/_content.cshtml"; +} + +
+
+
+
+
+ + + + diff --git a/Mini.Web/appsettings.json b/Mini.Web/appsettings.json index a2d20a8..8eabae0 100644 --- a/Mini.Web/appsettings.json +++ b/Mini.Web/appsettings.json @@ -6,15 +6,15 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "crmContext": "Server=10.22.11.112;uid=root;pwd=Sa123456.;database=wework;port=3306;Connection Timeout=380;", - "crmMsgContext": "Server=10.22.11.112;uid=root;pwd=Sa123456.;database=wework_ww89347c2378b6e050;port=3306;sslmode=none;Connection Timeout=380;", - "wxContext": "Server=10.22.11.112;uid=root;pwd=Sa123456.;database=wxcontext;port=3306;sslmode=none;Connection Timeout=380;", + "crmContext": "Server=10.22.11.116;uid=root;pwd=Sa123456.;database=wework;port=3306;Connection Timeout=380;", + "crmMsgContext": "Server=10.22.11.116;uid=root;pwd=Sa123456.;database=wework_ww89347c2378b6e050;port=3306;sslmode=none;Connection Timeout=380;", + "wxContext": "Server=10.22.11.116;uid=root;pwd=Sa123456.;database=wxcontext;port=3306;sslmode=none;Connection Timeout=380;", "hgContext": "DATA SOURCE=192.168.11.67:1521/orcl;PERSIST SECURITY INFO=True;USER ID=UPDEV;PASSWORD=sa123456." }, - "HHMessageFile": "http://10.22.11.112:8081/", - "InnerFile": "http://10.22.11.112:8081/", + "HHMessageFile": "http://10.22.11.116:8081/", + "InnerFile": "http://10.22.11.116:8081/", "NewCoreInterface": "http://192.168.11.111:909/", - "HG_INTERNAL_WEBAPI": "p://192.168.11.80:8094/", + "HG_INTERNAL_WEBAPI": "http://192.168.11.80:8094/", "CRM_CORE_WEBAPI": "http://192.168.11.80:8088/", "ZXD_WEBAPI": "http://120.77.165.155:8089/" } \ No newline at end of file