diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs index a170c31c2..aec0ebcb9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeLessonTermController.cs @@ -171,7 +171,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var listObj = new List(); 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 /// [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(); //课程表 - 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("保存成功!"); } + + + /// + /// 删除课程 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteLessonTerm(string keyValue) + { + arrangeLessonTermIBLL.DeleteLessonTerm(keyValue); + return Success("删除成功!"); + } + + /// + ///修改课程 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpdateLessonTerm(string keyValue,string postdata) + { + UpdateLessonTermEntity model = postdata.ToObject(); + arrangeLessonTermIBLL.UpdateLessonTerm(keyValue, model); + return Success("操作成功!"); + } + + #endregion /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml index 21330dde4..732a857de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.cshtml @@ -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 @@
  • 星期十
  • -
    +
    -
    -
    + +
    +
    +
    +
    +
    +
    + +
    diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js index a07100e45..a961a61bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeLessonTerm/IndexLessonTerm.js @@ -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 += '
    '; + html += '
    '; } 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 += ''; + html += ''; $.each(datas, function (i, item) { if (i > 0) { html += '
    '; } - html += '
    课程:' + + html += '
    ' + item.curriculum + '
    ' + - '
    教师:' + + '
    ' + item.teacher + '
    ' + - '
    班级:' + - item.className + - '
    ' + - '
    教室:' + + '
    ' + item.classRoom + '
    '; + //html += '
    课程:' + + // item.curriculum + + // '
    ' + + // '
    教师:' + + // item.teacher + + // '
    ' + + // '
    班级:' + + // item.className + + // '
    ' + + // '
    教室:' + + // item.classRoom + + // '
    '; }); html += ''; } else { - html += '
    '; + html += '
    '; } })(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 = ""; - var strFormHtml = strBodyStyle + "" + myHtml + ""; +//打印课程表 +$('#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 = ""; + var strFormHtml = strBodyStyle + "" + myHtml + ""; - 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(); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ArgLessonTermUpdRecordMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ArgLessonTermUpdRecordMap.cs new file mode 100644 index 000000000..4b9c285e2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/ArgLessonTermUpdRecordMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-05-24 10:27 + /// 描 述:排考数据同步 + /// + public class ArgLessonTermUpdRecordMap : EntityTypeConfiguration + { + public ArgLessonTermUpdRecordMap() + { + #region 表、主键 + //表 + this.ToTable("ARGLESSONTERMUPDRECORD"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 1f8190aef..f285e3c01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -69,6 +69,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordBLL.cs new file mode 100644 index 000000000..b9f0387c4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordBLL.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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-02-27 11:05 + /// 描 述:排课 + /// + public class ArgLessonTermUpdRecordBLL : ArgLessonTermUpdRecordIBLL + { + private ArgLessonTermUpdRecordService argLessonTermUpdRecordService = new ArgLessonTermUpdRecordService(); + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordEntity.cs new file mode 100644 index 000000000..47ea8bbd5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordEntity.cs @@ -0,0 +1,120 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-01-20 11:05 + /// 描 述:排课修改记录 + /// + public class ArgLessonTermUpdRecordEntity + { + #region 实体成员 + /// + /// 标识列 + /// + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 排课表Id + /// + /// + [Column("ALTID")] + public string ALTId { get; set; } + /// + /// 原课程 + /// + /// + [Column("LESSONNOOLD")] + public string LessonNoOld { get; set; } + /// + /// 新课程 + /// + /// + [Column("LESSONNONEW")] + public string LessonNoNew { get; set; } + /// + /// 原教师 + /// + /// + [Column("EMPNOOLD")] + public string EmpNoOld { get; set; } + /// + /// 新教师 + /// + /// + [Column("EMPNONEW")] + public string EmpNoNew { get; set; } + /// + /// 原教室 + /// + /// + [Column("CLASSROOMNOOLD")] + public string ClassroomNoOld { get; set; } + /// + /// 新教室 + /// + /// + [Column("CLASSROOMNONEW")] + public string ClassroomNoNew { get; set; } + /// + /// 原星期-节次 + /// + /// + [Column("LESSONTIMEOLD")] + public string LessonTimeOld { get; set; } + /// + /// 新星期-节次 + /// + /// + [Column("LESSONTIMENEW")] + public string LessonTimeNew { get; set; } + /// + /// 修改时间 + /// + /// + [Column("UPDATETIME")] + public DateTime? UpdateTime { get; set; } + /// + /// 操作人 + /// + /// + [Column("UPDATEUSERID")] + public string UpdateUserId { get; set; } + /// + /// 备注 + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.UpdateTime = DateTime.Now; + this.UpdateUserId = LoginUserInfo.Get().userId; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordIBLL.cs new file mode 100644 index 000000000..4c296cb9b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordIBLL.cs @@ -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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-02-27 11:05 + /// 描 述:排课 + /// + public interface ArgLessonTermUpdRecordIBLL + { + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordService.cs new file mode 100644 index 000000000..f44bd4d91 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArgLessonTermUpdRecord/ArgLessonTermUpdRecordService.cs @@ -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 +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-02-27 11:05 + /// 描 述:排课 + /// + public class ArgLessonTermUpdRecordService : RepositoryFactory + { + + + } + + +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs index 809b3b941..a5adc0b93 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs @@ -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); + } + } + } + /// /// 保存实体数据(新增、修改) /// 主键 @@ -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 GetStudents() { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs index 498e1a8f4..ce34fa660 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs @@ -86,6 +86,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// void DeleteEntity(string keyValue); + void DeleteLessonTerm(string keyValue); + void UpdateLessonTerm(string keyValue, UpdateLessonTermEntity model); /// /// 保存实体数据(新增、修改) /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index d1c035b96..2cc1968a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -197,6 +197,172 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 删除课程 + /// + /// + public void DeleteLessonTerm(string keyValue) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + var entity = db.FindEntity(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); + } + } + } + + /// + /// 修改课程 + /// + /// + 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(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(x => + x.LessonDate == lessonDate && x.LessonTime == lessiontime); + if (entity == null) + { + //不存在 新增 + var classInfo = db.FindEntity(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); + } + } + } + /// /// 保存实体数据(新增、修改) /// 主键 @@ -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()).ToList(); var lessonData = (await BaseRepository("CollegeMIS").FindListAsync()).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; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 6fb8d9603..4da072d09 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -107,6 +107,10 @@ + + + +