From 9560219319ee289180ab143600849bdba18aec24 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 5 Sep 2023 16:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=95=99?= =?UTF-8?q?=E5=AD=A6=E8=B0=83=E5=BA=A6=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArrangeLessonTermAttemperController.cs | 3 +- .../Views/ArrangeLessonTermAttemper/Form.js | 4 +- .../ArrangeLessonTermAttemper/FormView.cshtml | 6 +- .../ArrangeLessonTermAttemper/FormView.js | 41 ++++++++---- .../Views/ArrangeLessonTermAttemper/Index.js | 27 +++----- .../TimeTable/IndexInEducationSelect_.js | 3 +- .../ArrangeLessonTermAttemperEntity.cs | 2 +- .../ArrangeLessonTermAttemperService.cs | 64 ++++++++++++------- 8 files changed, 88 insertions(+), 62 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 c7c59cf3d..9a69cf7a5 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 @@ -157,7 +157,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers int index = 0; foreach (var item in jo["predata"]) { - index++; + //index++; if (string.IsNullOrEmpty(lastdata) || lastdata != item["LessonTime"].ToString()) { lastdata = item["LessonTime"].ToString(); @@ -177,6 +177,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers NewLessonTime = newlessontime }; query.Add(term); + index++; } entity.query = query; } 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 1b48e5f73..9e86788d4 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 @@ -484,7 +484,7 @@ var bootstrap = function ($, learun) { learun.alert.warning("校区、学年、学期不一致!"); return false; } - } else if (formData.AttemperType == "01") { //调课:调度时间比较;教师或教室必填一个; + } else if (formData.AttemperType == "01") { //换课:调度时间比较;教师或教室必填一个; if ((formData.NewEmpNo == null || formData.NewEmpNo == "") && (formData.NewClassroomNo == null || formData.NewClassroomNo == "")) { learun.alert.warning("课程新安排中教师或教室不能为空!"); return false; @@ -493,7 +493,7 @@ var bootstrap = function ($, learun) { learun.alert.warning("调度结束时间不能小于调度开始时间!"); return false; } - } else if (formData.AttemperType == "04") { + } else if (formData.AttemperType == "04") { //调课 if (formData) { formData.predata = JSON.parse($('#gridtable').attr("data-val")); formData.tardata = JSON.parse( $('#gridtable1').attr("data-val")); 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 32f15fa52..b53f159d8 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 @@ -142,11 +142,13 @@
调度开始时间*
-
+ @*
*@ +
调度结束时间*
-
+ @*
*@ +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js index 2787d6e1c..f4909c22f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js @@ -189,7 +189,7 @@ var bootstrap = function ($, learun) { $('#NewEmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); $('#ClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); $('#NewClassroomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); - + }, initData: function () { if (!!keyValue) { @@ -274,7 +274,7 @@ var bootstrap = function ($, learun) { } html1 += '日期:' + oldtime + '
节次:' + oldjieci.join(';') + '
课程:' + course + '
教师:' + teacher + ';
班级:' + class_.join(';') + '
教室:' + classroom; html2 += '调整到:' + newtime + '的' + newjieci.join(';'); - console.log(html1) + //console.log(html1) $("#gridtable").html(html1); //{"targettime":"2023-6-24","targetjieci":"1节;2节;"} var target_json = { "targettime": newtime, "targetjieci": newjieci.join(';') } @@ -282,7 +282,7 @@ var bootstrap = function ($, learun) { $("#gridtable1").html(html2) } } - + } }); } @@ -290,15 +290,30 @@ var bootstrap = function ($, learun) { }; bindData = function (temprow) { if (!!temprow) { - //$('#F_SchoolId').lrselectSet(temprow.schooldId); - $('#AcademicYearNo').lrselectSet(temprow.academicyear); - $('#Semester').lrselectSet(temprow.semester); - $('#DeptNo').lrselectSet(temprow.deptNo); - $('#MajorNo').lrselectSet(temprow.majorNo); - $('#LessonNo').lrselectSet(temprow.lessonNo); - $('#TeachClassNo').lrselectSet(temprow.teachClassNo); - $('#EmpNo').lrselectSet(temprow.empno); - $('#ClassroomNo').lrselectSet(temprow.classRoomNo); + if ($("#AttemperType").lrselectGet() == "04") { + //console.log(temprow) + var dataparams = temprow.predata; + //$('#gridtable').jfGridSet('refreshdata', temprow.predata); + var datahtml = temprow.predatastr;//tardata.targettime + '的' + tardata.targetjieci; + $('#gridtable').html(datahtml); + $('#gridtable').attr("data-val", JSON.stringify(dataparams)) + var tardata = (temprow.tardata); + var html = '调整到:' + tardata.targettime + '的' + tardata.targetjieci; + $('#gridtable1').html(html); + $('#gridtable1').attr("data-val", JSON.stringify(tardata)) + //$('#gridtable1').jfGridSet('refreshdata', temprow.predata); + //$('#gridtable'). + } else { + //$('#F_SchoolId').lrselectSet(temprow.schooldId); + $('#AcademicYearNo').lrselectSet(temprow.academicyear); + $('#Semester').lrselectSet(temprow.semester); + $('#DeptNo').lrselectSet(temprow.deptNo); + $('#MajorNo').lrselectSet(temprow.majorNo); + $('#LessonNo').lrselectSet(temprow.lessonNo); + $('#TeachClassNo').lrselectSet(temprow.teachClassNo); + $('#EmpNo').lrselectSet(temprow.empno); + $('#ClassroomNo').lrselectSet(temprow.classRoomNo); + } page.query(); } }; @@ -402,7 +417,7 @@ var bootstrap = function ($, learun) { } html1 += '日期:' + oldtime + '
节次:' + oldjieci.join(';') + '
课程:' + course + '
教师:' + teacher + ';
班级:' + class_.join(';') + '
教室:' + classroom; html2 += '调整到:' + newtime + '的' + newjieci.join(';'); - console.log(html1) + //console.log(html1) $("#gridtable").html(html1); //{"targettime":"2023-6-24","targetjieci":"1节;2节;"} var target_json = { "targettime": newtime, "targetjieci": newjieci.join(';') } 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 408b977cf..1e12860ea 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 @@ -254,7 +254,8 @@ var bootstrap = function ($, learun) { }); } }, - { label: "日期", name: "AcademicYearNo", width: 100, align: "left", + { + label: "日期", name: "AcademicYearNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.httpAsyncGet('/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) { if (res.code == learun.httpCode.success) { @@ -275,7 +276,7 @@ var bootstrap = function ($, learun) { learun.httpAsyncGet('/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) { if (res.code == learun.httpCode.success) { var t_data = []; - var t_w=[] + var t_w = [] for (var i = 0; i < res.data.length; i++) { if (t_data.indexOf(res.data[i].LessonTime.substring(1)) < 0) { t_data.push(res.data[i].LessonTime.substring(1)) @@ -285,7 +286,7 @@ var bootstrap = function ($, learun) { } } if (row.AttemperType == '04') { - callback("星期" + weekChina[t_w.join(',') - 1]+'第'+t_data.join(',')+'节'); + callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节'); } else { callback(''); } @@ -301,7 +302,7 @@ var bootstrap = function ($, learun) { if (res.code == learun.httpCode.success) { var t_data = []; for (var i = 0; i < res.data.length; i++) { - if (t_data.indexOf(res.data[i].NewLessonDate.substring(0,10)) < 0) { + if (t_data.indexOf(res.data[i].NewLessonDate.substring(0, 10)) < 0) { t_data.push(res.data[i].NewLessonDate.substring(0, 10)) } } @@ -317,7 +318,7 @@ var bootstrap = function ($, learun) { { label: "调课星期/节次", name: "AcademicYearNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.httpAsyncGet( '/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) { + learun.httpAsyncGet('/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) { if (res.code == learun.httpCode.success) { var t_data = []; var t_w = [] @@ -330,21 +331,10 @@ var bootstrap = function ($, learun) { } } if (row.AttemperType == '04') { - callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.join(',') + '节'); + callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节'); } else { callback(''); } - //var t_data = []; - //for (var i = 0; i < res.data.length; i++) { - // if (t_data.indexOf(res.data[i].NewLessonTime.substring(1)) < 0) { - // t_data.push(res.data[i].NewLessonTime.substring(1)) - // } - //} - //if (row.AttemperType == '04') { - // callback(t_data.join(',') + '节'); - //} else { - // callback(''); - //} } }); } @@ -543,6 +533,9 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (learun.clientdata.get(['userinfo']).account.toLowerCase() != "system") { + param.CreateUserId = learun.clientdata.get(['userinfo']).userId; + } $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 185344e4e..06f7da3bf 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 @@ -15,8 +15,7 @@ var bootstrap = function ($, learun) { if ($("#predata").text()) { //当前班级 var dataval = JSON.parse($("#predata .card-box").attr("data-val")) - //var classno = dataval.map(item =>} {}) - param.ClassNo = dataval.map(item => { return item.className }).filter(function (itm, i, a) { + param.ClassNo = dataval.map(item => { return item.teachClassNo }).filter(function (itm, i, a) { return i == a.indexOf(itm); }).join(','); 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 d92fac405..7feb07d58 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 @@ -21,7 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("ID")] public string Id { get; set; } /// - /// 调度类型:1调课,2停课,3对调 + /// 调度类型:1换课,2停课,3对调,4调课 /// [Column("ATTEMPERTYPE")] public string AttemperType { get; set; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs index fd930ff81..2a9ea37c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs @@ -89,9 +89,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); strSql.Append(" AND (t.EmpNo = @EmpNo or t.NewEmpNo=@EmpNo) "); - } + } + if (!queryParam["CreateUserId"].IsEmpty()) + { + dp.Add("CreateUserId", queryParam["CreateUserId"].ToString(), DbType.String); + strSql.Append(" AND t.CreateUserId = @CreateUserId "); + } var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); - + return result; } catch (Exception ex) @@ -117,15 +122,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var db = this.BaseRepository("CollegeMIS").BeginTrans(); - var result=db.FindEntity(c => c.Id == keyValue); - //result.query = db.FindList(c => c.AttemperId == keyValue).ToList(); - result.query = db.FindList(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a + var result = db.FindEntity(c => c.Id == keyValue); + if (result != null) + { + result.query = db.FindList($@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a left join arrangelessonterm b on a.LessonId=b.ALTId left join classinfo c on c.classno=replace(b.teachclassno,b.lessonname,'') - left join classroominfo d on d.classroomno=b.ClassroomNo").ToList(); + left join classroominfo d on d.classroomno=b.ClassroomNo + where 1=1 and a.AttemperId='{result.Id}' ").ToList(); + } return result; - - //return this.BaseRepository("CollegeMIS").FindEntity(keyValue); } catch (Exception ex) { @@ -151,13 +157,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var db = this.BaseRepository("CollegeMIS").BeginTrans(); var result = db.FindEntity(t => t.ProcessId == processId); - //result.query = db.FindList(c => c.AttemperId == keyValue).ToList(); - result.query = db.FindList(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a + if (result != null) + { + result.query = db.FindList($@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a left join arrangelessonterm b on a.LessonId=b.ALTId left join classinfo c on c.classno=replace(b.teachclassno,b.lessonname,'') - left join classroominfo d on d.classroomno=b.ClassroomNo").ToList(); + left join classroominfo d on d.classroomno=b.ClassroomNo + where 1=1 and a.AttemperId='{result.Id}' ").ToList(); + } return result; - //return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); } catch (Exception ex) { @@ -214,23 +222,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { entity.Modify(keyValue); this.BaseRepository("CollegeMIS").Update(entity); - this.BaseRepository("CollegeMIS").Delete(c => c.AttemperId == keyValue); - foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) + if (entity.AttemperType == "04") { - item.AttemperId = entity.Id; - item.Create(); - this.BaseRepository("CollegeMIS").Insert(item); + this.BaseRepository("CollegeMIS").Delete(c => c.AttemperId == keyValue); + foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) + { + item.AttemperId = entity.Id; + item.Create(); + this.BaseRepository("CollegeMIS").Insert(item); + } } + } else { entity.Create(); this.BaseRepository("CollegeMIS").Insert(entity); - foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) + if (entity.AttemperType == "04") { - item.AttemperId = entity.Id; - item.Create(); - this.BaseRepository("CollegeMIS").Insert(item); + foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) + { + item.AttemperId = entity.Id; + item.Create(); + this.BaseRepository("CollegeMIS").Insert(item); + } } } } @@ -428,12 +443,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - else if(entity.AttemperType == "04")//调课 + else if (entity.AttemperType == "04")//调课 { - entity.query = db.FindList(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a + entity.query = db.FindList($@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a left join arrangelessonterm b on a.LessonId=b.ALTId left join classinfo c on c.classno=replace(b.teachclassno,b.lessonname,'') - left join classroominfo d on d.classroomno=b.ClassroomNo").ToList(); + left join classroominfo d on d.classroomno=b.ClassroomNo + where 1=1 and a.AttemperId='{entity.Id}' ").ToList(); foreach (var item in entity.query) { string updatesql = "update ArrangeLessonTerm set LessonDate='" + item.NewLessonDate + "',LessonTime='" + item.NewLessonTime + "' where ALTId='" + item.LessonId + "'";