123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.GraduationManage.GraduationSetting;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.GraduationManage.GraduationSetting;
- using EMIS.ViewModel;
- using EMIS.Entities;
- using EMIS.CommonLogic.ChargeManage.ArrearsSituation;
- namespace EMIS.CommonLogic.GraduationManage.GraduationSetting
- {
- public class GraduationConditionServices : BaseServices, IGraduationConditionServices
- {
- public GraduationConditionDAL GraduationConditionDAL { get; set; }
- public IArrearsListServices ArrearsListServices { get; set; }
- /// <summary>
- /// 查询毕业条件信息View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="isCurrent"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<GraduationConditionView> GraduationConditionViewGrid(ConfiguretView configuretView, int? isCurrent,
- int pageIndex, int pageSize)
- {
- //毕业条件
- Expression<Func<ER_GraduationCondition, bool>> exp = (x => true);
- if (isCurrent.HasValue)
- {
- if (isCurrent == 1)
- {
- exp = exp.And(x => x.RecordStatus >= (int)SYS_STATUS.USABLE);
- }
- if (isCurrent == 0)
- {
- exp = exp.And(x => x.RecordStatus <= (int)SYS_STATUS.UNUSABLE);
- }
- }
- var query = GraduationConditionDAL.GetGraduationConditionQueryable(exp);
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return query.OrderBy(x => x.OrderNo).ToGridResultSet<GraduationConditionView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询毕业条件信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="isCurrent"></param>
- /// <returns></returns>
- public List<GraduationConditionView> GetGraduationViewList(ConfiguretView configuretView, int? isCurrent)
- {
- //毕业条件
- Expression<Func<ER_GraduationCondition, bool>> exp = (x => true);
- if (isCurrent.HasValue)
- {
- if (isCurrent == 1)
- {
- exp = exp.And(x => x.RecordStatus >= (int)SYS_STATUS.USABLE);
- }
- if (isCurrent == 0)
- {
- exp = exp.And(x => x.RecordStatus <= (int)SYS_STATUS.UNUSABLE);
- }
- }
- var query = GraduationConditionDAL.GetGraduationConditionQueryable(exp);
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return query.OrderBy(x => x.OrderNo).ToList();
- }
- /// <summary>
- /// 根据毕业条件ID查询对应毕业条件GraduationConditionView
- /// </summary>
- /// <param name="GraduationConditionID"></param>
- /// <returns></returns>
- public GraduationConditionView GetGraduationConditionView(Guid? GraduationConditionID)
- {
- try
- {
- var query = GraduationConditionDAL
- .GetGraduationConditionQueryable(x => x.GraduationConditionID == GraduationConditionID)
- .SingleOrDefault();
- return query;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 编辑
- /// </summary>
- /// <param name="graduationConditionView"></param>
- public void GraduationConditionEdit(GraduationConditionView graduationConditionView)
- {
- try
- {
- //查询数据库进行验证
- var graduationConditionVerification = GraduationConditionDAL.GraduationConditionRepository
- .GetList(x => x.GraduationConditionID != graduationConditionView.GraduationConditionID
- && x.Title == graduationConditionView.Title)
- .SingleOrDefault();
- if (graduationConditionVerification == null)
- {
- //数据有误验证
- if (graduationConditionView.GraduationConditionID != Guid.Empty)
- {
- var graduationCondition = GraduationConditionDAL.GraduationConditionRepository
- .GetList(x => x.GraduationConditionID == graduationConditionView.GraduationConditionID)
- .SingleOrDefault();
- if (graduationCondition == null)
- {
- throw new Exception("数据有误,请核查");
- }
- else
- {
- //表示修改
- graduationCondition.OrderNo = (short?)graduationConditionView.OrderNo;
- graduationCondition.Title = graduationConditionView.Title;
- graduationCondition.RecordStatus = graduationConditionView.IsEnable ? (int)SYS_STATUS.USABLE : (int)SYS_STATUS.UNUSABLE;
- SetModifyStatus(graduationCondition);
- }
- }
- else
- {
- //表示新增
- ER_GraduationCondition graduationCondition = new ER_GraduationCondition();
- graduationCondition.GraduationConditionID = Guid.NewGuid();
- graduationCondition.OrderNo = (short?)graduationConditionView.OrderNo;
- graduationCondition.Title = graduationConditionView.Title;
- graduationCondition.MethodFullName = graduationConditionView.MethodFullName;
- SetNewStatus(graduationCondition);
- UnitOfWork.Add(graduationCondition);
- }
- }
- else
- {
- throw new Exception("已存在相同条件名称的毕业条件,请核查");
- }
- //事务提交
- UnitOfWork.Commit();
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 无条件
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string NoCondition(Guid? userID)
- {
- return "Pass";
- }
- /// <summary>
- /// 所修课程(必修、限选)要求符合专业计划(不包括俱乐部课程)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string SpecialtyPlanCourseComplete(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if(courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //学生信息表
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //课程类型设置表(必修、限选)
- Expression<Func<EM_CourseTypeSelectCourseType, bool>> expCourseTypeSelectCourseType = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expCourseTypeSelectCourseType = expCourseTypeSelectCourseType.And(x => x.IsRequired.Value || x.IsOptionalCourse.Value);
- //查询对应的学生成绩信息List
- var finallyScoreViewList = GraduationConditionDAL
- .GetFinallyScoreNoClubViewQueryable(expStudent, expCourseTypeSelectCourseType).ToList();
- if (finallyScoreViewList == null || finallyScoreViewList.Count() <= 0)
- {
- return "成绩为空";
- }
- //查询对应的学生专业计划信息List
- var studentSpecialtyPlanViewList = GraduationConditionDAL
- .GetStudentSpecialtyPlanViewQueryable(expStudent).ToList();
- if (studentSpecialtyPlanViewList == null || studentSpecialtyPlanViewList.Count() <= 0)
- {
- return "专业计划为空";
- }
- else
- {
- foreach (var finallyScoreView in finallyScoreViewList)
- {
- //根据课程信息、课程类型、课程学分进行比对(学时暂时不考虑)
- var specialtyPlanView = studentSpecialtyPlanViewList
- .Where(x => x.CoursematerialID == finallyScoreView.CoursematerialID
- && x.CourseTypeID == finallyScoreView.CourseTypeID
- && x.Credit == finallyScoreView.Credit).FirstOrDefault();
- if (specialtyPlanView == null)
- {
- return "所修习课程不符合专业计划(" + finallyScoreView.CourseName
- + "-" + finallyScoreView.CourseTypeName
- + "-" + Math.Round(finallyScoreView.ScoreCredit.Value, 1) + "-" + finallyScoreView.StarttermName + ")";
- }
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 所修课程(必修,不包括俱乐部课程)成绩要求全部及格(>=60)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string LearnCourseScorePass(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //课程类型设置表(必修)
- Expression<Func<EM_CourseTypeSelectCourseType, bool>> expCourseTypeSelectCourseType = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expCourseTypeSelectCourseType = expCourseTypeSelectCourseType.And(x => x.IsRequired.Value);
- //查询对应的学生成绩信息List
- var finallyScoreViewList = GraduationConditionDAL
- .GetFinallyScoreNoClubViewQueryable(expStudent, expCourseTypeSelectCourseType).ToList();
- //查询对应的专项理论课程ViewList
- var specialItemViewList = finallyScoreViewList
- .Where(x => x.CourseName.Contains("专项理论")).ToList();
- if (finallyScoreViewList == null || finallyScoreViewList.Count() <= 0)
- {
- return "成绩为空";
- }
- else
- {
- foreach (var finallyScoreView in finallyScoreViewList)
- {
- if (finallyScoreView.TotalScore.Value >= 60)
- {
- //专项理论
- if (specialItemViewList != null && specialItemViewList.Count() > 0)
- {
- if (finallyScoreView.CourseName.Contains("专项理论"))
- {
- //查询对应的专项理论课程List(根据开课学期)
- var specialItemList = specialItemViewList
- .Where(x => x.StarttermID == finallyScoreView.StarttermID)
- .ToList();
- if (specialItemList != null && specialItemList.Count() > 1)
- {
- return finallyScoreView.StarttermName + "专项理论课程重复";
- }
- }
- }
- }
- else
- {
- return finallyScoreView.CourseName + "课程不及格(" + finallyScoreView.StarttermName + ")";
- }
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 毕业课程要求修习且及格(>=60)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GraduationCourseComplete(Guid? userID)
- {
- try
- {
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业课程信息List
- var graduationCourseViewList = GraduationConditionDAL
- .GetGraduationCourseViewQueryable(expStudent).ToList();
- if (graduationCourseViewList == null || graduationCourseViewList.Count() <= 0)
- {
- return "未设置毕业课程,请设置";
- }
- //查询对应的学生成绩信息List
- var finallyScoreViewList = GraduationConditionDAL
- .GetFinallyScoreViewQueryable(expStudent).ToList();
- if (finallyScoreViewList == null || finallyScoreViewList.Count() <= 0)
- {
- return "成绩为空";
- }
- bool isForeignLanguage = true; //外国语
- bool isOtherElective = true; //特别的选修(主项中的副项,如:体教)
- bool isMajorElective = true; //主项选修
- bool isDeputyElective = true; //副项选修
- bool isSpecialtyElective = true; //专项选修
- bool isSpecialtyImprove = true; //专项提高
- foreach (var graduationCourseView in graduationCourseViewList)
- {
- //注:以下逻辑暂时这么处理
- if (graduationCourseView.CourseName.Trim().StartsWith("外国语"))
- {
- //外国语
- if (isForeignLanguage)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var foreignLanguageViewList = finallyScoreViewList
- .Where(x => x.CourseName.Trim().StartsWith("外国语")).ToList();
- if (foreignLanguageViewList != null && foreignLanguageViewList.Count() > 0)
- {
- foreach (var foreignLanguageView in foreignLanguageViewList)
- {
- if (foreignLanguageView.TotalScore < 60)
- {
- return foreignLanguageView.CourseName + "课程不及格";
- }
- //查询对应的外国语课程List(根据开课学期)
- var foreignLanguageList = foreignLanguageViewList
- .Where(x => x.StarttermID == foreignLanguageView.StarttermID)
- .ToList();
- if (foreignLanguageList != null && foreignLanguageList.Count() > 1)
- {
- return foreignLanguageView.StarttermName + "外国语课程重复";
- }
- }
- isForeignLanguage = false;
- }
- else
- {
- return "外国语课程未录入";
- }
- }
- }
- else if (graduationCourseView.CourseName.Trim().StartsWith("主项选修2"))
- {
- //特别的选修
- if (isOtherElective)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var otherElectiveViewList = finallyScoreViewList
- .Where(x => x.CourseName.Trim().StartsWith("主项选修2")).ToList();
- if (otherElectiveViewList != null && otherElectiveViewList.Count() > 0)
- {
- foreach (var otherElectiveView in otherElectiveViewList)
- {
- if (otherElectiveView.TotalScore < 60)
- {
- return otherElectiveView.CourseName + "课程不及格";
- }
- //查询对应的主项选修2课程List(根据开课学期)
- var otherElectiveList = otherElectiveViewList
- .Where(x => x.StarttermID == otherElectiveView.StarttermID)
- .ToList();
- if (otherElectiveList != null && otherElectiveList.Count() > 1)
- {
- return otherElectiveView.StarttermName + "主项选修2课程重复";
- }
- }
- isOtherElective = false;
- }
- else
- {
- return "主项选修2课程未录入";
- }
- }
- }
- else if (graduationCourseView.CourseName.Trim().StartsWith("主项选修"))
- {
- //主项选修
- if (isMajorElective)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var majorElectiveViewList = finallyScoreViewList.Where(x => x.CourseName.Trim().StartsWith("主项选修")
- && !x.CourseName.Trim().StartsWith("主项选修2")).ToList();
- if (majorElectiveViewList != null && majorElectiveViewList.Count() > 0)
- {
- foreach (var majorElectiveView in majorElectiveViewList)
- {
- if (majorElectiveView.TotalScore < 60)
- {
- return majorElectiveView.CourseName + "课程不及格";
- }
- //查询对应的主项选修课程List(根据开课学期)
- var majorElectiveList = majorElectiveViewList
- .Where(x => x.StarttermID == majorElectiveView.StarttermID)
- .ToList();
- if (majorElectiveList != null && majorElectiveList.Count() > 1)
- {
- return majorElectiveView.StarttermName + "主项选修课程重复";
- }
- }
- //var majorElectiveList = stuScoreList.Select(x => x.CourseName.Substring(0, x.CourseName.Length - 1))
- // .ToList();
- //if (majorElectiveList.Distinct().Count() > 1)
- //{
- // return "各主项选修课程不同类";
- //}
- isMajorElective = false;
- }
- else
- {
- return "主项选修课程未录入";
- }
- }
- }
- else if (graduationCourseView.CourseName.Trim().StartsWith("副项选修"))
- {
- //副项选修
- if (isDeputyElective)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var deputyElectiveViewList = finallyScoreViewList
- .Where(x => x.CourseName.Trim().StartsWith("副项选修")).ToList();
- if (deputyElectiveViewList != null && deputyElectiveViewList.Count() > 0)
- {
- foreach (var deputyElectiveView in deputyElectiveViewList)
- {
- if (deputyElectiveView.TotalScore < 60)
- {
- return deputyElectiveView.CourseName + "课程不及格";
- }
- //查询对应的副项选修课程List(根据开课学期)
- var deputyElectiveList = deputyElectiveViewList
- .Where(x => x.StarttermID == deputyElectiveView.StarttermID)
- .ToList();
- if (deputyElectiveList != null && deputyElectiveList.Count() > 1)
- {
- return deputyElectiveView.StarttermName + "副项选修课程重复";
- }
- }
- isDeputyElective = false;
- }
- else
- {
- return "副项选修课程未录入";
- }
- }
- }
- else if (graduationCourseView.CourseName.Trim().StartsWith("专项选修"))
- {
- //专项选修
- if (isSpecialtyElective)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var specialtyElectiveViewList = finallyScoreViewList
- .Where(x => x.CourseName.Trim().StartsWith("专项选修")).ToList();
- if (specialtyElectiveViewList != null && specialtyElectiveViewList.Count() > 0)
- {
- foreach (var specialtyElectiveView in specialtyElectiveViewList)
- {
- if (specialtyElectiveView.TotalScore < 60)
- {
- return specialtyElectiveView.CourseName + "课程不及格";
- }
- //查询对应的专项选修课程List(根据开课学期)
- var specialtyElectiveList = specialtyElectiveViewList
- .Where(x => x.StarttermID == specialtyElectiveView.StarttermID)
- .ToList();
- if (specialtyElectiveList != null && specialtyElectiveList.Count() > 1)
- {
- return specialtyElectiveView.StarttermName + "专项选修课程重复";
- }
- }
- isSpecialtyElective = false;
- }
- else
- {
- return "专项选修课程未录入";
- }
- }
- }
- else if (graduationCourseView.CourseName.Trim().StartsWith("专项提高"))
- {
- //专项提高
- if (isSpecialtyImprove)
- {
- //根据课程名称进行比对(课程类型、课程学分、学时暂时不考虑)
- var specialtyImproveViewList = finallyScoreViewList
- .Where(x => x.CourseName.Trim().StartsWith("专项提高")).ToList();
- if (specialtyImproveViewList != null && specialtyImproveViewList.Count() > 0)
- {
- foreach (var specialtyImproveView in specialtyImproveViewList)
- {
- if (specialtyImproveView.TotalScore < 60)
- {
- return specialtyImproveView.CourseName + "课程不及格";
- }
- //查询对应的专项提高课程List(根据开课学期)
- var specialtyImproveList = specialtyImproveViewList
- .Where(x => x.StarttermID == specialtyImproveView.StarttermID)
- .ToList();
- if (specialtyImproveList != null && specialtyImproveList.Count() > 1)
- {
- return specialtyImproveView.StarttermName + "专项提高课程重复";
- }
- }
- isSpecialtyImprove = false;
- }
- else
- {
- return "专项提高课程未录入";
- }
- }
- }
- else
- {
- //根据课程信息、课程类型、课程学分进行比对(学时暂时不考虑)
- var finallyScoreView = finallyScoreViewList
- .Where(x => x.CoursematerialID == graduationCourseView.CoursematerialID
- && x.CourseTypeID == graduationCourseView.CourseTypeID
- && x.Credit == graduationCourseView.CourseCredit).SingleOrDefault();
- if (finallyScoreView == null)
- {
- return graduationCourseView.CourseName + "课程未录入";
- }
- if (finallyScoreView != null)
- {
- if (finallyScoreView.TotalScore.Value < 60)
- {
- return graduationCourseView.CourseName + "课程不及格(" + finallyScoreView.StarttermName + ")";
- }
- }
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 毕业设计(论文)课程要求修习且及格(>=60分)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GraduateDesignCourseComplete(Guid? userID)
- {
- try
- {
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业设计课程信息List
- var graduateDesignCourseList = GraduationConditionDAL
- .GraduateDesignCoursematerialRepository.GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (graduateDesignCourseList == null || graduateDesignCourseList.Count() <= 0)
- {
- return "未设置毕业设计课程,请设置";
- }
- //查询对应的毕业设计课程成绩信息List
- var finallyScoreViewList = GraduationConditionDAL
- .GetGraduateDesignCourseViewQueryable(expStudent).ToList();
- if (finallyScoreViewList == null || finallyScoreViewList.Count() <= 0)
- {
- return "毕业设计课程未录入";
- }
- foreach (var finallyScoreView in finallyScoreViewList)
- {
- if (finallyScoreView.TotalScore < 60)
- {
- return "毕业设计课程不及格(" + finallyScoreView.StarttermName + ")";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 类型(课程类型)学分要求符合(等于或大于等于)
- /// 注:实践环节学分=实践环节(不包含俱乐部)+实践环节(包含俱乐部)且大于4只取4分
- /// 校本课程学分=校本课程(不包含俱乐部)+校本课程(包含俱乐部)且大于4只取4分
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GradCourseTypeCreditComplete(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //查询毕业课程类型设置信息List
- var graduationCourseTypeSettingList = GraduationConditionDAL.GraduationCourseTypeSettingRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (graduationCourseTypeSettingList == null || graduationCourseTypeSettingList.Count() <= 0)
- {
- throw new Exception("毕业课程类型设置未配置,请配置");
- }
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业课程类型学分信息List
- var courseTypeRequirementViewList = GraduationConditionDAL
- .GetGradCourseTypeRequirementViewQueryable(expStudent).ToList();
- if (courseTypeRequirementViewList == null || courseTypeRequirementViewList.Count() <= 0)
- {
- return "未设置类型学分,请设置";
- }
- //查询对应的毕业学生课程类型学分信息List
- var gradStudentCourseTypeCreditViewList = GraduationConditionDAL
- .GetGradStudentCourseTypeCreditViewQueryable(expStudent).ToList();
- //查询对应的毕业学生成绩学分信息(根据学生信息)
- var gradStudentScoreCreditView = GraduationConditionDAL
- .GetGradStudentScoreCreditViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradStudentCourseTypeCreditViewList == null || gradStudentCourseTypeCreditViewList.Count() <= 0
- || gradStudentScoreCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- foreach (var courseTypeRequirementView in courseTypeRequirementViewList)
- {
- //查询对应的毕业学生课程类型学分信息
- var gradStudentCourseTypeCreditView = gradStudentCourseTypeCreditViewList
- .Where(x => x.CourseTypeID == courseTypeRequirementView.CourseTypeID)
- .SingleOrDefault();
- if (gradStudentCourseTypeCreditView == null)
- {
- return "类型学分(课程类型:" + courseTypeRequirementView.CourseTypeName + ")为空";
- }
- else
- {
- if (courseTypeRequirementView.IsRequired.Value)
- {
- //必修(等于)注:学前为大于等于(暂时这样考虑)
- //实践环节(实践环节学分=实践环节(不包含俱乐部)+实践环节(包含俱乐部)且大于4只取4分)
- if (courseTypeRequirementView.IsPractise.Value)
- {
- //学前教育专业为大于等于(逻辑暂时这样处理)
- if (gradStudentScoreCreditView.StandardID == 40106)
- {
- if (gradStudentScoreCreditView.PractiseCredit.Value < courseTypeRequirementView.TotalCredit.Value)
- {
- return "实践环节学分不足(-" + (courseTypeRequirementView.TotalCredit.Value
- - gradStudentScoreCreditView.PractiseCredit.Value).ToString() + ")";
- }
- }
- else
- {
- if (gradStudentScoreCreditView.PractiseCredit.Value > courseTypeRequirementView.TotalCredit.Value)
- {
- return "实践环节学分超标(+" + (gradStudentScoreCreditView.PractiseCredit.Value
- - courseTypeRequirementView.TotalCredit.Value).ToString() + ")";
- }
- if (gradStudentScoreCreditView.PractiseCredit.Value < courseTypeRequirementView.TotalCredit.Value)
- {
- return "实践环节学分不足(-" + (courseTypeRequirementView.TotalCredit.Value
- - gradStudentScoreCreditView.PractiseCredit.Value).ToString() + ")";
- }
- }
- }
- else
- {
- if (gradStudentCourseTypeCreditView.TotalCredit.Value > courseTypeRequirementView.TotalCredit.Value)
- {
- return "类型学分超标(" + courseTypeRequirementView.CourseTypeName + ":+"
- + (gradStudentCourseTypeCreditView.TotalCredit.Value
- - courseTypeRequirementView.TotalCredit.Value) + ")";
- }
- if (gradStudentCourseTypeCreditView.TotalCredit.Value < courseTypeRequirementView.TotalCredit.Value)
- {
- return "类型学分不足(" + courseTypeRequirementView.CourseTypeName + ":-"
- + (courseTypeRequirementView.TotalCredit.Value
- - gradStudentCourseTypeCreditView.TotalCredit.Value) + ")";
- }
- }
- }
- else
- {
- //限选、任选(大于等于)
- //校本课程(校本课程学分=校本课程(不包含俱乐部)+校本课程(包含俱乐部)且大于4只取4分)
- if (courseTypeRequirementView.IsSchoolbasedCurriculum.Value)
- {
- if (gradStudentScoreCreditView.SchoolbasedCredit.Value < courseTypeRequirementView.TotalCredit.Value)
- {
- return "校本课程学分不足(-" + (courseTypeRequirementView.TotalCredit.Value
- - gradStudentScoreCreditView.SchoolbasedCredit.Value).ToString() + ")";
- }
- }
- else
- {
- if (gradStudentCourseTypeCreditView.TotalCredit.Value < courseTypeRequirementView.TotalCredit.Value)
- {
- return "类型学分不足(" + courseTypeRequirementView.CourseTypeName + ":-"
- + (courseTypeRequirementView.TotalCredit.Value
- - gradStudentCourseTypeCreditView.TotalCredit.Value) + ")";
- }
- }
- }
- }
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 专业选修学分要求符合(大于等于)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GradSpecialtyOptionalCreditComplete(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //查询毕业课程类型设置信息List
- var graduationCourseTypeSettingList = GraduationConditionDAL.GraduationCourseTypeSettingRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (graduationCourseTypeSettingList == null || graduationCourseTypeSettingList.Count() <= 0)
- {
- throw new Exception("毕业课程类型设置未配置,请配置");
- }
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业专业学分信息View
- var gradGrademajorRequirementView = GraduationConditionDAL
- .GetGradGrademajorRequirementViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradGrademajorRequirementView == null)
- {
- return "未设置专业学分,请设置";
- }
- //查询对应的毕业学生成绩学分信息(根据学生信息)
- var gradStudentScoreCreditView = GraduationConditionDAL
- .GetGradStudentScoreCreditViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradStudentScoreCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- //对应的专业选修学分(选修学分=限选+任选)暂时是这样计算
- var specialtyOptionalCredit = gradStudentScoreCreditView.OptionalCourseCredit.Value
- + gradStudentScoreCreditView.FreeSelectionCourseCredit.Value;
- if (specialtyOptionalCredit < gradGrademajorRequirementView.OptionalCourseCredit.Value)
- {
- return "选修学分不足(-" + (gradGrademajorRequirementView.OptionalCourseCredit.Value
- - specialtyOptionalCredit).ToString() + ")";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 专业必修学分要求符合(等于)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GradSpecialtyRequiredCreditComplete(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //查询毕业课程类型设置信息List
- var graduationCourseTypeSettingList = GraduationConditionDAL.GraduationCourseTypeSettingRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (graduationCourseTypeSettingList == null || graduationCourseTypeSettingList.Count() <= 0)
- {
- throw new Exception("毕业课程类型设置未配置,请配置");
- }
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业专业学分信息View
- var gradGrademajorRequirementView = GraduationConditionDAL
- .GetGradGrademajorRequirementViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradGrademajorRequirementView == null)
- {
- return "未设置专业学分,请设置";
- }
- //查询对应的毕业学生成绩学分信息(根据学生信息)
- var gradStudentScoreCreditView = GraduationConditionDAL
- .GetGradStudentScoreCreditViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradStudentScoreCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- //对应的专业必修学分(必修学分=必修-实践环节(不包含俱乐部)- 实践环节学分(只包含俱乐部))
- var specialtyRequiredCredit = gradStudentScoreCreditView.RequiredCredit.Value
- - gradStudentScoreCreditView.PractiseNoClubCredit.Value
- - gradStudentScoreCreditView.PractiseClubCredit.Value;
- if (specialtyRequiredCredit > gradGrademajorRequirementView.RequiredCredit.Value)
- {
- return "必修学分超标(+" + (specialtyRequiredCredit
- - gradGrademajorRequirementView.RequiredCredit.Value).ToString() + ")";
- }
- if (specialtyRequiredCredit < gradGrademajorRequirementView.RequiredCredit.Value)
- {
- return "必修学分不足(-" + (gradGrademajorRequirementView.RequiredCredit.Value
- - specialtyRequiredCredit).ToString() + ")";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 专业总学分要求符合(大于等于)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GradSpecialtyTotalCreditComplete(Guid? userID)
- {
- try
- {
- //查询课程类型设置信息List
- var courseTypeSelectCourseTypeList = GraduationConditionDAL.CourseTypeSelectCourseTypeRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (courseTypeSelectCourseTypeList == null || courseTypeSelectCourseTypeList.Count() <= 0)
- {
- throw new Exception("课程类型设置未配置,请配置");
- }
- //查询毕业课程类型设置信息List
- var graduationCourseTypeSettingList = GraduationConditionDAL.GraduationCourseTypeSettingRepository
- .GetList(x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE).ToList();
- if (graduationCourseTypeSettingList == null || graduationCourseTypeSettingList.Count() <= 0)
- {
- throw new Exception("毕业课程类型设置未配置,请配置");
- }
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业专业学分信息View
- var gradGrademajorRequirementView = GraduationConditionDAL
- .GetGradGrademajorRequirementViewQueryable(expStudent)
- .SingleOrDefault();
- if (gradGrademajorRequirementView == null)
- {
- return "未设置专业学分,请设置";
- }
- //查询对应的毕业学生成绩学分信息(根据学生信息)
- var gradStudentScoreCreditView = GraduationConditionDAL
- .GetGradStudentScoreCreditViewQueryable(expStudent).SingleOrDefault();
- if (gradStudentScoreCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- //对应的专业总学分
- var specialtyTotalCredit = gradStudentScoreCreditView.TotalCredit.Value;
- if (specialtyTotalCredit < gradGrademajorRequirementView.TotalCredit.Value)
- {
- return "总学分不足(-" + (gradGrademajorRequirementView.TotalCredit.Value
- - specialtyTotalCredit).ToString() + ")";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 所修课程门数大于等于毕业门数且小于等于执行门数(毕业标准)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GraduationStandardCountComplete(Guid? userID)
- {
- try
- {
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业标准信息View
- var graduationStandardView = GraduationConditionDAL
- .GetGraduationStandardViewQueryable(expStudent).SingleOrDefault();
- if (graduationStandardView == null)
- {
- return "未设置毕业标准,请设置";
- }
- //查询对应的学生最终成绩学分信息View
- var finallyScorePersonalCreditView = GraduationConditionDAL
- .GetFinallyScorePersonalCreditViewQueryable(expStudent)
- .SingleOrDefault();
- if (finallyScorePersonalCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- if (finallyScorePersonalCreditView.CourseCount.Value < graduationStandardView.RequireCourseCount.Value)
- {
- return "所修课程门数不足(少" + (graduationStandardView.RequireCourseCount.Value
- - finallyScorePersonalCreditView.CourseCount.Value).ToString() + "门)";
- }
- if (finallyScorePersonalCreditView.CourseCount.Value > graduationStandardView.ExecCourseCount.Value)
- {
- return "所修课程门数超出(多" + (finallyScorePersonalCreditView.CourseCount.Value
- - graduationStandardView.ExecCourseCount.Value).ToString() + "门)";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 所修课程总学分大于等于毕业学分且小于等于执行学分(毕业标准)
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GraduationStandardCreditComplete(Guid? userID)
- {
- try
- {
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudent = expStudent.And(x => x.UserID == userID);
- //查询对应的毕业标准信息View
- var graduationStandardView = GraduationConditionDAL
- .GetGraduationStandardViewQueryable(expStudent).SingleOrDefault();
- if (graduationStandardView == null)
- {
- return "未设置毕业标准,请设置";
- }
- //查询对应的学生最终成绩学分信息View
- var finallyScorePersonalCreditView = GraduationConditionDAL
- .GetFinallyScorePersonalCreditViewQueryable(expStudent)
- .SingleOrDefault();
- if (finallyScorePersonalCreditView == null)
- {
- return "成绩为空";
- }
- else
- {
- if (finallyScorePersonalCreditView.TotalCredit.Value < graduationStandardView.GraduationCredit.Value)
- {
- return "所修课程总学分不足(少" + (graduationStandardView.GraduationCredit.Value
- - finallyScorePersonalCreditView.TotalCredit.Value).ToString() + "分)";
- }
- if (finallyScorePersonalCreditView.TotalCredit.Value > graduationStandardView.ExecutableCreditTotal.Value)
- {
- return "所修课程总学分超出(多" + (finallyScorePersonalCreditView.TotalCredit.Value
- - graduationStandardView.ExecutableCreditTotal.Value).ToString() + "分)";
- }
- }
- return "Pass";
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- /// <summary>
- /// 无欠缴学费记录
- /// </summary>
- /// <param name="userID"></param>
- /// <returns></returns>
- public string GradChargeComplete(Guid? userID)
- {
- try
- {
- var arrearListView = ArrearsListServices.GetArrearListView(userID);
- if (arrearListView == null)
- {
- //表示不欠费--欠费信息不存在
- return "Pass";
- }
- else
- {
- return "欠费(-" + Math.Round(arrearListView.AmountSum.Value, 1).ToString() + ")";
- }
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- }
- }
- }
|