/// <summary> /// 根据学生姓名查询学生信息 /// <para>作 者:Huang GaoLiang </para> /// <para>创建时间: 2018-10-29 </para> /// </summary> /// <param name="keyWord">学生名称或手机号</param> /// <param name="companyId">当前登录的用户</param> /// <returns>返回学生集合</returns> public static List <StudentSearchResponse> GetListBykeyWord(string keyWord, string companyId = null) { // 1、根据学生名称模糊或者电话号码查询学生名称信息 List <ViewStudent> sList = new ViewStudentRepository().GetViewStudentListByKeyWord(keyWord, companyId); List <long> ids = sList.Select(m => m.StudentId).ToList(); List <TblCstSchoolStudent> cList = new TblCstSchoolStudentRepository().GetSchoolIdByStudentIds(ids); // 2、所有的校区信息 List <SchoolResponse> schoolList = new OrgService().GetAllSchoolList(); // 3、组合数据 List <StudentSearchResponse> list = (from stu in sList select new StudentSearchResponse { StudentId = stu.StudentId, StudentName = stu.StudentName, Sex = stu.Sex, SexName = EnumName.GetDescription(typeof(SexEnum), stu.Sex), Age = Age.GetAge(stu.Birthday), Birthday = stu.Birthday, LinkMobile = stu.LinkMobile, ContactPersonMobile = string.IsNullOrEmpty(stu.ContactPersonMobile) ? "" : Regex.Replace(stu.ContactPersonMobile, "(\\d{3})\\d{4}(\\d{4})", "$1****$2"), //只截取第一个监护人手机号 Company = GetCompanyName(stu.StudentId, schoolList, cList), SchoolName = GetSchoolNameByStuId(stu.StudentId, schoolList, cList) }).ToList(); return(list.ToList()); }
/// <summary> /// 学生在读状态更新任务 /// <para>作 者:Huang GaoLiang </para> /// <para>创建时间:2018-11-12 </para> /// </summary> public static async Task RunStudentStatusJob() { // 1、获取所有的校区 List <TblCstSchoolStudent> schools = new TblCstSchoolStudentRepository().LoadList(m => true).ToList(); // 2、以校区为单位,更新校区学生的剩余课次和学生的在读态度 foreach (TblCstSchoolStudent s in schools) { //2.1、根据校区编号和学生编号获取学生的剩余课次 s.RemindClassTimes = new StudentTimetableService(s.SchoolId, s.StudentId).GetStudentRemindClassTimes(); await new TblCstSchoolStudentRepository().UpdateStudyRemindClassTimes(s); // 更新学生的剩余课次 await UpdateStuStudyStatus(s, schools); //更新学生的学生状态 } }
/// <summary> /// 根据学生编号查询学生所在的校区编号 /// <para>作 者: Huang GaoLiang </para> /// <para>创建时间: 2019-03-08 </para> /// </summary> /// <param name="studentIds">学生编号</param> /// <returns>返回校区编号集合</returns> internal static List <TblCstSchoolStudent> GetStudentSchoolList(List <long> studentIds) { List <TblCstSchoolStudent> schoolIds = new TblCstSchoolStudentRepository().GetSchoolIdByStudentIds(studentIds).ToList(); return(schoolIds); }