| | |
| | | private readonly ILiaotianService _liaotianService; |
| | | private readonly IUserService _userService; |
| | | private readonly IHrDeptService _hrDeptService; |
| | | private readonly IPltPageService _pltPageService; |
| | | |
| | | [CheckLogin] |
| | | public DailyManagementController(ILogger<DailyManagementController> logger, IDailyManagementService DailyManageService, |
| | | ILiaotianService liaotianService, IUserService userService, IHrDeptService hrDeptService) |
| | | ILiaotianService liaotianService, IUserService userService, IHrDeptService hrDeptService |
| | | , IPltPageService pltPageService) |
| | | { |
| | | _logger = logger; |
| | | _DailyManageService = DailyManageService; |
| | | _liaotianService = liaotianService; |
| | | _userService = userService; |
| | | _hrDeptService = hrDeptService; |
| | | _pltPageService = pltPageService; |
| | | } |
| | | |
| | | #region 通话管理 |
| | | [CheckLogin] |
| | | public IActionResult HoldPhone() |
| | | { |
| | | 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 actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = 0; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = "Add"; |
| | | actionEntity1.PageIco = "fa fa-plus"; |
| | | actionEntity1.ActionName = "新增"; |
| | | actionlist.Add(actionEntity1); |
| | | |
| | | //ActionEntity actionEntity1 = new ActionEntity(); |
| | | //actionEntity1.OpenType = 0; |
| | | //actionEntity1.ActionUrl = ""; |
| | | //actionEntity1.ActionFun = "Add"; |
| | | //actionEntity1.PageIco = "fa fa-plus"; |
| | | //actionEntity1.ActionName = "新增"; |
| | | //actionlist.Add(actionEntity1); |
| | | var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/DailyManagement/HoldPhone/"); |
| | | var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList(); |
| | | if(pageEntities1.Count(x=>x.PageShortcut == "Search") <= 0) |
| | | { |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | |
| | | ViewData["Creater"] = curentuser.Id; |
| | | } |
| | | var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList(); |
| | | |
| | | foreach (var pageEntity in pageEntities1) |
| | | { |
| | | ActionEntity actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = pageEntity.OpenType; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = pageEntity.PageShortcut; |
| | | actionEntity1.PageIco = pageEntity.PageIco; |
| | | actionEntity1.ActionName = pageEntity.PageName; |
| | | actionlist.Add(actionEntity1); |
| | | } |
| | | ViewData["ActionInfo"] = actionlist; |
| | | ViewData["ActionInfo2"] = pageEntities2; |
| | | ViewBag.LineType = _liaotianService.GetSYScode("ADM_HoldPhone", "LineType").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewBag.Intention = _liaotianService.GetSYScode("ADM_HoldPhone", "Intention").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | return View(); |
| | |
| | | public IActionResult EditMemoBook(string Rtype="1" , string id = "0") |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["users"] = _userService.GetList(); |
| | | ViewData["users"] = _userService.GetList().Where(x=>x.Id != curentuser.Id).ToList(); |
| | | AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(id); |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); |
| | | Rtype = string.IsNullOrEmpty(admMemoBookDTO.Rtype)? Rtype : admMemoBookDTO.Rtype; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | Rtype = string.IsNullOrEmpty(admMemoBookDTO.Rtype) ? Rtype : admMemoBookDTO.Rtype; |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | ViewBag.Rtype = Rtype; |
| | |
| | | [HttpPost] |
| | | public string SaveMemoBook(AdmMemoBookDTO memoBook) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | memoBook.RecStatus = "A"; |
| | | if (String.IsNullOrEmpty(memoBook.Id)) |
| | | { |
| | |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "查询"; |
| | | actionlist.Add(actionEntity); |
| | | ActionEntity actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = 0; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = "Add"; |
| | | actionEntity1.PageIco = "fa fa-plus"; |
| | | actionEntity1.ActionName = "工作安排"; |
| | | actionlist.Add(actionEntity1); |
| | | //ActionEntity actionEntity1 = new ActionEntity(); |
| | | //actionEntity1.OpenType = 0; |
| | | //actionEntity1.ActionUrl = ""; |
| | | //actionEntity1.ActionFun = "Add"; |
| | | //actionEntity1.PageIco = "fa fa-plus"; |
| | | //actionEntity1.ActionName = "工作安排"; |
| | | //actionlist.Add(actionEntity1); |
| | | |
| | | var pageEntities = _pltPageService.GetUserPage(curentuser.Id, "/DailyManagement/MemoWorkAnPai"); |
| | | var pageEntities1 = pageEntities.Where(x => x.PageMethod == "01").ToList(); |
| | | |
| | | var pageEntities2 = pageEntities.Where(x => x.PageMethod == "02").ToList(); |
| | | |
| | | foreach (var pageEntity in pageEntities1) |
| | | { |
| | | ActionEntity actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = pageEntity.OpenType; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = pageEntity.PageShortcut; |
| | | actionEntity1.PageIco = pageEntity.PageIco; |
| | | actionEntity1.ActionName = pageEntity.PageName; |
| | | actionlist.Add(actionEntity1); |
| | | } |
| | | ViewData["ActionInfo"] = actionlist; |
| | | ViewData["ActionInfo2"] = pageEntities2; |
| | | |
| | | |
| | | //ActionEntity actionEntity2 = new ActionEntity(); |
| | | //actionEntity2.OpenType = 0; |
| | |
| | | ViewBag.User = _userService.GetList().Select(x => new { code = x.Id, label = x.UserName }).ToList(); |
| | | |
| | | ViewBag.Wancheng = _liaotianService.GetSYScode("ADM_MemoBook", "HaveRead").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); |
| | | ViewData["ActionInfo"] = actionlist; |
| | | //ViewData["ActionInfo"] = actionlist; |
| | | return View(); |
| | | } |
| | | |
| | |
| | | public IActionResult EditWorkAnPai( string id = "") |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ViewData["users"] = _userService.GetList(); |
| | | ViewData["curentuser"] = curentuser; |
| | | ViewData["users"] = _userService.GetList().Where(x => x.Id != curentuser.Id).ToList(); |
| | | AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO(); |
| | | if (!string.IsNullOrEmpty(id)) |
| | | { |
| | |
| | | admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId; |
| | | } |
| | | |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | //admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = ""; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | ViewData["Dept"] = _hrDeptService.GetList(); |
| | |
| | | admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId; |
| | | } |
| | | |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | //admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = ""; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | ViewBag.KaoHe = _liaotianService.GetSYScode("ADM_MemoBook", "KaoHe"); |
| | |
| | | admMemoBookDTO = _DailyManageService.GetMemoBook(id); |
| | | } |
| | | |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | //admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = ""; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | ViewBag.Rtype = _liaotianService.GetSYScode("ADM_MemoBook", "Rtype").Where(x=>x.CodeSn=="2" || x.CodeSn == "4").ToList(); |
| | |
| | | admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId; |
| | | } |
| | | |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | //admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = ""; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | |
| | |
| | | admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId; |
| | | } |
| | | |
| | | if (admMemoBookDTO.Time.Equals(DateTime.MinValue)) |
| | | if (!admMemoBookDTO.Time.HasValue) |
| | | { |
| | | admMemoBookDTO.Time = DateTime.Now; |
| | | //admMemoBookDTO.Time = DateTime.Now; |
| | | admMemoBookDTO.TimeName = ""; |
| | | } |
| | | else |
| | | { |
| | | admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm"); |
| | | } |
| | | ViewData.Model = admMemoBookDTO; |
| | | |