@@ -56,9 +56,15 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers | |||
public ActionResult GetList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var list = loginStatisticsIBLL.GetList(queryJson).ToList(); | |||
var data = new { rows = list }; | |||
return Success(list); | |||
var list = loginStatisticsIBLL.GetList(paginationobj,queryJson).ToList(); | |||
var jsonData = new | |||
{ | |||
rows = list, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
@@ -5,6 +5,7 @@ var refreshGirdData; | |||
var tempData; | |||
var headData; | |||
var days; | |||
var date = new Date; | |||
var Year; | |||
var Month; | |||
var StrYearMonth = '合计'; | |||
@@ -15,16 +16,61 @@ var bootstrap = function ($, learun) { | |||
var endTime; | |||
var page = { | |||
init: function () { | |||
var date = new Date; | |||
Year = date.getFullYear(); | |||
Month = date.getMonth() + 1; | |||
page.bind(); | |||
page.initGird(); | |||
page.search(); | |||
}, | |||
bind: function () { | |||
page.bindColumn(); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
if (!!queryJson.Year && !!queryJson.Month) { | |||
Year = queryJson.Year; | |||
Month = Number(queryJson.Month) + 1; | |||
} else { | |||
Year = date.getFullYear(); | |||
Month = date.getMonth() + 1; | |||
} | |||
page.bindColumn(); | |||
page.search(queryJson); | |||
}, 250, 400); | |||
//年度 | |||
$('#Year').lrselect({ | |||
url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#Year').lrselectSet(Year); | |||
//月份 | |||
$('#Month').lrDataItemSelect({ code: 'MPMonth' }); | |||
$('#Month').lrselectSet(Month - 1); | |||
$('#Departmentid').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=classdata', | |||
param: { strWhere: "1=1 " }, | |||
value: "id", | |||
text: "name" | |||
}); | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
param: { strWhere: "1=1 " }, | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
bindColumn: function () { | |||
StrYearMonth = Year + '年' + Month + '月合计'; | |||
tempData = [ | |||
{ label: "31", name: "num31", width: 50, align: "left" }, | |||
]; | |||
headData = [ | |||
{ label: "职工编号/学号", name: "account", width: 120, align: "left" }, | |||
{ label: "姓名", name: "name", width: 120, align: "left" }, | |||
@@ -85,38 +131,14 @@ var bootstrap = function ($, learun) { | |||
{ label: "29", name: "num29", width: 50, align: "left" }, | |||
{ label: "30", name: "num30", width: 50, align: "left" }, | |||
]; | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 250, 400); | |||
//年度 | |||
$('#Year').lrselect({ | |||
url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#Year').lrselectSet(Year); | |||
//月份 | |||
$('#Month').lrDataItemSelect({ code: 'MPMonth' }); | |||
$('#Month').lrselectSet(Month); | |||
$('#Departmentid').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=classdata', | |||
param: { strWhere: "1=1 " }, | |||
value: "id", | |||
text: "name" | |||
}); | |||
$('#ClassNo').lrselect({ | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', | |||
param: { strWhere: "1=1 " }, | |||
value: "classno", | |||
text: "classname" | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
getDays(Year, Month); | |||
if (days == 31) { | |||
headData = headData.concat(tempData); | |||
} | |||
$("#gridtable")[0].dfop = undefined; | |||
page.initGird(); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -124,30 +146,21 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/LR_Desktop/LoginStatistics/GetList', | |||
headData: headData, | |||
mainId: 'account', | |||
isPage: false, | |||
isPage: true, | |||
}); | |||
page.search(); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
console.log('123', param); | |||
if (!param.Year) { | |||
console.log(123); | |||
param.Year = Year; | |||
} | |||
if (!param.Month) { | |||
console.log(1234); | |||
param.Month = Month; | |||
if (!!param.Year) { | |||
} else { | |||
param.Year = date.getFullYear(); | |||
} | |||
console.log('123_2', param); | |||
StrYearMonth = param.Year + '年' + param.Month + '月合计'; | |||
getDays(param.Year, param.Month); | |||
console.log('天数', days); | |||
if (days == 31) { | |||
console.log('31'); | |||
headData = headData.concat(tempData); | |||
if (!!param.Month) { | |||
param.Month = Number(param.Month) + 1; | |||
} else { | |||
param.Month = date.getMonth() + 1; | |||
} | |||
//$("#gridtable")[0].dfop = undefined; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -163,7 +176,6 @@ var bootstrap = function ($, learun) { | |||
async: false, | |||
cache: false, | |||
success: function (data) { | |||
console.log(data); | |||
days = data.data; | |||
}, | |||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||
@@ -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> | |||
@@ -42,6 +42,16 @@ var bootstrap = function ($, learun) { | |||
return flog; | |||
} | |||
function flogs2(num, data, obj) { | |||
var arr = new Array(); | |||
$.each(data, | |||
function (i, n) { | |||
if (n[obj] == num) { | |||
arr.push(n); | |||
} | |||
}) | |||
return arr; | |||
} | |||
//某节课空 | |||
function tdHandle() { | |||
var html = ''; | |||
@@ -50,30 +60,40 @@ var bootstrap = function ($, learun) { | |||
} | |||
return html; | |||
} | |||
//某节课不空 | |||
function tdHandles(lists) { | |||
var html = ''; | |||
for (var k = 1; k < 8; k++) { | |||
(function (arg) { | |||
var args = arg - 1; | |||
var datas = flogs(arg, lists, 'day'); | |||
if (datas) { | |||
html += '<td data=' + JSON.stringify(datas) + ' class="active"><div>课程:' + | |||
datas.lessonName + | |||
'</div>' + | |||
'<div>教师:' + | |||
datas.teacher + | |||
'</div>' + | |||
'<div>班级:' + | |||
datas.className + | |||
'</div>' + | |||
'<div>教室:' + | |||
datas.classRoom + | |||
'</div></td>'; | |||
var datas = flogs2(arg, lists, 'day'); | |||
if (datas.length > 0) { | |||
html += '<td class="active">'; | |||
$.each(datas, function (i, item) { | |||
if (i > 0) { | |||
html += '<hr>'; | |||
} | |||
html += '<div><span class="leave" curriculum=' + item.curriculum + ' academicyear=' + item.academicyear + ' semester=' + item.semester + ' empno=' + item.empno + ' lessonNo=' + item.lessonNo + ' teachClassNo=' + item.teachClassNo + ' lessonTime=' + item.lessonTime + ' lessonDate=' + item.lessonDate + ' lessonSortNo=' + item.lessonSortNo + ' classRoomNo=' + item.classRoomNo +' data=' + item + '>课程:' + | |||
item.curriculum + | |||
'</span></div>' + | |||
'<div>教师:' + | |||
item.teacher + | |||
'</div>' + | |||
'<div>班级:' + | |||
item.className + | |||
'</div>' + | |||
'<div>教室:' + | |||
item.classRoom + | |||
'</div>'; | |||
}); | |||
html += '</td>'; | |||
} else { | |||
html += '<td><div></div><div></div><div></div><div></div></td>'; | |||
} | |||
})(k); | |||
} | |||
return html; | |||
@@ -123,15 +143,26 @@ var bootstrap = function ($, learun) { | |||
page.search(); | |||
} | |||
}); | |||
//'td.active1', | |||
$('.perFestivalsBox').on('click', | |||
'td.active', | |||
'.leave', | |||
function () { | |||
var params = JSON.parse($(this).attr('data')); | |||
var $this = $(this); | |||
var curriculum = $this.attr('curriculum'); | |||
var academicyear = $this.attr('academicyear'); | |||
var semester = $this.attr('semester'); | |||
var empno = $this.attr('empno'); | |||
var lessonNo = $this.attr('lessonNo'); | |||
var teachClassNo = $this.attr('teachClassNo'); | |||
var lessonTime = $this.attr('lessonTime'); | |||
var lessonDate = $this.attr('lessonDate'); | |||
var lessonSortNo = $this.attr('lessonSortNo'); | |||
var classRoomNo = $this.attr('classRoomNo'); | |||
learun.layerForm({ | |||
id: 'form', | |||
title: "[" + params.curriculum + "]课堂考勤", | |||
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/AttendanceDetail?year=' + params.academicyear + '&semester=' + params.semester + '&empno=' + params.empno + '&lessonNo=' + params.lessonNo + '&teachClassNo=' + params.teachClassNo + '&lessonTime=' + params.lessonTime + '&lessonDate=' + params.lessonDate + '&lessonSortNo=' + params.lessonSortNo + '&classRoomNo=' + params.classRoomNo, | |||
title: "[" + curriculum + "]课堂考勤", | |||
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/AttendanceDetail?year=' + academicyear + '&semester=' + semester + '&empno=' + empno + '&lessonNo=' + lessonNo + '&teachClassNo=' + teachClassNo + '&lessonTime=' + lessonTime + '&lessonDate=' + lessonDate + '&lessonSortNo=' + lessonSortNo + '&classRoomNo=' + classRoomNo, | |||
width: 1000, | |||
height: 600, | |||
btn: null | |||
@@ -246,7 +246,8 @@ namespace Learun.Application.OA | |||
this.F_ModifyUserName = userInfo.realName; | |||
} | |||
#endregion | |||
[NotMapped] | |||
public string F_Send { get; set; } | |||
} | |||
@@ -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> | |||
@@ -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> | |||
@@ -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> | |||
@@ -17,11 +17,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginStatisticsEntity> GetList(string queryJson) | |||
public IEnumerable<LoginStatisticsEntity> GetList(Pagination paginationobj,string queryJson) | |||
{ | |||
try | |||
{ | |||
return loginStatisticsService.GetList( queryJson); | |||
return loginStatisticsService.GetList(paginationobj,queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -13,7 +13,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<LoginStatisticsEntity> GetList(string queryJson); | |||
IEnumerable<LoginStatisticsEntity> GetList(Pagination paginationobj,string queryJson); | |||
#endregion | |||
@@ -18,12 +18,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<LoginStatisticsEntity> GetList(string queryJson) | |||
public IEnumerable<LoginStatisticsEntity> GetList(Pagination paginationobj, string queryJson) | |||
{ | |||
try | |||
{ | |||
var dbname_Mis = BaseRepository("CollegeMIS").getDbConnection().Database; | |||
var strSql = new StringBuilder("select name,account,classno,departmentid,daydata,num from ("); | |||
var strSql = new StringBuilder("select distinct name,account,classno,departmentid,daydata,num from ("); | |||
var sql = | |||
$@"select day(b.F_OperateTime) as daydata,a.f_operateaccount,c.classno,d.f_departmentid as departmentid, | |||
substring(a.f_operateaccount,charindex('(',a.f_operateaccount)+1,charindex(')',a.f_operateaccount)-charindex('(',a.f_operateaccount)-1) as name, | |||
@@ -54,23 +54,19 @@ left join LR_Base_user d on a.f_operateuserid=d.f_userid | |||
} | |||
if (!queryParam["Account"].IsEmpty()) | |||
{ | |||
dp.Add("Account", "%" + queryParam["Account"].ToString() + "%", DbType.String); | |||
whereStr.Append(" AND account Like @Account "); | |||
sql2.Append($" AND a.f_operateaccount like '%{queryParam["Account"].ToString()}%'"); | |||
} | |||
if (!queryParam["Name"].IsEmpty()) | |||
{ | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
whereStr.Append(" AND name Like @Name "); | |||
sql2.Append($" AND a.f_operateaccount like '%{queryParam["Name"].ToString()}%'"); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | |||
whereStr.Append(" AND ClassNo = @ClassNo "); | |||
sql2.Append($" AND classno='{queryParam["ClassNo"].ToString()}'"); | |||
} | |||
if (!queryParam["Departmentid"].IsEmpty()) | |||
{ | |||
dp.Add("Departmentid", queryParam["Departmentid"].ToString(), DbType.String); | |||
whereStr.Append(" AND Departmentid = @Departmentid "); | |||
sql2.Append($" AND d.f_departmentid='{queryParam["Departmentid"].ToString()}'"); | |||
} | |||
strSql.Append(sql); | |||
strSql.Append(sql1); | |||
@@ -88,7 +84,7 @@ isnull([25],0) as num25,isnull([26],0) as num26,isnull([27],0) as num27,isnull([ | |||
( | |||
SUM(num) for daydata in([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],[20],[21],[22],[23],[24],[25],[26],[27],[28],[29],[30],[31]) | |||
) TBL " + whereStr.ToString(); | |||
return this.BaseRepository().FindList<LoginStatisticsEntity>(str, dp); | |||
return this.BaseRepository().FindList<LoginStatisticsEntity>(str, dp, paginationobj); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -13,7 +13,11 @@ | |||
<add name="YKTDBString" connectionString="Data Source=xcykt;Persist Security Info=True;User ID=xcysdata;Password=xcysdata2019;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="mjDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=mjxtjh;User ID=mjxtjh;Password=s1RKFzJvIG7KfcNRtntZ" providerName="System.Data.SqlClient" /> | |||
<add name="tsDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=tsgxtjh;User ID=tsgxtjh;Password=Qs6cYOzFoQupbr12MFZm" providerName="System.Data.SqlClient" /> | |||
<add name="bachuJavaDBString" connectionString="Data Source=127.0.0.1;Database=oa;User ID=root;Password=123456;Command Logging=false;" providerName="MySql.Data.MySqlClient" /> | |||
<add name="TLMZYMiddleDBString" connectionString="Data Source=TLMZYMIDDLE;Persist Security Info=True;User ID=digitalschool;Password=digitalschool;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="CYZJMiddleDBString" connectionString="Data Source=CYZJMIDDLE;Persist Security Info=True;User ID=digitalschool;Password=digitalschool;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="YongyouDb" connectionString="Server=.;Password=1;User ID=sa; Initial Catalog=u8gx" providerName="System.Data.SqlClient" /> | |||
<add name="XCMiddleDBString" connectionString="Data Source=FSZJK;Persist Security Info=True;User ID=fszjk;Password=fszjk20220705;Unicode=True" providerName="System.Data.OracleClient" /> | |||
</connectionStrings> | |||
<startup> | |||