| | |
| | | using System.IO; |
| | | using Microsoft.Extensions.Configuration; |
| | | using System.Transactions; |
| | | using CommonToolsCore; |
| | | using System.Text; |
| | | |
| | | namespace zhengcaioa.Controllers.Expert |
| | | { |
| | |
| | | return JsonConvert.SerializeObject(_expertService.SearchByPaging(search)); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | [CheckLogin] |
| | | public IActionResult Indexziliao() |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | ActionEntity actionEntity4 = new ActionEntity(); |
| | | actionEntity4.OpenType = 0; |
| | | actionEntity4.ActionUrl = ""; |
| | | actionEntity4.ActionFun = "Duanxin"; |
| | | actionEntity4.PageIco = ""; |
| | | actionEntity4.ActionName = "群发短信"; |
| | | actionlist.Add(actionEntity4); |
| | | ViewData["ActionInfo"] = actionlist; |
| | | |
| | | ViewBag.expertType = _liaotianService.GetSYScode("experts", "expertType").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.level = _liaotianService.GetSYScode("experts", "level").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.Province = _projectService.Getsheng().Select(x => new { code = x.CodeId, label = x.Name }).ToList(); |
| | | // ViewBag.City = _projectService.Getshi( ).Select(x => new { code = x.CodeId, label = x.Name }).ToList(); |
| | | ViewBag.ReviewItem = _liaotianService.GetSYScode("experts", "ReviewItem").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | |
| | | |
| | | ViewBag.users = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | #region 编辑 |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | public IActionResult Duanxin(string id = null) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | ViewData["baifangid"] = id; |
| | | |
| | | |
| | | |
| | | return View(); |
| | | } |
| | | |
| | | |
| | | |
| | | public IActionResult Fasong(string neirong, string baifangid) |
| | | { |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | resultEntity.Result = true; |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["curentuser"] = curentuser; |
| | | List<ExpertDTO> result = new List<ExpertDTO>(); |
| | | |
| | | if (baifangid != null) |
| | | { |
| | | result = _expertService.GetList(baifangid.Split(",")); |
| | | } |
| | | else |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "无联系人号码"; |
| | | } |
| | | string customename = ""; |
| | | StringBuilder number = new StringBuilder(); ; |
| | | if (result != null && result.Count > 0) |
| | | { |
| | | for (int i = 0; i < result.Count; i++) |
| | | { |
| | | number.Append(string.IsNullOrEmpty(result[i].Phone1) ? result[i].Phone2 : result[i].Phone1); |
| | | customename += result[i].Name + ","; |
| | | if (i != result.Count - 1) |
| | | { |
| | | number.Append(","); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "无联系电话"; |
| | | } |
| | | |
| | | string sss = SMSHelper.PushWToUserMES(number.ToString(), "您好,专家. 详情见" + neirong); |
| | | if (int.Parse(sss) <= 0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = "短信发送失败"; |
| | | |
| | | } |
| | | |
| | | _logger.LogInformation(curentuser.UserName + "发送短信给专家" + customename); |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | } |
| | | } |