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; }
///
/// 查询毕业条件信息View
///
///
///
///
///
///
public IGridResultSet GraduationConditionViewGrid(ConfiguretView configuretView, int? isCurrent,
int pageIndex, int pageSize)
{
//毕业条件
Expression> 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(pageIndex, pageSize);
}
///
/// 查询毕业条件信息List
///
///
///
///
public List GetGraduationViewList(ConfiguretView configuretView, int? isCurrent)
{
//毕业条件
Expression> 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();
}
///
/// 根据毕业条件ID查询对应毕业条件GraduationConditionView
///
///
///
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);
}
}
///
/// 编辑
///
///
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);
}
}
///
/// 无条件
///
///
///
public string NoCondition(Guid? userID)
{
return "Pass";
}
///
/// 所修课程(必修、限选)要求符合专业计划(不包括俱乐部课程)
///
///
///
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> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
expStudent = expStudent.And(x => x.UserID == userID);
//课程类型设置表(必修、限选)
Expression> 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);
}
}
///
/// 所修课程(必修,不包括俱乐部课程)成绩要求全部及格(>=60)
///
///
///
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> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
expStudent = expStudent.And(x => x.UserID == userID);
//课程类型设置表(必修)
Expression> 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);
}
}
///
/// 毕业课程要求修习且及格(>=60)
///
///
///
public string GraduationCourseComplete(Guid? userID)
{
try
{
//学生信息
Expression> 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);
}
}
///
/// 毕业设计(论文)课程要求修习且及格(>=60分)
///
///
///
public string GraduateDesignCourseComplete(Guid? userID)
{
try
{
//学生信息
Expression> 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);
}
}
///
/// 类型(课程类型)学分要求符合(等于或大于等于)
/// 注:实践环节学分=实践环节(不包含俱乐部)+实践环节(包含俱乐部)且大于4只取4分
/// 校本课程学分=校本课程(不包含俱乐部)+校本课程(包含俱乐部)且大于4只取4分
///
///
///
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> 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);
}
}
///
/// 专业选修学分要求符合(大于等于)
///
///
///
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> 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);
}
}
///
/// 专业必修学分要求符合(等于)
///
///
///
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> 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);
}
}
///
/// 专业总学分要求符合(大于等于)
///
///
///
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> 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);
}
}
///
/// 所修课程门数大于等于毕业门数且小于等于执行门数(毕业标准)
///
///
///
public string GraduationStandardCountComplete(Guid? userID)
{
try
{
//学生信息
Expression> 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);
}
}
///
/// 所修课程总学分大于等于毕业学分且小于等于执行学分(毕业标准)
///
///
///
public string GraduationStandardCreditComplete(Guid? userID)
{
try
{
//学生信息
Expression> 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);
}
}
///
/// 无欠缴学费记录
///
///
///
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);
}
}
}
}