123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Linq.Expressions;
- using Bowin.Common.Linq;
- using Bowin.Common.Data;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EvaluationManage.StudentEvaluation;
- using EMIS.DataLogic.EvaluationManage.StudentEvaluation;
- using EMIS.CommonLogic.StudentManage.StudentStatistics;
- namespace EMIS.CommonLogic.EvaluationManage.StudentEvaluation
- {
- public class EvaluationStudentSettingDetailServices : BaseServices, IEvaluationStudentSettingDetailServices
- {
- public EvaluationStudentSettingDAL EvaluationStudentSettingDAL { get; set; }
- public Lazy<IInSchoolSettingServices> InSchoolSettingServices { get; set; }
- /// <summary>
- /// 查询对应的学评名单信息View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="departmentID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="evaluationTableID"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="openState"></param>
- /// <param name="isEvaluation"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<EvaluationStudentSettingDetailView> GetEvaluationStudentSettingDetailViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- Guid? departmentID, Guid? coursematerialID, int? courseTypeID, int? teachingModeID, Guid? staffID, Guid? evaluationTableID, int? inSchoolStatus, int? openState, int? isEvaluation, int pageIndex, int pageSize)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (staffID.HasValue)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.UserID == staffID);
- }
- if (evaluationTableID.HasValue)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (openState.HasValue)
- {
- if (openState.Value == (int)CF_GeneralPurpose.IsYes)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
- }
- if (openState.Value == (int)CF_GeneralPurpose.IsNo)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState != true);
- }
- }
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (coursematerialID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CourseTypeID == courseTypeID);
- }
- if (teachingModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.TeachingModeID == teachingModeID);
- }
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolyearID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.SchoolyearID == schoolyearID);
- }
- if (collegeID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.DepartmentID == departmentID);
- }
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationStudentSettingDAL.GetEvaluationStudentSettingDetailViewQueryable(expEvaluationStudentSetting, expEducationMissionClass, expEducationMission, expStudent);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (isEvaluation.HasValue)
- {
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsYes)
- {
- query = query.Where(x => x.IsEvaluation == true);
- }
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsNo)
- {
- query = query.Where(x => x.IsEvaluation != true);
- }
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length).ThenBy(x => x.DepartmentNo)
- .ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ThenBy(x => x.StudentNo).ToGridResultSet<EvaluationStudentSettingDetailView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询对应的学评名单信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="departmentID"></param>
- /// <param name="coursematerialID"></param>
- /// <param name="courseTypeID"></param>
- /// <param name="teachingModeID"></param>
- /// <param name="staffID"></param>
- /// <param name="evaluationTableID"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="openState"></param>
- /// <param name="isEvaluation"></param>
- /// <returns></returns>
- public IList<EvaluationStudentSettingDetailView> GetEvaluationStudentSettingDetailViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID,
- Guid? departmentID, Guid? coursematerialID, int? courseTypeID, int? teachingModeID, Guid? staffID, Guid? evaluationTableID, int? inSchoolStatus, int? openState, int? isEvaluation)
- {
- Expression<Func<EM_EvaluationStudentSetting, bool>> expEvaluationStudentSetting = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (staffID.HasValue)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.UserID == staffID);
- }
- if (evaluationTableID.HasValue)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (openState.HasValue)
- {
- if (openState.Value == (int)CF_GeneralPurpose.IsYes)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState == true);
- }
- if (openState.Value == (int)CF_GeneralPurpose.IsNo)
- {
- expEvaluationStudentSetting = expEvaluationStudentSetting.And(x => x.OpenState != true);
- }
- }
- Expression<Func<EM_EducationMissionClass, bool>> expEducationMissionClass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (coursematerialID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CoursematerialID == coursematerialID);
- }
- if (courseTypeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.CourseTypeID == courseTypeID);
- }
- if (teachingModeID.HasValue)
- {
- expEducationMissionClass = expEducationMissionClass.And(x => x.TeachingModeID == teachingModeID);
- }
- Expression<Func<EM_EducationMission, bool>> expEducationMission = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (schoolyearID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.SchoolyearID == schoolyearID);
- }
- if (collegeID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.CollegeID == collegeID);
- }
- if (departmentID.HasValue)
- {
- expEducationMission = expEducationMission.And(x => x.DepartmentID == departmentID);
- }
- Expression<Func<CF_Student, bool>> expStudent = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.Value.GetInschoolStatusList(true);
- if (inSchoolStatus == 1)
- {
- expStudent = expStudent.And(x => inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- if (inSchoolStatus == 0)
- {
- expStudent = expStudent.And(x => !inschoolStatusList.Contains(x.InSchoolStatusID));
- }
- }
- var query = EvaluationStudentSettingDAL.GetEvaluationStudentSettingDetailViewQueryable(expEvaluationStudentSetting, expEducationMissionClass, expEducationMission, expStudent);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (isEvaluation.HasValue)
- {
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsYes)
- {
- query = query.Where(x => x.IsEvaluation == true);
- }
- if (isEvaluation.Value == (int)CF_GeneralPurpose.IsNo)
- {
- query = query.Where(x => x.IsEvaluation != true);
- }
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByDepartment(query, x => x.DepartmentID).OrderBy(x => x.SchoolyearValue).ThenBy(x => x.DepartmentNo.Length).ThenBy(x => x.DepartmentNo)
- .ThenBy(x => x.CourseCode.Length).ThenBy(x => x.CourseCode).ThenBy(x => x.CourseTypeID).ThenBy(x => x.TeachingModeID).ThenBy(x => x.StudentNo).ToList();
- }
- }
- }
|