diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs index 59c0b8b36..4908acf4d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs @@ -365,7 +365,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return JsonResult(noDataResult); } //学生课表请假记录 - var leaveList = stuAttendanceLeaveIBLL.GetList(); + var leaveList = stuAttendanceLeaveIBLL.GetListByJson("{\"StuNo\":\"" + userInfo.account + "\"}"); var formatData = from d in timeTables.AsEnumerable() let tt = d.LessonTime.Split('-')[1] group d by tt into g @@ -394,8 +394,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers lessonSortNo = e.LessonSortNo, e?.OLPEId, 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, + leaveType = leaveList.Any(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime) ? 1 : 0, + checkType = leaveList.FirstOrDefault(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime)?.IsCheck, } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs index 47b01af09..f89c04510 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -6,6 +6,7 @@ using System.Data.SqlClient; using System.Linq; using System.Threading.Tasks; using System.Web; +using System.Web.Helpers; using Learun.Application.Organization; using Learun.Application.TwoDevelopment.EducationalAdministration; using Learun.Util; @@ -295,7 +296,8 @@ namespace Learun.Application.WebApi.Modules Data = arrangeLessonTermIBLL.GetTimeTableInEducation(param.StartDate, param.EndDate, "", param.Account, "").ToList(); } } - + //学生课表请假记录 + var leaveList = stuAttendanceLeaveIBLL.GetListByJson("{\"StuNo\":\""+userInfo.account+"\"}"); var formatData = from d in Data.AsEnumerable() let tt = d.LessonTime.Split('-')[0] group d by tt into g @@ -324,7 +326,10 @@ namespace Learun.Application.WebApi.Modules classRoomNo = string.IsNullOrEmpty(e.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.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime) ? 1 : 0, + checkType = leaveList.FirstOrDefault(c => c.LessonNo == e?.LessonNo && c.LessonDate == e.LessonDate && c.LessonTime == e.LessonTime)?.IsCheck, + } } ;