From d2baf58b3c1c74e001b071ebe5b243a3031f2fcd Mon Sep 17 00:00:00 2001 From: hwh2023 <598694955@qq.com> Date: Tue, 25 Jun 2024 11:29:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermAttemperController.cs | 100 +++++++++++------- .../Views/ArrangeLessonTermAttemper/Form.js | 73 +++++++------ .../Views/ArrangeLessonTermAttemper/Index.js | 2 +- .../Controllers/TimeTableController.cs | 72 +++++++++++++ .../Views/TimeTable/IndexInEducationSelect.js | 43 ++++++-- .../ArrangeLessonTermAttemperEntity.cs | 5 + 6 files changed, 209 insertions(+), 86 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs index bd3c7f444..38e142797 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs @@ -139,50 +139,72 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { + //[{"AttemperId":"5b52c7e8-d5f5-4d54-a859-1544b7d62bf6","Day":"2","LessonTime":"23","LessonDate":"2024-03-05","SchooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","Academicyear":"23-24","Semester":"2","DeptNo":"01","Deptname":"","MajorNo":"GZ13","LessonNo":"GZ1302006","Curriculum":"编舞技法基础","TeachClassNo":"G2201010303","ClassName":"22高职男班(舞蹈表演)","Empno":"5516","Teacher":"董东洋","ClassRoomNo":"1008","ClassRoom":"教学楼008","LessonSortNo":"1"}] + + //JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity); ArrangeLessonTermAttemperEntity entity = strEntity.ToObject(); - if (entity.AttemperType == "03") + entity.Details = JsonConvert.SerializeObject(entity.query); + if (entity.AttemperType == "01") { - //if (entity.F_SchoolId != entity.NewF_SchoolId || entity.AcademicYearNo != entity.NewAcademicYearNo || entity.Semester != entity.NewSemester) - if (entity.AcademicYearNo != entity.NewAcademicYearNo || entity.Semester != entity.NewSemester) - { - return Fail("校区、学年、学期不一致!"); - } + //调课 } - if (entity.AttemperType=="04") + else if (entity.AttemperType == "02") { - JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity); - List query = new List(); - string[] targetjieci = jo["tardata"]["targetjieci"].ToString().TrimEnd(';').Split(';'); - string targettime = jo["tardata"]["targettime"].ToString(); - string lastdata = ""; - int i = 0; - int index = 0; - foreach (var item in jo["predata"]) - { - //index++; - if (string.IsNullOrEmpty(lastdata) || lastdata != item["LessonTime"].ToString()) - { - lastdata = item["LessonTime"].ToString(); - if ( index >= jo["predata"].Count()/2) - { - i++; - } - } - DateTime NewLessonDate = Convert.ToDateTime(jo["tardata"]["targettime"].ToString()); - string newlessontime = Convert.ToInt32(NewLessonDate.DayOfWeek).ToString()+ targetjieci[i].Replace("节",""); - ArrangeLessonTermAttrmperChildEntity term = new ArrangeLessonTermAttrmperChildEntity - { - LessonId = !string.IsNullOrEmpty(keyValue) ? item["LessonId"].ToString(): item["AltId"].ToString(), - LessonDate = Convert.ToDateTime(item["LessonDate"].ToString()), - LessonTime = item["LessonTime"].ToString(), - NewLessonDate =NewLessonDate , - NewLessonTime = newlessontime - }; - query.Add(term); - index++; - } - entity.query = query; + //停课 + } + else if (entity.AttemperType == "03") + { + //换课 + + } + + + #region 旧逻辑 + //if (entity.AttemperType == "03") + //{ + // //if (entity.F_SchoolId != entity.NewF_SchoolId || entity.AcademicYearNo != entity.NewAcademicYearNo || entity.Semester != entity.NewSemester) + // if (entity.AcademicYearNo != entity.NewAcademicYearNo || entity.Semester != entity.NewSemester) + // { + // return Fail("校区、学年、学期不一致!"); + // } + //} + //if (entity.AttemperType == "04") + //{ + // //JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity); + // List query = new List(); + // string[] targetjieci = jo["tardata"]["targetjieci"].ToString().TrimEnd(';').Split(';'); + // string targettime = jo["tardata"]["targettime"].ToString(); + // string lastdata = ""; + // int i = 0; + // int index = 0; + // foreach (var item in jo["predata"]) + // { + // //index++; + // if (string.IsNullOrEmpty(lastdata) || lastdata != item["LessonTime"].ToString()) + // { + // lastdata = item["LessonTime"].ToString(); + // if (index >= jo["predata"].Count() / 2) + // { + // i++; + // } + // } + // DateTime NewLessonDate = Convert.ToDateTime(jo["tardata"]["targettime"].ToString()); + // string newlessontime = Convert.ToInt32(NewLessonDate.DayOfWeek).ToString() + targetjieci[i].Replace("节", ""); + // ArrangeLessonTermAttrmperChildEntity term = new ArrangeLessonTermAttrmperChildEntity + // { + // LessonId = !string.IsNullOrEmpty(keyValue) ? item["LessonId"].ToString() : item["AltId"].ToString(), + // LessonDate = Convert.ToDateTime(item["LessonDate"].ToString()), + // LessonTime = item["LessonTime"].ToString(), + // NewLessonDate = NewLessonDate, + // NewLessonTime = newlessontime + // }; + // query.Add(term); + // index++; + // } + // entity.query = query; + //} + #endregion entity.Status = 0; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js index c97154fb2..84c48f1b9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js @@ -324,10 +324,10 @@ var bootstrap = function ($, learun) { //{"AltId":"c7c2e0dc-12c5-4742-ba27-f8084fa712eb","day":"2","lessonTime":"21","lessonDate":"2024-06-11","schooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","academicyear":"23-24","semester":"2","deptNo":"06","deptname":"","majorNo":"GZ02","lessonNo":"GZ0202999","curriculum":"音乐表演(民族乐器演奏方向)专业主课","teachClassNo":"G2306010301","className":"2301班(器乐系)","empno":"1132","teacher":"吴权喜","classRoomNo":"1012","classRoom":"音乐楼012","lessonSortNo":"1"} $('#gridtable2').jfGrid({ headData: [ - { label: "学年", name: "academicyear", width: 100, align: "left" }, - { label: "学期", name: "semester", width: 100, align: "left" }, + { label: "学年", name: "Academicyear", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, { - label: "系部", name: "deptNo", width: 100, align: "left", + label: "系部", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', @@ -340,7 +340,7 @@ var bootstrap = function ($, learun) { } }, { - label: "专业", name: "majorNo", width: 100, align: "left", + label: "专业", name: "MajorNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', @@ -353,7 +353,7 @@ var bootstrap = function ($, learun) { } }, { - label: "课程", name: "lessonNo", width: 100, align: "left", + label: "课程", name: "LessonNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', @@ -366,7 +366,7 @@ var bootstrap = function ($, learun) { } }, { - label: "班级", name: "teachClassNo", width: 100, align: "left", + label: "班级", name: "TeachClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', @@ -379,7 +379,7 @@ var bootstrap = function ($, learun) { } }, { - label: "教师", name: "empno", width: 100, align: "left", + label: "教师", name: "Empno", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', @@ -392,7 +392,7 @@ var bootstrap = function ($, learun) { } }, { - label: "教室", name: "classRoomNo", width: 100, align: "left", + label: "教室", name: "ClassRoomNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', @@ -572,28 +572,31 @@ var bootstrap = function ($, learun) { // 保存数据 save = function (processId, callBack, i) { var formData = $('body').lrGetFormData(); - if (formData.AttemperType == "03") { //对调:校区、学年、学期需要一致 - //if (formData.F_SchoolId !== formData.NewF_SchoolId || formData.AcademicYearNo !== formData.NewAcademicYearNo || formData.Semester !== formData.NewSemester) { - if (formData.AcademicYearNo !== formData.NewAcademicYearNo || formData.Semester !== formData.NewSemester) { - learun.alert.warning("校区、学年、学期不一致!"); - return false; - } - } else if (formData.AttemperType == "01") { //换课:调度时间比较;教师或教室必填一个; - if ((formData.NewEmpNo == null || formData.NewEmpNo == "") && (formData.NewClassroomNo == null || formData.NewClassroomNo == "")) { - learun.alert.warning("课程新安排中教师或教室不能为空!"); - return false; - } - if (formData.AttemperEndTime < formData.AttemperStartTime) { - learun.alert.warning("调度结束时间不能小于调度开始时间!"); - return false; - } - } else if (formData.AttemperType == "04") { //调课 - if (formData) { - formData.predata = JSON.parse($('#gridtable').attr("data-val")); - formData.tardata = JSON.parse( $('#gridtable1').attr("data-val")); - } + if (false) { + //if (formData.AttemperType == "03") { //对调:校区、学年、学期需要一致 + // //if (formData.F_SchoolId !== formData.NewF_SchoolId || formData.AcademicYearNo !== formData.NewAcademicYearNo || formData.Semester !== formData.NewSemester) { + // if (formData.AcademicYearNo !== formData.NewAcademicYearNo || formData.Semester !== formData.NewSemester) { + // learun.alert.warning("校区、学年、学期不一致!"); + // return false; + // } + //} else if (formData.AttemperType == "01") { //换课:调度时间比较;教师或教室必填一个; + // if ((formData.NewEmpNo == null || formData.NewEmpNo == "") && (formData.NewClassroomNo == null || formData.NewClassroomNo == "")) { + // learun.alert.warning("课程新安排中教师或教室不能为空!"); + // return false; + // } + // if (formData.AttemperEndTime < formData.AttemperStartTime) { + // learun.alert.warning("调度结束时间不能小于调度开始时间!"); + // return false; + // } + //} else if (formData.AttemperType == "04") { //调课 + // if (formData) { + // formData.predata = JSON.parse($('#gridtable').attr("data-val")); + // formData.tardata = JSON.parse( $('#gridtable1').attr("data-val")); + // } + //} } - + //获取要操作的课程列表 + formData.query = $('#gridtable2').jfGridGet('rowdatas'); console.log(formData) if (!!processId) { formData.ProcessId = processId; @@ -601,12 +604,12 @@ var bootstrap = function ($, learun) { var postData = { strEntity: JSON.stringify(formData) }; - //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/SaveForm?keyValue=' + keyValue, postData, function (res) { - // // 保存成功后才回调 - // if (!!callBack) { - // callBack(res, i); - // } - //}); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js index 7f076ee91..f98885a43 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js @@ -102,7 +102,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('Id'); selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { - if (selectedRow.Status !== 0) { + if (selectedRow[0].Status !== 0) { learun.alert.warning("当前课程异动记录已提交,无法删除!"); return false; } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs index 2bc47c72a..e06832985 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs @@ -577,6 +577,78 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = formatData }; return JsonResult(result); } + /// + /// 课程表【教务】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetDataInEducationSelect_news(string startTime, string endTime, string classNo, string empNo, string schoolId) + { + var userInfo = LoginUserInfo.Get(); + //开始时间 + var startdate = string.IsNullOrEmpty(startTime) ? DateTime.Today : Convert.ToDateTime(startTime); + var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); + var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); + + var semesterAndYear = Common.GetSemesterAndYear(startDate); + var strAcademicYear = semesterAndYear.AcademicYearLong; + var strSemester = semesterAndYear.Semester; + + var timeTableList = new List(); + //课程表 + var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, ""); + timeTableList.AddRange(data); + //选修课课程表 + //var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId); + //timeTableList.AddRange(dataOfElective); + + var timeTables = timeTableList.ToList(); + var noDataResult = new + { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = "" }; + if (!timeTables.Any()) + { + return JsonResult(noDataResult); + } + var formatData = from d in timeTables + let tt = d.LessonTime.Substring(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) + where ee == g.Key + select new + { + AttemperId = e.AltId, + Day = e.LessonTime.ToCharArray()[0], + LessonTime = e.LessonTime, + LessonDate = e.LessonDate.ToString("yyyy-MM-dd"), + SchooldId = e?.F_SchoolId, + Academicyear = semesterAndYear.AcademicYearShort, + Semester = strSemester, + DeptNo = e?.DeptNo, + Deptname = "", + MajorNo = e?.MajorNo, + LessonNo = e?.LessonNo, + Curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName, + TeachClassNo = e?.TeachClassNo, + ClassName = string.IsNullOrEmpty(e.ClassName) ? "" : e.ClassName, + Empno = e?.EmpNo, + Teacher = e?.EmpName, + ClassRoomNo = string.IsNullOrEmpty(e.ClassRoomNo) ? "" : e.ClassRoomNo.Trim(), + ClassRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(), + LessonSortNo = e.LessonSortNo + } + } + ; + + var result = new + { schoolName = "课程表", semester = $"{strAcademicYear}学年度 第{strSemester}学期", weekList = formatData }; + return JsonResult(result); + } /// /// 课程表【教务】--班级下拉框信息 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js index c5660ce4b..6748fe91a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js @@ -10,7 +10,7 @@ var bootstrap = function ($, learun) { page.bindSelect(); }, loadData: function (param) { - $.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducationSelect', param, + $.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducationSelect_news', param, function (data) { // 数据处理 var html = ''; @@ -30,7 +30,7 @@ var bootstrap = function ($, learun) { })(i); //调用时参数 } $('.personT').text(data.schoolName); - $('.perSemester').text(data.semester); + $('.perSemester').text(data.Semester); $('.perFestivalsBox table').html(html); function flogs(num, data, obj) { @@ -70,7 +70,7 @@ var bootstrap = function ($, learun) { for (var k = 1; k < 8; k++) { (function (arg) { var args = arg - 1; - var datas = flogs2(arg, lists, 'day'); + var datas = flogs2(arg, lists, 'Day'); if (datas.length > 0) { html += ''; $.each(datas, function (i, item) { @@ -78,16 +78,16 @@ var bootstrap = function ($, learun) { html += '
'; } html += "
课程:" + - item.curriculum + + item.Curriculum + "
" + "
教师:" + - item.teacher + + item.Teacher + "
" + "
班级:" + - item.className + + item.ClassName + "
" + "
教室:" + - item.classRoom + + item.ClassRoom + "
"; }); html += ''; @@ -160,11 +160,32 @@ var bootstrap = function ($, learun) { //点击课程表内容 $('.perFestivalsBox').on('click', 'td.active div.box', function () { var box = $(this); - //$('.perFestivalsBox').find('div.box.active').removeClass('active'); - if (box[0].className.indexOf('active') >= 0) { - box.removeClass('active'); + var choosedata = JSON.parse(box[0].getAttribute('data-val')); + $('.perFestivalsBox').find('div.box.active').removeClass('active'); + if ($('#ClassNo').lrselectGet() == '' && $('#EmpNo').lrselectGet() == '') { + learun.alert.warning("请选择班级或者教师!"); } else { - box.addClass('active'); + //{"AltId":"5b52c7e8-d5f5-4d54-a859-1544b7d62bf6","day":"2","lessonTime":"23","lessonDate":"2024-03-05","schooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","academicyear":"23-24","semester":"2","deptNo":"01","deptname":"","majorNo":"GZ13","lessonNo":"GZ1302006","curriculum":"编舞技法基础","teachClassNo":"G2201010303","className":"22高职男班(舞蹈表演)","empno":"5516","teacher":"董东洋","classRoomNo":"1008","classRoom":"教学楼008","lessonSortNo":"1"} + //(1)合班课判断逻辑:同一时间、同一教室、相同教师(1个或多个)、多个班级学生 即为合班课 + //(2)选择课程安排可以将所属合班课程同时勾选,教学调度系统流程只需发起一次即可 + + for (var i = 0; i < box.parent()[0].children.length; i++) { + if (box.parent()[0].children[i].getAttribute('class')) { + if (box.parent()[0].children[i].getAttribute('class').indexOf('box') >= 0) { + console.log(box.parent()[0].children[i].getAttribute('data-val')) + var item = box.parent()[0].children[i]; + var itemdata = JSON.parse(item.getAttribute('data-val')); + if (choosedata.ClassRoomNo == itemdata.ClassRoomNo) { + item.setAttribute('class', 'box active') + } + } + } + } + //if (box[0].className.indexOf('active') >= 0) { + // box.removeClass('active'); + //} else { + // box.addClass('active'); + //} } }); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs index 7feb07d58..f7964e09e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs @@ -170,6 +170,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("PROCESSID")] public string ProcessId { get; set; } + /// + /// Details + /// + [Column("DETAILS")] + public string Details { get; set; } #endregion #region 扩展操作 From fc7243459562de8e032a62b99c34d85e60a624f3 Mon Sep 17 00:00:00 2001 From: hwh2023 <598694955@qq.com> Date: Thu, 27 Jun 2024 09:47:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E8=AF=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermAttemperController.cs | 49 ++++- .../ArrangeLessonTermAttemper/Form.cshtml | 2 +- .../Views/ArrangeLessonTermAttemper/Form.js | 50 +++-- .../ArrangeLessonTermAttemper/FormView.cshtml | 8 +- .../ArrangeLessonTermAttemper/FormView.js | 181 +++++++++++++++++- .../ArrangeLessonTermAttemperEntity.cs | 10 +- .../ArrangeLessonTermAttemperService.cs | 3 + 7 files changed, 266 insertions(+), 37 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs index 38e142797..3c52846bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs @@ -139,11 +139,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { - //[{"AttemperId":"5b52c7e8-d5f5-4d54-a859-1544b7d62bf6","Day":"2","LessonTime":"23","LessonDate":"2024-03-05","SchooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","Academicyear":"23-24","Semester":"2","DeptNo":"01","Deptname":"","MajorNo":"GZ13","LessonNo":"GZ1302006","Curriculum":"编舞技法基础","TeachClassNo":"G2201010303","ClassName":"22高职男班(舞蹈表演)","Empno":"5516","Teacher":"董东洋","ClassRoomNo":"1008","ClassRoom":"教学楼008","LessonSortNo":"1"}] - - //JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity); + //[{"AttemperId":"3ec8df23-c045-428c-b37c-c370b73f53ef","Day":"5","LessonTime":"53","LessonDate":"2024-03-08","SchooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","Academicyear":"23-24","Semester":"2","DeptNo":"01","Deptname":"","MajorNo":"GZ13","LessonNo":"GZ1303001","Curriculum":"爵士舞","TeachClassNo":"G2201010303","ClassName":"22高职男班(舞蹈表演)","Empno":"2224","Teacher":"魏志勇","ClassRoomNo":"3102","ClassRoom":"舞蹈楼102","LessonSortNo":"1"},{"AttemperId":"e4970ebb-1af5-4298-b03c-f8014e1adb06","Day":"5","LessonTime":"53","LessonDate":"2024-03-08","SchooldId":"207fa1a9-160c-4943-a89b-8fa4db0547ce","Academicyear":"23-24","Semester":"2","DeptNo":"01","Deptname":"","MajorNo":"GZ13","LessonNo":"GZ1302005","Curriculum":"中国古典舞身韵","TeachClassNo":"G2201010303","ClassName":"22高职男班(舞蹈表演)","Empno":"5526","Teacher":"焦晓天","ClassRoomNo":"3102","ClassRoom":"舞蹈楼102","LessonSortNo":"1"}] + //"CreateUserId":"System","CreateUserName":"超级管理员","CreateTime":"2024-06-25 13:14:35","AttemperType":"02","AttemperTimeType":"","NewAcademicYearNo":"","NewSemester":"","NewDeptNo":"","NewMajorNo":"","NewLessonNo":"","NewTeachClassNo":"","NewEmpNo":"","NewClassroomNo":"","AttemperStartTime":"","AttemperEndTime":"","AttemperRemark":"22" + JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity); ArrangeLessonTermAttemperEntity entity = strEntity.ToObject(); - entity.Details = JsonConvert.SerializeObject(entity.query); + if (entity.AttemperType == "01") { //调课 @@ -158,8 +158,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers //换课 } - - + #region 旧逻辑 //if (entity.AttemperType == "03") //{ @@ -206,10 +205,42 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers //} #endregion + foreach (var item in jo["query"]) + { + ArrangeLessonTermAttemperEntity itementity = new ArrangeLessonTermAttemperEntity(); + itementity.CreateUserId = entity.CreateUserId; + itementity.CreateUserName = entity.CreateUserName; + itementity.CreateTime = entity.CreateTime; + itementity.AttemperRemark = entity.AttemperRemark; + itementity.AttemperType = entity.AttemperType;//调课类型 + + itementity.NewAcademicYearNo= entity.NewAcademicYearNo; + itementity.NewSemester = entity.NewSemester; + itementity.NewDeptNo = entity.NewDeptNo; + itementity.NewMajorNo = entity.NewMajorNo; + itementity.NewLessonNo = entity.NewLessonNo; + itementity.NewTeachClassNo = entity.NewTeachClassNo; + itementity.NewEmpNo = entity.NewEmpNo; + itementity.NewClassroomNo = entity.NewClassroomNo; + + itementity.AcademicYearNo = item["Academicyear"].ToString(); + itementity.Semester = item["Semester"].ToString(); + itementity.DeptNo = item["DeptNo"].ToString(); + itementity.MajorNo = item["MajorNo"].ToString(); + itementity.LessonNo = item["LessonNo"].ToString(); + itementity.TeachClassNo = item["TeachClassNo"].ToString(); + itementity.EmpNo = item["Empno"].ToString(); + itementity.ClassroomNo = item["ClassRoomNo"].ToString(); - entity.Status = 0; - entity.CheckStatus = 0; - arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, entity); + itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限 + + itementity.AttemperStartTime = entity.AttemperStartTime; + itementity.AttemperEndTime = entity.AttemperEndTime; + + itementity.Status = 0; + itementity.CheckStatus = 0; + arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, itementity); + } return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml index ae5169a3c..4e180d61a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.cshtml @@ -57,7 +57,7 @@
校区*
*@ -
+
@*
学年*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js index 84c48f1b9..b9c35e54d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js @@ -210,10 +210,34 @@ var bootstrap = function ($, learun) { }); $('#TeachClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); $('#NewTeachClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); - $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); - $('#NewEmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); - $('#ClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); - $('#NewClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); + $('#EmpNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', + value: 'value', + text: 'text' + }); + //$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //$('#NewEmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + $('#NewEmpNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', + value: 'value', + text: 'text' + }); + //$('#ClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); + $('#ClassroomNo').lrselect({ + allowSearch: true, + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', + value: 'classroomno', + text: 'classroomname' + }); + //$('#NewClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); + $('#NewClassroomNo').lrselect({ + allowSearch: true, + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', + value: 'classroomno', + text: 'classroomname' + }); //调度开始时间 $('#AttemperStartTime').lrselect({ allowSearch: true }); //调度结束时间 @@ -364,7 +388,7 @@ var bootstrap = function ($, learun) { } }); } - }, + }, { label: "班级", name: "TeachClassNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -477,14 +501,14 @@ var bootstrap = function ($, learun) { bindDataNew = function (temprow) { if (!!temprow) { //$('#NewF_SchoolId').lrselectSet(temprow.schooldId); - $('#NewAcademicYearNo').lrselectSet(temprow.academicyear); - $('#NewSemester').lrselectSet(temprow.semester); - $('#NewDeptNo').lrselectSet(temprow.deptNo); - $('#NewMajorNo').lrselectSet(temprow.majorNo); - $('#NewLessonNo').lrselectSet(temprow.lessonNo); - $('#NewTeachClassNo').lrselectSet(temprow.teachClassNo); - $('#NewEmpNo').lrselectSet(temprow.empno); - $('#NewClassroomNo').lrselectSet(temprow.classRoomNo); + $('#NewAcademicYearNo').lrselectSet(temprow[0].Academicyear); + $('#NewSemester').lrselectSet(temprow[0].Semester); + $('#NewDeptNo').lrselectSet(temprow[0].DeptNo); + $('#NewMajorNo').lrselectSet(temprow[0].MajorNo); + $('#NewLessonNo').lrselectSet(temprow[0].LessonNo); + $('#NewTeachClassNo').lrselectSet(temprow[0].TeachClassNo); + $('#NewEmpNo').lrselectSet(temprow[0].Empno); + $('#NewClassroomNo').lrselectSet(temprow[0].ClassRoomNo); } }; // 验证数据是否填写完整 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.cshtml index b53f159d8..d25f1ff28 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.cshtml @@ -60,8 +60,10 @@
校区*
*@ -
-
+
+ +
+ @*
学年*
@@ -92,7 +94,7 @@
教室*
-
+
*@