123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Common.EvaluationManage;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.EvaluationManage.EvaluationEnter;
- using EMIS.ViewModel;
- using System.Linq.Expressions;
- using EMIS.Entities;
- using Bowin.Common.Linq;
- using Bowin.Common.Utility;
- using Bowin.Common.Mapping;
- using EMIS.CommonLogic.SystemServices;
- using Bowin.Common.JSON;
- using EMIS.Utility;
- using EMIS.DataLogic.SystemDAL;
- using EMIS.ViewModel.EvaluationManage;
- namespace EMIS.CommonLogic.EvaluationManage
- {
- public class EvaluationAdviseServices : BaseServices, IEvaluationAdviseServices
- {
- public EvaluationAdviseDAL EvaluationAdviseDAL { get; set; }
- public EvaluationRecordDAL EvaluationRecordDAL { get; set; }
- public EvaluationEnterDAL EvaluationEnterDAL { get; set; }
- public IGridResultSet<EvaluationAdviseView> GetEvaluationAdviseViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? collegeID, Guid? departmentID, Guid? evaluationTableID, Guid? typeID, Guid? staffID, int pageIndex, int pageSize)//, Guid? collegeID, Guid? departmentID
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- //var query = EvaluationEnterDAL.GetEvaluationEnterQuery();
- var query = EvaluationAdviseDAL.GetEvaluationAdviseQuery();
- if (curUser.CollegeID != null)//考虑到管理员院系ID为null
- {
- query = GetQueryByDataRangeByCollege(query);//以院系 区分
- }
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- query = query.Where(w => w.SchoolyearID == schoolyearID);
- }
- if (evaluationTableID.HasValue && evaluationTableID != Guid.Empty)
- {
- query = query.Where(w => w.EvaluationTableID == evaluationTableID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- query = query.Where(w => w.EvaluationTypeID == typeID);
- }
- if (collegeID.HasValue && collegeID != Guid.Empty)
- {
- query = query.Where(w => w.CollegeID == collegeID);
- }
- if (departmentID.HasValue && departmentID != Guid.Empty)
- {
- query = query.Where(w => w.DepartmentID == departmentID);
- }
- if (staffID.HasValue && staffID != Guid.Empty)
- {
- query = query.Where(w => w.Sys_User.Any(x => x.UserID == staffID));
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- query = query.OrderByDescending(w => w.SchoolyearCode);
- return query.ToGridResultSet<EvaluationAdviseView>(pageIndex, pageSize);
- //return query.ToGridResultSet<EvaluationAdviseView>(pageIndex, pageSize);
- }
- public IList<EvaluationAdviseView> GetEvaluationAdviseViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? collegeID, Guid? departmentID, Guid? evaluationTableID, Guid? typeID, Guid? staffID)//, Guid? collegeID, Guid? departmentID
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- //var query = EvaluationEnterDAL.GetEvaluationEnterQuery();
- var query = EvaluationAdviseDAL.GetEvaluationAdviseQuery();
- if (curUser.CollegeID != null)//考虑到管理员院系ID为null
- {
- query = GetQueryByDataRangeByCollege(query);//以院系 区分
- }
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- query = query.Where(w => w.SchoolyearID == schoolyearID);
- }
- if (evaluationTableID.HasValue && evaluationTableID != Guid.Empty)
- {
- query = query.Where(w => w.EvaluationTableID == evaluationTableID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- query = query.Where(w => w.EvaluationTypeID == typeID);
- }
- if (collegeID.HasValue && collegeID != Guid.Empty)
- {
- query = query.Where(w => w.CollegeID == collegeID);
- }
- if (departmentID.HasValue && departmentID != Guid.Empty)
- {
- query = query.Where(w => w.DepartmentID == departmentID);
- }
- if (staffID.HasValue && staffID != Guid.Empty)
- {
- query = query.Where(w => w.Sys_User.Any(x => x.UserID == staffID));
- }
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- query = query.OrderByDescending(w => w.CourseCode);
- return query.ToList();
- }
- public IGridResultSet<EvaluationAdviseView> GetMyEvaluationViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? coursematerialID, Guid? evaluationTableID, Guid? typeID, Guid? staffID, int pageIndex, int pageSize)//, Guid? collegeID, Guid? departmentID
- {
- int paramterTypeID = (int)CF_ParameterType.EvaluationSensitiveWord;
- var paraquery = from a in EvaluationAdviseDAL.parameterRepository.GetList(x => x.ParameterTypeID == paramterTypeID)
- select new
- {
- Value = a.Value,
- };
- //List<String> valueList = new List<string>();
- List<String> sArray = new List<string>();
- //var values = paraquery.FirstOrDefault().Value;
- if (paraquery != null)
- {
- var values = paraquery.FirstOrDefault().Value;
- sArray = values.Split('|').ToList();
- //for (int i = 0; i < values.Split('|').Length; i++)
- //{
- // string id = values.Split('|')[i];
- // if (!string.IsNullOrEmpty(id))
- // {
- // valueList.Add(id);
- // }
- //}
- }
- else {
- sArray = null;
- }
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- //var query = EvaluationEnterDAL.GetEvaluationEnterQuery();
- Expression<Func<EM_EducationMissionClass, bool>> emcexp = x => true;
- Expression<Func<EM_EducationMission, bool>> emexp = x => true;
- Expression<Func<EM_EvaluationEnter, bool>> eeexp = x => true;
- Expression<Func<EM_EvaluationTable, bool>> etexp = x => true;
- //var query = EvaluationEnterDAL.GetEvaluationEnterQuery();
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- emexp = emexp.And(x => x.SchoolyearID == schoolyearID);
- }
- if (evaluationTableID.HasValue && evaluationTableID != Guid.Empty)
- {
- eeexp = eeexp.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- etexp = etexp.And(x => x.EvaluationTypeID == typeID);
- }
- if (coursematerialID.HasValue && coursematerialID != Guid.Empty)
- {
- emcexp = emcexp.And(x => x.CoursematerialID == coursematerialID);
- }
- var query = EvaluationAdviseDAL.GetMyEvaluationQuery(emcexp, emexp, eeexp, etexp);
- if (staffID.HasValue && staffID != Guid.Empty)
- {
- query = query.Where(w => w.Sys_User.Any(x => x.UserID == staffID));
- }
- //不知道是否需要数据范围
- //if (curUser.CollegeID != null)//考虑到管理员院系ID为null
- //{
- // query = GetQueryByDataRangeByCollege(query);//以院系 区分
- //}
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- query = query.OrderByDescending(w => w.SchoolyearCode);
- //query.ToList().ForEach(x => x.Remark = (sArray != null ? (sArray.Any(y => x.Remark.Contains(y.ToString())) ? "" : x.Remark) : x.Remark));
- var result = query.ToGridResultSet<EvaluationAdviseView>(pageIndex, pageSize);
- result.rows.ForEach(x => x.Remark = (sArray != null ? (sArray.Any(y => x.Remark.Contains(y.ToString())) ? "" : x.Remark) : x.Remark));
- return result;
- //return query.ToGridResultSet<EvaluationAdviseView>(pageIndex, pageSize);
- }
- public IList<EvaluationAdviseView> GetMyEvaluationViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? coursematerialID, Guid? evaluationTableID, Guid? typeID, Guid? staffID)//, Guid? collegeID, Guid? departmentID
- {
- var curUser = EMIS.Utility.FormValidate.CustomPrincipal.Current;
- Expression<Func<EM_EducationMissionClass, bool>> emcexp = x => true;
- Expression<Func<EM_EducationMission, bool>> emexp = x => true;
- Expression<Func<EM_EvaluationEnter, bool>> eeexp = x => true;
- Expression<Func<EM_EvaluationTable, bool>> etexp = x => true;
- //var query = EvaluationEnterDAL.GetEvaluationEnterQuery();
-
-
- if (schoolyearID.HasValue && schoolyearID != Guid.Empty)
- {
- emexp = emexp.And(x => x.SchoolyearID == schoolyearID);
- }
- if (evaluationTableID.HasValue && evaluationTableID != Guid.Empty)
- {
- eeexp = eeexp.And(x => x.EvaluationTableID == evaluationTableID);
- }
- if (typeID.HasValue && typeID != Guid.Empty)
- {
- etexp = etexp.And(x => x.EvaluationTypeID == typeID);
- }
- if (coursematerialID.HasValue && coursematerialID != Guid.Empty)
- {
- emcexp = emcexp.And(x => x.CoursematerialID == coursematerialID);
- }
- var query = EvaluationAdviseDAL.GetMyEvaluationQuery(emcexp, emexp, eeexp, etexp);
- if (staffID.HasValue && staffID != Guid.Empty)
- {
- query = query.Where(w => w.Sys_User.Any(x => x.UserID == staffID));
- }
- //不知道是不是需要数据范围
- //if (curUser.CollegeID != null)//考虑到管理员院系ID为null
- //{
- // query = GetQueryByDataRangeByCollege(query);//以院系 区分
- //}
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- query = query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue);
- query = query.OrderByDescending(x => x.SchoolyearCode);
- return query.ToList();
- }
- public void Delete(List<Guid> ids)
- {
-
-
- }
- }
- }
|