From dd0a669773634c67ae16003f1497447dcc1fac08 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 20 Jan 2022 09:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=A1=A8=20=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermController.cs | 30 +-- .../ArrangeLessonTerm/IndexLessonTerm.cshtml | 12 +- .../ArrangeLessonTerm/IndexLessonTerm.js | 181 ++++++++++-------- .../ArrangeLessonTermService.cs | 3 +- 4 files changed, 128 insertions(+), 98 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 a170c31c2..d2ad39b5b 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 @@ -171,7 +171,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var listObj = new List(); for (int i = 1; i <= weekTimes; i++) { - listObj.Add(new { text = "第" + i + "周", value = i }); + listObj.Add(new { text = i + "周", value = i }); } var jsonData = new { @@ -234,11 +234,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpGet] [AjaxOnly] - public ActionResult GetDataInEducation(string classNo, string curWeek) + public ActionResult GetDataInEducation(string classNo, int curWeek) { var userInfo = LoginUserInfo.Get(); //开始时间 - var startdate = string.IsNullOrEmpty(startTime) ? DateTime.Today : Convert.ToDateTime(startTime); + var startdate = DateTime.Today; var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); @@ -246,13 +246,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var strAcademicYear = semesterAndYear.AcademicYearLong; var strSemester = semesterAndYear.Semester; + //校历 + var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); + var StartTime = entity.StartTime.Value; + //根据第几周,计算查询的开始和结束日期 + startDate = StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd"); + endDate= StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd"); + var timeTableList = new List(); //课程表 - var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId); + var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", ""); timeTableList.AddRange(data); //选修课课程表 - var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId); - timeTableList.AddRange(dataOfElective); + //var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", ""); + //timeTableList.AddRange(dataOfElective); var timeTables = timeTableList.ToList(); var noDataResult = new @@ -261,19 +268,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return JsonResult(noDataResult); } - var formatData = from d in timeTables - let tt = d.LessonTime.Substring(1) + var formatData = from d in timeTables.AsEnumerable() + let tt = d.LessonTime.Split('-')[1] group d by tt into g orderby g.Key select new { time = g.Key, - list = from e in timeTables - let ee = e.LessonTime.Substring(1) + list = from e in timeTables.AsEnumerable() + let ee = e.LessonTime.Split('-')[1] where ee == g.Key select new { - day = e.LessonTime.ToCharArray()[0], + ALTId=e.ALTId, + day = e.LessonTime.Split('-')[0], curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName, teacher = e?.EmpName, classRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(), 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 21330dde4..d23e31308 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 @@ -163,12 +163,18 @@
  • 星期十
  • -
    +
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    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 a07100e45..f76a26d50 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 @@ -4,13 +4,14 @@ var bootstrap = function ($, learun) { var endTime = '2022-01-23'; var classNo; var curWeek; + var weekList; var page = { init: function () { page.bind(); page.bindSelect(); }, loadData: function (param) { - $.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducation', param, + $.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetDataInEducation', param, function (data) { console.log('res', data); // 数据处理 @@ -19,7 +20,6 @@ var bootstrap = function ($, learun) { //十节课 for (var i = 1; i < 11; i++) { (function (arg) { - //console.log('arg', arg); var args = arg - 1; var datas = flogs(arg, weekLists, 'time'); //console.log('datas', datas); @@ -63,7 +63,7 @@ var bootstrap = function ($, learun) { function tdHandle() { var html = ''; for (var j = 0; j < 10; j++) { - html += '
    '; + html += '
    '; } return html; } @@ -76,28 +76,37 @@ var bootstrap = function ($, learun) { var args = arg - 1; var datas = flogs2(arg, lists, 'day'); if (datas.length > 0) { - html += ''; + html += ''; $.each(datas, function (i, item) { if (i > 0) { html += '
    '; } - html += '
    课程:' + + html += '
    ' + item.curriculum + '
    ' + - '
    教师:' + + '
    ' + item.teacher + '
    ' + - '
    班级:' + - item.className + - '
    ' + - '
    教室:' + + '
    ' + item.classRoom + '
    '; + //html += '
    课程:' + + // item.curriculum + + // '
    ' + + // '
    教师:' + + // item.teacher + + // '
    ' + + // '
    班级:' + + // item.className + + // '
    ' + + // '
    教室:' + + // item.classRoom + + // '
    '; }); html += ''; } else { - html += '
    '; + html += '
    '; } })(k); @@ -120,31 +129,53 @@ var bootstrap = function ($, learun) { //获取周次 learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime', function (res) { if (res.code == 200) { + weekList = res.data.weekList; $('#WeekTimes').lrRadioCheckbox({ type: 'radio', data: res.data.weekList, //data: [{ text: '分析清晰', value: '1' }, { text: '需要改进', value: '2' }] - select: function(item) { - console.log(item); - } + }); + curWeek = res.data.curWeek; if (!$('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').is(":checked")) { $('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').trigger('click'); } + //周次 + $('#WeekTimeSelect').lrselect({ + placeholder: "请选择周次", + maxHeight: 300, + allowSearch: true, + type: 'multiple', + data: res.data.weekList + }); } - + }); - - $('#WeekTimes').change(function() { + //切换周次 + $('#WeekTimes').change(function () { curWeek = $('#WeekTimes input[name="WeekTimes"]:checked ').val(); page.search(); }); - + //单元格选中事件 + $("#lessonTermTable").on('click', '.active', function () { + console.log('选中!'); + //undefined + //console.log($(this).attr('id')); + //console.log('当前周', curWeek); + //第几节 + //console.log('节次', $(this).closest("tr").find("td:eq(0)").text()); + //星期几 + //console.log('星期', $(this).attr('num')); + $('#WeekTimeSelect').lrselectSet('1'); + $('#WeekSelect').lrselectSet('2'); + $('#NodeSelect').lrselectSet(($(this).closest("tr").find("td:eq(0)").text()).replace('节', '')); + + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - + //查询 //$('#lr_search').on('click', function () { // var p = {}; @@ -183,82 +214,66 @@ var bootstrap = function ($, learun) { } }, bindSelect: function () { - ////校区 - //$('#F_SchoolId').lrDataSourceSelect({ - // code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { - // if (!!item) { - // // 班级 - // $('#ClassNo').lrselectRefresh({ - // placeholder: "请选择班级", - // allowSearch: true, - // url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', - // param: { schoolId: item.f_companyid }, - // value: 'value', - // text: 'text' - // }); - // // 教师 - // $('#EmpNo').lrselectRefresh({ - // placeholder: "请选择教师", - // allowSearch: true, - // url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', - // param: { schoolId: item.f_companyid }, - // value: 'value', - // text: 'text' - // }); - // } else { - // //班级 - // $('#ClassNo').lrselectRefresh({ - // placeholder: "请选择班级", - // allowSearch: true, - // url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', - // param: { schoolId: "" }, - // value: 'value', - // text: 'text' - // }); - // //教师 - // $('#EmpNo').lrselectRefresh({ - // placeholder: "请选择教师", - // allowSearch: true, - // url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', - // param: { schoolId: "" }, - // value: 'value', - // text: 'text' - // }); - // } - // } - //}); - ////班级 - //$('#ClassNo').lrselect({ - // placeholder: "请选择班级", - // allowSearch: true, - // url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', - // value: 'value', - // text: 'text' - //}); - //教师 - $('#EmpNo').lrselect({ - placeholder: "请选择教师", + //课程 + $('#LessonInfo').lrDataSourceSelect({ + // 展开最大高度 + maxHeight: '100px', + placeholder: "请选择课程", allowSearch: true, - url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', - value: 'value', - text: 'text' + code: 'LessonInfo', + value: 'lessonno', + text: 'lessonname' }); //教师 - $('#EmpNo1').lrselect({ + $('#EmpInfo').lrDataSourceSelect({ placeholder: "请选择教师", + maxHeight: 300, + allowSearch: true, + code: 'EmpInfo', + value: 'empno', + text: 'empname' + }); + //教室 + $('#ClassroomInfo').lrDataSourceSelect({ + placeholder: "请选择教室", + maxHeight: 300, + allowSearch: true, + code: 'ClassroomInfo', + value: 'classroomno', + text: 'classroomname' + }); + ////周次 + //$('#WeekTimeSelect').lrselect({ + // placeholder: "请选择周次", + // maxHeight: 300, + // allowSearch: true, + // type:'multiple', + // data: weekList + //}); + //星期 + $('#WeekSelect').lrselect({ + placeholder: "请选择星期", + maxHeight: 300, + allowSearch: true, + //type: 'multiple', + data: [{ text: '星期一', value: '1' }, { text: '星期二', value: '2' }, { text: '星期三', value: '3' }, { text: '星期四', value: '4' }, { text: '星期五', value: '5' }, { text: '星期六', value: '6' }, { text: '星期日', value: '7' }, { text: '星期八', value: '8' }, { text: '星期九', value: '9' }, { text: '星期十', value: '10' }] + }); + //节次 + $('#NodeSelect').lrselect({ + placeholder: "请选择节次", + maxHeight: 300, allowSearch: true, - url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime', - value: 'value', - text: 'text' + //type: 'multiple', + data: [{ text: '1节', value: '1' }, { text: '2节', value: '2' }, { text: '3节', value: '3' }, { text: '4节', value: '4' }, { text: '5节', value: '5' }, { text: '6节', value: '6' }, { text: '7节', value: '7' }, { text: '8节', value: '8' }, { text: '9节', value: '9' }, { text: '10节', value: '10' }] }); - + $('#NodeSelect').lrselectSet(5); }, search: function (param) { param = param || {}; //当前第几周 param.curWeek = curWeek; //班级 - param.classNo = classNo; + param.classNo = '202010';//classNo; page.loadData(param); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index d1c035b96..95c7347f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -1545,7 +1545,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les var semesterAndYear = Common.GetSemesterAndYear(startDate); var strAcademicYear = semesterAndYear.AcademicYearShort; var strSemester = semesterAndYear.Semester; - string sql = @"select b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName + string sql = @"select b.ALTId,b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName from ArrangeLessonTerm b left join ClassroomInfo c on c.ClassroomNo=b.classroomNo left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo @@ -2008,6 +2008,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les public class TimeTable { + public string ALTId { get; set; } public DateTime LessonDate { get; set; } public string EnName { get; set; } public string AcademicYear { get; set; }