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 d2ad39b5b..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; @@ -251,7 +251,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers 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"); + endDate = StartTime.AddDays(((curWeek - 1) * 14)).AddDays(10).ToString("yyyy-MM-dd"); var timeTableList = new List(); //课程表 @@ -280,7 +280,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers where ee == g.Key select new { - ALTId=e.ALTId, + ALTId = e.ALTId, day = e.LessonTime.Split('-')[0], curriculum = e.LessonSortNo == "2" ? e.LessonName + "[选修]" : e.LessonName, teacher = e?.EmpName, @@ -335,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 d23e31308..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,18 +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 f76a26d50..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,7 +1,5 @@ var refreshGirdData; var bootstrap = function ($, learun) { - var startTime = '2022-01-17'; - var endTime = '2022-01-23'; var classNo; var curWeek; var weekList; @@ -13,7 +11,7 @@ var bootstrap = function ($, learun) { loadData: function (param) { $.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/ArrangeLessonTerm/GetDataInEducation', param, function (data) { - console.log('res', data); + //console.log('res', data); // 数据处理 var html = ''; var weekLists = data.weekList; @@ -133,6 +131,8 @@ var bootstrap = function ($, learun) { $('#WeekTimes').lrRadioCheckbox({ type: 'radio', data: res.data.weekList, + value: 'value', + text: 'text' //data: [{ text: '分析清晰', value: '1' }, { text: '需要改进', value: '2' }] }); @@ -146,7 +146,9 @@ var bootstrap = function ($, learun) { maxHeight: 300, allowSearch: true, type: 'multiple', - data: res.data.weekList + data: res.data.weekList, + value: 'value', + text: 'text' }); } @@ -158,16 +160,30 @@ var bootstrap = function ($, learun) { }); //单元格选中事件 $("#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'); + 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('节', '')); }); @@ -175,107 +191,160 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); + //删除 + $('#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(); + })}; + }); +}); - //查询 - //$('#lr_search').on('click', function () { - // var p = {}; - // p.schoolId = $('#F_SchoolId').lrselectGet(); - // p.ClassNo = $('#ClassNo').lrselectGet(); - // p.EmpNo = $('#EmpNo').lrselectGet(); - // page.search(p); - //}); +//查询 +//$('#lr_search').on('click', function () { +// var p = {}; +// p.schoolId = $('#F_SchoolId').lrselectGet(); +// p.ClassNo = $('#ClassNo').lrselectGet(); +// p.EmpNo = $('#EmpNo').lrselectGet(); +// page.search(p); +//}); - //打印课程表 - $('#perBtn').on('click', - function () { - AddPrintContent(); - }); - var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量 +//打印课程表 +$('#perBtn').on('click', + function () { + AddPrintContent(); + }); +var LODOP, P_ID = "", TaskID1, TaskID2, t, waiting = false, c = 0, loop = 0; //声明为全局变量 - function AddPrintContent() { - var myHtml = myHtml = $('.personalBox').html(); - var strBodyStyle = ""; - var strFormHtml = strBodyStyle + "" + myHtml + ""; +function AddPrintContent() { + var myHtml = myHtml = $('.personalBox').html(); + var strBodyStyle = ""; + var strFormHtml = strBodyStyle + "" + myHtml + ""; - LODOP = getLodop(); - LODOP.PRINT_INIT("个人授课表"); - LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4"); + LODOP = getLodop(); + LODOP.PRINT_INIT("个人授课表"); + LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4"); - LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); - LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); + LODOP.SET_PRINT_MODE("PRINT_DUPLEX", 2); + LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE", 7); - 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.ADD_PRINT_HTM(10, 10, '284mm', '185mm', strFormHtml); + //打印预览 + LODOP.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); //横向时的正向显示 + var TaskID1 = LODOP.PREVIEW(); + // 直接打印 + // var TaskID1=LODOP.PRINT(); - } +} }, - 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' }] - }); - //节次 - $('#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' }] - }); - $('#NodeSelect').lrselectSet(5); - }, - search: function (param) { - param = param || {}; - //当前第几周 - param.curWeek = curWeek; - //班级 - param.classNo = '202010';//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 95c7347f8..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(); @@ -2006,6 +2174,27 @@ 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; } 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 @@ + + + +