/// <summary>
        /// 根据学期Id和班级Id等查询条件获取学生考勤核对信息
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2019-03-13</para>
        /// </summary>
        /// <param name="searchRequest">考勤查询条件</param>
        /// <returns>获取学生考勤核对信息列表</returns>
        public async Task <StudentAttendCheckResponse> GetStudentAttendanceList(StudentAttendSearchRequest searchRequest)
        {
            var result = new StudentAttendCheckResponse();
            //获取校区学生的当前学期的课程信息
            var studentLessonList = await _attendanceRepository.Value.GetStudentAttendListAsync(_schoolId, searchRequest);

            if (studentLessonList != null && studentLessonList.Count > 0)
            {
                result.DateInfos         = GetLessonDateInfo(studentLessonList);          //获取课程日期集合
                result.StudentAttendList = await GetStudentAttendList(studentLessonList); //获取班级学生的考勤信息
            }
            return(result);
        }
        /// <summary>
        /// 根据学期Id和班级Id等查询条件获取学生考勤统计表信息
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2019-03-04</para>
        /// </summary>
        /// <param name="searchRequest">考勤查询条件</param>
        /// <returns>获取学生考勤统计表</returns>
        public async Task <StudentAttendReportResponse> GetStudentAttendanceReport(StudentAttendSearchRequest searchRequest)
        {
            var result = new StudentAttendReportResponse();
            //获取校区学生的当前学期的课程信息
            var studentLessonList = await _attendanceRepository.Value.GetAttendListByFinanceAsync(_schoolId, searchRequest);

            if (studentLessonList != null && studentLessonList.Count > 0)
            {
                //获取所有老师信息
                var teacherInfoList = TeachService.GetTeachers();
                var lessonList      = studentLessonList.Where(a => (searchRequest.Month > 0 && a.ClassDate.Year == searchRequest.Year && a.ClassDate.Month == searchRequest.Month) ||
                                                              searchRequest.Month == 0).ToList();
                result.DateInfos         = GetLessonDateInfo(lessonList);                                                                           //获取课程日期集合
                result.StudentAttendList = await GetStudentAttendList(studentLessonList, teacherInfoList, searchRequest.Year, searchRequest.Month); //获取班级学生的考勤信息

                result.TeacherAttendList = GetTeacherAttendList(studentLessonList, teacherInfoList, searchRequest.Year, searchRequest.Month);       //获取班级老师的考勤信息
            }
            return(result);
        }
示例#3
0
 public async Task <StudentAttendReportResponse> GetStudentAttendanceReport([FromQuery] StudentAttendSearchRequest searchRequest)
 {
     return(await new AttendanceService(base.SchoolId).GetStudentAttendanceReport(searchRequest));
 }
示例#4
0
        /// <summary>
        /// 根据校区Id、学生Id和学生考勤查询条件获取学生考勤信息
        /// <para>作    者:郭伟佳</para>
        /// <para>创建时间:2018-11-06</para>
        /// </summary>
        /// <param name="schoolId">校区Id</param>
        /// <param name="request">学生考勤请求对象</param>
        /// <returns>学生考勤信息列表</returns>
        public async Task <List <ViewStudentAttendance> > GetAttendListByFinanceAsync(string schoolId, StudentAttendSearchRequest request)
        {
            StringBuilder querySql = new StringBuilder();

            querySql.Append(LESSON_STUDENT_FINANCE_SQL);
            querySql.Append(@" WHERE  A.SCHOOLID = @SchoolId ");
            //过滤校区
            List <SqlParameter> parameterList = new List <SqlParameter>()
            {
                new SqlParameter("@SchoolId", schoolId)
            };

            //过滤学期
            if (request.TermId.HasValue)
            {
                querySql.Append(" AND A.TERMID = @TermId ");
                parameterList.Add(new SqlParameter("@TermId", request.TermId.Value));
            }
            //过滤班级
            if (request.ClassId.HasValue)
            {
                querySql.Append(" AND A.CLASSID = @ClassId ");
                parameterList.Add(new SqlParameter("@ClassId", request.ClassId.Value));
            }
            return(await CurrentContext.ViewStudentAttendance.FromSql(querySql.ToString(), parameterList.ToArray()).ToListAsync());
        }