From dc7593e199de3d090d01bebab2b4ab835f7ac315 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 30 Jan 2024 09:00:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=8E=92=E8=AF=BE=E5=8D=81?= =?UTF-8?q?=E5=A4=A9=E6=94=B9=E4=B8=BA=E4=B8=83=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ArrangeLessonTermController.cs | 13 ++++++------- .../Views/ArrangeLessonTerm/IndexLessonTerm.cshtml | 5 +++++ .../Views/ArrangeLessonTerm/IndexLessonTerm.js | 2 +- .../ArrangeLessonTerm/IndexLessonTermStu.cshtml | 5 +++++ .../Views/ArrangeLessonTerm/IndexLessonTermStu.js | 2 +- .../ArrangeLessonTerm/IndexLessonTermTeach.cshtml | 5 +++++ .../Learun.Application.WebApi/Modules/TimeTable.cs | 14 +++++++------- 7 files changed, 30 insertions(+), 16 deletions(-) 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 4908acf4d..ea35e42de 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 @@ -232,7 +232,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd")); //int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 int countDay = endTime.Subtract(startDate).Days; - int countWeek = countDay / 14 + 1; + int countWeek = countDay / 7 + 1; return countWeek; } @@ -248,7 +248,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 int days = curDay.Subtract(startTime).Days; //int days = curDay.DayOfYear; - int daysOutOneWeek = days - (14 - firstdayofweek); + int daysOutOneWeek = days - (7 - firstdayofweek); if (daysOutOneWeek <= 0) { @@ -256,8 +256,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } else { - int weeks = daysOutOneWeek / 14; - if (daysOutOneWeek % 14 != 0) + int weeks = daysOutOneWeek / 7; + if (daysOutOneWeek % 7 != 0) weeks++; return weeks + 1; @@ -300,14 +300,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); var StartTime = entity.StartTime.Value; //根据第几周,计算查询的开始和结束日期 - startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).ToString("yyyy-MM-dd");//StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd"); + startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays((curWeek - 1) * 7)).ToString("yyyy-MM-dd");//StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd"); if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime) { startDate = StartTime.ToString("yyyy-MM-dd"); } - endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).AddDays(10) - .ToString("yyyy-MM-dd");// StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd"); + endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays((curWeek - 1) * 7)).AddDays(6).ToString("yyyy-MM-dd");// StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd"); var timeTableList = new List(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml index b2ed41f8a..37fac9116 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml @@ -161,6 +161,11 @@
+
+
+ +
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js index 397d036f5..ec8e45faa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js @@ -13,7 +13,7 @@ var bootstrap = function ($, learun) { function (data) { //console.log('res', data); // 数据处理 - var html = '节次/星期星期一星期二星期三星期四星期五星期六星期日星期八星期九星期十'; + var html = '节次/星期星期一星期二星期三星期四星期五星期六星期日'; var weekLists = data.weekList; //十节课 2022.6.14 修改为一天十一节课 for (var i = 1; i < 12; i++) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.cshtml index b716be16b..72da1ef20 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.cshtml @@ -146,6 +146,11 @@
+
+
+ +
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.js index cd048bc4e..fc3f07546 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermStu.js @@ -13,7 +13,7 @@ var bootstrap = function ($, learun) { function (data) { //console.log('res', data); // 数据处理 - var html = '节次/星期星期一星期二星期三星期四星期五星期六星期日星期八星期九星期十'; + var html = '节次/星期星期一星期二星期三星期四星期五星期六星期日'; var weekLists = data.weekList; //十节课 for (var i = 1; i < 12; i++) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermTeach.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermTeach.cshtml index 4ab6317c3..955062071 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermTeach.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTermTeach.cshtml @@ -146,6 +146,11 @@
+
+
+ +
+
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 f89c04510..89ca7d9e1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -124,12 +124,12 @@ namespace Learun.Application.WebApi.Modules //获取第几周 var curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value); ///获取当前周次开始时间 - startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).ToString("yyyy-MM-dd"); + startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 7))).ToString("yyyy-MM-dd"); if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime)//判断第几周 { startDate = StartTime.ToString("yyyy-MM-dd"); } - endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).AddDays(13).ToString("yyyy-MM-dd"); + endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 7))).AddDays(6).ToString("yyyy-MM-dd"); param.StartDate = startDate; param.EndDate = endDate; } @@ -269,12 +269,12 @@ namespace Learun.Application.WebApi.Modules //获取第几周 var curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value); ///获取当前周次开始时间 - startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).ToString("yyyy-MM-dd"); + startDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 7))).ToString("yyyy-MM-dd"); if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime)//判断第几周 { startDate = StartTime.ToString("yyyy-MM-dd"); } - endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 14))).AddDays(13).ToString("yyyy-MM-dd"); + endDate = Common.CalculateFirstDateOfWeek(StartTime.AddDays(((curWeek - 1) * 7))).AddDays(6).ToString("yyyy-MM-dd"); param.StartDate = startDate; param.EndDate = endDate; } @@ -396,7 +396,7 @@ namespace Learun.Application.WebApi.Modules int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 int days = curDay.Subtract(startTime).Days; //int days = curDay.DayOfYear; - int daysOutOneWeek = days - (14 - firstdayofweek); + int daysOutOneWeek = days - (7 - firstdayofweek); if (daysOutOneWeek <= 0) { @@ -404,8 +404,8 @@ namespace Learun.Application.WebApi.Modules } else { - int weeks = daysOutOneWeek / 14; - if (daysOutOneWeek % 14 != 0) + int weeks = daysOutOneWeek / 7; + if (daysOutOneWeek % 7 != 0) weeks++; return weeks + 1;