From 550ececac5c18716675cd430964a0161779eebde Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 21 Mar 2023 15:56:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=B1=8D=E5=BC=82=E5=8A=A8=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E5=8A=9F=E8=83=BD=20=E8=AF=BE=E8=A1=A8=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuTransferInfo/StuTransferInfoService.cs | 124 ++++++++++-------- 1 file changed, 71 insertions(+), 53 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs index 138cd362c..d7a217e4e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuTransferInfo/StuTransferInfoService.cs @@ -425,7 +425,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var stulist = this.BaseRepository("CollegeMIS").FindEntity(x => x.StuId == upTrua.StuId); var InsertStuTran = new StuInfoBasicTranEntity(); - + var CreateList = new StuSelectLessonListEntity(); switch (upTrua.AnomalousType) { case "01": //留级 @@ -624,9 +624,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 课表(StuSelectLessonList,旧-写入新班级课表数据;) - - db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); - + //db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); + // wx修改 2023-3-21 课表空数据报错 ,查找同班同学 如果不为空继续执行 + if (CreateInsertStuSelectLessonList(upTrua, stulist) != null) + { + db.Insert(CreateList); + } #endregion } else if (upTrua.AnomalousType == "02" || upTrua.AnomalousType == "05" || upTrua.AnomalousType == "06") @@ -846,7 +849,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration stulist.Grade = upTrua.NewGrade; db.Update(stulist); } - + if (upTrua.RecoverWriteMark == "1") //恢复账号 { #region 用户表 @@ -859,7 +862,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 课表(StuSelectLessonList,旧-写入新班级课表数据;) - db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); + //db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); + // wx修改 2023-3-21 课表空数据报错 ,查找同班同学 如果不为空继续执行 + if (CreateInsertStuSelectLessonList(upTrua, stulist) != null) + { + db.Insert(CreateList); + } #endregion break; @@ -889,8 +897,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 课表(StuSelectLessonList,旧-写入新班级课表数据;) - db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); - + //db.Insert(CreateInsertStuSelectLessonList(upTrua, stulist)); + // wx修改 2023-3-21 课表空数据报错 ,查找同班同学 如果不为空继续执行 + if (CreateInsertStuSelectLessonList(upTrua, stulist) != null) + { + db.Insert(CreateList); + } #endregion break; default: @@ -1122,54 +1134,60 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration //查找一个同班同学作为参考 var referenceStuInfoBasic = this.BaseRepository("CollegeMIS").FindEntity(x => x.CheckMark == "1" && x.DeptNo == upTrua.NewDeptNo && x.MajorNo == upTrua.NewMajorNo && x.ClassNo == upTrua.NewClassNo && x.Grade == upTrua.NewGrade); //参考同学的课表:学年大;学年同且学期大于等于;。 - var referenceStuSelectLessonList = this.BaseRepository("CollegeMIS").FindList(x => x.StuNo == referenceStuInfoBasic.StuNo && x.StuName == referenceStuInfoBasic.StuName); - referenceStuSelectLessonList = referenceStuSelectLessonList.Where(x => x.AcademicYearNo.ToDecimal() > nowYearSemester.AcademicYearShort.ToDecimal() || (x.AcademicYearNo == nowYearSemester.AcademicYearShort && x.Semester.ToDecimal() >= nowYearSemester.Semester.ToDecimal())); - var insertStuSelectLessonList = new List(); - foreach (var referenceEntity in referenceStuSelectLessonList) + if (referenceStuInfoBasic != null) + { + var referenceStuSelectLessonList = this.BaseRepository("CollegeMIS").FindList(x => x.StuNo == referenceStuInfoBasic.StuNo && x.StuName == referenceStuInfoBasic.StuName); + referenceStuSelectLessonList = referenceStuSelectLessonList.Where(x => x.AcademicYearNo.ToDecimal() > nowYearSemester.AcademicYearShort.ToDecimal() || (x.AcademicYearNo == nowYearSemester.AcademicYearShort && x.Semester.ToDecimal() >= nowYearSemester.Semester.ToDecimal())); + var insertStuSelectLessonList = new List(); + foreach (var referenceEntity in referenceStuSelectLessonList) + { + var entity = new StuSelectLessonListEntity(); + entity.NoticeBookNo = stulist.NoticeNo; + entity.StuNo = stulist.StuNo; + entity.DeptNo = referenceEntity.DeptNo; + entity.MajorNo = referenceEntity.MajorNo; + entity.ClassNo = referenceEntity.ClassNo; + entity.MajorDetailNo = referenceEntity.MajorDetailNo; + entity.MajorDetailName = referenceEntity.MajorDetailName; + entity.StuName = stulist.StuName; + entity.GenderNo = stulist.GenderNo == true ? "1" : "0"; + entity.AcademicYearNo = referenceEntity.AcademicYearNo; + entity.Semester = referenceEntity.Semester; + entity.OpenLessonDeptNo = referenceEntity.OpenLessonDeptNo; + entity.OpenLessonMajorNo = referenceEntity.OpenLessonMajorNo; + entity.LessonNo = referenceEntity.LessonNo; + entity.LessonName = referenceEntity.LessonName; + entity.PartCode = referenceEntity.PartCode; + entity.LessonNameEng = referenceEntity.LessonNameEng; + entity.OrdinaryScoreScale = referenceEntity.OrdinaryScoreScale; + entity.TermInScoreScale = referenceEntity.TermInScoreScale; + entity.TermEndScoreScale = referenceEntity.TermEndScoreScale; + entity.OtherScoreScale = referenceEntity.OtherScoreScale; + entity.TeachClassNo = referenceEntity.TeachClassNo; + entity.LessonSortNo = referenceEntity.LessonSortNo; + entity.StuSortNo = referenceEntity.StuSortNo; + entity.Grade = referenceEntity.Grade; + entity.StudyScore = referenceEntity.StudyScore; + entity.TotalStudyHour = referenceEntity.TotalStudyHour; + entity.IsInEffect = referenceEntity.IsInEffect; + entity.Remark = referenceEntity.Remark; + entity.ConflictLessonNo = referenceEntity.ConflictLessonNo; + entity.EmpNo = referenceEntity.EmpNo; + entity.TeachPlanNo = referenceEntity.TeachPlanNo; + entity.IsPitchOn = referenceEntity.IsPitchOn; + entity.CheckMark = referenceEntity.CheckMark; + entity.InsertTime = DateTime.Now; + entity.F_SchoolId = referenceEntity.F_SchoolId; + insertStuSelectLessonList.Add(entity); + } + return insertStuSelectLessonList; + } + else { - var entity = new StuSelectLessonListEntity(); - entity.NoticeBookNo = stulist.NoticeNo; - entity.StuNo = stulist.StuNo; - entity.DeptNo = referenceEntity.DeptNo; - entity.MajorNo = referenceEntity.MajorNo; - entity.ClassNo = referenceEntity.ClassNo; - entity.MajorDetailNo = referenceEntity.MajorDetailNo; - entity.MajorDetailName = referenceEntity.MajorDetailName; - entity.StuName = stulist.StuName; - entity.GenderNo = stulist.GenderNo == true ? "1" : "0"; - entity.AcademicYearNo = referenceEntity.AcademicYearNo; - entity.Semester = referenceEntity.Semester; - entity.OpenLessonDeptNo = referenceEntity.OpenLessonDeptNo; - entity.OpenLessonMajorNo = referenceEntity.OpenLessonMajorNo; - entity.LessonNo = referenceEntity.LessonNo; - entity.LessonName = referenceEntity.LessonName; - entity.PartCode = referenceEntity.PartCode; - entity.LessonNameEng = referenceEntity.LessonNameEng; - entity.OrdinaryScoreScale = referenceEntity.OrdinaryScoreScale; - entity.TermInScoreScale = referenceEntity.TermInScoreScale; - entity.TermEndScoreScale = referenceEntity.TermEndScoreScale; - entity.OtherScoreScale = referenceEntity.OtherScoreScale; - entity.TeachClassNo = referenceEntity.TeachClassNo; - entity.LessonSortNo = referenceEntity.LessonSortNo; - entity.StuSortNo = referenceEntity.StuSortNo; - entity.Grade = referenceEntity.Grade; - entity.StudyScore = referenceEntity.StudyScore; - entity.TotalStudyHour = referenceEntity.TotalStudyHour; - entity.IsInEffect = referenceEntity.IsInEffect; - entity.Remark = referenceEntity.Remark; - entity.ConflictLessonNo = referenceEntity.ConflictLessonNo; - entity.EmpNo = referenceEntity.EmpNo; - entity.TeachPlanNo = referenceEntity.TeachPlanNo; - entity.IsPitchOn = referenceEntity.IsPitchOn; - entity.CheckMark = referenceEntity.CheckMark; - entity.InsertTime = DateTime.Now; - entity.F_SchoolId = referenceEntity.F_SchoolId; - insertStuSelectLessonList.Add(entity); + return null; } - - return insertStuSelectLessonList; } - + #endregion