using IServices;
|
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.Extensions.Logging;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Threading.Tasks;
|
using zhengcaioa.Models;
|
using Newtonsoft.Json;
|
using DTO;
|
using Microsoft.AspNetCore.Http;
|
using zhengcaioa.IService;
|
|
namespace zhengcaioa.Controllers.AdmManagement
|
{
|
public class DailyManagementController : Controller
|
{
|
private readonly ILogger<DailyManagementController> _logger;
|
private readonly IDailyManagementService _DailyManageService;
|
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
|
, 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 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();
|
}
|
|
[CheckLogin]
|
public string GetList(AdmHoldPhoneDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
return JsonConvert.SerializeObject(_DailyManageService.GetHoldPhoneList(search));
|
}
|
|
[CheckLogin]
|
public IActionResult EditHoldPhone(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
|
ViewData["users"] = _userService.GetList();
|
ViewData["LineType"] = _liaotianService.GetSYScode("ADM_HoldPhone", "LineType").ToList();
|
ViewData["Intention"] = _liaotianService.GetSYScode("ADM_HoldPhone", "Intention").ToList();
|
AdmHoldPhoneDTO admHoldPhoneDTO = _DailyManageService.GetHoldPhone(id);
|
if (admHoldPhoneDTO.InTime.Equals(DateTime.MinValue))
|
{
|
admHoldPhoneDTO.InTime = DateTime.Now;
|
}
|
if (string.IsNullOrEmpty(admHoldPhoneDTO.UserId) )
|
{
|
admHoldPhoneDTO.UserId = curentuser.Id;
|
}
|
|
if (string.IsNullOrEmpty(admHoldPhoneDTO.LineType))
|
{
|
admHoldPhoneDTO.LineType = "1";
|
}
|
if (string.IsNullOrEmpty(admHoldPhoneDTO.Intention))
|
{
|
admHoldPhoneDTO.Intention = "3";
|
}
|
|
ViewData.Model = admHoldPhoneDTO;
|
return View();
|
}
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveAskLeave(AdmHoldPhoneDTO admHoldPhone)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
admHoldPhone.RecStatus = "A";
|
if (String.IsNullOrEmpty(admHoldPhone.Id))
|
{
|
admHoldPhone.Creater = curentuser.Id;
|
admHoldPhone.Createtime = DateTime.Now;
|
}
|
else
|
{
|
admHoldPhone.Modifier = curentuser.Id;
|
admHoldPhone.Modifytime = DateTime.Now;
|
}
|
ResultEntity resultEntity = _DailyManageService.SaveHoldPhone(admHoldPhone);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
[CheckLogin]
|
public string ModifyStatus(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = _DailyManageService.ModifyStatus(id, curentuser.Id);
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
#endregion
|
|
#region 工作提醒
|
/// <summary>
|
/// 工作提醒
|
/// </summary>
|
/// <returns></returns>
|
[CheckLogin]
|
public IActionResult MemoBook()
|
{
|
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 actionEntity2 = new ActionEntity();
|
//actionEntity2.OpenType = 0;
|
//actionEntity2.ActionUrl = "";
|
//actionEntity2.ActionFun = "Memo";
|
//actionEntity2.PageIco = "fa fa-plus";
|
//actionEntity2.ActionName = "我的备忘录";
|
//actionlist.Add(actionEntity2);
|
ViewData["ActionInfo"] = actionlist;
|
return View();
|
}
|
|
/// <summary>
|
/// 工作提醒列表
|
/// </summary>
|
/// <param name="search"></param>
|
/// <returns></returns>
|
[CheckLogin]
|
public string GetMomeBookList(AdmMemoBookDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
// search.Creater = curentuser.Id;
|
return JsonConvert.SerializeObject(_DailyManageService.GetMemoBookList(search));
|
}
|
|
|
[CheckLogin]
|
public IActionResult EditMemoBook(string Rtype="1" , string id = "0")
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["users"] = _userService.GetList().Where(x=>x.Id != curentuser.Id).ToList();
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
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;
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
|
[CheckLogin]
|
public string ModifyMemoBookStatus(string id,bool isReaded = false)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
if (admMemoBookDTO.HaveRead == 1)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "已经完成得提醒不能删除";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
resultEntity = _DailyManageService.ModifyMemoBookStatus(id, curentuser.Id, isReaded);
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveMemoBook(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
memoBook.RecStatus = "A";
|
if (String.IsNullOrEmpty(memoBook.Id))
|
{
|
memoBook.Creater = curentuser.Id;
|
memoBook.Createtime = DateTime.Now;
|
}
|
else
|
{
|
memoBook.Modifier = curentuser.Id;
|
memoBook.Modifytime = DateTime.Now;
|
}
|
ResultEntity resultEntity = _DailyManageService.SaveMemoBook(memoBook);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
public IActionResult ShowRemind()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
return View();
|
}
|
|
public int CountRemindRecord()
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
return _DailyManageService.GetRemind(curentuser.Id);
|
}
|
#endregion
|
|
|
|
|
|
|
#region 工作安排
|
/// <summary>
|
/// 工作提醒
|
/// </summary>
|
/// <returns></returns>
|
[CheckLogin]
|
public IActionResult MemoWorkAnPai()
|
{
|
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);
|
|
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;
|
//actionEntity2.ActionUrl = "";
|
//actionEntity2.ActionFun = "Memo";
|
//actionEntity2.PageIco = "fa fa-plus";
|
//actionEntity2.ActionName = "我的备忘录";
|
//actionlist.Add(actionEntity2);
|
ViewBag.Dept = _hrDeptService.GetList().Select(x => new { code = x.Id, label = x.DeptName }).ToList();
|
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;
|
return View();
|
}
|
|
/// <summary>
|
/// 工作提醒列表
|
/// </summary>
|
/// <param name="search"></param>
|
/// <returns></returns>
|
[CheckLogin]
|
public string GetWorkAnPaiList(AdmMemoBookDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
// search.Creater = curentuser.Id;
|
return JsonConvert.SerializeObject(_DailyManageService.GetMemoBookList(search));
|
}
|
|
|
|
[CheckLogin]
|
public IActionResult EditWorkAnPai( string id = "")
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ViewData["users"] = _userService.GetList().Where(x => x.Id != curentuser.Id).ToList();
|
AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO();
|
if (!string.IsNullOrEmpty(id))
|
{
|
admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId;
|
}
|
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
//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();
|
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
[CheckLogin]
|
public string ModifyWorkAnPaiStatus(string id, bool isReaded = false)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
if (admMemoBookDTO.HaveRead == 1)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "已经完成得工作不能删除";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
resultEntity = _DailyManageService.ModifyMemoBookStatus(id, curentuser.Id, isReaded);
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveWorkAnPai(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
memoBook.RecStatus = "A";
|
if (String.IsNullOrEmpty(memoBook.Id))
|
{
|
memoBook.Creater = curentuser.Id;
|
memoBook.Createtime = DateTime.Now;
|
}
|
else
|
{
|
memoBook.Modifier = curentuser.Id;
|
memoBook.Modifytime = DateTime.Now;
|
}
|
|
ResultEntity resultEntity = _DailyManageService.SaveMemoBook(memoBook);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
|
[CheckLogin]
|
public IActionResult EditWorkKaoHe(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO();
|
if (!string.IsNullOrEmpty(id))
|
{
|
admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId;
|
}
|
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
//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");
|
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveWorkKaoHe(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(memoBook.Id);
|
if (string.IsNullOrEmpty(admMemoBookDTO.Id))
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未找到工作安排";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
if (admMemoBookDTO.HaveRead!=1)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未完成的工作不能考核";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
admMemoBookDTO.KaoHe = memoBook.KaoHe;
|
admMemoBookDTO.ZhuiZe = memoBook.ZhuiZe;
|
admMemoBookDTO.Modifier = curentuser.Id;
|
admMemoBookDTO.Modifytime = DateTime.Now;
|
|
|
resultEntity = _DailyManageService.SaveMemoBookKaohe(admMemoBookDTO);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
|
#endregion
|
|
|
|
|
#region 我的工作
|
/// <summary>
|
/// 工作提醒
|
/// </summary>
|
/// <returns></returns>
|
[CheckLogin]
|
public IActionResult MemoWorkmy()
|
{
|
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 actionEntity2 = new ActionEntity();
|
//actionEntity2.OpenType = 0;
|
//actionEntity2.ActionUrl = "";
|
//actionEntity2.ActionFun = "Memo";
|
//actionEntity2.PageIco = "fa fa-plus";
|
//actionEntity2.ActionName = "我的备忘录";
|
//actionlist.Add(actionEntity2);
|
|
|
ViewBag.Wancheng = _liaotianService.GetSYScode("ADM_MemoBook", "HaveRead").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.Rtype = _liaotianService.GetSYScode("ADM_MemoBook", "Rtype").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewBag.KaoHe = _liaotianService.GetSYScode("ADM_MemoBook", "KaoHe").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
|
ViewData["ActionInfo"] = actionlist;
|
return View();
|
}
|
|
/// <summary>
|
/// 工作提醒列表
|
/// </summary>
|
/// <param name="search"></param>
|
/// <returns></returns>
|
[CheckLogin]
|
public string GetWorkmyList(AdmMemoBookDTOSearch search)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
// search.Creater = curentuser.Id;
|
return JsonConvert.SerializeObject(_DailyManageService.GetMemoBookList(search));
|
}
|
|
|
[CheckLogin]
|
public IActionResult EditWorkmy(string id = "")
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
|
AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO();
|
if (!string.IsNullOrEmpty(id))
|
{
|
admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
}
|
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
//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();
|
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
[CheckLogin]
|
public string ModifyWorkmyStatus(string id, bool isReaded = false)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ViewData["curentuser"] = curentuser;
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
if (admMemoBookDTO.HaveRead == 1)
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "已经完成得工作不能删除";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
resultEntity = _DailyManageService.ModifyMemoBookStatus(id, curentuser.Id, isReaded);
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveWorkmy(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
memoBook.RecStatus = "A";
|
memoBook.ToUserId = curentuser.Id;
|
if (String.IsNullOrEmpty(memoBook.Id))
|
{
|
memoBook.Creater = curentuser.Id;
|
memoBook.Createtime = DateTime.Now;
|
}
|
else
|
{
|
memoBook.Modifier = curentuser.Id;
|
memoBook.Modifytime = DateTime.Now;
|
}
|
|
ResultEntity resultEntity = _DailyManageService.SaveMemoBook(memoBook);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
|
[CheckLogin]
|
public IActionResult EditWorkBanLi(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO();
|
if (!string.IsNullOrEmpty(id))
|
{
|
admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId;
|
}
|
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
//admMemoBookDTO.Time = DateTime.Now;
|
admMemoBookDTO.TimeName = "";
|
}
|
else
|
{
|
admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm");
|
}
|
ViewData.Model = admMemoBookDTO;
|
|
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveWorkBanLi(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(memoBook.Id);
|
if (string.IsNullOrEmpty(admMemoBookDTO.Id))
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未找到我的工作";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
|
admMemoBookDTO.BanLi = memoBook.BanLi;
|
admMemoBookDTO.HaveRead = 1;
|
admMemoBookDTO.Modifier = curentuser.Id;
|
admMemoBookDTO.Modifytime = DateTime.Now;
|
admMemoBookDTO.WanchengTime = admMemoBookDTO.Modifytime;
|
|
|
resultEntity = _DailyManageService.SaveMemoBook(admMemoBookDTO);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
|
|
[CheckLogin]
|
public IActionResult EditWorkShenSu(string id)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
AdmMemoBookDTO admMemoBookDTO = new AdmMemoBookDTO();
|
if (!string.IsNullOrEmpty(id))
|
{
|
admMemoBookDTO = _DailyManageService.GetMemoBook(id);
|
admMemoBookDTO.WorkDept = _userService.GetPltUserEntity(admMemoBookDTO.ToUserId).DeptId;
|
}
|
|
if (!admMemoBookDTO.Time.HasValue)
|
{
|
//admMemoBookDTO.Time = DateTime.Now;
|
admMemoBookDTO.TimeName = "";
|
}
|
else
|
{
|
admMemoBookDTO.TimeName = admMemoBookDTO.Time.Value.ToString("yyyy-MM-dd HH:mm");
|
}
|
ViewData.Model = admMemoBookDTO;
|
|
|
ViewBag.curUserId = curentuser.Id;
|
return View();
|
}
|
|
|
[CheckLogin]
|
[HttpPost]
|
public string SaveWorkShenSu(AdmMemoBookDTO memoBook)
|
{
|
var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
|
ResultEntity resultEntity = new ResultEntity();
|
resultEntity.Result = false;
|
AdmMemoBookDTO admMemoBookDTO = _DailyManageService.GetMemoBook(memoBook.Id);
|
if (string.IsNullOrEmpty(admMemoBookDTO.Id))
|
{
|
resultEntity.Result = false;
|
resultEntity.Message = "未找到我的工作";
|
return JsonConvert.SerializeObject(resultEntity);
|
}
|
|
admMemoBookDTO.ShenSu = memoBook.ShenSu;
|
admMemoBookDTO.Modifier = curentuser.Id;
|
admMemoBookDTO.Modifytime = DateTime.Now;
|
admMemoBookDTO.ShenSuTime = admMemoBookDTO.Modifytime;
|
|
|
resultEntity = _DailyManageService.SaveMemoBookKaohe(admMemoBookDTO);
|
return JsonConvert.SerializeObject(resultEntity);
|
|
}
|
|
#endregion
|
}
|
}
|