Ver código fonte

课程表 列表查询显示

临城职教中职
zhangli 2 anos atrás
pai
commit
dd0a669773
4 arquivos alterados com 128 adições e 98 exclusões
  1. +19
    -11
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs
  2. +9
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml
  3. +98
    -83
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js
  4. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs

+ 19
- 11
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs Ver arquivo

@@ -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
{
@@ -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(),


+ 9
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml Ver arquivo

@@ -163,12 +163,18 @@
<li>星期十</li>
</ul>
<div class="perFestivalsBox">
<table cellspacing="0" border="0"></table>
<table id="lessonTermTable" cellspacing="0" border="0"></table>
</div>
</div>
<div class="rightDiv">
<div id="EmpNo"></div>
<div id="EmpNo1"></div>
<div id="LessonInfo"></div>
<div id="EmpInfo"></div>
<div id="ClassroomInfo"></div>
<div id="WeekTimeSelect"></div>
<div id="WeekSelect"></div>
<div id="NodeSelect"></div>
<button class="btn btn-default" id="delete">删除</button>
<button class="btn btn-default " id="edit">修改</button>
</div>
</div>


+ 98
- 83
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js Ver arquivo

@@ -4,13 +4,14 @@ var bootstrap = function ($, learun) {
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);
// 数据处理
@@ -19,7 +20,6 @@ var bootstrap = function ($, learun) {
//十节课
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 +63,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 +76,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,31 +129,53 @@ 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,
//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
});
}
});
$('#WeekTimes').change(function() {
//切换周次
$('#WeekTimes').change(function () {
curWeek = $('#WeekTimes input[name="WeekTimes"]:checked ').val();
page.search();
});
//单元格选中事件
$("#lessonTermTable").on('click', '.active', function () {
console.log('选中!');
//undefined
//console.log($(this).attr('id'));
//console.log('当前周', curWeek);
//第几节
//console.log('节次', $(this).closest("tr").find("td:eq(0)").text());
//星期几
//console.log('星期', $(this).attr('num'));
$('#WeekTimeSelect').lrselectSet('1');
$('#WeekSelect').lrselectSet('2');
$('#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 = {};
@@ -183,82 +214,66 @@ var bootstrap = function ($, learun) {
}
},
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: "请选择教师",
//课程
$('#LessonInfo').lrDataSourceSelect({
// 展开最大高度
maxHeight: '100px',
placeholder: "请选择课程",
allowSearch: true,
url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetTeacherData',
value: 'value',
text: 'text'
code: 'LessonInfo',
value: 'lessonno',
text: 'lessonname'
});
//教师
$('#EmpNo1').lrselect({
$('#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' }]
});
//节次
$('#NodeSelect').lrselect({
placeholder: "请选择节次",
maxHeight: 300,
allowSearch: true,
url: top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetWeekTime',
value: 'value',
text: 'text'
//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' }]
});
$('#NodeSelect').lrselectSet(5);
},
search: function (param) {
param = param || {};
//当前第几周
param.curWeek = curWeek;
//班级
param.classNo = classNo;
param.classNo = '202010';//classNo;
page.loadData(param);
}
};


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs Ver arquivo

@@ -1545,7 +1545,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
@@ -2008,6 +2008,7 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les

public class TimeTable
{
public string ALTId { get; set; }
public DateTime LessonDate { get; set; }
public string EnName { get; set; }
public string AcademicYear { get; set; }


Carregando…
Cancelar
Salvar