From 6861e1782e28256c70b7e7e2d98f990a35a6606f Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 14 Nov 2022 11:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=A1=A8=E5=AD=A6=E5=B9=B4?= =?UTF-8?q?=E5=AD=A6=E6=9C=9F=20=E5=89=8D=E7=AB=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/TimeTable.cs | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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 06cf05a57..3359f0d1c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -193,14 +193,29 @@ namespace Learun.Application.WebApi.Modules var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); // 获取学年,学期 - var semesterAndYear = Common.GetSemesterAndYear(startDate); - var strAcademicYear = semesterAndYear.AcademicYearLong; - var strSemester = semesterAndYear.Semester; + var strAcademicYear = ""; + var strSemester = ""; + var AcademicYearShort = ""; + if (!string.IsNullOrEmpty(param.StartDate)) + { + var NewsemesterAndYear = Common.GetSemesterAndYear(param.StartDate); + strAcademicYear = NewsemesterAndYear.AcademicYearLong; + strSemester = NewsemesterAndYear.Semester; + AcademicYearShort = NewsemesterAndYear.AcademicYearShort; + } + else + { + var semesterAndYear = Common.GetSemesterAndYear(startDate); + strAcademicYear = semesterAndYear.AcademicYearLong; + strSemester = semesterAndYear.Semester; + AcademicYearShort = semesterAndYear.AcademicYearShort; + } + if (param.StartDate.IsEmpty() && param.EndDate.IsEmpty()) { // 校历 - var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); + var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(AcademicYearShort, strSemester); var StartTime = entity.StartTime.Value; //获取第几周 var curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value);