From 19a6eab69a3b0bf7ee952af704ba5064270e3489 Mon Sep 17 00:00:00 2001 From: edy Date: Thu, 9 Dec 2021 15:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=BC=80=E8=AF=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92=20=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE=E8=AE=A1?= =?UTF-8?q?=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 66 +++---- .../Controllers/ClassPlanTeachController.cs | 186 +++++++++++++----- .../Views/ClassPlan/Index.js | 52 ++++- .../Views/ClassPlanTeach/Index.cshtml | 2 +- .../Views/ClassPlanTeach/Index.js | 33 ++-- .../Views/ClassPlanTeach/TeachForm.js | 31 +-- .../Views/ClassPlanTeach/TeachFormQZ.cshtml | 11 ++ .../Views/ClassPlanTeach/TeachFormQZ.js | 32 +++ .../Learun.Application.Web.csproj | 8 +- .../ClassPlan/ClassPlanBLL.cs | 44 +++++ .../ClassPlan/ClassPlanIBLL.cs | 11 +- .../ClassPlan/ClassPlanService.cs | 121 +++++++++--- .../StuSelectLessonListBLL.cs | 19 ++ .../StuSelectLessonListIBLL.cs | 3 + .../StuSelectLessonListService.cs | 57 +++--- .../TeachClass/TeachClassBLL.cs | 64 +++--- .../TeachClass/TeachClassIBLL.cs | 25 ++- .../TeachClass/TeachClassService.cs | 138 +++++-------- 18 files changed, 580 insertions(+), 323 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs index 2476f2cae..cdb33e70f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs @@ -111,15 +111,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { - if (!string.IsNullOrEmpty(keyValue)) - { - classPlanIBLL.DelRelation(keyValue); - } OpenLessonPlanEntity entity = strEntity.ToObject(); if (!string.IsNullOrEmpty(keyValue)) { entity.AmendDate = DateTime.Now; } + entity.State = 0; entity.IsAllowEdit = true; entity.MakeDate = DateTime.Now; var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); @@ -146,49 +143,40 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult CourseArranging(string keyValue) { - var data = classPlanIBLL.GetClassPlanEntity(keyValue); - data.State = 1; + var entity = classPlanIBLL.GetListById(keyValue); List TeachList = new List(); - TeachClassEntity TeachEntity = new TeachClassEntity(); - - List stringList = classInfoIBLL.GetAllClass(). - Where(x => x.DeptNo == data.DeptNo && x.MajorNo == data.MajorNo && x.Grade == data.Grade) - .OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); - if (stringList.Count > 0) + for (int i = 0; i < entity.Count; i++) { - var teachInfo = teachClassIBLL.GetAllClass().Where(s => - s.DeptNo == data.DeptNo && s.MajorNo == data.MajorNo && s.Grade == data.Grade && s.Semester == data.Semester - && s.LessonNo == data.LessonNo && s.AcademicYearNo == data.AcademicYearNo).OrderBy(s => s.ID).ToList(); - - if (teachInfo.Count > 0) + var lessonList = classInfoIBLL.GetAllClass(). + Where(x => x.DeptNo == entity[i].DeptNo && x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) + .OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); + if (lessonList.Count > 0) { - return Fail("排课失败!已存在此课程信息"); + for (int j = 0; j < lessonList.Count; j++) + { + TeachClassEntity TeachEntity = new TeachClassEntity(); + TeachEntity.TeachClassNo = lessonList[j]; + TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; + TeachEntity.DeptNo = entity[i].DeptNo; + TeachEntity.MajorNo = entity[i].MajorNo; + TeachEntity.Grade = entity[i].Grade; + TeachEntity.Semester = entity[i].Semester; + TeachEntity.LessonNo = entity[i].LessonNo; + TeachEntity.StuNum = entity[i].StuNum; + TeachEntity.LessonSortNo = entity[i].LessonSortNo; + TeachEntity.F_SchoolId = entity[i].F_SchoolId; + TeachList.Add(TeachEntity); + } } - for (int i = 0; i < stringList.Count; i++) + else { - TeachEntity.TeachClassNo = stringList[i]; - TeachEntity.AcademicYearNo = data.AcademicYearNo; - TeachEntity.DeptNo = data.DeptNo; - TeachEntity.MajorNo = data.MajorNo; - TeachEntity.Grade = data.Grade; - TeachEntity.Semester = data.Semester; - TeachEntity.LessonNo = data.LessonNo; - TeachEntity.StuNum = data.StuNum; - TeachEntity.EmpNo = data.TeachNo; - TeachEntity.LessonSortNo = data.LessonSortNo; - TeachEntity.F_SchoolId = data.F_SchoolId; - TeachList.Add(TeachEntity); + return Fail("排课失败!暂无排课班级"); } - teachClassIBLL.SaveEntityList(TeachList); - classPlanIBLL.SaveEntity(keyValue, data); - - return Success("排课成功"); - } - else - { - return Fail("排课失败!暂无排课班级"); } + teachClassIBLL.SaveEntityList(TeachList); + classPlanIBLL.SaveEntityList(keyValue, entity); + return Success("排课成功"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs index 89d9c3ae2..0b10baebb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System; using System.Linq; using DocumentFormat.OpenXml.Office.CustomUI; +using List = DocumentFormat.OpenXml.Office2010.ExcelAc.List; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -43,6 +44,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult TeachFormQZ() + { + return View(); + } #endregion #region 获取数据 @@ -128,60 +139,143 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpPost] [AjaxOnly] - public ActionResult SetTeach(string keyValue, string Teach) + public ActionResult SetTeach(string keyValue, string EmpNo) { - var entity = teachClassIBLL.GetTeachClassEntity(keyValue); - entity.EmpNo = Teach; - teachClassIBLL.SaveEntity(keyValue, entity); + var entityList = teachClassIBLL.GetTeachListById(keyValue); + List TeachList = new List(); + for (int i = 0; i < entityList.Count; i++) + { + var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo + && s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId + && s.ClassNo == entityList[i].TeachClassNo + ).ToList(); + if (stuDataList.Count > 0) + { + for (int j = 0; j < stuDataList.Count; j++) + { + StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); + TeachEntity.StuNo = stuDataList[j].StuNo; + TeachEntity.DeptNo = entityList[i].DeptNo; + TeachEntity.MajorNo = entityList[i].MajorNo; + TeachEntity.ClassNo = stuDataList[j].ClassNo; + TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; + TeachEntity.MajorDetailName = entityList[i].MajorDetailName; + TeachEntity.StuName = stuDataList[j].StuName; + TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; + TeachEntity.Semester = entityList[i].Semester; + TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; + TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; + TeachEntity.LessonNo = entityList[i].LessonNo; + TeachEntity.PartCode = entityList[i].PartCode; + TeachEntity.OrdinaryScoreScale = 0; + TeachEntity.TermInScoreScale = 0; + TeachEntity.TermEndScoreScale = 0; + TeachEntity.OtherScoreScale = 0; + TeachEntity.TeachClassNo = entityList[i].TeachClassNo; + TeachEntity.LessonSortNo = entityList[i].LessonSortNo; + TeachEntity.StuSortNo = entityList[i].LessonSortNo; + TeachEntity.Grade = entityList[i].Grade; + TeachEntity.StudyScore = 2; + TeachEntity.TotalStudyHour = 2; + TeachEntity.IsInEffect = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.F_SchoolId = entityList[i].F_SchoolId; + TeachEntity.CheckMark = "1"; + TeachEntity.InsertTime = DateTime.Now; + TeachList.Add(TeachEntity); + } + } + else + { + return Fail("设置失败,未发现相关学生!"); + } + } + StuSelectLesson.SaveEntityList(TeachList); + + teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 - var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => - s.DeptNo == entity.DeptNo && s.MajorNo == entity.MajorNo && s.F_SchoolId == entity.F_SchoolId && entity.TeachClassNo.Contains(s.ClassNo)) - .ToList(); - if (stuDataList.Count < 0) + return Success("设置成功!"); + + } + public ActionResult QzSetTeach(string keyValue, string EmpNo) + { + var entityList = teachClassIBLL.GetTeachListById(keyValue); + string Nid = ""; + if (entityList.Count > 0) { - List TeachList = new List(); - StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); - for (int i = 0; i < stuDataList.Count; i++) + for (int i = 0; i < entityList.Count; i++) { - TeachEntity.NoticeBookNo = stuDataList[i].NoticeNo; - TeachEntity.StuNo = stuDataList[i].StuNo; - TeachEntity.DeptNo = stuDataList[i].DeptNo; - TeachEntity.MajorNo = stuDataList[i].MajorNo; - TeachEntity.ClassNo = stuDataList[i].ClassNo; - TeachEntity.MajorDetailNo = stuDataList[i].MajorDetailNo; - TeachEntity.MajorDetailName = stuDataList[i].MajorDetailName; - TeachEntity.StuName = stuDataList[i].StuName; - TeachEntity.GenderNo = stuDataList[i].GenderNo.ToString(); - TeachEntity.AcademicYearNo = entity.AcademicYearNo; - TeachEntity.Semester = entity.Semester; - TeachEntity.OpenLessonDeptNo = entity.DeptNo; - TeachEntity.OpenLessonMajorNo = entity.MajorNo; - TeachEntity.LessonNo = entity.LessonNo; - TeachEntity.PartCode = entity.PartCode; - TeachEntity.OrdinaryScoreScale = 0; - TeachEntity.TermInScoreScale = 0; - TeachEntity.TermEndScoreScale = 0; - TeachEntity.OtherScoreScale = 0; - TeachEntity.TeachClassNo = entity.TeachClassNo; - TeachEntity.LessonSortNo = entity.LessonSortNo; - TeachEntity.StuSortNo = entity.LessonSortNo; - TeachEntity.Grade = entity.Grade; - TeachEntity.StudyScore = 2; - TeachEntity.TotalStudyHour = 2; - TeachEntity.IsInEffect = "1"; - TeachEntity.IsPitchOn = "1"; - TeachEntity.IsPitchOn = "1"; - TeachEntity.F_SchoolId = entity.F_SchoolId; - TeachEntity.InsertTime = DateTime.Now; - TeachList.Add(TeachEntity); + List ssList = StuSelectLesson.GetAllList().Where( + y => y.DeptNo == entityList[i].DeptNo + && y.MajorNo == entityList[i].MajorNo + && y.F_SchoolId == entityList[i].F_SchoolId + && y.ClassNo == entityList[i].TeachClassNo + && y.LessonNo == entityList[i].LessonNo + && y.CheckMark == "1" + ).Select(x => x.SelectId.ToString()).ToList(); + Nid += string.Join(",", ssList) + ","; } - StuSelectLesson.SaveEntityList(TeachList); - return Success("设置成功!"); } - else + + Nid = Nid.TrimEnd(','); + StuSelectLesson.DeleteEntity(Nid); + + List TeachList = new List(); + for (int i = 0; i < entityList.Count; i++) { - return Fail("设置失败!"); + var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo + && s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId + && s.ClassNo == entityList[i].TeachClassNo + ).ToList(); + if (stuDataList.Count > 0) + { + for (int j = 0; j < stuDataList.Count; j++) + { + StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); + TeachEntity.StuNo = stuDataList[j].StuNo; + TeachEntity.DeptNo = entityList[i].DeptNo; + TeachEntity.MajorNo = entityList[i].MajorNo; + TeachEntity.ClassNo = stuDataList[j].ClassNo; + TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; + TeachEntity.MajorDetailName = entityList[i].MajorDetailName; + TeachEntity.StuName = stuDataList[j].StuName; + TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1"; + TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; + TeachEntity.Semester = entityList[i].Semester; + TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; + TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; + TeachEntity.LessonNo = entityList[i].LessonNo; + TeachEntity.PartCode = entityList[i].PartCode; + TeachEntity.OrdinaryScoreScale = 0; + TeachEntity.TermInScoreScale = 0; + TeachEntity.TermEndScoreScale = 0; + TeachEntity.OtherScoreScale = 0; + TeachEntity.TeachClassNo = entityList[i].TeachClassNo; + TeachEntity.LessonSortNo = entityList[i].LessonSortNo; + TeachEntity.StuSortNo = entityList[i].LessonSortNo; + TeachEntity.Grade = entityList[i].Grade; + TeachEntity.StudyScore = 2; + TeachEntity.TotalStudyHour = 2; + TeachEntity.IsInEffect = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.F_SchoolId = entityList[i].F_SchoolId; + TeachEntity.InsertTime = DateTime.Now; + TeachList.Add(TeachEntity); + } + } + else + { + return Fail("设置失败,未发现相关学生!"); + } } + + StuSelectLesson.SaveEntityList(TeachList); + + teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 + + return Success("设置成功!"); } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js index e6a26ebb9..c22726aea 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js @@ -65,6 +65,10 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } var state = $('#gridtable').jfGridValue('State'); if (state == 0) { learun.layerForm({ @@ -98,9 +102,15 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); - var state = $('#gridtable').jfGridValue('State'); if (learun.checkrow(keyValue)) { - if (state == 0) { + var state = $('#gridtable').jfGridValue('State').split(','); + var allEmpty = true; + for (var i = 0; i < state.length; i++) { + if (state[i] != 0) { + allEmpty = false; + } + } + if (allEmpty) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { @@ -127,13 +137,28 @@ var bootstrap = function ($, learun) { $('#lr_courses').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('确定要进行排课么!', function (res) { - if (res) { - learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', { keyValue: keyValue }, function () { - refreshGirdData(); - }); + var state = $('#gridtable').jfGridValue('State').split(','); + var allEmpty = true; + for (var i = 0; i < state.length; i++) { + if (state[i] != 0) { + allEmpty = false; } - }); + } + if (allEmpty) { + learun.layerConfirm('确定要进行排课么!', + function (res) { + if (res) { + learun.postForm( + top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', + { keyValue: keyValue }, + function () { + refreshGirdData(); + }); + } + }); + } else { + learun.alert.warning("不嫩选择已排课的课程计划"); + } } }); }, @@ -228,6 +253,16 @@ var bootstrap = function ($, learun) { { label: "年级", name: "Grade", width: 50, align: "left" }, { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, { label: "课程名称", name: "LessonName", width: 200, align: "left" }, + { + label: "状态", name: "State", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 0) { + return '未排课'; + } if (cellvalue == 1) { + return '已排课'; + } + } + }, { label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" }, { label: "人数", name: "StuNum", width: 80, align: "left" }, { label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, @@ -253,6 +288,7 @@ var bootstrap = function ($, learun) { ], mainId: 'ID', sidx: 'MakeDate desc', + isMultiselect: true, isPage: true }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml index 876285af0..4a6fdd314 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml @@ -57,7 +57,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js index b4169e320..2755e71ab 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js @@ -7,6 +7,7 @@ var refreshGirdData; var bootstrap = function ($, learun) { "use strict"; + var cddeptname = ''; var page = { init: function () { page.inittree(); @@ -63,9 +64,15 @@ var bootstrap = function ($, learun) { // 设置教师 $('#lr_teach').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); - var empno = $('#gridtable').jfGridValue('EmpNo'); if (learun.checkrow(keyValue)) { - if (empno) { + var empno = $('#gridtable').jfGridValue('EmpNo').split(','); + var allEmpty = true; + for (var i = 0; i < empno.length; i++) { + if (empno[i] != '') { + allEmpty = false; + } + } + if (allEmpty) { learun.layerForm({ id: 'form', title: '设置教师', @@ -77,28 +84,27 @@ var bootstrap = function ($, learun) { } }); } else { - learun.alert.warning("所选班级已设置教师不能重复设置!!!"); + learun.alert.warning("所选班级已设置教师,不可重复设置!!!"); } } - }); // 强制设置教师 $('#lr_qzteach').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); - var loginInfo = learun.clientdata.get(['userinfo']); if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', - title: '设置教师', - url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SelectForm?objectId=' + keyValue + '&companyId=' + loginInfo.F_CompanyId + '&departmentId=' + loginInfo.F_DepartmentId + '&category=1', - width: 800, - height: 520, + title: '强制设置教师', + url: top.$.rootUrl + + '/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' + + keyValue, + width: 400, + height: 300, callBack: function (id) { return top[id].acceptClick(); } }); } - }); }, inittree: function () { @@ -211,11 +217,11 @@ var bootstrap = function ($, learun) { label: "教师", name: "EmpNo", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', key: value, - keyId: 'empno', + keyId: 'f_encode', callback: function (_data) { - callback(_data['empname']); + callback(_data['f_realname']); } }); } @@ -233,6 +239,7 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.DeptNo = cddeptname; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js index 8961f0b68..db907b115 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js @@ -12,36 +12,21 @@ var bootstrap = function ($, learun) { init: function () { $('.lr-form-wrap').lrscroll(); page.bind(); - //page.initData(); }, bind: function () { $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); - //$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'realname' }); } - //initData: function () { - // if (!!keyValue) { - // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) { - // for (var id in data) { - // if (!!data[id].length && data[id].length > 0) { - // $('#' + id).jfGridSet('refreshdata', data[id]); - // } - // else { - // $('[data-table="' + id + '"]').lrSetFormData(data[id]); - // } - // } - // }); - // } - //} }; // 保存数据 acceptClick = function (callBack) { - console.log(keyValue, 111); - //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach?keyValue=' + keyValue, function (res) { - // // 保存成功后才回调 - // if (!!callBack) { - // callBack(); - // } - //}); + if (!$('body').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + var EmpNo = postData.EmpNo; + console.log(EmpNo); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () { + }); }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml new file mode 100644 index 000000000..487c450dd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.cshtml @@ -0,0 +1,11 @@ +@{ + ViewBag.Title = "开课计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
教师*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js new file mode 100644 index 000000000..02ee00152 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js @@ -0,0 +1,32 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-11-29 11:43 + * 描 述:开课计划 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + }, + bind: function () { + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + var EmpNo = postData.EmpNo; + console.log(EmpNo); + learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () { + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 9e0c788e2..f6f41c7d9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -944,6 +944,7 @@ + @@ -7458,6 +7459,7 @@ + @@ -7582,10 +7584,10 @@ False - True - 20472 + True + 20472 / - http://localhost:20873/ + http://localhost:20873/ False False diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs index 2f7754595..44d709d8a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs @@ -177,6 +177,50 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public List GetListById(string keyValue) + { + try + { + return classPlanService.GetListById(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveEntityList(string keyValue, List entity) + { + try + { + classPlanService.SaveEntityList(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs index f8b0f7f18..012eb2fa5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs @@ -58,13 +58,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 年级 /// 课程 /// - OpenLessonPlanEntity GetRepetitions( string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); + OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); /// /// 编辑时删除关联数据 /// /// void DelRelation(string keyValue); + + /// + /// 获取TeachClass表实体数据 + /// 主键 + /// + /// + List GetListById(string keyValue); + + void SaveEntityList(string keyValue, List entity); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs index 71604f5b1..822519c21 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs @@ -125,47 +125,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - var keyvalue = Convert.ToInt32(keyValue); - var OpList = this.BaseRepository("CollegeMIS").FindEntity(t => t.ID == keyvalue); - if (OpList != null) + var keyvalue = keyValue.Split(','); + foreach (var items in keyvalue) { - var TeachList = this.BaseRepository("CollegeMIS").FindList( - x => x.DeptNo == OpList.DeptNo && - x.MajorNo == OpList.MajorNo && - x.Grade == OpList.Grade && - x.Semester == OpList.Semester && - x.LessonNo == OpList.LessonNo && - x.AcademicYearNo == OpList.AcademicYearNo - ).ToList(); - List StrTeach = null; - if (TeachList.Count > 0) + var OpList = this.BaseRepository("CollegeMIS").FindEntity(t => t.ID.ToString() == items); + if (OpList != null) { - StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); - if (StrTeach.Count() > 0) + var TeachList = this.BaseRepository("CollegeMIS").FindList( + x => x.DeptNo == OpList.DeptNo && + x.MajorNo == OpList.MajorNo && + x.Grade == OpList.Grade && + x.Semester == OpList.Semester && + x.LessonNo == OpList.LessonNo && + x.AcademicYearNo == OpList.AcademicYearNo + ).ToList(); + List StrTeach = null; + if (TeachList.Count > 0) { - var LessonList = this.BaseRepository("CollegeMIS").FindList( - y => y.DeptNo == OpList.DeptNo && - y.MajorNo == OpList.MajorNo && - y.Grade == OpList.Grade && - y.Semester == OpList.Semester && - y.LessonNo == OpList.LessonNo && - y.AcademicYearNo == OpList.AcademicYearNo && - StrTeach.Contains(y.ClassNo) - ); - foreach (var item in LessonList) + StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); + if (StrTeach.Count() > 0) { - db.Delete(m => m.SelectId == Convert.ToInt32(item.SelectId)); - } + var LessonList = this.BaseRepository("CollegeMIS").FindList( + y => y.DeptNo == OpList.DeptNo && + y.MajorNo == OpList.MajorNo && + y.Grade == OpList.Grade && + y.Semester == OpList.Semester && + y.LessonNo == OpList.LessonNo && + y.AcademicYearNo == OpList.AcademicYearNo && + StrTeach.Contains(y.ClassNo) + ); + foreach (var item in LessonList) + { + db.Delete(m => m.SelectId == Convert.ToInt32(item.SelectId)); + } - foreach (var item in TeachList) - { - db.Delete(m => m.ID == item.ID); + foreach (var item in TeachList) + { + db.Delete(m => m.ID == item.ID); + } } } } + db.Delete(m => m.ID.ToString() == items); } - //this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyvalue); - db.Delete(m => m.ID == keyvalue); db.Commit(); } catch (Exception ex) @@ -315,6 +317,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取OpenLessonPlan表实体数据 + /// 主键 + /// + /// + public List GetListById(string keyValue) + { + try + { + var id = keyValue.Split(','); + return this.BaseRepository("CollegeMIS") + .FindList(x => id.Contains(x.ID.ToString())).ToList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + public void SaveEntityList(string keyValue, List entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyvalue = keyValue.Split(','); + foreach (var item in keyvalue) + { + var entityList = this.BaseRepository("CollegeMIS").FindEntity(x => x.ID.ToString() == item); + entityList.State = 1; + db.Update(entityList); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs index 34845643b..9fbfaf9a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs @@ -140,6 +140,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetAllList() + { + try + { + return stuSelectLessonListService.GetAllList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs index b645826a9..9d90b7f5d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs @@ -44,6 +44,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, StuSelectLessonListEntity entity); void SaveEntityList(List entity); + + IEnumerable GetAllList(); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs index 8626a5efd..c3dfede79 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs @@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" * "); - strSql.Append(" FROM Dispatch t "); + strSql.Append(" FROM StuSelectLessonList t "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -42,27 +42,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); strSql.Append(" AND t.DisFrom like @keyword "); } - string beginDate = queryParam["StartTime"].ToString(); - string endDate = queryParam["EndTime"].ToString(); - if (!string.IsNullOrEmpty(beginDate) && !string.IsNullOrEmpty(endDate)) - { - #region 获取日期(年 月 日) - string bYaer = beginDate.Substring(0, 4); - string bMonth = beginDate.Substring(5, 2); - string bdate = beginDate.Substring(8, 2); - string eYaer = endDate.Substring(0, 4); - string eMonth = endDate.Substring(5, 2); - #endregion - string edate = endDate.Substring(8, 2); - strSql.Append(@" and (t.DisYear BETWEEN '" + bYaer + "' and '" + eYaer + "') " + - "and (t.DisMonth BETWEEN '" + bMonth + "' and '" + eMonth + "') " + - " and (t.DisDay BETWEEN '" + bdate + "' and '" + edate + "') "); - - } - if (!queryParam["userId"].IsEmpty()) - { - strSql.Append(" AND t.Id Not in(select DisId from DispatchAudit where AuditUser ='" + queryParam["userId"].ToString() + "') "); - } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -112,13 +91,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - var keyvalue = Convert.ToInt32(keyValue); - this.BaseRepository("CollegeMIS").Delete(t => t.SelectId == keyvalue); + //this.BaseRepository("CollegeMIS").Delete(t => t.StuId == keyValue); + + //多个删除 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.Delete(t => t.SelectId.ToString() == item); + } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; @@ -199,7 +187,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration stuLessonList.TermInScoreScale = item.TermInScoreScale; stuLessonList.TermEndScoreScale = item.TermEndScoreScale; stuLessonList.OtherScoreScale = item.OtherScoreScale; - stuLessonList.TeachClassNo = item.TeachClassNo; stuLessonList.LessonSortNo = item.LessonSortNo; stuLessonList.StuSortNo = item.StuSortNo; stuLessonList.Grade = item.Grade; @@ -213,6 +200,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration stuLessonList.IsPitchOn = item.IsPitchOn; stuLessonList.CheckMark = item.CheckMark; stuLessonList.InsertTime = item.InsertTime; + stuLessonList.CheckMark = "1"; db.Insert(stuLessonList); } db.Commit(); @@ -230,6 +218,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public IEnumerable GetAllList() + { + try + { + return this.BaseRepository("CollegeMIS").FindList(m => m.CheckMark == "1"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs index 31e11e250..8e07b0437 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs @@ -93,29 +93,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 提交数据 - public void Lock(string keyValue) - { - try - { - teachClassEntity.Lock(keyValue); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - public void UnLock(string keyValue) + public void DeleteEntity(string keyValue) { try { - teachClassEntity.UnLock(keyValue); + teachClassEntity.DeleteEntity(keyValue); } catch (Exception ex) { @@ -129,16 +111,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// - /// 删除实体数据 + /// 保存实体数据(新增、修改) /// 主键 /// /// - public void DeleteEntity(string keyValue) + public void SaveEntity(string keyValue, TeachClassEntity entity) { try { - teachClassEntity.DeleteEntity(keyValue); + teachClassEntity.SaveEntity(keyValue, entity); } catch (Exception ex) { @@ -153,16 +136,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - /// - /// 保存实体数据(新增、修改) - /// 主键 - /// - /// - public void SaveEntity(string keyValue, TeachClassEntity entity) + public void SaveEntityList(List entity) { try { - teachClassEntity.SaveEntity(keyValue, entity); + teachClassEntity.SaveEntityList(entity); } catch (Exception ex) { @@ -176,12 +154,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + #endregion - public void SaveEntityList(List entity) + #region 扩展数据 + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public List GetTeachListById(string keyValue) { try { - teachClassEntity.SaveEntityList(entity); + return teachClassEntity.GetTeachListById(keyValue); } catch (Exception ex) { @@ -195,11 +180,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - #endregion - - #region 扩展数据 /// - /// + /// 查询条件 /// /// public IEnumerable GetAllClass() @@ -221,12 +203,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - - public void SetTeach(string keyValue) + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNo(string keyValue, string EmpNo) { try { - teachClassEntity.SetTeach(keyValue); + teachClassEntity.UpEmpNo(keyValue, EmpNo); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs index b69b5bca8..27aeb4551 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs @@ -30,8 +30,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 提交数据 - void Lock(string keyValue); - void UnLock(string keyValue); /// /// 删除实体数据 /// 主键 @@ -52,14 +50,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 扩展数据 /// - /// 设置教师 + /// 获取ClassTeach表实体数据 + /// 主键 + /// + /// + List GetTeachListById(string keyValue); + /// + /// 保存数据 /// - /// - void SetTeach(string keyValue); - + /// void SaveEntityList(List entity); - + /// + /// 去重 + /// + /// IEnumerable GetAllClass(); + /// + /// 保存/修改教师 + /// + /// + /// + void UpEmpNo(string keyvalue, string EmpNo); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs index f48bd9059..6798daddd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs @@ -115,7 +115,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + int ID = Convert.ToInt32(keyValue); + return this.BaseRepository("CollegeMIS").FindEntity(ID); } catch (Exception ex) { @@ -132,65 +133,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 提交数据 - public void Lock(string keyValue) - { - var db = this.BaseRepository("CollegeMIS").BeginTrans(); - try - { - //单个启用 - //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'"); - - //多个启用 - var keyValueArr = keyValue.Split(','); - foreach (var item in keyValueArr) - { - db.ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + item + "'"); - } - db.Commit(); - } - catch (Exception ex) - { - db.Rollback(); - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } - - public void UnLock(string keyValue) - { - var db = this.BaseRepository("CollegeMIS").BeginTrans(); - try - { - //单个停用 - //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + keyValue + "'"); - - //多个停用 - var keyValueArr = keyValue.Split(','); - foreach (var item in keyValueArr) - { - db.ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + item + "'"); - } - db.Commit(); - } - catch (Exception ex) - { - db.Rollback(); - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } /// /// 删除实体数据 /// 主键 @@ -201,14 +143,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - //单个删除 - //this.BaseRepository("CollegeMIS").Delete(t => t.ClassId == keyValue); - - //多个删除 + //修改 var keyValueArr = keyValue.Split(','); foreach (var item in keyValueArr) { - db.Delete(t => t.ID == Convert.ToInt32(item)); + var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ID == Convert.ToInt32(item)); + if (entity != null) + { + entity.EmpNo = ""; + db.Update(entity); + } } db.Commit(); } @@ -283,32 +227,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - #endregion - public void SetTeach(string keyValue) + + /// + /// 获取ClassInfo表实体数据 + /// 主键 + /// + /// + public List GetTeachListById(string keyValue) { - var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - //foreach (var item in List) - //{ - // TeachClassEntity Teach = new TeachClassEntity(); - // Teach.TeachClassNo = item.TeachClassNo; - // Teach.AcademicYearNo = item.AcademicYearNo; - // Teach.DeptNo = item.DeptNo; - // Teach.MajorNo = item.MajorNo; - // Teach.Grade = item.Grade; - // Teach.Semester = item.Semester; - // Teach.LessonNo = item.LessonNo; - // Teach.StuNum = item.StuNum; - // Teach.LessonSortNo = item.LessonSortNo; - // Teach.F_SchoolId = item.F_SchoolId; - // db.Insert(Teach); - //} - db.Commit(); + var id = keyValue.Split(','); + return this.BaseRepository("CollegeMIS") + .FindList(x => id.Contains(x.ID.ToString())).ToList(); } catch (Exception ex) { - db.Rollback(); if (ex is ExceptionEx) { throw; @@ -319,7 +253,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - /// /// 保存数据 /// @@ -360,6 +293,39 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 保存或修改教师 + /// + /// + /// + public void UpEmpNo(string keyValue, string EmpNo) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyarray = keyValue.Split(','); + foreach (var item in keyarray) + { + var entityList = this.GetTeachClassEntity(item); + entityList.EmpNo = EmpNo; + db.Update(entityList); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } }