|
@@ -6,6 +6,9 @@ using System.Collections.Generic; |
|
|
using System.Collections; |
|
|
using System.Collections; |
|
|
using System; |
|
|
using System; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
|
|
|
using Learun.Application.OA; |
|
|
|
|
|
using Learun.Application.TwoDevelopment.EducationalAdministration; |
|
|
|
|
|
using Learun.Application.WorkFlow; |
|
|
|
|
|
|
|
|
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers |
|
|
namespace Learun.Application.Web.Areas.LR_Desktop.Controllers |
|
|
{ |
|
|
{ |
|
@@ -91,6 +94,96 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers |
|
|
|
|
|
|
|
|
return Success(count); |
|
|
return Success(count); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private SYS_ReceiveMessageIBLL sYS_ReceiveMessageIBLL = new SYS_ReceiveMessageBLL(); |
|
|
|
|
|
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL(); |
|
|
|
|
|
private NoticeIBLL newsIBLL = new NoticeBLL(); |
|
|
|
|
|
private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 获取未读的消息的数量 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
/// <param name="pagination">分页参数</param> |
|
|
|
|
|
/// <param name="queryJson">查询参数</param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
[HttpGet] |
|
|
|
|
|
[AjaxOnly] |
|
|
|
|
|
public ActionResult GetCountFortotalUnread() |
|
|
|
|
|
{ |
|
|
|
|
|
int totalcount = 0; |
|
|
|
|
|
#region 待办 |
|
|
|
|
|
var userinfo = LoginUserInfo.Get(); |
|
|
|
|
|
Pagination paginationobj = new Pagination() { rows = 100, page = 1, sidx = "readflag asc,SENDTIME desc ", sord = "desc" }; |
|
|
|
|
|
//未读邮件 |
|
|
|
|
|
int UnreadMail = sYS_ReceiveMessageIBLL.GetPageList(paginationobj, "{\"userId\":\"" + userinfo.userId + "\"}").Count(m => m.READFLAG == 0); |
|
|
|
|
|
//办公事项 |
|
|
|
|
|
paginationobj.sidx = "F_CreateDate"; |
|
|
|
|
|
int UnreadTask = nWFProcessIBLL.GetMyTaskPageList(userinfo, paginationobj, "{}").Count(); |
|
|
|
|
|
//公告 |
|
|
|
|
|
List<NewsEntity> outnewslist = new List<NewsEntity>(); |
|
|
|
|
|
var newsList = newsIBLL.GetPageList(paginationobj, ""); |
|
|
|
|
|
foreach (var newsitemEntity in newsList) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(newsitemEntity.F_SendPostId)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(userinfo.postIds)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (userinfo.postIds.Contains(",")) |
|
|
|
|
|
{ |
|
|
|
|
|
foreach (var postid in userinfo.postIds.Split(',')) |
|
|
|
|
|
{ |
|
|
|
|
|
if (newsitemEntity.F_SendPostId.Contains(postid)) |
|
|
|
|
|
{ |
|
|
|
|
|
outnewslist.Add(newsitemEntity); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
if (newsitemEntity.F_SendPostId.Contains(userinfo.postIds)) |
|
|
|
|
|
{ |
|
|
|
|
|
outnewslist.Add(newsitemEntity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(newsitemEntity.F_SendDeptId)) |
|
|
|
|
|
{ |
|
|
|
|
|
if (userinfo.departmentId != null && newsitemEntity.F_SendDeptId.Contains(userinfo.departmentId)) |
|
|
|
|
|
{ |
|
|
|
|
|
outnewslist.Add(newsitemEntity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
outnewslist.Add(newsitemEntity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var readnewslist = newsIBLL.GetList("", userinfo.userId).Where(m => !string.IsNullOrEmpty(m.RNewsId)).Select(m => m.F_NewsId); |
|
|
|
|
|
int UnreadNews = outnewslist.Count(m => !readnewslist.Contains(m.F_NewsId)); |
|
|
|
|
|
paginationobj.sidx = "SendTime"; |
|
|
|
|
|
int UnreadFile = sys_ReceiveFileIBLL.GetPageListBySenderId(userinfo.userId).Count(); |
|
|
|
|
|
//普通教师请假-未归档数 |
|
|
|
|
|
int UnfileLeave = 0; |
|
|
|
|
|
//中层领导请假-未归档数 |
|
|
|
|
|
int UnfileLeaveZC = 0; |
|
|
|
|
|
|
|
|
|
|
|
totalcount = UnreadFile + UnreadNews + UnreadTask + UnreadMail + UnfileLeave + UnfileLeaveZC; |
|
|
|
|
|
#endregion |
|
|
|
|
|
var data = new |
|
|
|
|
|
{ |
|
|
|
|
|
UnreadTask= UnreadTask, |
|
|
|
|
|
UnreadNews= UnreadNews, |
|
|
|
|
|
UnfileLeave= UnfileLeave, |
|
|
|
|
|
UnfileLeaveZC= UnfileLeaveZC, |
|
|
|
|
|
totalcount = totalcount |
|
|
|
|
|
}; |
|
|
|
|
|
return Success(data); |
|
|
|
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 获取未读的消息 |
|
|
/// 获取未读的消息 |
|
|
/// </summary> |
|
|
/// </summary> |
|
|