|
|
@@ -9,6 +9,7 @@ using System.Text; |
|
|
|
using System.Data; |
|
|
|
using Learun.Application.OA; |
|
|
|
using Learun.Application.Organization; |
|
|
|
using System; |
|
|
|
|
|
|
|
namespace Learun.Application.WebApi.Modules |
|
|
|
{ |
|
|
@@ -18,12 +19,15 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
private NoticeIBLL noticeIBLL = new NoticeBLL(); |
|
|
|
private DepartmentIBLL departmentIBLL = new DepartmentBLL(); |
|
|
|
private PostIBLL postIBLL = new PostBLL(); |
|
|
|
private LR_OA_NewsReadIBLL lR_OA_NewsReadIBLL = new LR_OA_NewsReadBLL(); |
|
|
|
|
|
|
|
public NewsApi() |
|
|
|
: base("/learun/news") |
|
|
|
{ |
|
|
|
Get["/list"] = GetList; |
|
|
|
Get["/shList"] = GetshList; |
|
|
|
|
|
|
|
Post["/newsRead"] = NewsRead; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -137,11 +141,41 @@ namespace Learun.Application.WebApi.Modules |
|
|
|
} |
|
|
|
return Success(shlist); |
|
|
|
} |
|
|
|
#region 私有类 |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 阅读通知公告 |
|
|
|
/// <param name="keyValue">主键</param> |
|
|
|
/// <summary> |
|
|
|
/// <returns></returns> |
|
|
|
public Response NewsRead(dynamic _) |
|
|
|
{ |
|
|
|
var loginUserInfo = LoginUserInfo.Get(); |
|
|
|
NoticeEntity parameter = this.GetReqData<NoticeEntity>(); |
|
|
|
|
|
|
|
//判断当前用户是否阅读当前通知公告 |
|
|
|
var entity = lR_OA_NewsReadIBLL.GetLR_OA_NewsReadEntityByNewsIdAndUserId(parameter.newsId, loginUserInfo.userId); |
|
|
|
if (entity == null) |
|
|
|
{ |
|
|
|
var lR_OA_NewsRead = new LR_OA_NewsReadEntity() |
|
|
|
{ |
|
|
|
NewsId = parameter.newsId, |
|
|
|
RUserId = loginUserInfo.userId, |
|
|
|
RUserName = loginUserInfo.realName, |
|
|
|
RTime = DateTime.Now |
|
|
|
}; |
|
|
|
lR_OA_NewsReadIBLL.SaveEntity("", lR_OA_NewsRead); |
|
|
|
|
|
|
|
//修改当前通知公告的浏览量 |
|
|
|
lR_OA_NewsReadIBLL.UpdateNewsPV(parameter.newsId); |
|
|
|
} |
|
|
|
|
|
|
|
return Success("阅读成功!"); |
|
|
|
} |
|
|
|
#region 私有类 |
|
|
|
private class NoticeEntity |
|
|
|
{ |
|
|
|
public string ProgressId { get; set; } |
|
|
|
public string newsId { get; set; } |
|
|
|
} |
|
|
|
#endregion |
|
|
|
|
|
|
|