Pārlūkot izejas kodu

调课完成

黑龙江艺术高中职
hwh2023 pirms 4 mēnešiem
vecāks
revīzija
b81175b28d
13 mainītis faili ar 678 papildinājumiem un 315 dzēšanām
  1. +109
    -38
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs
  2. +61
    -57
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js
  3. +42
    -9
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js
  4. +7
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.cshtml
  5. +95
    -73
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js
  6. +13
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs
  7. +7
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect_.cshtml
  8. +195
    -104
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect_.js
  9. +10
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs
  10. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperBLL.cs
  11. +10
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs
  12. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperIBLL.cs
  13. +99
    -18
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs

+ 109
- 38
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermAttemperController.cs Parādīt failu

@@ -139,8 +139,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string 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"
//{"CreateUserId":"e17c5186-238f-4cf6-aeb3-73780a2ec6ad","CreateUserName":"刘思阅","CreateTime":"2024-07-15 17:14:28","AttemperType":"04","AttemperTimeType":"","NewAcademicYearNo":"","NewSemester":"","NewDeptNo":"","NewMajorNo":"","NewLessonNo":"","NewTeachClassNo":"","NewEmpNo":"","NewClassroomNo":"","AttemperStartTime":"","AttemperEndTime":"","NewTime":"","AttemperRemark":"","predata":[{"AltId":"a57b3b95-60ce-41c3-8180-78140562b002","LessonTime":"15","LessonDate":"2024-06-24","time":"2024-06-24","jieci":"5节","curriculum":"舞蹈基本功","AcademicYearNo":"23-24","Semester":"2","DeptNo":"01","MajorNo":"GZ13","LessonNo":"GZ1302001","TeachClassNo":"G2201010303","EmpName":"刘思阅","ClassroomNo":"3102","classRoom":"舞蹈楼102","ClassName":"22高职男班(舞蹈表演)"},{"AltId":"001ec263-4aad-40db-bd2b-5f33bc895b93","LessonTime":"15","LessonDate":"2024-06-24","time":"2024-06-24","jieci":"5节","curriculum":"舞蹈基本功","AcademicYearNo":"23-24","Semester":"2","DeptNo":"01","MajorNo":"GZ13","LessonNo":"GZ1302001","TeachClassNo":"G2201010303","EmpName":"刘思阅","ClassroomNo":"3102","classRoom":"舞蹈楼102","ClassName":"22高职男班(舞蹈表演)"}],"tardata":{"targettime":"2024-6-26","targetjieci":"4节;"}}
JObject jo = (JObject)JsonConvert.DeserializeObject(strEntity);
ArrangeLessonTermAttemperEntity entity = strEntity.ToObject<ArrangeLessonTermAttemperEntity>();
@@ -158,7 +157,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
//换课

}
#region 旧逻辑
//if (entity.AttemperType == "03")
//{
@@ -204,52 +203,124 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
// entity.query = query;
//}
#endregion
if (entity.AttemperType=="04")
{
List<ArrangeLessonTermAttemperEntity> query = new List<ArrangeLessonTermAttemperEntity>();
foreach (var item in jo["predata"])
{
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.LessonDate = Convert.ToDateTime(item["LessonDate"].ToString());
itementity.LessonTime = item["LessonTime"].ToString();
itementity.AcademicYearNo = item["AcademicYearNo"].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();


foreach (var item in jo["query"])
itementity.NewTime = Convert.ToDateTime(jo["tardata"]["targettime"].ToString());
string week= ((DateTime)itementity.NewTime).DayOfWeek.ToString("d");
string jieci = (week == "0" ? "7" : week) + jo["tardata"]["targetjieci"].ToString().Replace("节;", "");
itementity.newjieci = jieci;

itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限

itementity.AttemperStartTime = entity.AttemperStartTime;
itementity.AttemperEndTime = entity.AttemperEndTime;
itementity.IsDelete = 1;
itementity.Status = 0;
itementity.CheckStatus = 0;
query.Add(itementity);
}

foreach (var item in query)
{
arrangeLessonTermAttemperIBLL.SaveEntity("", item);
}
}

else
{
ArrangeLessonTermAttemperEntity itementity = new ArrangeLessonTermAttemperEntity();
itementity.CreateUserId = entity.CreateUserId;
itementity.CreateUserName = entity.CreateUserName;
itementity.CreateTime = entity.CreateTime;
itementity.AttemperRemark = entity.AttemperRemark;
itementity.AttemperType = entity.AttemperType;//调课类型
List<ArrangeLessonTermAttemperEntity> query = new List<ArrangeLessonTermAttemperEntity>();
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.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.LessonDate = Convert.ToDateTime(item["LessonDate"].ToString());
itementity.LessonTime = item["LessonTime"].ToString();
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();
itementity.NewTime = entity.NewTime;
itementity.LessonDate = Convert.ToDateTime(item["LessonDate"].ToString());
itementity.LessonTime = item["LessonTime"].ToString();
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();
itementity.NewTime = entity.NewTime;

itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限
itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限

itementity.AttemperStartTime = entity.AttemperStartTime;
itementity.AttemperEndTime = entity.AttemperEndTime;
if (itementity.AttemperType=="03")
itementity.AttemperStartTime = entity.AttemperStartTime;
itementity.AttemperEndTime = entity.AttemperEndTime;
if (itementity.AttemperType == "03")
{
itementity.IsDelete = 0;
itementity.Status = 1;
itementity.CheckStatus = 2;//通过
}
else
{
itementity.IsDelete = 1;
itementity.Status = 0;
itementity.CheckStatus = 0;
}
query.Add(itementity);
}
if (entity.AttemperType == "03")
{
itementity.Status = 1;
itementity.CheckStatus = 2;//通过
DateTime newtime = (DateTime)entity.NewTime;
arrangeLessonTermAttemperIBLL.SaveEntitys(newtime, query);
}
else
{
itementity.Status = 0;
itementity.CheckStatus = 0;
foreach (var item in query)
{
arrangeLessonTermAttemperIBLL.SaveEntity("", item);
}
}
arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, itementity);
}

return Success("保存成功!");


+ 61
- 57
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Form.js Parādīt failu

@@ -34,31 +34,33 @@ var bootstrap = function ($, learun) {
query: function () {
var p = {};
var datas = $('#gridtable2').jfGridGet('rowdatas');
//p.F_SchoolId = $('#F_SchoolId').lrselectGet();
p.AcademicYearNo = datas[0].Academicyear;// $('#AcademicYearNo').lrselectGet();
p.Semester = datas[0].Semester;//$('#Semester').lrselectGet();
p.DeptNo = datas[0].DeptNo;//$('#DeptNo').lrselectGet();
p.MajorNo = datas[0].MajorNo;//$('#MajorNo').lrselectGet();
p.LessonNo = datas[0].LessonNo;//$('#LessonNo').lrselectGet();
p.TeachClassNo = datas[0].TeachClassNo;//$('#TeachClassNo').lrselectGet();
p.EmpNo = datas[0].Empno;// $('#EmpNo').lrselectGet();
p.ClassroomNo = datas[0].ClassRoomNo;//$('#ClassroomNo').lrselectGet();
//if (!!p.F_SchoolId && !!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) {
if (!!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) {
//调度开始时间
$('#AttemperStartTime').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetLessonDateList?queryJson=' + JSON.stringify(p),
value: 'value',
text: 'text'
});
//调度结束时间
$('#AttemperEndTime').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetLessonDateList?queryJson=' + JSON.stringify(p),
value: 'value',
text: 'text'
});
if (datas.length > 0) {
//p.F_SchoolId = $('#F_SchoolId').lrselectGet();
p.AcademicYearNo = datas[0].Academicyear;// $('#AcademicYearNo').lrselectGet();
p.Semester = datas[0].Semester;//$('#Semester').lrselectGet();
p.DeptNo = datas[0].DeptNo;//$('#DeptNo').lrselectGet();
p.MajorNo = datas[0].MajorNo;//$('#MajorNo').lrselectGet();
p.LessonNo = datas[0].LessonNo;//$('#LessonNo').lrselectGet();
p.TeachClassNo = datas[0].TeachClassNo;//$('#TeachClassNo').lrselectGet();
p.EmpNo = datas[0].Empno;// $('#EmpNo').lrselectGet();
p.ClassroomNo = datas[0].ClassRoomNo;//$('#ClassroomNo').lrselectGet();
//if (!!p.F_SchoolId && !!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) {
if (!!p.AcademicYearNo && !!p.Semester && !!p.DeptNo && !!p.MajorNo && !!p.LessonNo && !!p.TeachClassNo && !!p.EmpNo && !!p.ClassroomNo) {
//调度开始时间
$('#AttemperStartTime').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetLessonDateList?queryJson=' + JSON.stringify(p),
value: 'value',
text: 'text'
});
//调度结束时间
$('#AttemperEndTime').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetLessonDateList?queryJson=' + JSON.stringify(p),
value: 'value',
text: 'text'
});
}
}
},
bind: function () {
@@ -103,10 +105,13 @@ var bootstrap = function ($, learun) {
bindSelect: function () {
$('#AttemperType').lrDataItemSelect({
code: 'AttemperType', select: function (item) {
if (item.id == '03') {
if (learun.clientdata.get(['userinfo']).roleIds.indexOf("d080a7c6-17bd-401b-b3df-fe0f741e5838") < 0) {
learun.alert.warning("无权操作!");
return;
if (item) {
if (item.id == '03') {
if (learun.clientdata.get(['userinfo']).roleIds.indexOf("d080a7c6-17bd-401b-b3df-fe0f741e5838") < 0) {
$("#AttemperType").lrselectSet('');
learun.alert.warning("无权操作!");
return;
}
}
}
$('.AttemperType').hide();
@@ -607,34 +612,33 @@ var bootstrap = function ($, learun) {
// 保存数据
save = function (processId, callBack, i) {
var formData = $('body').lrGetFormData();
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');
if (formData.query.length==0) {
learun.alert.warning("请选择课程!");
return 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"));
}
} else {
//获取要操作的课程列表
formData.query = $('#gridtable2').jfGridGet('rowdatas');
if (formData.query.length == 0) {
learun.alert.warning("请选择课程!");
return false;
}
}
console.log(formData)
if (!!processId) {


+ 42
- 9
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/FormView.js Parādīt failu

@@ -560,7 +560,7 @@ var bootstrap = function ($, learun) {
$(".olddata").removeAttr("isvalid");
$(".olddata").removeAttr("checkexpession");
$(".olddata").removeAttr('readonly');
$("#gridtable").attr("data-val", JSON.stringify(data[id].query));
$("#gridtable").attr("data-val", [JSON.stringify(data[id])]);
var html1 = "";
var html2 = "";

@@ -572,22 +572,55 @@ var bootstrap = function ($, learun) {
var classroom = '';
var newtime = '';
var newjieci = [];
for (var i = 0; i < data[id].query.length; i++) {
var item = data[id].query[i];
for (var i = 0; i < [data[id]].length; i++) {
var item = data[id];
var jieci1 = item.LessonTime.substring(1, item.LessonTime.length) + '节';
var jieci2 = item.NewLessonTime.substring(1, item.NewLessonTime.length) + '节';
var jieci2 = item.newjieci.substring(1, item.newjieci.length) + '节';
if (i == 0) {
oldtime = item.LessonDate.substring(0, 10);
course = item.LessonName;
teacher = item.EmpName;
classroom = item.ClassroomName;
newtime = item.NewLessonDate.substring(0, 10)
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
key: item.LessonNo,
keyId: 'lessonno',
callback: function (_data) {
course=_data['lessonname'];
}
});
//course = item.LessonName;
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo',
key: item.EmpNo,
keyId: 'empno',
callback: function (_data) {
teacher=_data['empname'];
}
});
//teacher = item.EmpName;
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo',
key: item.ClassroomNo,
keyId: 'classroomno',
callback: function (_data) {
classroom=_data['classroomname'];
}
});
//classroom = item.ClassroomName;
newtime = item.NewTime.substring(0, 10)
}
if (oldjieci.indexOf(jieci1) < 0) {
oldjieci.push(jieci1)
}
if (class_.indexOf(item.Classname) < 0) {
class_.push(item.Classname)
var classname=''
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
key: item.TeachClassNo,
keyId: 'classno',
callback: function (_data) {
classname=_data['classname'];
}
});
class_.push(classname)
}
if (newjieci.indexOf(jieci2) < 0) {
newjieci.push(jieci2)


+ 7
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.cshtml Parādīt failu

@@ -19,9 +19,9 @@
<div id="AttemperTimeType"></div>
</div>
@*<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">校区</div>
<div id="F_SchoolId"></div>
</div>*@
<div class="lr-form-item-title">校区</div>
<div id="F_SchoolId"></div>
</div>*@
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">学年</div>
<div id="AcademicYearNo"></div>
@@ -50,6 +50,10 @@
<div class="lr-form-item-title">教师</div>
<div id="EmpNo"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">是否显示</div>
<div id="IsDelete"></div>
</div>
</div>
</div>
</div>


+ 95
- 73
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTermAttemper/Index.js Parādīt failu

@@ -35,10 +35,19 @@ var bootstrap = function ($, learun) {
text: 'text'
});
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
//$('#IsDelete').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
$('#IsDelete').lrselect({
placeholder: "是否外聘",
data: [{ text: "是", value: "1" }, { text: "否", value: "0" }],
text: "text",
value: "value",
});
$('#IsDelete').lrselectSet(1);
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
$('#TeachClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
//$('input[name="IsDelete"][value="1"]').prop('checked', true)
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
@@ -167,7 +176,7 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTermAttemper/GetPageList',
headData: [
{
@@ -264,88 +273,100 @@ 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) {
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].LessonDate.substring(0, 10)) < 0) {
t_data.push(res.data[i].LessonDate.substring(0, 10))
}
}
callback(t_data.join(','));
}
});
}
label: "日期", name: "LessonDate", 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) {
// var t_data = [];
// for (var i = 0; i < res.data.length; i++) {
// if (t_data.indexOf(res.data[i].LessonDate.substring(0, 10)) < 0) {
// t_data.push(res.data[i].LessonDate.substring(0, 10))
// }
// }
// callback(t_data.join(','));
// }
// });
//}
},
{
label: "星期/节次", name: "AcademicYearNo", width: 100, align: "left",
label: "星期/节次", name: "LessonTime", 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) {
var t_data = [];
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))
}
if (t_w.indexOf(res.data[i].LessonTime.substring(0, 1)) < 0) {
t_w.push(res.data[i].LessonTime.substring(0, 1))
}
}
if (row.AttemperType == '04') {
callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节');
} else {
callback('');
}
}
});
if (value) {
var strs = "星期" + value.substring(0, 1) + "第" + value.substring(1, value.length) + "节";
callback(strs)
} else {
callback('');
}
//learun.httpAsyncGet('/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) {
// if (res.code == learun.httpCode.success) {
// var t_data = [];
// 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))
// }
// if (t_w.indexOf(res.data[i].LessonTime.substring(0, 1)) < 0) {
// t_w.push(res.data[i].LessonTime.substring(0, 1))
// }
// }
// if (row.AttemperType == '04') {
// callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节');
// } else {
// callback('');
// }
// }
//});
}
},
//调课属性
{
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) {
var t_data = [];
for (var i = 0; i < res.data.length; i++) {
if (t_data.indexOf(res.data[i].NewLessonDate.substring(0, 10)) < 0) {
t_data.push(res.data[i].NewLessonDate.substring(0, 10))
}
}
if (row.AttemperType == '04') {
callback(t_data.join(','));
} else {
callback('');
}
}
});
}
label: "调课日期", name: "NewTime", 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) {
// var t_data = [];
// for (var i = 0; i < res.data.length; i++) {
// if (t_data.indexOf(res.data[i].NewLessonDate.substring(0, 10)) < 0) {
// t_data.push(res.data[i].NewLessonDate.substring(0, 10))
// }
// }
// if (row.AttemperType == '04') {
// callback(t_data.join(','));
// } else {
// callback('');
// }
// }
// });
//}
},
{
label: "调课星期/节次", name: "AcademicYearNo", width: 100, align: "left",
label: "调课星期/节次", name: "newjieci", 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) {
var t_data = [];
var t_w = []
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 (t_w.indexOf(res.data[i].NewLessonTime.substring(0, 1)) < 0) {
t_w.push(res.data[i].NewLessonTime.substring(0, 1))
}
}
if (row.AttemperType == '04') {
callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节');
} else {
callback('');
}
}
});
if (value) {
var strs = "星期" + value.substring(0, 1) + "第" + value.substring(1, value.length) + "节";
callback(strs)
} else {
callback('');
}
//learun.httpAsyncGet('/EducationalAdministration/ArrangeLessonTermAttemper/GetchildData?code=' + row.Id, function (res) {
// if (res.code == learun.httpCode.success) {
// var t_data = [];
// var t_w = []
// 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 (t_w.indexOf(res.data[i].NewLessonTime.substring(0, 1)) < 0) {
// t_w.push(res.data[i].NewLessonTime.substring(0, 1))
// }
// }
// if (row.AttemperType == '04') {
// callback("星期" + weekChina[t_w.join(',') - 1] + '第' + t_data.sort((a, b) => { return a - b; }).join(',') + '节');
// } else {
// callback('');
// }
// }
//});
}
},
//换课属性
@@ -546,6 +567,7 @@ var bootstrap = function ($, learun) {
if (learun.clientdata.get(['userinfo']).account.toLowerCase() != "system") {
param.CreateUserId = learun.clientdata.get(['userinfo']).userId;
}
//param.IsDelete = 1;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};


+ 13
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs Parādīt failu

@@ -33,7 +33,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL();
private Edu_ChangeTeacherLessonIBLL edu_ChangeTeacherLessonIBLL = new Edu_ChangeTeacherLessonBLL();
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
private Pm_LessonscheduleverIBLL pm_LessonscheduleverIBLL=new Pm_LessonscheduleverBLL();
private Pm_LessonscheduleverIBLL pm_LessonscheduleverIBLL = new Pm_LessonscheduleverBLL();
private Pm_PkDataIBLL pm_PkDataIBLL = new Pm_PkDataBLL();
#region 视图功能

@@ -98,7 +98,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
{
return View();
}
/// <summary>
/// 课程表【教务】
/// <summary>
@@ -195,13 +195,13 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
var monday = firstday.LessonDate.Value.AddDays(-Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek) + 1);
var sunday = lastday.LessonDate.Value.AddDays(7 - Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek));
//总周数
var weekCount = Math.Ceiling(Convert.ToDouble((sunday - monday).Days+1) / 7);
var weekCount = Math.Ceiling(Convert.ToDouble((sunday - monday).Days + 1) / 7);
for (var i = 0; i < weekCount; i++)
{
var wentity = new WeekDate();
wentity.week = i + 1;
wentity.startdate = monday.AddDays(i * 7).ToString("yyyy-MM-dd");
wentity.enddate = monday.AddDays(i * 7+6).ToString("yyyy-MM-dd");
wentity.enddate = monday.AddDays(i * 7 + 6).ToString("yyyy-MM-dd");
wentity.textweek = "第" + wentity.week + "周 (" + wentity.startdate + "~" + wentity.enddate + ")";
weekdatelist.Add(wentity);
}
@@ -307,11 +307,11 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly]
public ActionResult PkSyncForm()
{
var bb=pm_LessonscheduleverIBLL.GetData();
if(bb!=null)
var bb = pm_LessonscheduleverIBLL.GetData();
if (bb != null)
{
var bbid = bb.id;
var r=pm_PkDataIBLL.SyncPkData(bbid);
var r = pm_PkDataIBLL.SyncPkData(bbid);
return Success(r);
}
return Fail("同步失败(未找到版本)");
@@ -452,6 +452,8 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
var timeTableList = new List<TimeTable>();
//课程表
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, classroomNo);
var aaa = data.Where(c => c.LessonDate == new DateTime(2024, 03, 11)).ToList();
var bbb = aaa.Select(c => c.LessonTime);
timeTableList.AddRange(data);
//选修课课程表
//20220718因 更改教务课表显示格式为班级作为列头,选修课无班级所以不能显示在课表内
@@ -550,7 +552,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
where ee == g.Key
select new
{
AltId=e.AltId,
AltId = e.AltId,
day = e.LessonTime.ToCharArray()[0],
lessonTime = e.LessonTime,
lessonDate = e.LessonDate.ToString("yyyy-MM-dd"),
@@ -558,7 +560,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
academicyear = semesterAndYear.AcademicYearShort,
semester = strSemester,
deptNo = e?.DeptNo,
deptname="",
deptname = "",
majorNo = e?.MajorNo,
lessonNo = e?.LessonNo,
curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName,
@@ -585,6 +587,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly]
public ActionResult GetDataInEducationSelect_news(string startTime, string endTime, string classNo, string empNo, string schoolId)
{
string roomno = Request.QueryString["ClassRoomNo"];
var userInfo = LoginUserInfo.Get();
//开始时间
var startdate = string.IsNullOrEmpty(startTime) ? DateTime.Today : Convert.ToDateTime(startTime);
@@ -597,7 +600,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers

var timeTableList = new List<TimeTable>();
//课程表
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, "");
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId, roomno);
timeTableList.AddRange(data);
//选修课课程表
//var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId);


+ 7
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect_.cshtml Parādīt failu

@@ -151,7 +151,13 @@
<div id="datesearch" type="lrselect" class="lr-select" style="width: 250px;"></div>
</div>

<div class="lr-layout-tool-item">
<div id="ClassNo" type="lrselect" class="lr-select"></div>
</div>
<div class="lr-layout-tool-item">
<div id="EmpNo" type="lrselect" class="lr-select"></div>
</div>

<div class="lr-layout-tool-item">
<a id="lr_search" class="btn btn-primary">查询</a>
</div>


+ 195
- 104
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect_.js Parādīt failu

@@ -15,17 +15,23 @@ var bootstrap = function ($, learun) {
if ($("#predata").text()) {
//当前班级
var dataval = JSON.parse($("#predata .card-box").attr("data-val"))
param.ClassNo = dataval.map(item => { return item.teachClassNo }).filter(function (itm, i, a) {
param.ClassNo = dataval.map(item => { return item.TeachClassNo }).filter(function (itm, i, a) {
return i == a.indexOf(itm);
}).join(',');

//param.ClassNo = dataval.TeachClassNo;//班级
param.ClassRoomNo = dataval.map(item => { return item.ClassRoomNo }).filter(function (itm, i, a) {
return i == a.indexOf(itm);
}).join(',');//dataval.ClassRoomNo;//教室
param.EmpNo = dataval.map(item => { return item.Empno }).filter(function (itm, i, a) {
return i == a.indexOf(itm);
}).join(',');// dataval.Empno;//老师
//禁用所有box
$(".box").removeClass("box");
} else {
param.EmpNo = learun.clientdata.get(['userinfo']).account;
//param.EmpNo = learun.clientdata.get(['userinfo']).account;
}

$.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducationSelect', param,
$.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducationSelect_news', param,
function (data) {
// 数据处理
var html = '';
@@ -37,7 +43,6 @@ var bootstrap = function ($, learun) {
var datas = flogs(arg, weekLists, 'time');
html += ' <tr><td>' + arg + '节</td>';
if (datas) {
//不为空
var lists = datas.list;
html += tdHandles(lists);
} else {
@@ -52,78 +57,78 @@ var bootstrap = function ($, learun) {

//过滤数组生成合并单元格参数rowspan
//遍历列
for (var b = 1; b < 8; b++) {
//所有列表格
var line_tds = $(".perFestivalsBox table tr").find("td:eq(" + b + ")");
//遍历当前列所有单元格(两行代表一个大课)
for (var a = 0; a < line_tds.length / 2; a++) {
var index1 = 2 * a;
var index2 = (2 * a + 1);
//第一行(当前大课)
var obj = $(line_tds[index1]);
//第二行(当前大课)
var obj1 = $(line_tds[index2]);
//for (var b = 1; b < 8; b++) {
// //所有列表格
// var line_tds = $(".perFestivalsBox table tr").find("td:eq(" + b + ")");
// //遍历当前列所有单元格(两行代表一个大课)
// for (var a = 0; a < line_tds.length / 2; a++) {
// var index1 = 2 * a;
// var index2 = (2 * a + 1);
// //第一行(当前大课)
// var obj = $(line_tds[index1]);
// //第二行(当前大课)
// var obj1 = $(line_tds[index2]);

if (!obj.text() && !obj1.text()) {
//合并空白单元格
obj.attr('rowspan', '2');
//obj1.attr("style", "display:none");
obj1.addClass("remove_td");
}
else {
var listdata = [];
var listdata1 = [];
for (var i = 0; i < obj.find(".box").length; i++) {
listdata.push(JSON.parse($(obj.find(".box")[i]).attr("data-val")))
if (i != 0) {
$(obj.find(".box")[i]).addClass("remove_div");
}
}
for (var i = 0; i < obj1.find(".box").length; i++) {
listdata1.push(JSON.parse($(obj1.find(".box")[i]).attr("data-val")))
}
// if (!obj.text() && !obj1.text()) {
// //合并空白单元格
// obj.attr('rowspan', '2');
// //obj1.attr("style", "display:none");
// obj1.addClass("remove_td");
// }
// else {
// var listdata = [];
// var listdata1 = [];
// for (var i = 0; i < obj.find(".box").length; i++) {
// listdata.push(JSON.parse($(obj.find(".box")[i]).attr("data-val")))
// if (i != 0) {
// $(obj.find(".box")[i]).addClass("remove_div");
// }
// }
// for (var i = 0; i < obj1.find(".box").length; i++) {
// listdata1.push(JSON.parse($(obj1.find(".box")[i]).attr("data-val")))
// }

var div_1 = '', div_2 = '', div_3 = '', div_4 = '', time = '', jieci = '';
var newarr = listdata.concat(listdata1);
// var div_1 = '', div_2 = '', div_3 = '', div_4 = '', time = '', jieci = '';
// var newarr = listdata.concat(listdata1);

for (var i = 0; i < newarr.length; i++) {
if (div_1.indexOf(newarr[i].curriculum) < 0) {
div_1 += newarr[i].curriculum + ";";
}
if (div_2.indexOf(newarr[i].teacher) < 0) {
div_2 += newarr[i].teacher + ";";
}
if (div_3.indexOf(newarr[i].className) < 0) {
div_3 += newarr[i].className + ";";
}
if (div_4.indexOf(newarr[i].classRoom) < 0) {
div_4 += newarr[i].classRoom + ";";
}
}
const mydate = new Date(startTime)
mydate.setDate(mydate.getDate() + (b - 1))
// for (var i = 0; i < newarr.length; i++) {
// if (div_1.indexOf(newarr[i].curriculum) < 0) {
// div_1 += newarr[i].curriculum + ";";
// }
// if (div_2.indexOf(newarr[i].teacher) < 0) {
// div_2 += newarr[i].teacher + ";";
// }
// if (div_3.indexOf(newarr[i].className) < 0) {
// div_3 += newarr[i].className + ";";
// }
// if (div_4.indexOf(newarr[i].classRoom) < 0) {
// div_4 += newarr[i].classRoom + ";";
// }
// }
// const mydate = new Date(startTime)
// mydate.setDate(mydate.getDate() + (b - 1))

time = mydate.toLocaleDateString().replace(/\//g, '-');
jieci = (index1 + 1) + '节;' + (index2 + 1) + '节';
// time = mydate.toLocaleDateString().replace(/\//g, '-');
// jieci = (index1 + 1) + '节;' + (index2 + 1) + '节';

obj.find(".box div:eq(0)").html("课程:" + div_1);
obj.find(".box div:eq(1)").html("教师:" + div_2);
obj.find(".box div:eq(2)").html("班级:" + div_3);
obj.find(".box div:eq(3)").html("教室:" + div_4);
obj.attr('rowspan', '2');
obj.find(".box:eq(0)").attr('data-val', JSON.stringify(newarr));
obj.find(".box:eq(0)").attr('data-curriculum', div_1);
obj.find(".box:eq(0)").attr('data-teacher', div_2);
obj.find(".box:eq(0)").attr('data-className', div_3);
obj.find(".box:eq(0)").attr('data-classRoom', div_4);
obj.find(".box:eq(0)").attr('data-time', time);
obj.find(".box:eq(0)").attr('data-jieci', jieci);
//obj1.attr("style", "display:none");
// obj.find(".box div:eq(0)").html("课程:" + div_1);
// obj.find(".box div:eq(1)").html("教师:" + div_2);
// obj.find(".box div:eq(2)").html("班级:" + div_3);
// obj.find(".box div:eq(3)").html("教室:" + div_4);
// obj.attr('rowspan', '2');
// obj.find(".box:eq(0)").attr('data-val', JSON.stringify(newarr));
// obj.find(".box:eq(0)").attr('data-curriculum', div_1);
// obj.find(".box:eq(0)").attr('data-teacher', div_2);
// obj.find(".box:eq(0)").attr('data-className', div_3);
// obj.find(".box:eq(0)").attr('data-classRoom', div_4);
// obj.find(".box:eq(0)").attr('data-time', time);
// obj.find(".box:eq(0)").attr('data-jieci', jieci);
// //obj1.attr("style", "display:none");

obj1.addClass("remove_td");
}
}
}
// obj1.addClass("remove_td");
// }
// }
//}
//删除所有隐藏的td标签
$(".remove_td").remove()
$(".remove_div").remove()
@@ -145,7 +150,6 @@ var bootstrap = function ($, learun) {
})
return flog;
}

function flogs2(num, data, obj) {
var arr = new Array();
$.each(data,
@@ -166,13 +170,14 @@ var bootstrap = function ($, learun) {
return html;
}


//某节课不空
function tdHandles(lists) {
var html = '';
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 += '<td class="active">';
$.each(datas, function (i, item) {
@@ -180,16 +185,16 @@ var bootstrap = function ($, learun) {
html += '<hr>';
}
html += "<div class='box' data-val='" + JSON.stringify(item) + "'><div>课程:" +
item.curriculum +
item.Curriculum +
"</div>" +
"<div>教师:" +
item.teacher +
item.Teacher +
"</div>" +
"<div>班级:" +
item.className +
item.ClassName +
"</div>" +
"<div>教室:" +
item.classRoom +
item.ClassRoom +
"</div></div>";
});
html += '</td>';
@@ -202,6 +207,39 @@ var bootstrap = function ($, learun) {
}
return html;
}
//function tdHandles(lists) {
// var html = '';
// for (var k = 1; k < 8; k++) {
// (function (arg) {
// var args = arg - 1;
// var datas = flogs2(arg, lists, 'day');
// if (datas.length > 0) {
// html += '<td class="active">';
// $.each(datas, function (i, item) {
// if (i > 0) {
// html += '<hr>';
// }
// html += "<div class='box' data-val='" + JSON.stringify(item) + "'><div>课程:" +
// item.curriculum +
// "</div>" +
// "<div>教师:" +
// item.teacher +
// "</div>" +
// "<div>班级:" +
// item.className +
// "</div>" +
// "<div>教室:" +
// item.classRoom +
// "</div></div>";
// });
// html += '</td>';
// } else {
// html += '<td><div><div></div><div></div><div></div><div></div></div></td>';
// }
// })(k);
// }
// return html;
//}
});
},
bind: function () {
@@ -255,7 +293,8 @@ var bootstrap = function ($, learun) {
//查询
$('#lr_search').on('click', function () {
var p = {};

p.ClassNo = $('#ClassNo').lrselectGet();
p.EmpNo = $('#EmpNo').lrselectGet();
page.search(p);
});
//点击课程表内容
@@ -263,22 +302,39 @@ var bootstrap = function ($, learun) {
var box = $(this);
var dataval = box.attr("data-val");
var curriculum = box.attr("data-curriculum");
var teacher = box.attr("data-teacher");
var className = box.attr("data-className");
var classRoom = box.attr("data-classRoom");
var time = box.attr("data-time");
var jieci = box.attr("data-jieci");
var jsondataval = JSON.parse(dataval);
var curriculum = jsondataval.Curriculum;// box.attr("data-curriculum");
var teacher = "";//jsondataval.Teacher;// box.attr("data-teacher");
var className = "";//jsondataval.ClassName;// box.attr("data-className");
var classRoom = jsondataval.ClassRoom;// box.attr("data-classRoom");
var time = jsondataval.LessonDate;// box.attr("data-time");
var jieci = jsondataval.LessonTime.substring(1, jsondataval.LessonTime.length)+"节";// box.attr("data-jieci");
var startTime = new Date(Date.parse(time));
var conditionTime = new Date();
if (startTime < conditionTime) {
learun.alert.warning("只允许调整次日后的课程!");
return;
//learun.alert.warning("只允许调整次日后的课程!");
//return;
}
$('.perFestivalsBox').find('div.box.active').removeClass('active');
var list=[]
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 (jsondataval.ClassRoomNo == itemdata.ClassRoomNo) {
teacher += itemdata.Teacher+";";
className += itemdata.ClassName + ";";
item.setAttribute('class', 'box active')
list.push(itemdata)
}
}
}
}
box.addClass('active');
var html = '';
html += '<div class="card-box" data-val=\'' + dataval + '\' data-time=\''+time+'\' data-jieci=\''+jieci+'\'>';
html += '<div class="card-box" data-val=\'' + JSON.stringify(list) + '\' data-time=\'' + time + '\' data-jieci=\'' + jieci + '\'>';
html += ' <div class="card-box-content">';
html += ' <p>日期:' + time + '</p>';
html += ' <p>节次:' + jieci + '</p>';
@@ -311,14 +367,14 @@ var bootstrap = function ($, learun) {
const mydate = new Date(startTime);
mydate.setDate(mydate.getDate() + (lie - 2));
var time = mydate.toLocaleDateString().replace(/\//g, '-');;
var jieci = hang + '节;' + (hang + 1) + '节;';
var jieci = hang + '节;';//+ (hang + 1) + '节;';
var source_curriclum = $("#predata").find("p:eq(2)").text();
var source_tearch = $("#predata").find("p:eq(3)").text();
var source_class = $("#predata").find("p:eq(4)").text();
var source_classroom = $("#predata").find("p:eq(5)").text();
if (new Date(time) < new Date()) {
learun.alert.warning("只允许选择次日以后的课程!");
return;
//learun.alert.warning("只允许选择次日以后的课程!");
//return;
}

var html = '';
@@ -349,6 +405,22 @@ var bootstrap = function ($, learun) {
})
},
bindSelect: function () {
//班级
$('#ClassNo').lrselect({
placeholder: "请选择班级",
allowSearch: true,
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData',
value: 'value',
text: 'text'
});
//教师
$('#EmpNo').lrselect({
placeholder: "请选择教师",
allowSearch: true,
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData',
value: 'value',
text: 'text'
});
$("#datesearch").lrselect({
placeholder: "请选择周次",
width: "250px",
@@ -393,24 +465,43 @@ var bootstrap = function ($, learun) {

//需要调度的课程
$.each(data_val, function (i, item) {
//Academicyear: "23-24"
//AttemperId: "500d679e-d028-43a4-a9a1-170fa8b722f6"
//ClassName: "22高职男班(舞蹈表演)"
//ClassRoom: "舞蹈楼102"
//ClassRoomNo: "3102"
//Curriculum: "舞蹈基本功"
//Day: "1"
//DeptNo: "01"
//Deptname: ""
//Empno: "1098"
//LessonDate: "2024-03-04"
//LessonNo: "GZ1302001"
//LessonSortNo: "1"
//LessonTime: "15"
//MajorNo: "GZ13"
//SchooldId: "207fa1a9-160c-4943-a89b-8fa4db0547ce"
//Semester: "2"
//TeachClassNo: "G2201010303"
//Teacher: "陈爱新"
predata_.push({
AltId:item.AltId,
LessonTime: item.lessonTime,
LessonDate: item.lessonDate,
AltId: item.AttemperId,
LessonTime: item.LessonTime,
LessonDate: item.LessonDate,
time: pre_datatime,
jieci: pre_datajieci,
curriculum: item.curriculum,
AcademicYearNo: item.academicyear,
Semester: item.semester,
DeptNo: item.deptNo,
MajorNo: item.majorNo,
LessonNo: item.lessonNo,
TeachClassNo: item.teachClassNo,
EmpNo: item.empno,
curriculum: item.Curriculum,
AcademicYearNo: item.Academicyear,
Semester: item.Semester,
DeptNo: item.DeptNo,
MajorNo: item.MajorNo,
LessonNo: item.LessonNo,
TeachClassNo: item.TeachClassNo,
EmpNo: item.Empno,
EmpName: learun.clientdata.get(['userinfo']).realName,
ClassroomNo: item.classRoomNo,
classRoom:item.classRoom,
ClassName:item.ClassName
ClassroomNo: item.ClassRoomNo,
classRoom: item.ClassRoom,
ClassName: item.ClassName
});
})



+ 10
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs Parādīt failu

@@ -1820,7 +1820,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les
{
if (classNo.Contains(","))
{
result = result.Where(x => classNo.Contains(x.ClassName));
result = result.Where(x => classNo.Contains(x.TeachClassNo));
}
else
{
@@ -1829,7 +1829,15 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les
}
if (!string.IsNullOrEmpty(empNo))
{
result = result.Where(x => x.EmpNo == empNo);
if (empNo.Contains(","))
{
result = result.Where(x => empNo.Contains(x.EmpNo));
}
else
{
result = result.Where(x => x.EmpNo == empNo);
}
//result = result.Where(x => x.EmpNo == empNo);
}
if (!string.IsNullOrEmpty(schoolId))
{


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperBLL.cs Parādīt failu

@@ -142,6 +142,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void SaveEntitys(DateTime keyValue, List<ArrangeLessonTermAttemperEntity> entity)
{
try
{
arrangeLessonTermAttemperService.SaveEntitys(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 扩展数据


+ 10
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperEntity.cs Parādīt failu

@@ -185,6 +185,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("NEWTIME")]
public DateTime? NewTime { get; set; }
/// <summary>
/// 是否显示
/// </summary>
[Column("ISDELETE")]
public int? IsDelete { get; set; }
/// <summary>
/// newjieci
/// </summary>
[Column("NEWJIECI")]
public string newjieci { get; set; }
#endregion

#region 扩展操作


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperIBLL.cs Parādīt failu

@@ -1,6 +1,7 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;
using System;

namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
@@ -49,6 +50,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
void SaveEntity(string keyValue, ArrangeLessonTermAttemperEntity entity);
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
void SaveEntitys(DateTime newtime, List<ArrangeLessonTermAttemperEntity >query);
#endregion

#region 扩展数据


+ 99
- 18
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTermAttemper/ArrangeLessonTermAttemperService.cs Parādīt failu

@@ -91,6 +91,16 @@ 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["IsDelete"].IsEmpty())
{
dp.Add("IsDelete", queryParam["IsDelete"].ToString(), DbType.String);
strSql.Append(" AND (t.IsDelete = @IsDelete) ");
}
else
{
dp.Add("IsDelete", 1, DbType.String);
strSql.Append(" AND (t.IsDelete = @IsDelete) ");
}
if (!queryParam["CreateUserId"].IsEmpty())
{
dp.Add("CreateUserId", queryParam["CreateUserId"].ToString(), DbType.String);
@@ -157,7 +167,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
var result = db.FindEntity<ArrangeLessonTermAttemperEntity>(t => t.ProcessId == processId);
string sql = @"select a.*,b.ClassName,c.EmpName,d.ClassroomName,e.LessonName from ArrangeLessonTermAttemper a
left join ClassInfo b on b.ClassNo = a.TeachClassNo
left join EmpInfo c on c.EmpNo = a.EmpNo
left join classroominfo d on d.classroomno = a.ClassroomNo
left join LessonInfo e on e.LessonNo = a.LessonNo
where a.ProcessId = '"+processId+"'";
var result = db.FindEntity<ArrangeLessonTermAttemperEntity>(c=>c.ProcessId==processId);
if (result != null)
{
result.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>($@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a
@@ -246,16 +262,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

if (entity.AttemperType == "03")
{
this.BaseRepository("CollegeMIS").ExecuteBySql($"update ArrangeLessonTerm set LessonDate='{entity.NewTime}' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'");
string week = ((DateTime)entity.NewTime).DayOfWeek.ToString("d");
//string jieci = (week == "0" ? "7" : week) + jo["tardata"]["targetjieci"].ToString().Replace("节;", "");
//entity.NewLessonTime = ((DateTime)entity.NewTime).DayOfWeek.ToString("d") + entity.LessonTime.Substring(1);
entity.NewLessonTime = (week == "0" ? "7" : week) + entity.LessonTime.Substring(1);
//复制一份数据到指定日期,同时目标日期的所有课程取消
//复制一份数据到指定日期
var result = this.BaseRepository("CollegeMIS").FindEntity<ArrangeLessonTermEntity>(c => c.AcademicYearNo == entity.AcademicYearNo && c.Semester == entity.Semester && c.DeptNo == entity.DeptNo && c.MajorNo == entity.MajorNo && c.LessonNo == entity.LessonNo && c.TeachClassNo.Contains(entity.TeachClassNo) && c.EmpNo == entity.EmpNo && c.ClassroomNo == entity.ClassroomNo && c.LessonDate == entity.LessonDate && c.LessonTime == entity.LessonTime);
var result1 = this.BaseRepository("CollegeMIS").FindEntity<ArrangeLessonTermEntity>($"select * from ArrangeLessonTerm where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'");


//目标日期的所有课程取消
this.BaseRepository("CollegeMIS").ExecuteBySql($"update ArrangeLessonTerm set checkmark='0' where LessonDate='{entity.NewTime}'");

result.LessonDate = entity.NewTime;
result.LessonTime = entity.NewLessonTime;
result.Create();
this.BaseRepository("CollegeMIS").Insert(result);


//this.BaseRepository("CollegeMIS").ExecuteBySql($"update ArrangeLessonTerm set LessonDate='{entity.NewTime}',lessontime='{entity.NewLessonTime}' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'");
}
if (entity.AttemperType == "04")
{
foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query)
{
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);
//}
}
}
}
@@ -272,6 +307,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public void SaveEntitys(DateTime newtime, List<ArrangeLessonTermAttemperEntity> query)
{
try
{
//目标日期的所有课程取消
this.BaseRepository("CollegeMIS").ExecuteBySql($"update ArrangeLessonTerm set checkmark='0' where LessonDate='{newtime}'");
//复制一份数据到指定日期
foreach (ArrangeLessonTermAttemperEntity entity in query)
{
entity.Create();
this.BaseRepository("CollegeMIS").Insert(entity);

if (entity.AttemperType == "03")
{
string week = ((DateTime)entity.NewTime).DayOfWeek.ToString("d")!="0"? ((DateTime)entity.NewTime).DayOfWeek.ToString("d"):"7";
entity.NewLessonTime = week + entity.LessonTime.Substring(1);
//复制一份数据到指定日期,同时目标日期的所有课程取消
var result = this.BaseRepository("CollegeMIS").FindEntity<ArrangeLessonTermEntity>(c => c.AcademicYearNo == entity.AcademicYearNo && c.Semester == entity.Semester && c.DeptNo == entity.DeptNo && c.MajorNo == entity.MajorNo && c.LessonNo == entity.LessonNo && c.TeachClassNo.Contains(entity.TeachClassNo) && c.EmpNo == entity.EmpNo && c.ClassroomNo == entity.ClassroomNo && c.LessonDate == entity.LessonDate && c.LessonTime == entity.LessonTime);

result.LessonDate = entity.NewTime;
result.LessonTime = entity.NewLessonTime;
result.Create();
int insertresult=this.BaseRepository("CollegeMIS").Insert(result);
}
}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 扩展数据
@@ -505,16 +583,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
else if (entity.AttemperType == "04")//调课
{
entity.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>($@"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
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 + "'";
db.ExecuteBySql(updatesql);
}
//entity.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>($@"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
//where 1=1 and a.AttemperId='{entity.Id}' ").ToList();

string updatesql = $"update ArrangeLessonTerm set LessonDate='{entity.NewTime }',LessonTime='{entity.newjieci}' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'";
db.ExecuteBySql(updatesql);
//foreach (var item in entity.query)
//{
// string updatesql = "update ArrangeLessonTerm set LessonDate='" + item.NewLessonDate + "',LessonTime='" + item.NewLessonTime + "' where ALTId='" + item.LessonId + "'";
// db.ExecuteBySql(updatesql);
//}
}
}



Notiek ielāde…
Atcelt
Saglabāt