@@ -171,7 +171,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var listObj = new List<Object>(); | |||
for (int i = 1; i <= weekTimes; i++) | |||
{ | |||
listObj.Add(new { text = "第" + i + "周", value = i }); | |||
listObj.Add(new { text = i + "周", value = i }); | |||
} | |||
var jsonData = new | |||
{ | |||
@@ -189,8 +189,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
string returnStr = ""; | |||
var startDate = DateTime.Parse(Common.CalculateFirstDateOfWeek(startTime).ToString("yyyy-MM-dd")); | |||
int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | |||
int countDay = endTime.Subtract(startDate).Days; //endTime.DayOfYear; | |||
//int k = Convert.ToInt32(startTime.DayOfWeek);//得到开始时间的第一天是周几 | |||
int countDay = endTime.Subtract(startDate).Days; | |||
int countWeek = countDay / 14 + 1; | |||
return countWeek; | |||
@@ -234,11 +234,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetDataInEducation(string classNo, string curWeek) | |||
public ActionResult GetDataInEducation(string classNo, int curWeek) | |||
{ | |||
var userInfo = LoginUserInfo.Get(); | |||
//开始时间 | |||
var startdate = string.IsNullOrEmpty(startTime) ? DateTime.Today : Convert.ToDateTime(startTime); | |||
var startdate = DateTime.Today; | |||
var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); | |||
var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); | |||
@@ -246,13 +246,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var strAcademicYear = semesterAndYear.AcademicYearLong; | |||
var strSemester = semesterAndYear.Semester; | |||
//校历 | |||
var entity = schoolCalendarIbll.GetSchoolCalendarEntityByNo(semesterAndYear.AcademicYearShort, semesterAndYear.Semester); | |||
var StartTime = entity.StartTime.Value; | |||
//根据第几周,计算查询的开始和结束日期 | |||
startDate = StartTime.AddDays(((curWeek - 1) * 14)).ToString("yyyy-MM-dd"); | |||
endDate = StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd"); | |||
var timeTableList = new List<TimeTable>(); | |||
//课程表 | |||
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId); | |||
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", ""); | |||
timeTableList.AddRange(data); | |||
//选修课课程表 | |||
var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, empNo, schoolId); | |||
timeTableList.AddRange(dataOfElective); | |||
//var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, classNo, "", ""); | |||
//timeTableList.AddRange(dataOfElective); | |||
var timeTables = timeTableList.ToList(); | |||
var noDataResult = new | |||
@@ -261,19 +268,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return JsonResult(noDataResult); | |||
} | |||
var formatData = from d in timeTables | |||
let tt = d.LessonTime.Substring(1) | |||
var formatData = from d in timeTables.AsEnumerable() | |||
let tt = d.LessonTime.Split('-')[1] | |||
group d by tt into g | |||
orderby g.Key | |||
select new | |||
{ | |||
time = g.Key, | |||
list = from e in timeTables | |||
let ee = e.LessonTime.Substring(1) | |||
list = from e in timeTables.AsEnumerable() | |||
let ee = e.LessonTime.Split('-')[1] | |||
where ee == g.Key | |||
select new | |||
{ | |||
day = e.LessonTime.ToCharArray()[0], | |||
ALTId = e.ALTId, | |||
day = e.LessonTime.Split('-')[0], | |||
curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName, | |||
teacher = e?.EmpName, | |||
classRoom = string.IsNullOrEmpty(e.ClassroomName) ? "" : e.ClassroomName.Trim(), | |||
@@ -327,6 +335,36 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
arrangeLessonTermIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 删除课程 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteLessonTerm(string keyValue) | |||
{ | |||
arrangeLessonTermIBLL.DeleteLessonTerm(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
///修改课程 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult UpdateLessonTerm(string keyValue,string postdata) | |||
{ | |||
UpdateLessonTermEntity model = postdata.ToObject<UpdateLessonTermEntity>(); | |||
arrangeLessonTermIBLL.UpdateLessonTerm(keyValue, model); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
/// <summary> | |||
@@ -102,6 +102,9 @@ | |||
.lr-select { | |||
width: 150px; | |||
} | |||
.radio { | |||
margin-bottom: 0px; | |||
} | |||
.perWeek1 li { | |||
width: 9%; | |||
float: left; | |||
@@ -114,10 +117,20 @@ | |||
} | |||
.rightDiv { | |||
width: 20%; | |||
height: 50%; | |||
float: right; | |||
} | |||
.rightDiv .rdiv { | |||
margin-left: 20%; | |||
margin-top: 10px; | |||
} | |||
.rightDiv .dbtn { | |||
margin-left: 20%; | |||
margin-top: 10px; | |||
} | |||
.rightDiv .ebtn { | |||
margin-top: 10px; | |||
} | |||
.perFestivalsBox td { | |||
padding: 1px; | |||
width: 9%; | |||
@@ -163,12 +176,19 @@ | |||
<li>星期十</li> | |||
</ul> | |||
<div class="perFestivalsBox"> | |||
<table cellspacing="0" border="0"></table> | |||
<table id="lessonTermTable" cellspacing="0" border="0" style="width: 100%"></table> | |||
</div> | |||
</div> | |||
<div class="rightDiv"> | |||
<div id="EmpNo"></div> | |||
<div id="EmpNo1"></div> | |||
<input id="ALTId" hidden="hidden" /> | |||
<div class="rdiv" id="LessonInfo"></div> | |||
<div class="rdiv" id="EmpInfo"></div> | |||
<div class="rdiv" id="ClassroomInfo"></div> | |||
<div class="rdiv" id="WeekTimeSelect"></div> | |||
<div class="rdiv" id="WeekSelect"></div> | |||
<div class="rdiv" id="NodeSelect"></div> | |||
<button class="btn btn-default dbtn" id="delete">删除</button> | |||
<button class="btn btn-default ebtn" id="edit">修改</button> | |||
</div> | |||
</div> | |||
@@ -1,25 +1,23 @@ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
var startTime = '2022-01-17'; | |||
var endTime = '2022-01-23'; | |||
var classNo; | |||
var curWeek; | |||
var weekList; | |||
var page = { | |||
init: function () { | |||
page.bind(); | |||
page.bindSelect(); | |||
}, | |||
loadData: function (param) { | |||
$.lrSetFormWithParam(top.$.rootUrl + '/PersonnelManagement/TimeTable/GetDataInEducation', param, | |||
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetDataInEducation', param, | |||
function (data) { | |||
console.log('res', data); | |||
//console.log('res', data); | |||
// 数据处理 | |||
var html = ''; | |||
var weekLists = data.weekList; | |||
//十节课 | |||
for (var i = 1; i < 11; i++) { | |||
(function (arg) { | |||
//console.log('arg', arg); | |||
var args = arg - 1; | |||
var datas = flogs(arg, weekLists, 'time'); | |||
//console.log('datas', datas); | |||
@@ -63,7 +61,7 @@ var bootstrap = function ($, learun) { | |||
function tdHandle() { | |||
var html = ''; | |||
for (var j = 0; j < 10; j++) { | |||
html += '<td><div></div><div></div><div></div><div></div></td>'; | |||
html += '<td class="active" id="" num="' + j + '"><div></div><div></div><div></div><div></div></td>'; | |||
} | |||
return html; | |||
} | |||
@@ -76,28 +74,37 @@ var bootstrap = function ($, learun) { | |||
var args = arg - 1; | |||
var datas = flogs2(arg, lists, 'day'); | |||
if (datas.length > 0) { | |||
html += '<td class="active">'; | |||
html += '<td class="active" id="' + datas[0].ALTId + '" num="' + k + '">'; | |||
$.each(datas, function (i, item) { | |||
if (i > 0) { | |||
html += '<hr>'; | |||
} | |||
html += '<div>课程:' + | |||
html += '<div>' + | |||
item.curriculum + | |||
'</div>' + | |||
'<div>教师:' + | |||
'<div>' + | |||
item.teacher + | |||
'</div>' + | |||
'<div>班级:' + | |||
item.className + | |||
'</div>' + | |||
'<div>教室:' + | |||
'<div>' + | |||
item.classRoom + | |||
'</div>'; | |||
//html += '<div>课程:' + | |||
// item.curriculum + | |||
// '</div>' + | |||
// '<div>教师:' + | |||
// item.teacher + | |||
// '</div>' + | |||
// '<div>班级:' + | |||
// item.className + | |||
// '</div>' + | |||
// '<div>教室:' + | |||
// item.classRoom + | |||
// '</div>'; | |||
}); | |||
html += '</td>'; | |||
} else { | |||
html += '<td><div></div><div></div><div></div><div></div></td>'; | |||
html += '<td class="active" id="" num="' + k + '"><div></div><div></div><div></div><div></div></td>'; | |||
} | |||
})(k); | |||
@@ -120,147 +127,224 @@ var bootstrap = function ($, learun) { | |||
//获取周次 | |||
learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime', function (res) { | |||
if (res.code == 200) { | |||
weekList = res.data.weekList; | |||
$('#WeekTimes').lrRadioCheckbox({ | |||
type: 'radio', | |||
data: res.data.weekList, | |||
value: 'value', | |||
text: 'text' | |||
//data: [{ text: '分析清晰', value: '1' }, { text: '需要改进', value: '2' }] | |||
select: function(item) { | |||
console.log(item); | |||
} | |||
}); | |||
curWeek = res.data.curWeek; | |||
if (!$('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').is(":checked")) { | |||
$('#WeekTimes').find('input[value="' + res.data.curWeek + '"]').trigger('click'); | |||
} | |||
//周次 | |||
$('#WeekTimeSelect').lrselect({ | |||
placeholder: "请选择周次", | |||
maxHeight: 300, | |||
allowSearch: true, | |||
type: 'multiple', | |||
data: res.data.weekList, | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
} | |||
}); | |||
$('#WeekTimes').change(function() { | |||
//切换周次 | |||
$('#WeekTimes').change(function () { | |||
curWeek = $('#WeekTimes input[name="WeekTimes"]:checked ').val(); | |||
page.search(); | |||
}); | |||
//单元格选中事件 | |||
$("#lessonTermTable").on('click', '.active', function () { | |||
var id = $(this).attr('id'); | |||
$('#ALTId').val(id); | |||
//console.log('id',id); | |||
if (id.length > 0 && id != 'undefined') { | |||
learun.httpAsyncGet( | |||
top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetFormData?keyValue=' + id, | |||
function (res) { | |||
if (res.data) { | |||
$('#LessonInfo').lrselectSet(res.data.LessonNo); | |||
$('#EmpInfo').lrselectSet(res.data.EmpNo); | |||
$('#ClassroomInfo').lrselectSet(res.data.ClassroomNo); | |||
} else { | |||
$('#LessonInfo').lrselectSet(''); | |||
$('#EmpInfo').lrselectSet(''); | |||
$('#ClassroomInfo').lrselectSet(''); | |||
} | |||
}); | |||
} else { | |||
$('#LessonInfo').lrselectSet(''); | |||
$('#EmpInfo').lrselectSet(''); | |||
$('#ClassroomInfo').lrselectSet(''); | |||
} | |||
$('#WeekTimeSelect').lrselectSet(curWeek); | |||
$('#WeekSelect').lrselectSet($(this).attr('num')); | |||
$('#NodeSelect').lrselectSet(($(this).closest("tr").find("td:eq(0)").text()).replace('节', '')); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
//查询 | |||
//$('#lr_search').on('click', function () { | |||
// var p = {}; | |||
// p.schoolId = $('#F_SchoolId').lrselectGet(); | |||
// p.ClassNo = $('#ClassNo').lrselectGet(); | |||
// p.EmpNo = $('#EmpNo').lrselectGet(); | |||
// page.search(p); | |||
//}); | |||
//删除 | |||
$('#delete').on('click', function () { | |||
if ($('#ALTId').val()) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/DeleteLessonTerm', { keyValue: $('#ALTId').val() }, function () { | |||
$('#LessonInfo').lrselectSet(''); | |||
$('#EmpInfo').lrselectSet(''); | |||
$('#ClassroomInfo').lrselectSet(''); | |||
$('#WeekTimeSelect').lrselectSet(''); | |||
$('#WeekSelect').lrselectSet(''); | |||
$('#NodeSelect').lrselectSet(''); | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
//修改 | |||
$('#edit').on('click', function () { | |||
learun.layerConfirm('是否确认修改该项!', function (res) { | |||
if (res) { | |||
var keyValue = $('#ALTId').val(); | |||
var postdata = { | |||
//keyValue: $('#ALTId').val(), | |||
TeachClassNo: classNo, | |||
LessonNo: $('#LessonInfo').lrselectGet(), | |||
LessonName: $('#LessonInfo').lrselectGetText(), | |||
EmpNo: $('#EmpInfo').lrselectGet(), | |||
EmpName: $('#EmpInfo').lrselectGetText(), | |||
ClassroomNo: $('#ClassroomInfo').lrselectGet(), | |||
WeekTimeSelect: $('#WeekTimeSelect').lrselectGet(), | |||
WeekSelect: $('#WeekSelect').lrselectGet(), | |||
NodeSelect: $('#NodeSelect').lrselectGet() | |||
}; | |||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/UpdateLessonTerm?keyValue=' + keyValue, { postdata: JSON.stringify(postdata) }, function () { | |||
$('#LessonInfo').lrselectSet(''); | |||
$('#EmpInfo').lrselectSet(''); | |||
$('#ClassroomInfo').lrselectSet(''); | |||
$('#WeekTimeSelect').lrselectSet(''); | |||
$('#WeekSelect').lrselectSet(''); | |||
$('#NodeSelect').lrselectSet(''); | |||
refreshGirdData(); | |||
})}; | |||
}); | |||
}); | |||
//打印课程表 | |||
$('#perBtn').on('click', | |||
function () { | |||
AddPrintContent(); | |||
}); | |||
var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量 | |||
//查询 | |||
//$('#lr_search').on('click', function () { | |||
// var p = {}; | |||
// p.schoolId = $('#F_SchoolId').lrselectGet(); | |||
// p.ClassNo = $('#ClassNo').lrselectGet(); | |||
// p.EmpNo = $('#EmpNo').lrselectGet(); | |||
// page.search(p); | |||
//}); | |||
function AddPrintContent() { | |||
var myHtml = myHtml = $('.personalBox').html(); | |||
var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>"; | |||
var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>"; | |||
//打印课程表 | |||
$('#perBtn').on('click', | |||
function () { | |||
AddPrintContent(); | |||
}); | |||
var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量 | |||
LODOP = getLodop(); | |||
LODOP.PRINT_INIT("个人授课表"); | |||
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4"); | |||
function AddPrintContent() { | |||
var myHtml = myHtml = $('.personalBox').html(); | |||
var strBodyStyle = "<style>" + document.getElementById("style1").innerHTML + "</style>"; | |||
var strFormHtml = strBodyStyle + "<body>" + myHtml + "</body>"; | |||
LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); | |||
LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); | |||
LODOP = getLodop(); | |||
LODOP.PRINT_INIT("个人授课表"); | |||
LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4"); | |||
LODOP.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml); | |||
//打印预览 | |||
LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示 | |||
var TaskID1 = LODOP.PREVIEW(); | |||
// 直接打印 | |||
// var TaskID1=LODOP.PRINT(); | |||
LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); | |||
LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); | |||
} | |||
}, | |||
bindSelect: function () { | |||
////校区 | |||
//$('#F_SchoolId').lrDataSourceSelect({ | |||
// code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { | |||
// if (!!item) { | |||
// // 班级 | |||
// $('#ClassNo').lrselectRefresh({ | |||
// placeholder: "请选择班级", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', | |||
// param: { schoolId: item.f_companyid }, | |||
// value: 'value', | |||
// text: 'text' | |||
// }); | |||
// // 教师 | |||
// $('#EmpNo').lrselectRefresh({ | |||
// placeholder: "请选择教师", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', | |||
// param: { schoolId: item.f_companyid }, | |||
// value: 'value', | |||
// text: 'text' | |||
// }); | |||
// } else { | |||
// //班级 | |||
// $('#ClassNo').lrselectRefresh({ | |||
// placeholder: "请选择班级", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', | |||
// param: { schoolId: "" }, | |||
// value: 'value', | |||
// text: 'text' | |||
// }); | |||
// //教师 | |||
// $('#EmpNo').lrselectRefresh({ | |||
// placeholder: "请选择教师", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', | |||
// param: { schoolId: "" }, | |||
// value: 'value', | |||
// text: 'text' | |||
// }); | |||
// } | |||
// } | |||
//}); | |||
////班级 | |||
//$('#ClassNo').lrselect({ | |||
// placeholder: "请选择班级", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetClassData', | |||
// value: 'value', | |||
// text: 'text' | |||
//}); | |||
//教师 | |||
$('#EmpNo').lrselect({ | |||
placeholder: "请选择教师", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//教师 | |||
$('#EmpNo1').lrselect({ | |||
placeholder: "请选择教师", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
LODOP.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml); | |||
//打印预览 | |||
LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示 | |||
var TaskID1 = LODOP.PREVIEW(); | |||
// 直接打印 | |||
// var TaskID1=LODOP.PRINT(); | |||
} | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
//当前第几周 | |||
param.curWeek = curWeek; | |||
//班级 | |||
param.classNo = classNo; | |||
page.loadData(param); | |||
} | |||
bindSelect: function () { | |||
//课程 | |||
$('#LessonInfo').lrDataSourceSelect({ | |||
// 展开最大高度 | |||
maxHeight: '100px', | |||
placeholder: "请选择课程", | |||
allowSearch: true, | |||
code: 'LessonInfo', | |||
value: 'lessonno', | |||
text: 'lessonname' | |||
}); | |||
//教师 | |||
$('#EmpInfo').lrDataSourceSelect({ | |||
placeholder: "请选择教师", | |||
maxHeight: 300, | |||
allowSearch: true, | |||
code: 'EmpInfo', | |||
value: 'empno', | |||
text: 'empname' | |||
}); | |||
//教室 | |||
$('#ClassroomInfo').lrDataSourceSelect({ | |||
placeholder: "请选择教室", | |||
maxHeight: 300, | |||
allowSearch: true, | |||
code: 'ClassroomInfo', | |||
value: 'classroomno', | |||
text: 'classroomname' | |||
}); | |||
////周次 | |||
//$('#WeekTimeSelect').lrselect({ | |||
// placeholder: "请选择周次", | |||
// maxHeight: 300, | |||
// allowSearch: true, | |||
// type:'multiple', | |||
// data: weekList | |||
//}); | |||
//星期 | |||
$('#WeekSelect').lrselect({ | |||
placeholder: "请选择星期", | |||
maxHeight: 300, | |||
allowSearch: true, | |||
//type: 'multiple', | |||
data: [{ text: '星期一', value: '1' }, { text: '星期二', value: '2' }, { text: '星期三', value: '3' }, { text: '星期四', value: '4' }, { text: '星期五', value: '5' }, { text: '星期六', value: '6' }, { text: '星期日', value: '7' }, { text: '星期八', value: '8' }, { text: '星期九', value: '9' }, { text: '星期十', value: '10' }], | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//节次 | |||
$('#NodeSelect').lrselect({ | |||
placeholder: "请选择节次", | |||
maxHeight: 300, | |||
allowSearch: true, | |||
//type: 'multiple', | |||
data: [{ text: '1节', value: '1' }, { text: '2节', value: '2' }, { text: '3节', value: '3' }, { text: '4节', value: '4' }, { text: '5节', value: '5' }, { text: '6节', value: '6' }, { text: '7节', value: '7' }, { text: '8节', value: '8' }, { text: '9节', value: '9' }, { text: '10节', value: '10' }], | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
//当前第几周 | |||
param.curWeek = curWeek; | |||
//班级 | |||
param.classNo = '202010';//classNo; | |||
page.loadData(param); | |||
} | |||
}; | |||
page.init(); | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
}; |
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2019-05-24 10:27 | |||
/// 描 述:排考数据同步 | |||
/// </summary> | |||
public class ArgLessonTermUpdRecordMap : EntityTypeConfiguration<ArgLessonTermUpdRecordEntity> | |||
{ | |||
public ArgLessonTermUpdRecordMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("ARGLESSONTERMUPDRECORD"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -69,6 +69,7 @@ | |||
<Compile Include="AssetManagementSystem\Ass_ScrapItemMap.cs" /> | |||
<Compile Include="AssetManagementSystem\Ass_ScrapMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeExamTermItemNewMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecordMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeExamTermNewMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonSyncMap.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemperMap.cs" /> | |||
@@ -0,0 +1,23 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using Learun.Application.Organization; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2019-02-27 11:05 | |||
/// 描 述:排课 | |||
/// </summary> | |||
public class ArgLessonTermUpdRecordBLL : ArgLessonTermUpdRecordIBLL | |||
{ | |||
private ArgLessonTermUpdRecordService argLessonTermUpdRecordService = new ArgLessonTermUpdRecordService(); | |||
} | |||
} |
@@ -0,0 +1,120 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-01-20 11:05 | |||
/// 描 述:排课修改记录 | |||
/// </summary> | |||
public class ArgLessonTermUpdRecordEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 标识列 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 排课表Id | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ALTID")] | |||
public string ALTId { get; set; } | |||
/// <summary> | |||
/// 原课程 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNOOLD")] | |||
public string LessonNoOld { get; set; } | |||
/// <summary> | |||
/// 新课程 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNONEW")] | |||
public string LessonNoNew { get; set; } | |||
/// <summary> | |||
/// 原教师 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EMPNOOLD")] | |||
public string EmpNoOld { get; set; } | |||
/// <summary> | |||
/// 新教师 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EMPNONEW")] | |||
public string EmpNoNew { get; set; } | |||
/// <summary> | |||
/// 原教室 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNOOLD")] | |||
public string ClassroomNoOld { get; set; } | |||
/// <summary> | |||
/// 新教室 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNONEW")] | |||
public string ClassroomNoNew { get; set; } | |||
/// <summary> | |||
/// 原星期-节次 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONTIMEOLD")] | |||
public string LessonTimeOld { get; set; } | |||
/// <summary> | |||
/// 新星期-节次 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONTIMENEW")] | |||
public string LessonTimeNew { get; set; } | |||
/// <summary> | |||
/// 修改时间 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("UPDATETIME")] | |||
public DateTime? UpdateTime { get; set; } | |||
/// <summary> | |||
/// 操作人 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("UPDATEUSERID")] | |||
public string UpdateUserId { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.UpdateTime = DateTime.Now; | |||
this.UpdateUserId = LoginUserInfo.Get().userId; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,20 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
using Learun.Application.Organization; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2019-02-27 11:05 | |||
/// 描 述:排课 | |||
/// </summary> | |||
public interface ArgLessonTermUpdRecordIBLL | |||
{ | |||
} | |||
} |
@@ -0,0 +1,36 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Diagnostics; | |||
using System.Linq; | |||
using System.Net.Http; | |||
using System.Runtime.InteropServices; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Learun.Application.Base.SystemModule; | |||
using Learun.Application.Organization; | |||
using Newtonsoft.Json; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.ArrangeExamTermService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2019-02-27 11:05 | |||
/// 描 述:排课 | |||
/// </summary> | |||
public class ArgLessonTermUpdRecordService : RepositoryFactory | |||
{ | |||
} | |||
} | |||
@@ -213,6 +213,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public void DeleteLessonTerm(string keyValue) | |||
{ | |||
try | |||
{ | |||
arrangeLessonTermService.DeleteLessonTerm(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
@@ -237,6 +256,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model) | |||
{ | |||
try | |||
{ | |||
arrangeLessonTermService.UpdateLessonTerm(keyValue, model); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<StuInfoBasicEntity> GetStudents() | |||
{ | |||
try | |||
@@ -86,6 +86,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
void DeleteEntity(string keyValue); | |||
void DeleteLessonTerm(string keyValue); | |||
void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
@@ -197,6 +197,172 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 删除课程 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void DeleteLessonTerm(string keyValue) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
db.BeginTrans(); | |||
var entity = db.FindEntity<ArrangeLessonTermEntity>(keyValue); | |||
//更改课程表标记 | |||
entity.CheckMark = "0"; | |||
entity.Modify(keyValue); | |||
db.Update(entity); | |||
//新增修改记录表 | |||
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity(); | |||
record.Create(); | |||
record.ALTId = entity.ALTId; | |||
record.LessonNoOld = entity.LessonNo; | |||
record.LessonNoNew = ""; | |||
record.EmpNoOld = entity.EmpNo; | |||
record.EmpNoNew = ""; | |||
record.ClassroomNoOld = entity.ClassroomNo; | |||
record.ClassroomNoNew = ""; | |||
record.Remark = "删除"; | |||
db.Insert(record); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 修改课程 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
db.BeginTrans(); | |||
//开始时间 | |||
var startdate = DateTime.Today; | |||
var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); | |||
var semesterAndYear = Common.GetSemesterAndYear(startDate); | |||
//学校日历 | |||
var schoolCalendar = this.BaseRepository().FindEntity<SchoolCalendarEntity>(x => | |||
x.AcademicYearNo == semesterAndYear.AcademicYearShort && x.Semester == semesterAndYear.Semester); | |||
//周次 | |||
var weekTimeAry = model.WeekTimeSelect.Split(','); | |||
foreach (var weekTime in weekTimeAry) | |||
{ | |||
var weektime = Convert.ToInt32(weekTime); | |||
//开课时间 | |||
DateTime lessonDate = DateTime.Now; | |||
if (weektime == 1) | |||
{ | |||
//第一周 | |||
lessonDate = Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value) | |||
.AddDays(model.WeekSelect - 1); | |||
} | |||
else | |||
{ | |||
var start= Common.CalculateFirstDateOfWeek(schoolCalendar.StartTime.Value).AddDays((Convert.ToInt32(weekTime) - 1) * 14); | |||
lessonDate = start.AddDays(model.WeekSelect - 1); | |||
} | |||
var lessiontime = model.WeekSelect + "-" + model.NodeSelect; | |||
var entity = | |||
db.FindEntity<ArrangeLessonTermEntity>(x => | |||
x.LessonDate == lessonDate && x.LessonTime == lessiontime); | |||
if (entity == null) | |||
{ | |||
//不存在 新增 | |||
var classInfo = db.FindEntity<ClassInfoEntity>(x => x.ClassNo == model.TeachClassNo); | |||
entity = new ArrangeLessonTermEntity(); | |||
entity.Create(); | |||
entity.LessonDate = lessonDate; | |||
entity.AcademicYearNo = semesterAndYear.AcademicYearShort; | |||
entity.Semester = semesterAndYear.Semester; | |||
entity.LessonDate = lessonDate; | |||
entity.DeptNo = classInfo?.DeptNo; | |||
entity.MajorNo = classInfo?.MajorNo; | |||
entity.LessonNo = model.LessonNo; | |||
entity.LessonName = model.LessonName; | |||
entity.EmpNo = model.EmpNo; | |||
entity.EmpName = model.EmpName; | |||
entity.TeachClassNo = model.TeachClassNo; | |||
entity.ClassroomNo = model.ClassroomNo; | |||
entity.LessonTime = lessiontime; | |||
entity.CheckMark = "1"; | |||
entity.F_SchoolId = LoginUserInfo.Get().companyId; | |||
db.Insert(entity); | |||
//新增修改记录表 | |||
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity(); | |||
record.Create(); | |||
record.ALTId = entity.ALTId; | |||
record.LessonNoOld = ""; | |||
record.LessonNoNew = model.LessonNo; | |||
record.EmpNoOld = ""; | |||
record.EmpNoNew = model.EmpNo; | |||
record.ClassroomNoOld = ""; | |||
record.ClassroomNoNew = model.ClassroomNo; | |||
record.Remark = "新增"; | |||
db.Insert(record); | |||
} | |||
else | |||
{ | |||
//新增修改记录表 | |||
ArgLessonTermUpdRecordEntity record = new ArgLessonTermUpdRecordEntity(); | |||
record.Create(); | |||
record.ALTId = entity.ALTId; | |||
record.LessonNoOld = entity.LessonNo; | |||
record.LessonNoNew = model.LessonNo; | |||
record.EmpNoOld = entity.EmpNo; | |||
record.EmpNoNew = model.EmpNo; | |||
record.ClassroomNoOld = entity.ClassroomNo; | |||
record.ClassroomNoNew = model.ClassroomNo; | |||
record.Remark = "修改"; | |||
db.Insert(record); | |||
//存在 修改 | |||
entity.TeachClassNo = model.TeachClassNo; | |||
entity.LessonNo = model.LessonNo; | |||
entity.LessonName = model.LessonName; | |||
entity.EmpNo = model.EmpNo; | |||
entity.EmpName = model.EmpName; | |||
entity.ClassroomNo = model.ClassroomNo; | |||
db.Update(entity); | |||
} | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
@@ -230,6 +396,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
internal bool GetAny() | |||
{ | |||
try | |||
@@ -705,14 +873,14 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest | |||
MajorNo = classinfo?.MajorNo, | |||
LessonNo = item.curriculunNumber, | |||
LessonName = item.curriculunName, | |||
TeachClassNo =classinfo?.ClassNo, | |||
TeachClassNo = classinfo?.ClassNo, | |||
EmpNo = item.teacherNumber, | |||
EmpName = item.teachername, | |||
LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == item.curriculunNumber)?.LessonSortNo, | |||
ClassroomNo = classroomData.FirstOrDefault(m => m.ClassroomNo == item.ClassroomNo)?.ClassroomNo, | |||
LessonTime = item.week+"-"+item.section, | |||
LessonTime = item.week + "-" + item.section, | |||
CheckMark = "1", | |||
F_SchoolId =entity.F_SchoolId | |||
F_SchoolId = entity.F_SchoolId | |||
}; | |||
if (oldArrangeLessonTermList.Count(m => m.AcademicYearNo == insertData.AcademicYearNo && m.Semester == insertData.Semester | |||
&& m.LessonNo == insertData.LessonNo && m.LessonDate == insertData.LessonDate | |||
@@ -845,7 +1013,7 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest | |||
LEFT JOIN tb_major m ON m.id=p.major | |||
LEFT JOIN tb_course cour ON cour.id= p.`course` | |||
LEFT JOIN tb_curriculum curr ON curr.id=cour.`course` | |||
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester | |||
WHERE s.year = '" + entity.AcademicYearNo + "' AND s.number = '" + entity.Semester | |||
+ "' AND sc.sid = '" + entity.F_SchoolId + "' ORDER BY p.`major` "); | |||
var majorData = (await BaseRepository("CollegeMIS").FindListAsync<CdMajorEntity>()).ToList(); | |||
var lessonData = (await BaseRepository("CollegeMIS").FindListAsync<LessonInfoEntity>()).ToList(); | |||
@@ -1545,7 +1713,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||
var semesterAndYear = Common.GetSemesterAndYear(startDate); | |||
var strAcademicYear = semesterAndYear.AcademicYearShort; | |||
var strSemester = semesterAndYear.Semester; | |||
string sql = @"select b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName | |||
string sql = @"select b.ALTId,b.F_SchoolId,b.DeptNo,b.MajorNo,b.AcademicYearNo as AcademicYear,b.LessonNo,b.LessonName,b.LessonTime,b.LessonDate,b.EmpNo,b.Empname EmpName,replace (b.TeachClassNo,b.LessonName,'') TeachClassNo, c.ClassroomName,b.Semester,b.ClassroomNo as ClassRoomNo,b.LessonSortNo,d.ClassName | |||
from ArrangeLessonTerm b | |||
left join ClassroomInfo c on c.ClassroomNo=b.classroomNo | |||
left join ClassInfo d on replace(b.TeachClassNo,b.LessonName,'')=d.ClassNo | |||
@@ -2006,8 +2174,30 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||
#region MyRegion | |||
#region 编辑课程表 | |||
public class UpdateLessonTermEntity | |||
{ | |||
public string TeachClassNo { get; set; } | |||
public string LessonNo { get; set; } | |||
public string LessonName { get; set; } | |||
public string EmpNo { get; set; } | |||
public string EmpName { get; set; } | |||
public string ClassroomNo { get; set; } | |||
//周次 | |||
public string WeekTimeSelect { get; set; } | |||
//星期 | |||
public int WeekSelect { get; set; } | |||
//节次 | |||
public int NodeSelect { get; set; } | |||
} | |||
#endregion | |||
public class TimeTable | |||
{ | |||
public string ALTId { get; set; } | |||
public DateTime LessonDate { get; set; } | |||
public string EnName { get; set; } | |||
public string AcademicYear { get; set; } | |||
@@ -107,6 +107,10 @@ | |||
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncEntity.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncService.cs" /> | |||
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordEntity.cs" /> | |||
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ArgLessonTermUpdRecord\ArgLessonTermUpdRecordService.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperBLL.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperEntity.cs" /> | |||
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemper\ArrangeLessonTermAttemperIBLL.cs" /> | |||