@@ -232,7 +232,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd")); | var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd")); | ||||
//int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | //int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | ||||
int countDay = endTime.Subtract(startDate).Days; | int countDay = endTime.Subtract(startDate).Days; | ||||
int countWeek = countDay / 14 + 1; | |||||
int countWeek = countDay / 7 + 1; | |||||
return countWeek; | return countWeek; | ||||
} | } | ||||
@@ -248,7 +248,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | ||||
int days = curDay.Subtract(startTime).Days; | int days = curDay.Subtract(startTime).Days; | ||||
//int days = curDay.DayOfYear; | //int days = curDay.DayOfYear; | ||||
int daysOutOneWeek = days - (14 - firstdayofweek); | |||||
int daysOutOneWeek = days - (7 - firstdayofweek); | |||||
if (daysOutOneWeek <= 0) | if (daysOutOneWeek <= 0) | ||||
{ | { | ||||
@@ -256,8 +256,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
int weeks = daysOutOneWeek / 14; | |||||
if (daysOutOneWeek % 14 != 0) | |||||
int weeks = daysOutOneWeek / 7; | |||||
if (daysOutOneWeek % 7 != 0) | |||||
weeks++; | weeks++; | ||||
return weeks + 1; | return weeks + 1; | ||||
@@ -300,14 +300,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); | var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); | ||||
var StartTime = entity.StartTime.Value; | 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) | if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime) | ||||
{ | { | ||||
startDate = StartTime.ToString("yyyy-MM-dd"); | 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<TimeTable>(); | var timeTableList = new List<TimeTable>(); | ||||
@@ -161,6 +161,11 @@ | |||||
<div class="lr-layout-center"> | <div class="lr-layout-center"> | ||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | <div class="lr-layout-wrap lr-layout-wrap-notitle "> | ||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="lr-layout-body" style="overflow: auto;"> | <div class="lr-layout-body" style="overflow: auto;"> | ||||
<div class="warpper"> | <div class="warpper"> | ||||
@@ -13,7 +13,7 @@ var bootstrap = function ($, learun) { | |||||
function (data) { | function (data) { | ||||
//console.log('res', data); | //console.log('res', data); | ||||
// 数据处理 | // 数据处理 | ||||
var html = '<tr style="height: 30px;"><td>节次/星期</td><td>星期一</td><td>星期二</td><td>星期三</td><td>星期四</td><td>星期五</td><td>星期六</td><td>星期日</td><td>星期八</td><td>星期九</td><td>星期十</td></tr>'; | |||||
var html = '<tr style="height: 30px;"><td>节次/星期</td><td>星期一</td><td>星期二</td><td>星期三</td><td>星期四</td><td>星期五</td><td>星期六</td><td>星期日</td></tr>'; | |||||
var weekLists = data.weekList; | var weekLists = data.weekList; | ||||
//十节课 2022.6.14 修改为一天十一节课 | //十节课 2022.6.14 修改为一天十一节课 | ||||
for (var i = 1; i < 12; i++) { | for (var i = 1; i < 12; i++) { | ||||
@@ -146,6 +146,11 @@ | |||||
<div class="lr-layout-center"> | <div class="lr-layout-center"> | ||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | <div class="lr-layout-wrap lr-layout-wrap-notitle "> | ||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="lr-layout-body" style="overflow: auto;"> | <div class="lr-layout-body" style="overflow: auto;"> | ||||
<div class="warpper"> | <div class="warpper"> | ||||
@@ -13,7 +13,7 @@ var bootstrap = function ($, learun) { | |||||
function (data) { | function (data) { | ||||
//console.log('res', data); | //console.log('res', data); | ||||
// 数据处理 | // 数据处理 | ||||
var html = '<tr style="height: 30px;"><td>节次/星期</td><td>星期一</td><td>星期二</td><td>星期三</td><td>星期四</td><td>星期五</td><td>星期六</td><td>星期日</td><td>星期八</td><td>星期九</td><td>星期十</td></tr>'; | |||||
var html = '<tr style="height: 30px;"><td>节次/星期</td><td>星期一</td><td>星期二</td><td>星期三</td><td>星期四</td><td>星期五</td><td>星期六</td><td>星期日</td></tr>'; | |||||
var weekLists = data.weekList; | var weekLists = data.weekList; | ||||
//十节课 | //十节课 | ||||
for (var i = 1; i < 12; i++) { | for (var i = 1; i < 12; i++) { | ||||
@@ -146,6 +146,11 @@ | |||||
<div class="lr-layout-center"> | <div class="lr-layout-center"> | ||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | <div class="lr-layout-wrap lr-layout-wrap-notitle "> | ||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="lr-layout-body" style="overflow: auto;"> | <div class="lr-layout-body" style="overflow: auto;"> | ||||
<div class="warpper"> | <div class="warpper"> | ||||
@@ -124,12 +124,12 @@ namespace Learun.Application.WebApi.Modules | |||||
//获取第几周 | //获取第几周 | ||||
var curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value); | 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)//判断第几周 | if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime)//判断第几周 | ||||
{ | { | ||||
startDate = StartTime.ToString("yyyy-MM-dd"); | 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.StartDate = startDate; | ||||
param.EndDate = endDate; | param.EndDate = endDate; | ||||
} | } | ||||
@@ -269,12 +269,12 @@ namespace Learun.Application.WebApi.Modules | |||||
//获取第几周 | //获取第几周 | ||||
var curWeek = WeekOfYear(startdate, entity.StartTime.Value, entity.EndTime.Value); | 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)//判断第几周 | if (curWeek == 1 && Convert.ToDateTime(startDate) < StartTime)//判断第几周 | ||||
{ | { | ||||
startDate = StartTime.ToString("yyyy-MM-dd"); | 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.StartDate = startDate; | ||||
param.EndDate = endDate; | param.EndDate = endDate; | ||||
} | } | ||||
@@ -396,7 +396,7 @@ namespace Learun.Application.WebApi.Modules | |||||
int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | ||||
int days = curDay.Subtract(startTime).Days; | int days = curDay.Subtract(startTime).Days; | ||||
//int days = curDay.DayOfYear; | //int days = curDay.DayOfYear; | ||||
int daysOutOneWeek = days - (14 - firstdayofweek); | |||||
int daysOutOneWeek = days - (7 - firstdayofweek); | |||||
if (daysOutOneWeek <= 0) | if (daysOutOneWeek <= 0) | ||||
{ | { | ||||
@@ -404,8 +404,8 @@ namespace Learun.Application.WebApi.Modules | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
int weeks = daysOutOneWeek / 14; | |||||
if (daysOutOneWeek % 14 != 0) | |||||
int weeks = daysOutOneWeek / 7; | |||||
if (daysOutOneWeek % 7 != 0) | |||||
weeks++; | weeks++; | ||||
return weeks + 1; | return weeks + 1; | ||||