@@ -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; | |||
} | |||
@@ -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")); | |||
@@ -142,11 +142,13 @@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item AttemperType AttemperTypeTiao" data-table="ArrangeLessonTermAttemper"> | |||
<div class="lr-form-item-title">调度开始时间<font face="宋体">*</font></div> | |||
<div id="AttemperStartTime"></div> | |||
@*<div id="AttemperStartTime"></div>*@ | |||
<input id="AttemperStartTime" type="text" class="form-control" readonly /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item AttemperType AttemperTypeTiao" data-table="ArrangeLessonTermAttemper"> | |||
<div class="lr-form-item-title">调度结束时间<font face="宋体">*</font></div> | |||
<div id="AttemperEndTime"></div> | |||
@*<div id="AttemperEndTime"></div>*@ | |||
<input id="AttemperEndTime" type="text" class="form-control" readonly /> | |||
</div> | |||
</div> | |||
@@ -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 + ' <br>节次:' + oldjieci.join(';') + ' <br>课程:' + course + ' <br>教师:' + teacher + '; <br>班级:' + class_.join(';') + '<br>教室:' + 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 + ' <br>节次:' + oldjieci.join(';') + ' <br>课程:' + course + ' <br>教师:' + teacher + '; <br>班级:' + class_.join(';') + '<br>教室:' + 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(';') } | |||
@@ -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) }); | |||
} | |||
}; | |||
@@ -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(','); | |||
@@ -21,7 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 调度类型:1调课,2停课,3对调 | |||
/// 调度类型:1换课,2停课,3对调,4调课 | |||
/// </summary> | |||
[Column("ATTEMPERTYPE")] | |||
public string AttemperType { get; set; } | |||
@@ -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<ArrangeLessonTermAttemperEntity>(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<ArrangeLessonTermAttemperEntity>(c => c.Id == keyValue); | |||
//result.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>(c => c.AttemperId == keyValue).ToList(); | |||
result.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a | |||
var result = db.FindEntity<ArrangeLessonTermAttemperEntity>(c => c.Id == keyValue); | |||
if (result != null) | |||
{ | |||
result.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").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<ArrangeLessonTermAttemperEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -151,13 +157,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
var result = db.FindEntity<ArrangeLessonTermAttemperEntity>(t => t.ProcessId == processId); | |||
//result.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>(c => c.AttemperId == keyValue).ToList(); | |||
result.query = db.FindList<ArrangeLessonTermAttrmperChildEntity>(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a | |||
if (result != null) | |||
{ | |||
result.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").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<ArrangeLessonTermAttemperEntity>(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<ArrangeLessonTermAttrmperChildEntity>(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<ArrangeLessonTermAttrmperChildEntity>(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<ArrangeLessonTermAttrmperChildEntity>(@"select a.*,b.lessonname,b.EmpName,b.empno,c.classname,d.classroomname from ArrangeLessonTermAttrmperChild a | |||
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").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 + "'"; | |||