部门
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexStatistics.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexStatistics.js
index 3616a6403..f4e23a11c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexStatistics.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexStatistics.js
@@ -21,6 +21,15 @@ var bootstrap = function ($, learun) {
$('#lr_refresh').on('click', function () {
location.reload();
});
+ //年度
+ $('#Year').lrselect({
+ url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear',
+ value: 'value',
+ text: 'text'
+ });
+ //$('#Year').lrselectSet(Year);
+ //月份
+ $('#Month').lrDataItemSelect({ code: 'MPMonth' });
$('#F_Departmentid').lrselect({
allowSearch: true,
@@ -35,7 +44,7 @@ var bootstrap = function ($, learun) {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/LR_OAModule/Notice/GetPageListForStatistics',
headData: [
- { label: '职工编号', name: 'F_Encode', width: 100, align: 'left' },
+ { label: '职工编号', name: 'F_Account', width: 100, align: 'left' },
{ label: '姓名', name: 'F_RealName', width: 100, align: 'left' },
{
label: '部门', name: 'F_Departmentid', width: 100, align: 'left',
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs
index 0ef92e14f..108981f1a 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/News/NewsEntity.cs
@@ -257,7 +257,7 @@ namespace Learun.Application.OA
[NotMapped]
public string F_Departmentid { get; set; }
[NotMapped]
- public string F_Encode { get; set; }
+ public string F_Account { get; set; }
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs
index ad0efb626..8a1eb125c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs
@@ -59,19 +59,38 @@ namespace Learun.Application.OA
{
try
{
- var sql = new StringBuilder(@"select t.*,u.f_encode,u.f_realname,f_departmentid from (
- select t1.ruserid,isnull(srnum,0) as srnum,isnull(rnum,0) as rnum from (
- select ruserid,COUNT(1) as srnum from LR_OA_News t left join LR_OA_NewsShouldRead s on s.newsid=t.f_newsid
- WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1 group by ruserid
- ) t1
- left join (
- select ruserid,COUNT(1) as rnum from LR_OA_News t left join LR_OA_NewsRead r on r.newsid=t.f_newsid
- WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1 and DATEDIFF(HOUR,t.F_ReleaseTime,r.RTime)<=24*7 group by ruserid
- ) t2 on t1.ruserid=t2.ruserid
- ) t
- left join lr_base_user u on t.ruserid=u.f_userid where 1=1
- ");
var queryParam = queryJson.ToJObject();
+ var sql = new StringBuilder(@"select t.*,u.F_Account,u.f_realname,f_departmentid from ");
+ sql.Append("(");
+ sql.Append("select t1.ruserid,isnull(srnum,0) as srnum,isnull(rnum,0) as rnum from (");
+ sql.Append(
+ @"select ruserid,COUNT(1) as srnum from LR_OA_News t left join LR_OA_NewsShouldRead s on s.newsid=t.f_newsid
+left join lr_base_user u on s.RUserId=u.F_UserId
+ WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1
+ and u.F_Account like '20%'
+ and t.F_ReleaseTime>CONVERT(datetime,SUBSTRING(u.F_Account,1,4)+'-08-31',120) ");
+ if (!queryParam["Year"].IsEmpty() && !queryParam["Month"].IsEmpty())
+ {
+ sql.Append($" and year(t.F_ReleaseTime)='{queryParam["Year"].ToString()}' and month(t.F_ReleaseTime)='{queryParam["Month"].ToString()}'");
+ }
+
+ sql.Append(" group by ruserid ) t1 left join (");
+ sql.Append(
+ @" select ruserid,COUNT(1) as rnum from LR_OA_News t left join LR_OA_NewsRead r on r.newsid=t.f_newsid
+left join lr_base_user u on r.RUserId=u.F_UserId
+ WHERE t.F_TypeId = 2 and t.F_DeleteMark=0 and t.F_EnabledMark=1
+ and u.F_Account like '20%'
+ and t.F_ReleaseTime>CONVERT(datetime,SUBSTRING(u.F_Account,1,4)+'-08-31',120)
+ and DATEDIFF(HOUR,t.F_ReleaseTime,r.RTime)<=24*7 ");
+ if (!queryParam["Year"].IsEmpty() && !queryParam["Month"].IsEmpty())
+ {
+ sql.Append($" and year(t.F_ReleaseTime)='{queryParam["Year"].ToString()}' and month(t.F_ReleaseTime)='{queryParam["Month"].ToString()}'");
+ }
+
+ sql.Append(" group by ruserid ) t2 on t1.ruserid=t2.ruserid ");
+ sql.Append(") t");
+ sql.Append(" left join lr_base_user u on t.ruserid=u.f_userid where 1=1 ");
+
// 虚拟参数
var dp = new DynamicParameters(new { });
if (queryParam.HasValues)