123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.ChargeManage.ChargeSituation;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using Bowin.Common.Linq;
- using EMIS.DataLogic.ChargeManage.ChargeSituation;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.StudentManage.StudentStatistics;
- namespace EMIS.CommonLogic.ChargeManage.ChargeSituation
- {
- public class ChargeAggregateServices:BaseServices,IChargeAggregateServices
- {
- public ChargeAggregateDAL ChargeAggregateDAL { get; set; }
- public IInSchoolSettingServices InSchoolSettingServices { get; set; }
- public IChargeDelayServices IChargeDelayServices { get; set; }
- /// <summary>
- /// 查询费用明细View
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="collegeID"></param>
- /// <param name="yearID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="chargeYearID"></param>
- /// <param name="chargeProjectID"></param>
- /// <param name="inSchoolStatus"></param>
- /// <param name="pageIndex"></param>
- /// <param name="pageSize"></param>
- /// <returns></returns>
- public IGridResultSet<ChargeAggregateView> GetChargeAggregateViewGrid(ConfiguretView configuretView, Guid? collegeID,
- int? yearID, int? standardID, int? educationID, int? learningformID, string learnSystem,
- int? chargeYearID, Guid? chargeProjectID, int? inSchoolStatus, int pageIndex, int pageSize)
- {
- //查询对应的全部流程环节信息(WorkflowStatusView)
- var chargeDelayWorkflowStatusView = IChargeDelayServices.GetStatusViewList();
- if (chargeDelayWorkflowStatusView == null || chargeDelayWorkflowStatusView.Count() <= 0)
- {
- throw new Exception("工作流平台中,费用缓交流程未配置,请核查");
- }
- //查询缓交申请工作流程结束环节状态ID(通过)
- var chargeDelayEndtStatus = IChargeDelayServices.GetCorrectEndStatus();
- if (chargeDelayEndtStatus == null)
- {
- throw new Exception("工作流平台中,费用缓交结束环节流程未配置,请核查");
- }
- //应收名单
- Expression<Func<EC_StudentCharge, bool>> expStudentCharge = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (chargeYearID.HasValue)
- {
- expStudentCharge = expStudentCharge.And(x => x.ChargeYear == chargeYearID);
- }
- if (chargeProjectID.HasValue)
- {
- expStudentCharge = expStudentCharge.And(x => x.ChargeProjectID == chargeProjectID);
- }
-
- //缓交信息
- Expression<Func<EC_ChargeDelay, bool>> expChargeDelayPass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //缓交申请(审核通过)
- expChargeDelayPass = expChargeDelayPass.And(x => x.RecordStatus == chargeDelayEndtStatus);
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => true);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.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 = ChargeAggregateDAL.GetChargeAggregateView(expStudentCharge, expChargeDelayPass, expStudent);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (yearID.HasValue)
- {
- query = query.Where(x => x.GradeStr == yearID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query)
- .OrderBy(x => x.StudentNo.Length).ThenBy(x => x.StudentNo)
- .ThenBy(x => x.ClassNo.Length).ThenBy(x => x.ClassNo)
- .ThenBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode)
- .ToGridResultSet<ChargeAggregateView>(pageIndex, pageSize);
- }
- /// <summary>
- /// 查询费用明细List
- /// </summary>
- /// <param name="configuretView"></param>
- /// <param name="collegeID"></param>
- /// <param name="yearID"></param>
- /// <param name="standardID"></param>
- /// <param name="educationID"></param>
- /// <param name="learningformID"></param>
- /// <param name="learnSystem"></param>
- /// <param name="chargeYearID"></param>
- /// <param name="chargeProjectID"></param>
- /// <param name="inSchoolStatus"></param>
- /// <returns></returns>
- public List<ChargeAggregateView> GetChargeAggregateViewList(ConfiguretView configuretView, Guid? collegeID,
- int? yearID, int? standardID, int? educationID, int? learningformID, string learnSystem,
- int? chargeYearID, Guid? chargeProjectID, int? inSchoolStatus)
- {
- //查询对应的全部流程环节信息(WorkflowStatusView)
- var chargeDelayWorkflowStatusView = IChargeDelayServices.GetStatusViewList();
- if (chargeDelayWorkflowStatusView == null || chargeDelayWorkflowStatusView.Count() <= 0)
- {
- throw new Exception("工作流平台中,费用缓交流程未配置,请核查");
- }
- //查询缓交申请工作流程结束环节状态ID(通过)
- var chargeDelayEndtStatus = IChargeDelayServices.GetCorrectEndStatus();
- if (chargeDelayEndtStatus == null)
- {
- throw new Exception("工作流平台中,费用缓交结束环节流程未配置,请核查");
- }
- //应收名单
- Expression<Func<EC_StudentCharge, bool>> expStudentCharge = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- if (chargeYearID.HasValue)
- {
- expStudentCharge = expStudentCharge.And(x => x.ChargeYear == chargeYearID);
- }
- if (chargeProjectID.HasValue)
- {
- expStudentCharge = expStudentCharge.And(x => x.ChargeProjectID == chargeProjectID);
- }
- //缓交信息
- Expression<Func<EC_ChargeDelay, bool>> expChargeDelayPass = (x => x.RecordStatus > (int)SYS_STATUS.UNUSABLE);
- //缓交申请(审核通过)
- expChargeDelayPass = expChargeDelayPass.And(x => x.RecordStatus == chargeDelayEndtStatus);
- //学生信息
- Expression<Func<CF_Student, bool>> expStudent = (x => true);
- if (inSchoolStatus != null && inSchoolStatus > -1)
- {
- var inschoolStatusList = InSchoolSettingServices.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 = ChargeAggregateDAL.GetChargeAggregateView(expStudentCharge, expChargeDelayPass, expStudent);
- if (collegeID.HasValue)
- {
- query = query.Where(x => x.CollegeID == collegeID);
- }
- if (yearID.HasValue)
- {
- query = query.Where(x => x.GradeStr == yearID);
- }
- if (standardID.HasValue)
- {
- query = query.Where(x => x.StandardID == standardID);
- }
- if (educationID.HasValue)
- {
- query = query.Where(x => x.EducationID == educationID);
- }
- if (learningformID.HasValue)
- {
- query = query.Where(x => x.LearningformID == learningformID);
- }
- if (!string.IsNullOrEmpty(learnSystem) && learnSystem != "-1")
- {
- var LearnSystems = Convert.ToDecimal(learnSystem);
- query = query.Where(x => x.LearnSystem == LearnSystems);
- }
- //查询条件
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- {
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue.Trim());
- }
- return this.GetQueryByDataRangeByCollege(query)
- .OrderBy(x => x.StudentNo.Length).ThenBy(x => x.StudentNo)
- .ThenBy(x => x.ClassNo.Length).ThenBy(x => x.ClassNo)
- .ThenBy(x => x.CollegeCode.Length).ThenBy(x => x.CollegeCode)
- .ToList();
- }
- }
- }
|