From 402f9568e48e6e1a9d29d37dcda46737047425d5 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 25 十一月 2021 10:49:10 +0800 Subject: [PATCH] 专家通讯录优化 --- zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 202 insertions(+), 5 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs b/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs index aa5ae0e..efaacce 100644 --- a/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/Expert/ExpertController.cs @@ -12,6 +12,8 @@ using System.IO; using Microsoft.Extensions.Configuration; using System.Transactions; +using CommonToolsCore; +using System.Text; namespace zhengcaioa.Controllers.Expert { @@ -27,8 +29,10 @@ private readonly ICooperOrderService _cooperOrderService; private readonly IFiAccountService _fiAccountService; private readonly IFiAccountRecordService _iFiAccountRecordService; + private readonly IAreaService _iAreaService; public ExpertController(ILogger<ExpertController> logger, IExpertService expertService, IProjectService projectService, ILiaotianService liaotianService, IUserService userService - , IFiSubjectService ifiSubjectService, ICooperOrderService cooperOrderService, IFiAccountService fiAccountService, IFiAccountRecordService iFiAccountRecordService) + , IFiSubjectService ifiSubjectService, ICooperOrderService cooperOrderService, IFiAccountService fiAccountService, IFiAccountRecordService iFiAccountRecordService + , IAreaService iAreaService) { _logger = logger; _expertService = expertService; @@ -39,6 +43,7 @@ _cooperOrderService = cooperOrderService; _fiAccountService = fiAccountService; _iFiAccountRecordService = iFiAccountRecordService; + _iAreaService = iAreaService; } [CheckLogin] public IActionResult Index() @@ -82,9 +87,45 @@ #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(); + ViewBag.YearJiou = _liaotianService.GetSYScode("experts", "year_jiou").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + return View(); + } + + #region 缂栬緫 [CheckLogin] - public ActionResult Edit(string id = null) + public ActionResult Edit(string id = null, string Province = null, string City = null) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); @@ -107,8 +148,28 @@ } else { - expertDTO.Province = "510000"; - expertDTO.City = "510100"; + if (string.IsNullOrEmpty(Province)) + { + expertDTO.Province = "510000"; + } + else + { + expertDTO.Province = Province; + } + if (string.IsNullOrEmpty(City)) + { + expertDTO.City = "510100"; + } + else + { + expertDTO.City = City; + } + expertDTO.ExpertType = "4"; + expertDTO.Level = "1"; + expertDTO.CertiNumber = "SC"; + expertDTO.InfoSource = "01"; + expertDTO.Sex = "1"; + expertDTO.YearJiou = "1"; } // var sheng = _projectService.Getsheng(); @@ -122,6 +183,7 @@ ViewBag.Province = _projectService.Getsheng();//.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); ViewBag.City = _projectService.Getshi(expertDTO.Province);//.Select(x => new { code = x.CodeId, label = x.Name }).ToList(); + ViewBag.YearJiou = _liaotianService.GetSYScode("experts", "year_jiou");//.Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); ViewData.Model = expertDTO; return View(); } @@ -532,9 +594,144 @@ - + #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); + } + + + /// <summary> + /// 鍒ゆ柇韬唤璇佹槸鍚﹂噸澶� + /// </summary> + /// <param name="shengid">鐪乮d</param> + /// <returns></returns> + /// + [CheckLogin] + public string IdCardChongfu(string IdCard = "",string Id = "") + { + ResultEntity resultEntity = _expertService.IdCardChongfu(IdCard, Id); + + return JsonConvert.SerializeObject(resultEntity); + + } + + + /// <summary> + /// 鍒ゆ柇涓撳璇佹槸鍚﹂噸澶� + /// </summary> + /// <param name="shengid">鐪乮d</param> + /// <returns></returns> + /// + [CheckLogin] + public string CertiNumberChongfu(string CertiNumber = "", string Id = "") + { + ResultEntity resultEntity = _expertService.CertiNumberChongfu(CertiNumber, Id); + if (resultEntity.Result) + { + //鎷嗚В涓撳璇佸彿 + + var CertiNumber11 = CertiNumber.Replace("SC", ""); + var sysCodeDtls = _liaotianService.GetSYScode("experts", "City"); + + var chengshis = sysCodeDtls.Where(x => CertiNumber11.StartsWith(x.CodeSn)).ToList(); + if (chengshis.Count > 0) + { + var areaDTOs = _iAreaService.GetList(); + + var chengshi = areaDTOs.Where(x => x.Name == chengshis[0].Comments).FirstOrDefault(); + if (chengshi != null) + { + resultEntity.Message = chengshi.CodeId; + resultEntity.Remark = chengshi.ParentId; + } + + } + + } + + return JsonConvert.SerializeObject(resultEntity); + + } + + + /// <summary> + /// 鍒ゆ柇鐢佃瘽鏄惁閲嶅 + /// </summary> + /// <param name="shengid">鐪乮d</param> + /// <returns></returns> + /// + [CheckLogin] + public string Phone1Chongfu(string Phone1 = "", string Id = "") + { + ResultEntity resultEntity = _expertService.Phone1Chongfu(Phone1, Id); + + return JsonConvert.SerializeObject(resultEntity); + + } + } } -- Gitblit v1.9.1