12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Text;
- using Bowin.Common.Linq;
- using Bowin.Common.Linq.Entity;
- using EMIS.Entities;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.StudentChange;
- using EMIS.DataLogic.StudentManage.StudentChange;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.CommonLogic.StudentManage.StudentChange
- {
- public class ChangeTotalServices : BaseWorkflowServices<CF_DifferentDynamic>, IChangeTotalServices
- {
- public Lazy<StudentChangeDAL> StudentChangeDAL { get; set; }
- /// <summary>
- /// 查询对应的异动统计信息ChangeTotalView
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<ChangeTotalView> GetChangeTotalViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID, int pageIndex, int pageSize)
- {
- var endApproveStatusID = this.GetCorrectEndStatus();
- Expression<Func<CF_DifferentDynamic, bool>> expStudentChange = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudentChange = expStudentChange.And(x => x.ApprovalStatus == endApproveStatusID);
- if (schoolyearID.HasValue)
- {
- expStudentChange = expStudentChange.And(x => x.SchoolyearID == schoolyearID);
- }
-
- var query = StudentChangeDAL.Value.GetChangeTotalViewQueryable(expStudentChange);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CampusCode).ThenBy(x => x.CollegeNo).ToGridResultSet<ChangeTotalView>(pageIndex, pageSize);
-
- return result;
- }
- /// <summary>
- /// 查询对应的异动统计信息List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="schoolyearID"></param>
- /// <param name="campusID"></param>
- /// <param name="collegeID"></param>
- /// <returns></returns>
- public IList<ChangeTotalView> GetChangeTotalViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? campusID, Guid? collegeID)
- {
- var endApproveStatusID = this.GetCorrectEndStatus();
- Expression<Func<CF_DifferentDynamic, bool>> expStudentChange = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- expStudentChange = expStudentChange.And(x => x.ApprovalStatus == endApproveStatusID);
- if (schoolyearID.HasValue)
- {
- expStudentChange = expStudentChange.And(x => x.SchoolyearID == schoolyearID);
- }
- var query = StudentChangeDAL.Value.GetChangeTotalViewQueryable(expStudentChange);
- if (campusID.HasValue)
- {
- query = query.Where(x => x.CampusID == campusID);
- }
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- var result = this.GetQueryByDataRangeByCollege(query).OrderBy(x => x.CampusCode).ThenBy(x => x.CollegeNo).ToList();
- return result;
- }
- }
- }
|