diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs index 06493a9a2..6b39240d9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs @@ -243,7 +243,8 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { return JsonResult(noDataResult); } - var formatDataa = from d in timeTables + var leaveList = stuAttendanceLeaveIBLL.GetList(); + var formatData = from d in timeTables let tt = d.LessonTime.Substring(1) group d by tt into g orderby g.Key @@ -270,43 +271,46 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers classRoomNo = e?.ClassRoomNo.Trim(), lessonSortNo = e.LessonSortNo, e.OLPEId, - className = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName + className = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName, + leaveType = leaveList.Any(c => c.LessonNo == e.LessonNo && c.StuNo == userInfo.account && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime) ? 1 : 0, + checkType = leaveList.FirstOrDefault(c => c.LessonNo == e.LessonNo && c.StuNo == userInfo.account && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime)?.IsCheck, + } } ; - var leaveList = stuAttendanceLeaveIBLL.GetList(); - var formatData = timeTables.OrderBy(a => a.LessonTime.Substring(1)) - .Select(a => new - { - time = a.LessonTime.Substring(1), - list = timeTables.Where(b => b.LessonTime.Substring(1) == a.LessonTime.Substring(1)) - .Select(b => new - { - day = b.LessonTime.ToCharArray()[0], - curriculum = string.IsNullOrEmpty(b.EnName) ? (b.LessonSortNo == "2" ? b.LessonName + "[选修]" : b.LessonName) : (b.LessonSortNo == "2" ? b.EnName + "[选修]" : b.EnName), - lessonName = b.LessonName, - teacher = b.EmpName, - classRoom = b.ClassroomName.Trim(), - academicyear = semesterAndYear.AcademicYearShort, - semester = strSemester, - lessonNo = b?.LessonNo, - teachClassNo = b?.TeachClassNo, - empno = b?.EmpNo, - lessonTime = b.LessonTime, - lessonDate = b.LessonDate.ToString("yyyy-MM-dd"), - classRoomNo = b?.ClassRoomNo.Trim(), - lessonSortNo = b.LessonSortNo, - b.OLPEId, - className = string.IsNullOrEmpty(b.ClassName) ? "" : b.ClassName, - leaveType = leaveList.Any(c => c.LessonNo == b.LessonNo && c.StuNo == userInfo.account && c.LessonDate == b.LessonDate && c.LessonTime == b.LessonTime) ? 1 : 0, - checkType = leaveList.FirstOrDefault(c => c.LessonNo == b.LessonNo && c.StuNo == userInfo.account && c.LessonDate == b.LessonDate && c.LessonTime == b.LessonTime)?.IsCheck, - - }) - - }); + // var leaveList = stuAttendanceLeaveIBLL.GetList(); + //var formatData = timeTables.OrderBy(a => a.LessonTime.Substring(1)) + // .Select(a => new + // { + // time = a.LessonTime.Substring(1), + // list = timeTables.Where(b => b.LessonTime.Substring(1) == a.LessonTime.Substring(1)) + // .Select(b => new + // { + // day = b.LessonTime.ToCharArray()[0], + // curriculum = string.IsNullOrEmpty(b.EnName) ? (b.LessonSortNo == "2" ? b.LessonName + "[选修]" : b.LessonName) : (b.LessonSortNo == "2" ? b.EnName + "[选修]" : b.EnName), + // lessonName = b.LessonName, + // teacher = b.EmpName, + // classRoom = b.ClassroomName.Trim(), + // academicyear = semesterAndYear.AcademicYearShort, + // semester = strSemester, + // lessonNo = b?.LessonNo, + // teachClassNo = b?.TeachClassNo, + // empno = b?.EmpNo, + // lessonTime = b.LessonTime, + // lessonDate = b.LessonDate.ToString("yyyy-MM-dd"), + // classRoomNo = b?.ClassRoomNo.Trim(), + // lessonSortNo = b.LessonSortNo, + // b.OLPEId, + // className = string.IsNullOrEmpty(b.ClassName) ? "" : b.ClassName, + // leaveType = leaveList.Any(c => c.LessonNo == b.LessonNo && c.StuNo == userInfo.account && c.LessonDate == b.LessonDate && c.LessonTime == b.LessonTime) ? 1 : 0, + // checkType = leaveList.FirstOrDefault(c => c.LessonNo == b.LessonNo && c.StuNo == userInfo.account && c.LessonDate == b.LessonDate && c.LessonTime == b.LessonTime)?.IsCheck, + + // }) + + // }); //foreach (var item in formatData.list) //{ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js index a501716f7..56a1d195d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js @@ -69,6 +69,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 = ''; @@ -84,39 +94,48 @@ var bootstrap = function ($, learun) { for (var k = 1; k < 8; k++) { (function (arg) { var args = arg - 1; - var datas = flogs(arg, lists, 'day'); - if (datas) { - html += '
课程:' + - datas.curriculum + - '
' + - //'
教师:' + - //datas.teacher + - //'
' + - '
班级:' + - datas.className + - '
' + - '
教室:' + - datas.classRoom; - var loginInfo = learun.clientdata.get(['userinfo']); - if (loginInfo.Description == "学生") { - if (datas.leaveType == 1) { - if (datas.checkType == 1) { - html += '
请假通过'; - } else if (datas.checkType == 2) { - html += '请假未通过'; + var datas = flogs2(arg, lists, 'day'); + if (datas.length > 0) { + html += ''; + $.each(datas, function (i, item) { + if (i > 0) { + html += '
'; + } + html += '
课程:' + + item.curriculum + + '
' + + '
教师:' + + item.teacher + + '
' + + '
班级:' + + item.className + + '
' + + '
教室:' + + item.classRoom + + '
'; + var loginInfo = learun.clientdata.get(['userinfo']); + if (loginInfo.Description == "学生") { + if (item.leaveType == 1) { + if (item.checkType == 1) { + html += '请假通过'; + } else if (item.checkType == 2) { + html += '请假未通过'; + } else { + html += '请假申请中'; + } + } else { - html += '请假申请中'; + html += '请假'; } - - } else { - html += '请假'; } - } + }); + + html += ''; - html += ""; } else { - html += '
'; + html += '
'; } + })(k); } return html;