From b5c3ea4ee4fb81fc6b2d58c0213f70cb776b71e4 Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 16 Jun 2022 10:30:39 +0800 Subject: [PATCH] =?UTF-8?q?=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 | 34 +++++++++++-------- .../Controllers/ClassPlanTeachController.cs | 28 ++++++++------- .../TeachClass/TeachClassService.cs | 34 ++++++++++++------- 3 files changed, 56 insertions(+), 40 deletions(-) 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 428b71244..aca057421 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 @@ -118,6 +118,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } entity.State = 0; entity.IsAllowEdit = true; + entity.LessonSortNo = "1"; + entity.CheckMark = "1"; entity.MakeDate = DateTime.Now; var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.MajorNo, entity.Grade, entity.LessonNo); if (model != null) @@ -144,27 +146,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult CourseArranging(string keyValue) { var entity = classPlanIBLL.GetListById(keyValue); - List TeachList = new List(); + for (int i = 0; i < entity.Count; i++) { - var lessonList = classInfoIBLL.GetAllClass(). + var classList = classInfoIBLL.GetAllClass(). Where(x => x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) - .OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); - if (lessonList.Count > 0) + .OrderBy(x => x.ClassNo).Select(stringClass => new { stringClass.ClassNo, stringClass.ClassName }).ToList(); + if (classList.Count > 0) { - for (int j = 0; j < lessonList.Count; j++) + for (int j = 0; j < classList.Count; j++) { - TeachClassEntity TeachEntity = new TeachClassEntity(); - TeachEntity.TeachClassNo = lessonList[j]; - TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; - 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; + TeachClassEntity TeachEntity = new TeachClassEntity + { + TeachClassNo = classList[j].ClassNo, + AcademicYearNo = entity[i].AcademicYearNo + MajorNo = entity[i].MajorNo, + Grade = entity[i].Grade, + Semester = entity[i].Semester, + LessonNo = entity[i].LessonNo, + StuNum = entity[i].StuNum, + LessonSortNo = entity[i].LessonSortNo, + F_SchoolId = entity[i].F_SchoolId + }; TeachList.Add(TeachEntity); } } 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 75946a8fb..0fa2695f2 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 @@ -22,6 +22,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); #region 视图功能 @@ -142,48 +143,50 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SetTeach(string keyValue, string EmpNo) { var entityList = teachClassIBLL.GetTeachListById(keyValue); + var lessonData = lessonInfoIBLL.GetAllLesson(); + List TeachList = new List(); for (int i = 0; i < entityList.Count; i++) { - var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => - s.MajorNo == entityList[i].MajorNo - && s.F_SchoolId == entityList[i].F_SchoolId - && s.ClassNo == entityList[i].TeachClassNo + 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.NoticeBookNo = stuDataList[j].StuNo; TeachEntity.StuNo = stuDataList[j].StuNo; + TeachEntity.DeptNo = entityList[i].DeptNo; TeachEntity.MajorNo = entityList[i].MajorNo; TeachEntity.ClassNo = stuDataList[j].ClassNo; - TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1"; - TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; - TeachEntity.MajorDetailName = entityList[i].MajorDetailName; TeachEntity.StuName = stuDataList[j].StuName; + TeachEntity.GenderNo = Convert.ToInt32(stuDataList[j].GenderNo).ToString(); 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.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonName; + TeachEntity.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.StuSortNo = "02"; TeachEntity.Grade = entityList[i].Grade; - TeachEntity.StudyScore = 2; - TeachEntity.TotalStudyHour = 2; + TeachEntity.StudyScore = 0; + TeachEntity.TotalStudyHour = 0; TeachEntity.IsInEffect = "1"; TeachEntity.IsPitchOn = "1"; + TeachEntity.EmpNo = EmpNo; TeachEntity.F_SchoolId = entityList[i].F_SchoolId; TeachEntity.CheckMark = "1"; TeachEntity.InsertTime = DateTime.Now; - TeachList.Add(TeachEntity); } } else @@ -211,7 +214,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers && 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) + ","; } 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 7a74b8abf..ea2dfbe83 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 @@ -266,18 +266,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { 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); + TeachClassEntity Teach = new TeachClassEntity + { + TeachClassNo = item.TeachClassNo, + AcademicYearNo = item.AcademicYearNo, + DeptNo = item.DeptNo, + MajorNo = item.MajorNo, + Grade = item.Grade, + EmpNo = item.EmpNo, + Semester = item.Semester, + LessonNo = item.LessonNo, + StuNum = item.StuNum, + LessonSortNo = item.LessonSortNo, + F_SchoolId = item.F_SchoolId + }; + if (db.FindEntity( + x => x.F_SchoolId == Teach.F_SchoolId && x.AcademicYearNo == Teach.AcademicYearNo + && x.Semester == Teach.Semester && x.DeptNo == Teach.DeptNo + && x.MajorNo == Teach.MajorNo && x.TeachClassNo == Teach.TeachClassNo + && x.Grade == Teach.Grade && x.LessonNo == Teach.LessonNo) == null) + { + db.Insert(Teach); + } } db.Commit(); }