Przeglądaj źródła

通知公告阅读次数统计【未完成】

新疆影视学院高职
zhangli 2 lat temu
rodzic
commit
de036900d8
5 zmienionych plików z 153 dodań i 1 usunięć
  1. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs
  2. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs
  3. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs
  5. +110
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs

+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs Wyświetl plik

@@ -126,6 +126,26 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
};
return JsonResult(jsonData);
}

/// <summary>
/// 通知公告阅读统计
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="keyword">关键词</param>
/// <returns></returns>
public ActionResult GetPageListForStatistics(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = noticeIBLL.GetPageListForStatistics(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records,
};
return JsonResult(jsonData);
}
/// <summary>
/// 查看通知公告
/// </summary>


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs Wyświetl plik

@@ -246,7 +246,8 @@ namespace Learun.Application.OA
this.F_ModifyUserName = userInfo.realName;
}
#endregion

[NotMapped]
public string F_Send { get; set; }
}




+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs Wyświetl plik

@@ -40,6 +40,26 @@ namespace Learun.Application.OA
}
}
}

public IEnumerable<NewsEntity> GetPageListForStatistics(Pagination pagination, string queryJson)
{
try
{
return noticeService.GetPageListForStatistics(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 公告实体
/// </summary>


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs Wyświetl plik

@@ -20,6 +20,7 @@ namespace Learun.Application.OA
/// <param name="keyword">关键词</param>
/// <returns></returns>
IEnumerable<NewsEntity> GetPageList(Pagination pagination, string keyword);
IEnumerable<NewsEntity> GetPageListForStatistics(Pagination pagination, string queryJson);
/// <summary>
/// 公告实体
/// </summary>


+ 110
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs Wyświetl plik

@@ -46,6 +46,116 @@ namespace Learun.Application.OA
}
}
}

/// <summary>
/// 通知公告阅读统计
/// </summary>
/// <param name="pagination"></param>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<NewsEntity> GetPageListForStatistics(Pagination pagination, string queryJson)
{
try
{
var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database;
var basedbname = BaseRepository().getDbConnection().Database;

var sql =
@"SELECT case when (F_SendDeptId is null or len(F_SendDeptId)=0) and (F_SendPostId is null or len(F_SendDeptId)=0) then '1' else '' end as F_Send,
F_SendDeptId,F_SendPostId,*FROM LR_OA_News t WHERE t.F_TypeId = 2 and F_DeleteMark = 0 and F_EnabledMark = 1";
var list = BaseRepository().FindList<NewsEntity>(sql);


return list;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存通知公告应读人员
/// </summary>
public void SaveNewsShouldRead()
{
var db = this.BaseRepository();
try
{
db.BeginTrans();
var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database;
var basedbname = BaseRepository().getDbConnection().Database;

var sql =
@"SELECT case when (F_SendDeptId is null or len(F_SendDeptId)=0) and (F_SendPostId is null or len(F_SendDeptId)=0) then '1' else '' end as F_Send,
F_SendDeptId,F_SendPostId,* FROM LR_OA_News t WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1
and t.f_Newsid not in (SELECT Newsid from [dbo].[LR_OA_NewsShouldRead])";
var list = db.FindList<NewsEntity>(sql);
foreach (var news in list)
{
if (!string.IsNullOrEmpty(news.F_Send) && news.F_Send == "1")
{
//全部教师
db.ExecuteBySql($@"insert into LR_OA_NewsShouldRead
SELECT newid(),'{news.F_NewsId}',f_userid from lr_base_user where f_description='教师' and
f_userid not in (
SELECT ruserid from [dbo].[LR_OA_NewsShouldRead] where newsid='{news.F_NewsId}'
)
");
}
else
{
//接收部门
if (!string.IsNullOrEmpty(news.F_SendDeptId))
{
var deptids = string.Join("','", news.F_SendDeptId.Split(','));
db.ExecuteBySql($@"insert into LR_OA_NewsShouldRead
SELECT newid(),'{news.F_NewsId}',f_userid from lr_base_user where f_description='教师' and F_DepartmentId in ('{deptids}')
and f_userid not in (
SELECT ruserid from [dbo].[LR_OA_NewsShouldRead] where newsid='{news.F_NewsId}'
)");
//岗位
if (!string.IsNullOrEmpty(news.F_SendPostId))
{
var postids = string.Join("','", news.F_SendPostId.Split(','));
db.ExecuteBySql($@"insert into LR_OA_NewsShouldRead
SELECT newid(),'{news.F_NewsId}',f_userid from lr_base_user t
join LR_Base_UserRelation r on r.f_category='2' and t.F_UserId=r.f_userid
where t.f_description='教师' and r.f_objectid='{postids}'
and t.F_DepartmentId not in ('{deptids}')
and t.f_userid not in (
SELECT ruserid from [dbo].[LR_OA_NewsShouldRead] where newsid='{news.F_NewsId}'
)");
}
}

if (string.IsNullOrEmpty(news.F_SendDeptId) && !string.IsNullOrEmpty(news.F_SendPostId))
{

}
}
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 新闻公告实体
/// </summary>


Ładowanie…
Anuluj
Zapisz