123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.MinorManage.MinorPlanManage;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.Entities;
- using System.Linq.Expressions;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.MinorManage.MinorPlanManage;
- using EMIS.DataLogic.Common.CalendarManage;
- namespace EMIS.CommonLogic.MinorManage.MinorPlanManage
- {
- public class MinorPlanApplyServices : BaseWorkflowServices<CF_GrademinorApplication>, IMinorPlanApplyServices
- {
- public MinorPlanApplyDAL MinorPlanApplyDAL{get;set;}
- public SchoolYearDAL schoolYearDAL { get; set; }
-
- public IGridResultSet<MinorPlanApplyView> GetMinorPlanApplyViewGrid(ConfiguretView configuretView, int? yearID, int? standardID, Guid? collegeID, int? approvalStatus, int pageIndex, int pageSize)
- {
- var statusList = this.GetStatusViewList();
- Expression<Func<CF_GrademinorApplication, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (yearID.HasValue)
- exp = exp.And(x => x.YearID == yearID);
- if (standardID.HasValue)
- exp = exp.And(x => x.StandardID == standardID);
- if (collegeID.HasValue)
- exp = exp.And(x => x.CollegeID == collegeID);
- if (approvalStatus.HasValue)
- exp = exp.And(x => x.RecordStatus == approvalStatus);
- var query = MinorPlanApplyDAL.GetMinorPlanApplyViewQueryable(exp);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x=>x.SchoolyearCode).ThenBy(x => x.YearID).ThenBy(x=>x.StandardID).ThenBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo)
- .ThenByDescending(x => x.CreateTime).ToGridResultSet<MinorPlanApplyView>(pageIndex, pageSize);
- result.rows.ForEach(x => x.ApprovalStatusName = statusList.FirstOrDefault(w => w.ID == x.ApprovalStatus).Name);
- return result;
- }
- public List<MinorPlanApplyView> GetMinorPlanApplyViewList(ConfiguretView configuretView, int? yearID, int? standardID, Guid? collegeID, int? approvalStatus, List<Guid?> GradeMinorApplicationIDList)
- {
- Expression<Func<CF_GrademinorApplication, bool>> exp = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (GradeMinorApplicationIDList != null)
- exp = exp.And(x => GradeMinorApplicationIDList.Contains(x.GradeMinorApplicationID));
- if (yearID.HasValue)
- exp = exp.And(x => x.YearID == yearID);
- if (standardID.HasValue)
- exp = exp.And(x => x.StandardID == standardID);
- if (collegeID.HasValue)
- exp = exp.And(x => x.CollegeID == collegeID);
- if (approvalStatus.HasValue)
- exp = exp.And(x => x.RecordStatus == approvalStatus);
- var query = MinorPlanApplyDAL.GetMinorPlanApplyViewQueryable(exp);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- return this.GetQueryByDataRangeByCollege(query).OrderByDescending(x => x.YearID).ThenBy(x => x.CollegeNo.Length).ThenBy(x => x.CollegeNo)
- .ThenByDescending(x => x.StandardID).ThenByDescending(x => x.CreateTime).ToList();
- }
- public IGridResultSet<MinorPlanApplyView> StandardAndMinorSpecialtyCourseViewGrid(int? yearID, int? standardID, int pageIndex, int pageSize)
- {
- Expression<Func<EM_MinorCourse, bool>> exp = (x => x.IsEnable==true);
- var query = MinorPlanApplyDAL.StandardAndMinorSpecialtyCourseView(exp, yearID);
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- return this.GetQueryByDataRangeByCollege(query)
- .OrderBy(x => x.SchoolyearNumID).ThenBy(x => x.CourseCode)
- .ToGridResultSet<MinorPlanApplyView>(pageIndex, pageSize);
- }
- public IGridResultSet<MinorPlanApplyView> existStandardAndMinorSpecialtyCourseViewGrid(Guid? GradeMinorApplicationID, int pageIndex, int pageSize)
- {
- Expression<Func<CF_GrademinorApplication, bool>> exp = (x => x.GradeMinorApplicationID==GradeMinorApplicationID);
- var query = MinorPlanApplyDAL.existStandardAndMinorSpecialtyCourseView(exp);
-
- return this.GetQueryByDataRangeByCollege(query)
- .OrderBy(x => x.StarttermID).ThenBy(x => x.CourseCode)
- .ToGridResultSet<MinorPlanApplyView>(pageIndex, pageSize);
- }
- public void MinorPlanAdd(MinorPlanApplyView minorPlanApplyView, List<MinorPlanApplyView> minorSpecialCourseViewList)
- {
- try
- {
- var existGrademinorApplication = MinorPlanApplyDAL.GrademinorApplicationRepository.GetList(x => x.YearID == minorPlanApplyView.YearID && x.StandardID == minorPlanApplyView.StandardID).FirstOrDefault();
- if (existGrademinorApplication!=null)
- {
- throw new Exception(minorPlanApplyView.YearID+"级"+minorPlanApplyView.StandardName+"的辅修申请已存在。");
- }
- var graduatingSemester = EMIS.Utility.Const.LOCAL_SETTING_ENTRANCESEMESTERID;
- if (graduatingSemester == null)
- {
- throw new Exception("入学学期(春季、上学期、秋季、下学期)未配置,请检查");
- }
- var SchoolcodeID = Convert.ToInt32(graduatingSemester);
- var schoolYearList = this.schoolYearDAL.schoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- var minorSpecialCourseIDList = minorSpecialCourseViewList.Select(x => x.MinorCourseID).ToList();
- var minorSpecialCourseTeachModeTypeList = MinorPlanApplyDAL.MinorCourseTeachingModeTypeRepository.GetList(x => minorSpecialCourseIDList.Contains(x.MinorCourseID)).ToList();
- var minorSpecialCourseTeachPlaceList = MinorPlanApplyDAL.MinorCourseTeachingPlaceRepository.GetList(x => minorSpecialCourseIDList.Contains(x.MinorCourseID)).ToList();
- var nowSchoolYear = schoolYearList.Where(x => x.IsCurrent == true).FirstOrDefault();
- CF_GrademinorApplication GrademinorApplication = new CF_GrademinorApplication();
- GrademinorApplication.GradeMinorApplicationID = Guid.NewGuid();
- GrademinorApplication.SchoolyearID = nowSchoolYear.SchoolyearID;
- GrademinorApplication.CollegeID = minorPlanApplyView.CollegeID;
- GrademinorApplication.StandardID = minorPlanApplyView.StandardID;
- GrademinorApplication.YearID = minorPlanApplyView.YearID;
- GrademinorApplication.StudentLimit = minorPlanApplyView.StudentLimit;
- SetNewStatus(GrademinorApplication);
- UnitOfWork.Add(GrademinorApplication);
- UnitOfWork.Commit();
- List<EM_MinorPlanApplication> insertList = new List<EM_MinorPlanApplication>();
- List<EM_MinorPlanApplicationTeachingSetting> insertSettingList = new List<EM_MinorPlanApplicationTeachingSetting>();
- List<EM_MinorPlanApplicationTeachingModeType> insertTeachingModeTypeList = new List<EM_MinorPlanApplicationTeachingModeType>();
- List<EM_MinorPlanApplicationTeachingPlace> insertTeachingPlaceList = new List<EM_MinorPlanApplicationTeachingPlace>();
- foreach (var specialtyCourse in minorSpecialCourseViewList)
- {
- var startSchoolyear = schoolYearList.FirstOrDefault(x => x.Years == minorPlanApplyView.YearID && x.SchoolcodeID == SchoolcodeID);
- if (startSchoolyear == null)
- {
- throw new Exception("未能匹配到学年学期,请设置学年学期。");
- }
- var courseSchoolyear = schoolYearList.FirstOrDefault(x => x.Value == (startSchoolyear.Value + ((specialtyCourse.SchoolyearNumID - 1) * 2) + (specialtyCourse.SchoolcodeID == SchoolcodeID ? 0 : 1)));
- if (courseSchoolyear == null)
- {
- throw new Exception("课程" + specialtyCourse.CourseName + "的开课学年学期尚未设置,请先前往校历管理设置相应的学年学期。");
- }
- EM_MinorPlanApplication MinorPlanApplication = new EM_MinorPlanApplication();
- MinorPlanApplication.MinorPlanApplicationID = Guid.NewGuid();
- MinorPlanApplication.GrademinorApplicationID = GrademinorApplication.GradeMinorApplicationID;
- MinorPlanApplication.StarttermID = specialtyCourse.StarttermID;
- MinorPlanApplication.DepartmentID = specialtyCourse.DepartmentID;
- MinorPlanApplication.CoursematerialID = specialtyCourse.CoursematerialID;
- MinorPlanApplication.CourseStructureID = specialtyCourse.CourseStructureID;
- MinorPlanApplication.CourseCategoryID = specialtyCourse.CourseCategoryID;
- MinorPlanApplication.CourseTypeID = specialtyCourse.CourseTypeID;
- MinorPlanApplication.CourseQualityID = specialtyCourse.CourseQualityID;
- MinorPlanApplication.PracticeTypeID = specialtyCourse.PracticeTypeID;
- MinorPlanApplication.ExaminationModeID = specialtyCourse.ExaminationModeID;
- MinorPlanApplication.CourseFineID = specialtyCourse.CourseFineID;
- MinorPlanApplication.IsSpecialtycore = specialtyCourse.IsSpecialtycore;
- MinorPlanApplication.IsCooperation = specialtyCourse.IsCooperation;
- MinorPlanApplication.IsRequired = specialtyCourse.IsRequired;
- MinorPlanApplication.IsElective = specialtyCourse.IsElective;
- MinorPlanApplication.IsNetworkCourse = specialtyCourse.IsNetworkCourse;
- MinorPlanApplication.IsMainCourse = specialtyCourse.IsMainCourse;
- MinorPlanApplication.TeachinglanguageID = specialtyCourse.TeachinglanguageID;
- MinorPlanApplication.HandleModeID = specialtyCourse.HandleModeID;
- MinorPlanApplication.IsNeedMaterial = specialtyCourse.IsNeedMaterial;
- MinorPlanApplication.ResultTypeID = specialtyCourse.ResultTypeID;
- MinorPlanApplication.Remarks = minorPlanApplyView.Remarks;
- SetNewStatus(MinorPlanApplication);
- insertList.Add(MinorPlanApplication);
- EM_MinorPlanApplicationTeachingSetting MinorPlanApplicationTeachingSetting = new EM_MinorPlanApplicationTeachingSetting();
- MinorPlanApplicationTeachingSetting.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- MinorPlanApplicationTeachingSetting.Credit = specialtyCourse.Credit;
- MinorPlanApplicationTeachingSetting.TheoryCourse = specialtyCourse.TheoryCourse;
- MinorPlanApplicationTeachingSetting.Practicehours = specialtyCourse.Practicehours;
- MinorPlanApplicationTeachingSetting.Trialhours = specialtyCourse.Trialhours;
- MinorPlanApplicationTeachingSetting.WeeklyNum = specialtyCourse.WeeklyNum;
- MinorPlanApplicationTeachingSetting.TheoryWeeklyNum = specialtyCourse.TheoryWeeklyNum;
- MinorPlanApplicationTeachingSetting.PracticeWeeklyNum = specialtyCourse.PracticeWeeklyNum;
- MinorPlanApplicationTeachingSetting.TrialWeeklyNum = specialtyCourse.TrialWeeklyNum;
- MinorPlanApplicationTeachingSetting.StartWeeklyNum = specialtyCourse.StartWeeklyNum;
- MinorPlanApplicationTeachingSetting.EndWeeklyNum = specialtyCourse.EndWeeklyNum;
- MinorPlanApplicationTeachingSetting.WeeklyHours = specialtyCourse.WeeklyHours;
- insertSettingList.Add(MinorPlanApplicationTeachingSetting);
- minorSpecialCourseTeachModeTypeList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingModeType specialtyTeachingModeType = new EM_MinorPlanApplicationTeachingModeType();
- specialtyTeachingModeType.MinorPlanApplicationTeachingModeTypeID = Guid.NewGuid();
- specialtyTeachingModeType.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingModeType.TeachingModeID = x.TeachingModeID;
- this.SetNewStatus(specialtyTeachingModeType);
- insertTeachingModeTypeList.Add(specialtyTeachingModeType);
- });
- minorSpecialCourseTeachPlaceList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingPlace specialtyTeachingPlace = new EM_MinorPlanApplicationTeachingPlace();
- specialtyTeachingPlace.MinorPlanApplicationTeachingPlaceID = Guid.NewGuid();
- specialtyTeachingPlace.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingPlace.TeachingPlace = x.TeachingPlace;
- this.SetNewStatus(specialtyTeachingPlace);
- insertTeachingPlaceList.Add(specialtyTeachingPlace);
- });
- }
- UnitOfWork.BulkInsert(insertList);
- UnitOfWork.BulkInsert(insertSettingList);
- UnitOfWork.BulkInsert(insertTeachingModeTypeList);
- UnitOfWork.BulkInsert(insertTeachingPlaceList);
- }
- catch (Exception)
- {
- throw;
- }
- }
- public void MinorPlanEdit(MinorPlanApplyView minorPlanApplyView, List<MinorPlanApplyView> minorSpecialCourseViewList)
- {
- try
- {
- var existGrademinorApplication = MinorPlanApplyDAL.GrademinorApplicationRepository.GetList(x => x.YearID == minorPlanApplyView.YearID && x.StandardID == minorPlanApplyView.StandardID && x.GradeMinorApplicationID != minorPlanApplyView.GradeMinorApplicationID).FirstOrDefault();
- if (existGrademinorApplication != null)
- {
- throw new Exception(minorPlanApplyView.YearID + "级" + minorPlanApplyView.StandardName + "的辅修申请已存在。");
- }
- var graduatingSemester = EMIS.Utility.Const.LOCAL_SETTING_ENTRANCESEMESTERID;
- if (graduatingSemester == null)
- {
- throw new Exception("入学学期(春季、上学期、秋季、下学期)未配置,请检查");
- }
- var SchoolcodeID = Convert.ToInt32(graduatingSemester);
- var schoolYearList = this.schoolYearDAL.schoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- var GrademinorApplication = MinorPlanApplyDAL.GrademinorApplicationRepository.GetList(x => x.GradeMinorApplicationID == minorPlanApplyView.GradeMinorApplicationID).FirstOrDefault();
- var minorSpecialCourseIDList = minorSpecialCourseViewList.Select(x => x.MinorCourseID).ToList();
- var MinorPlanApplicationIDList = MinorPlanApplyDAL.MinorPlanApplicationRepository.GetList(x => x.GrademinorApplicationID == minorPlanApplyView.GradeMinorApplicationID).Select(x => x.MinorPlanApplicationID).ToList();
- var minorSpecialCourseTeachModeTypeList = MinorPlanApplyDAL.MinorCourseTeachingModeTypeRepository.GetList(x => minorSpecialCourseIDList.Contains(x.MinorCourseID)).ToList();
- var minorSpecialCourseTeachPlaceList = MinorPlanApplyDAL.MinorCourseTeachingPlaceRepository.GetList(x => minorSpecialCourseIDList.Contains(x.MinorCourseID)).ToList();
- var minorSpecialCourseList=MinorPlanApplyDAL.MinorCourseRepository.GetList(x=>minorSpecialCourseIDList.Contains(x.MinorCourseID));
- var nowSchoolYear = schoolYearList.Where(x => x.IsCurrent == true).FirstOrDefault();
- var isother = minorSpecialCourseList.Where(x => x.StandardID != minorPlanApplyView.StandardID).FirstOrDefault();
- if (isother!=null)
- {
- throw new Exception("所选课程中有其他专业的课程请重新选择");
- }
- if (MinorPlanApplicationIDList.Count>0)
- {
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingSetting>(x =>MinorPlanApplicationIDList.Contains(x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingModeType>(x => MinorPlanApplicationIDList.Contains((Guid)x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingPlace>(x => MinorPlanApplicationIDList.Contains((Guid)x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplication>(x => MinorPlanApplicationIDList.Contains(x.MinorPlanApplicationID));
- }
- if (GrademinorApplication != null)
- {
- CF_GrademinorApplication GrademinorApplications = GrademinorApplication;
- GrademinorApplications.StudentLimit = minorPlanApplyView.StudentLimit;
- GrademinorApplications.CollegeID = minorPlanApplyView.CollegeID;
- SetModifyStatus(GrademinorApplication);
- UnitOfWork.Commit();
- List<EM_MinorPlanApplication> insertList = new List<EM_MinorPlanApplication>();
- List<EM_MinorPlanApplicationTeachingSetting> insertSettingList = new List<EM_MinorPlanApplicationTeachingSetting>();
- List<EM_MinorPlanApplicationTeachingModeType> insertTeachingModeTypeList = new List<EM_MinorPlanApplicationTeachingModeType>();
- List<EM_MinorPlanApplicationTeachingPlace> insertTeachingPlaceList = new List<EM_MinorPlanApplicationTeachingPlace>();
- foreach (var specialtyCourse in minorSpecialCourseViewList)
- {
- var startSchoolyear = schoolYearList.FirstOrDefault(x => x.Years == minorPlanApplyView.YearID && x.SchoolcodeID == SchoolcodeID);
- if (startSchoolyear == null)
- {
- throw new Exception("未能匹配到学年学期,请设置学年学期。");
- }
- var courseSchoolyear = schoolYearList.FirstOrDefault(x => x.Value == (startSchoolyear.Value + ((specialtyCourse.SchoolyearNumID - 1) * 2) + (specialtyCourse.SchoolcodeID == SchoolcodeID ? 0 : 1)));
- if (courseSchoolyear == null)
- {
- throw new Exception("课程" + specialtyCourse.CourseName + "的开课学年学期尚未设置,请先前往校历管理设置相应的学年学期。");
- }
- EM_MinorPlanApplication MinorPlanApplication = new EM_MinorPlanApplication();
- MinorPlanApplication.MinorPlanApplicationID = Guid.NewGuid();
- MinorPlanApplication.GrademinorApplicationID = minorPlanApplyView.GradeMinorApplicationID;
- MinorPlanApplication.StarttermID = specialtyCourse.StarttermID;
- MinorPlanApplication.DepartmentID = specialtyCourse.DepartmentID;
- MinorPlanApplication.CoursematerialID = specialtyCourse.CoursematerialID;
- MinorPlanApplication.CourseStructureID = specialtyCourse.CourseStructureID;
- MinorPlanApplication.CourseCategoryID = specialtyCourse.CourseCategoryID;
- MinorPlanApplication.CourseTypeID = specialtyCourse.CourseTypeID;
- MinorPlanApplication.CourseQualityID = specialtyCourse.CourseQualityID;
- MinorPlanApplication.PracticeTypeID = specialtyCourse.PracticeTypeID;
- MinorPlanApplication.ExaminationModeID = specialtyCourse.ExaminationModeID;
- MinorPlanApplication.CourseFineID = specialtyCourse.CourseFineID;
- MinorPlanApplication.IsSpecialtycore = specialtyCourse.IsSpecialtycore;
- MinorPlanApplication.IsCooperation = specialtyCourse.IsCooperation;
- MinorPlanApplication.IsRequired = specialtyCourse.IsRequired;
- MinorPlanApplication.IsElective = specialtyCourse.IsElective;
- MinorPlanApplication.IsNetworkCourse = specialtyCourse.IsNetworkCourse;
- MinorPlanApplication.IsMainCourse = specialtyCourse.IsMainCourse;
- MinorPlanApplication.TeachinglanguageID = specialtyCourse.TeachinglanguageID;
- MinorPlanApplication.HandleModeID = specialtyCourse.HandleModeID;
- MinorPlanApplication.IsNeedMaterial = specialtyCourse.IsNeedMaterial;
- MinorPlanApplication.ResultTypeID = specialtyCourse.ResultTypeID;
- MinorPlanApplication.Remarks = minorPlanApplyView.Remarks;
- SetNewStatus(MinorPlanApplication);
- insertList.Add(MinorPlanApplication);
- EM_MinorPlanApplicationTeachingSetting MinorPlanApplicationTeachingSetting = new EM_MinorPlanApplicationTeachingSetting();
- MinorPlanApplicationTeachingSetting.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- MinorPlanApplicationTeachingSetting.Credit = specialtyCourse.Credit;
- MinorPlanApplicationTeachingSetting.TheoryCourse = specialtyCourse.TheoryCourse;
- MinorPlanApplicationTeachingSetting.Practicehours = specialtyCourse.Practicehours;
- MinorPlanApplicationTeachingSetting.Trialhours = specialtyCourse.Trialhours;
- MinorPlanApplicationTeachingSetting.WeeklyNum = specialtyCourse.WeeklyNum;
- MinorPlanApplicationTeachingSetting.TheoryWeeklyNum = specialtyCourse.TheoryWeeklyNum;
- MinorPlanApplicationTeachingSetting.PracticeWeeklyNum = specialtyCourse.PracticeWeeklyNum;
- MinorPlanApplicationTeachingSetting.TrialWeeklyNum = specialtyCourse.TrialWeeklyNum;
- MinorPlanApplicationTeachingSetting.StartWeeklyNum = specialtyCourse.StartWeeklyNum;
- MinorPlanApplicationTeachingSetting.EndWeeklyNum = specialtyCourse.EndWeeklyNum;
- MinorPlanApplicationTeachingSetting.WeeklyHours = specialtyCourse.WeeklyHours;
- insertSettingList.Add(MinorPlanApplicationTeachingSetting);
- minorSpecialCourseTeachModeTypeList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingModeType specialtyTeachingModeType = new EM_MinorPlanApplicationTeachingModeType();
- specialtyTeachingModeType.MinorPlanApplicationTeachingModeTypeID = Guid.NewGuid();
- specialtyTeachingModeType.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingModeType.TeachingModeID = x.TeachingModeID;
- this.SetNewStatus(specialtyTeachingModeType);
- insertTeachingModeTypeList.Add(specialtyTeachingModeType);
- });
- minorSpecialCourseTeachPlaceList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingPlace specialtyTeachingPlace = new EM_MinorPlanApplicationTeachingPlace();
- specialtyTeachingPlace.MinorPlanApplicationTeachingPlaceID = Guid.NewGuid();
- specialtyTeachingPlace.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingPlace.TeachingPlace = x.TeachingPlace;
- this.SetNewStatus(specialtyTeachingPlace);
- insertTeachingPlaceList.Add(specialtyTeachingPlace);
- });
- }
- UnitOfWork.BulkInsert(insertList);
- UnitOfWork.BulkInsert(insertSettingList);
- UnitOfWork.BulkInsert(insertTeachingModeTypeList);
- UnitOfWork.BulkInsert(insertTeachingPlaceList);
- }
- else
- {
- CF_GrademinorApplication GrademinorApplications = new CF_GrademinorApplication() ;
- GrademinorApplications.GradeMinorApplicationID = Guid.NewGuid();
- GrademinorApplications.SchoolyearID = nowSchoolYear.SchoolyearID;
- GrademinorApplications.CollegeID = minorPlanApplyView.CollegeID;
- GrademinorApplications.StandardID = minorPlanApplyView.StandardID;
- GrademinorApplications.YearID = minorPlanApplyView.YearID;
- GrademinorApplications.StudentLimit = minorPlanApplyView.StudentLimit;
- SetNewStatus(GrademinorApplications);
- UnitOfWork.Add(GrademinorApplications);
- UnitOfWork.Commit();
- List<EM_MinorPlanApplication> insertList = new List<EM_MinorPlanApplication>();
- List<EM_MinorPlanApplicationTeachingSetting> insertSettingList = new List<EM_MinorPlanApplicationTeachingSetting>();
- List<EM_MinorPlanApplicationTeachingModeType> insertTeachingModeTypeList = new List<EM_MinorPlanApplicationTeachingModeType>();
- List<EM_MinorPlanApplicationTeachingPlace> insertTeachingPlaceList = new List<EM_MinorPlanApplicationTeachingPlace>();
- foreach (var specialtyCourse in minorSpecialCourseViewList)
- {
- var startSchoolyear = schoolYearList.FirstOrDefault(x => x.Years == minorPlanApplyView.YearID && x.SchoolcodeID == SchoolcodeID);
- if (startSchoolyear == null)
- {
- throw new Exception("未能匹配到学年学期,请设置学年学期。");
- }
- var courseSchoolyear = schoolYearList.FirstOrDefault(x => x.Value == (startSchoolyear.Value + ((specialtyCourse.SchoolyearNumID - 1) * 2) + (specialtyCourse.SchoolcodeID == SchoolcodeID ? 0 : 1)));
- if (courseSchoolyear == null)
- {
- throw new Exception("课程" + specialtyCourse.CourseName + "的开课学年学期尚未设置,请先前往校历管理设置相应的学年学期。");
- }
- EM_MinorPlanApplication MinorPlanApplication = new EM_MinorPlanApplication();
- MinorPlanApplication.MinorPlanApplicationID = Guid.NewGuid();
- MinorPlanApplication.GrademinorApplicationID = GrademinorApplications.GradeMinorApplicationID;
- MinorPlanApplication.StarttermID = specialtyCourse.StarttermID;
- MinorPlanApplication.DepartmentID = specialtyCourse.DepartmentID;
- MinorPlanApplication.CoursematerialID = specialtyCourse.CoursematerialID;
- MinorPlanApplication.CourseStructureID = specialtyCourse.CourseStructureID;
- MinorPlanApplication.CourseCategoryID = specialtyCourse.CourseCategoryID;
- MinorPlanApplication.CourseTypeID = specialtyCourse.CourseTypeID;
- MinorPlanApplication.CourseQualityID = specialtyCourse.CourseQualityID;
- MinorPlanApplication.PracticeTypeID = specialtyCourse.PracticeTypeID;
- MinorPlanApplication.ExaminationModeID = specialtyCourse.ExaminationModeID;
- MinorPlanApplication.CourseFineID = specialtyCourse.CourseFineID;
- MinorPlanApplication.IsSpecialtycore = specialtyCourse.IsSpecialtycore;
- MinorPlanApplication.IsCooperation = specialtyCourse.IsCooperation;
- MinorPlanApplication.IsRequired = specialtyCourse.IsRequired;
- MinorPlanApplication.IsElective = specialtyCourse.IsElective;
- MinorPlanApplication.IsNetworkCourse = specialtyCourse.IsNetworkCourse;
- MinorPlanApplication.IsMainCourse = specialtyCourse.IsMainCourse;
- MinorPlanApplication.TeachinglanguageID = specialtyCourse.TeachinglanguageID;
- MinorPlanApplication.HandleModeID = specialtyCourse.HandleModeID;
- MinorPlanApplication.IsNeedMaterial = specialtyCourse.IsNeedMaterial;
- MinorPlanApplication.ResultTypeID = specialtyCourse.ResultTypeID;
- MinorPlanApplication.Remarks = minorPlanApplyView.Remarks;
- SetNewStatus(MinorPlanApplication);
- insertList.Add(MinorPlanApplication);
- EM_MinorPlanApplicationTeachingSetting MinorPlanApplicationTeachingSetting = new EM_MinorPlanApplicationTeachingSetting();
- MinorPlanApplicationTeachingSetting.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- MinorPlanApplicationTeachingSetting.Credit = specialtyCourse.Credit;
- MinorPlanApplicationTeachingSetting.TheoryCourse = specialtyCourse.TheoryCourse;
- MinorPlanApplicationTeachingSetting.Practicehours = specialtyCourse.Practicehours;
- MinorPlanApplicationTeachingSetting.Trialhours = specialtyCourse.Trialhours;
- MinorPlanApplicationTeachingSetting.WeeklyNum = specialtyCourse.WeeklyNum;
- MinorPlanApplicationTeachingSetting.TheoryWeeklyNum = specialtyCourse.TheoryWeeklyNum;
- MinorPlanApplicationTeachingSetting.PracticeWeeklyNum = specialtyCourse.PracticeWeeklyNum;
- MinorPlanApplicationTeachingSetting.TrialWeeklyNum = specialtyCourse.TrialWeeklyNum;
- MinorPlanApplicationTeachingSetting.StartWeeklyNum = specialtyCourse.StartWeeklyNum;
- MinorPlanApplicationTeachingSetting.EndWeeklyNum = specialtyCourse.EndWeeklyNum;
- MinorPlanApplicationTeachingSetting.WeeklyHours = specialtyCourse.WeeklyHours;
- insertSettingList.Add(MinorPlanApplicationTeachingSetting);
- minorSpecialCourseTeachModeTypeList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingModeType specialtyTeachingModeType = new EM_MinorPlanApplicationTeachingModeType();
- specialtyTeachingModeType.MinorPlanApplicationTeachingModeTypeID = Guid.NewGuid();
- specialtyTeachingModeType.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingModeType.TeachingModeID = x.TeachingModeID;
- this.SetNewStatus(specialtyTeachingModeType);
- insertTeachingModeTypeList.Add(specialtyTeachingModeType);
- });
- minorSpecialCourseTeachPlaceList.Where(x => x.MinorCourseID == specialtyCourse.MinorCourseID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingPlace specialtyTeachingPlace = new EM_MinorPlanApplicationTeachingPlace();
- specialtyTeachingPlace.MinorPlanApplicationTeachingPlaceID = Guid.NewGuid();
- specialtyTeachingPlace.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingPlace.TeachingPlace = x.TeachingPlace;
- this.SetNewStatus(specialtyTeachingPlace);
- insertTeachingPlaceList.Add(specialtyTeachingPlace);
- });
- }
- UnitOfWork.BulkInsert(insertList);
- UnitOfWork.BulkInsert(insertSettingList);
- UnitOfWork.BulkInsert(insertTeachingModeTypeList);
- UnitOfWork.BulkInsert(insertTeachingPlaceList);
- }
- }
- catch (Exception)
- {
- throw;
- }
- }
- public MinorPlanApplyView GetMinorPlanApplyView(Guid? GradeMinorApplicationIDs)
- {
- Expression<Func<CF_GrademinorApplication, bool>> exp = (x => x.GradeMinorApplicationID == GradeMinorApplicationIDs);
- var MinorApplication = MinorPlanApplyDAL.GetMinorPlanApplyViewQueryable(exp).FirstOrDefault();
- return MinorApplication;
- }
- /// <summary>
- /// 复制年级
- /// </summary>
- /// <param name="specialtyPlan"></param>
- /// <returns></returns>
- public string SpecialtyPlanCopyByGrade(MinorPlanApplyView minorPlanApplyView)
- {
- try
- {
- var graduatingSemester = EMIS.Utility.Const.LOCAL_SETTING_ENTRANCESEMESTERID;
- if (graduatingSemester == null)
- {
- throw new Exception("入学学期(春季、上学期、秋季、下学期)未配置,请检查");
- }
- var SchoolcodeID = Convert.ToInt32(graduatingSemester);
- var specialtyCourseList = MinorPlanApplyDAL.MinorCourseRepository.GetList(x => true).ToList();
- var schoolYearList = this.schoolYearDAL.schoolyearRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- var nowSchoolYear = schoolYearList.Where(x => x.IsCurrent == true).FirstOrDefault();
- //找复制源的辅修专业
- var sourceList = MinorPlanApplyDAL.GrademinorApplicationRepository.GetList(x => x.YearID == minorPlanApplyView.GrademajorBeForeYear).ToList();
- if (minorPlanApplyView.BeForeCollegeID.HasValue)
- {
- sourceList = sourceList.Where(x => x.CollegeID == minorPlanApplyView.BeForeCollegeID).ToList();
- }
- List<Guid?> sourceIDList=new List<Guid?>();
- foreach(var sourceID in sourceList)
- {
- Guid? ID= sourceID.GradeMinorApplicationID;
- sourceIDList.Add(ID);
- }
- //找复制源的辅修计划
- var sourceCourseList = MinorPlanApplyDAL.MinorPlanApplicationRepository.GetList(x => sourceIDList.Contains(x.GrademinorApplicationID)).ToList();
-
- var sourceCourseIDList = sourceCourseList.Select(x => x.MinorPlanApplicationID).ToList();
- var minorSpecialCourseTeachingSettingList = MinorPlanApplyDAL.MinorPlanApplicationTeachingSettingRepository.GetList(x => sourceCourseIDList.Contains((Guid)x.MinorPlanApplicationID)).ToList();
- var minorSpecialCourseTeachModeTypeList = MinorPlanApplyDAL.MinorPlanApplicationTeachingModeTypeRepository.GetList(x => sourceCourseIDList.Contains((Guid)x.MinorPlanApplicationID)).ToList();
- var minorSpecialCourseTeachPlaceList = MinorPlanApplyDAL.MinorPlanApplicationTeachingPlaceRepository.GetList(x => sourceCourseIDList.Contains((Guid)x.MinorPlanApplicationID)).ToList();
- //找复制源的专业计划
- //找到目标辅修专业
- var targetList = MinorPlanApplyDAL.GrademinorApplicationRepository.GetList(x => x.YearID == minorPlanApplyView.GrademajorAfterYear).ToList();
- int existCount = 0;
- int copyCount = 0;
- foreach (var source in sourceList)
- {
- var isCanCopy = targetList.Where(x => x.StandardID == source.StandardID).FirstOrDefault();
- if (isCanCopy!=null)
- {
- existCount = existCount+1;
- }
- else
- {
-
- CF_GrademinorApplication GrademinorApplication = new CF_GrademinorApplication();
- GrademinorApplication.GradeMinorApplicationID = Guid.NewGuid();
- GrademinorApplication.SchoolyearID = nowSchoolYear.SchoolyearID;
- GrademinorApplication.CollegeID = source.CollegeID;
- GrademinorApplication.StandardID = source.StandardID;
- GrademinorApplication.YearID = minorPlanApplyView.GrademajorAfterYear;
- GrademinorApplication.StudentLimit = source.StudentLimit;
- SetNewStatus(GrademinorApplication);
- UnitOfWork.Add(GrademinorApplication);
- copyCount = copyCount +1;
- List<EM_MinorPlanApplication> insertList = new List<EM_MinorPlanApplication>();
- List<EM_MinorPlanApplicationTeachingSetting> insertSettingList = new List<EM_MinorPlanApplicationTeachingSetting>();
- List<EM_MinorPlanApplicationTeachingModeType> insertTeachingModeTypeList = new List<EM_MinorPlanApplicationTeachingModeType>();
- List<EM_MinorPlanApplicationTeachingPlace> insertTeachingPlaceList = new List<EM_MinorPlanApplicationTeachingPlace>();
- #region 插入数据到列表中,准备批量插入
- foreach (var specialtyCourse in sourceCourseList)
- {
- if (specialtyCourse.GrademinorApplicationID == source.GradeMinorApplicationID)
- {
- var startSchoolyear = schoolYearList.FirstOrDefault(x => x.Years == minorPlanApplyView.GrademajorAfterYear && x.SchoolcodeID == SchoolcodeID);
- if (startSchoolyear == null)
- {
- throw new Exception("未能匹配到学年学期,请设置学年学期。");
- }
- var courseSchoolyear = schoolYearList.FirstOrDefault(x => x.Value == (startSchoolyear.Value + specialtyCourse.StarttermID - 1));
- if (courseSchoolyear == null)
- {
- throw new Exception("课程" + specialtyCourse.EM_Coursematerial.CourseName + "的开课学年学期尚未设置,请先前往校历管理设置相应的学年学期。");
- }
- EM_MinorPlanApplication MinorPlanApplication = new EM_MinorPlanApplication();
- MinorPlanApplication.MinorPlanApplicationID = Guid.NewGuid();
- MinorPlanApplication.GrademinorApplicationID = GrademinorApplication.GradeMinorApplicationID;
- MinorPlanApplication.StarttermID = specialtyCourse.StarttermID;
- MinorPlanApplication.DepartmentID = specialtyCourse.DepartmentID;
- MinorPlanApplication.CoursematerialID = specialtyCourse.CoursematerialID;
- MinorPlanApplication.CourseStructureID = specialtyCourse.CourseStructureID;
- MinorPlanApplication.CourseCategoryID = specialtyCourse.CourseCategoryID;
- MinorPlanApplication.CourseTypeID = specialtyCourse.CourseTypeID;
- MinorPlanApplication.CourseQualityID = specialtyCourse.CourseQualityID;
- MinorPlanApplication.PracticeTypeID = specialtyCourse.PracticeTypeID;
- MinorPlanApplication.ExaminationModeID = specialtyCourse.ExaminationModeID;
- MinorPlanApplication.CourseFineID = specialtyCourse.CourseFineID;
- MinorPlanApplication.IsSpecialtycore = specialtyCourse.IsSpecialtycore;
- MinorPlanApplication.IsCooperation = specialtyCourse.IsCooperation;
- MinorPlanApplication.IsRequired = specialtyCourse.IsRequired;
- MinorPlanApplication.IsElective = specialtyCourse.IsElective;
- MinorPlanApplication.IsNetworkCourse = specialtyCourse.IsNetworkCourse;
- MinorPlanApplication.IsMainCourse = specialtyCourse.IsMainCourse;
- MinorPlanApplication.TeachinglanguageID = specialtyCourse.TeachinglanguageID;
- MinorPlanApplication.HandleModeID = minorPlanApplyView.HandleModeID;
- MinorPlanApplication.IsNeedMaterial = minorPlanApplyView.IsNeedMaterial;
- MinorPlanApplication.ResultTypeID = specialtyCourse.ResultTypeID;
- MinorPlanApplication.Remarks = minorPlanApplyView.Remarks;
- SetNewStatus(MinorPlanApplication);
- insertList.Add(MinorPlanApplication);
- var minorSpecialCourseTeachingSetting = minorSpecialCourseTeachingSettingList.Where(x => x.MinorPlanApplicationID == specialtyCourse.MinorPlanApplicationID).FirstOrDefault();
- EM_MinorPlanApplicationTeachingSetting MinorPlanApplicationTeachingSetting = new EM_MinorPlanApplicationTeachingSetting();
- MinorPlanApplicationTeachingSetting.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- MinorPlanApplicationTeachingSetting.Credit = minorSpecialCourseTeachingSetting.Credit;
- MinorPlanApplicationTeachingSetting.TheoryCourse = minorSpecialCourseTeachingSetting.TheoryCourse;
- MinorPlanApplicationTeachingSetting.Practicehours = minorSpecialCourseTeachingSetting.Practicehours;
- MinorPlanApplicationTeachingSetting.Trialhours = minorSpecialCourseTeachingSetting.Trialhours;
- MinorPlanApplicationTeachingSetting.WeeklyNum = minorSpecialCourseTeachingSetting.WeeklyNum;
- MinorPlanApplicationTeachingSetting.TheoryWeeklyNum = minorSpecialCourseTeachingSetting.TheoryWeeklyNum;
- MinorPlanApplicationTeachingSetting.PracticeWeeklyNum = minorSpecialCourseTeachingSetting.PracticeWeeklyNum;
- MinorPlanApplicationTeachingSetting.TrialWeeklyNum = minorSpecialCourseTeachingSetting.TrialWeeklyNum;
- MinorPlanApplicationTeachingSetting.StartWeeklyNum = minorSpecialCourseTeachingSetting.StartWeeklyNum;
- MinorPlanApplicationTeachingSetting.EndWeeklyNum = minorSpecialCourseTeachingSetting.EndWeeklyNum;
- MinorPlanApplicationTeachingSetting.WeeklyHours = minorSpecialCourseTeachingSetting.WeeklyHours;
- insertSettingList.Add(MinorPlanApplicationTeachingSetting);
- minorSpecialCourseTeachModeTypeList.Where(x => x.MinorPlanApplicationID == specialtyCourse.MinorPlanApplicationID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingModeType specialtyTeachingModeType = new EM_MinorPlanApplicationTeachingModeType();
- specialtyTeachingModeType.MinorPlanApplicationTeachingModeTypeID = Guid.NewGuid();
- specialtyTeachingModeType.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingModeType.TeachingModeID = x.TeachingModeID;
- this.SetNewStatus(specialtyTeachingModeType);
- insertTeachingModeTypeList.Add(specialtyTeachingModeType);
- });
- minorSpecialCourseTeachPlaceList.Where(x => x.MinorPlanApplicationID == specialtyCourse.MinorPlanApplicationID).ToList().ForEach(x =>
- {
- EM_MinorPlanApplicationTeachingPlace specialtyTeachingPlace = new EM_MinorPlanApplicationTeachingPlace();
- specialtyTeachingPlace.MinorPlanApplicationTeachingPlaceID = Guid.NewGuid();
- specialtyTeachingPlace.MinorPlanApplicationID = MinorPlanApplication.MinorPlanApplicationID;
- specialtyTeachingPlace.TeachingPlace = x.TeachingPlace;
- this.SetNewStatus(specialtyTeachingPlace);
- insertTeachingPlaceList.Add(specialtyTeachingPlace);
- });
- }
- }
- #endregion
- UnitOfWork.BulkInsert(insertList);
- UnitOfWork.BulkInsert(insertSettingList);
- UnitOfWork.BulkInsert(insertTeachingModeTypeList);
- UnitOfWork.BulkInsert(insertTeachingPlaceList);
- UnitOfWork.Commit();
-
- }
- }
- string Success = "";
- if (existCount == 0)
- {
- Success = "复制成功,一共复制了" + copyCount + "条。";
- }
- else
- {
- Success = "复制成功,一共复制了" + copyCount + "条,有" + existCount+"条已存在没有复制。";
- }
- return Success;
- }
- catch (Exception)
- {
- throw;
- }
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="ids"></param>
- /// <returns></returns>
- public bool GradeMinorApplicationDelete(List<Guid?> ids)
- {
- try
- {
- if (ids.Count > 0)
- {
- var MinorPlanApplicationIDList = MinorPlanApplyDAL.MinorPlanApplicationRepository.GetList(x => ids.Contains(x.GrademinorApplicationID)).Select(x => x.MinorPlanApplicationID).ToList();
- if (MinorPlanApplicationIDList.Count > 0)
- {
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingModeType>(x => MinorPlanApplicationIDList.Contains((Guid)x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingPlace>(x => MinorPlanApplicationIDList.Contains((Guid)x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplicationTeachingSetting>(x => MinorPlanApplicationIDList.Contains(x.MinorPlanApplicationID));
- UnitOfWork.Delete<EM_MinorPlanApplication>(x => MinorPlanApplicationIDList.Contains(x.MinorPlanApplicationID));
- }
- UnitOfWork.Delete<CF_GrademinorApplication>(x => ids.Contains(x.GradeMinorApplicationID));
- }
- return true;
- }
- catch (Exception)
- {
- throw;
- }
- }
- public int GetStandardID_MinorPlanApplication_MinorSpecialtyPlanCount(List<Guid> ids)
- {
- return MinorPlanApplyDAL.GetStandardID_MinorPlanApplication_MinorSpecialtyPlan(ids);
- }
- /// <summary>
- /// 提交申请
- /// </summary>
- /// <param name="planApplicationIDs">计划申请ID</param>
- /// <param name="userID">提交人</param>
- /// <param name="comment">备注</param>
- public void SubmitPlanApplicationApply(List<Guid> GradeMinorApplicationIDs, Guid userID, List<string> status, string comment = "")
- {
- //在计划申请提交时验证课程的专业计划有无重复
- if (GradeMinorApplicationIDs.Count > 0)
- {
- var startStatus = this.GetStartStatus();
- var backPointStatusList = this.GetBackpointStatus();
- var MinorPlanApplyList = MinorPlanApplyDAL.GetMinorPlanApplyViewQueryable
- (x => GradeMinorApplicationIDs.Contains(x.GradeMinorApplicationID)).ToList();
- var wrongStatusList = MinorPlanApplyList.Where(x => x.ApprovalStatus != startStatus && !backPointStatusList.Contains(x.ApprovalStatus)).ToList();
- if (wrongStatusList.Count > 0)
- {
- throw new Exception("只能处理未提交和已退回的记录,请检查选择的项。");
- }
- var duplicatePlanList = MinorPlanApplyDAL
- .GetDuplicateSpecialtyPlanApplyView(x => GradeMinorApplicationIDs.Contains(x.GradeMinorApplicationID)).ToList();
- var submitList = MinorPlanApplyList.Where(x => x.ApprovalStatus == (int)startStatus).Select(x => (Guid)x.GradeMinorApplicationID).ToList();
- var resubmitList = MinorPlanApplyList.Where(x => backPointStatusList.Contains(x.ApprovalStatus) && !submitList.Contains((Guid)x.GradeMinorApplicationID)).Select(x => (Guid)x.GradeMinorApplicationID).ToList();
- if (duplicatePlanList.Count > 0)
- {
- throw new Exception(string.Join(";", duplicatePlanList.Select(x => x.YearID + "年" + x.StandardName + "专业已经有辅修专业计划,不能重复生成。")));
- }
- try
- {
- StartUp(submitList, userID, comment);
- Approve(resubmitList, userID, Guid.Empty, comment);
- }
- catch (Exception)
- {
- throw;
- }
- }
- }
- }
- }
|