|  | @@ -0,0 +1,67 @@
 | 
	
		
			
				|  |  | +package com.ym.mec.web.controller.school;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.school.dto.TeacherAttendanceDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.school.dto.TeacherAttendanceListDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.school.dto.TeacherAttendanceSumDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.school.page.TeacherAttendanceQueryDto;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.dal.school.page.TeacherAttendanceQueryInfo;
 | 
	
		
			
				|  |  | +import com.ym.mec.biz.service.TeacherAttendanceService;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.controller.BaseController;
 | 
	
		
			
				|  |  | +import com.ym.mec.common.entity.HttpResponseResult;
 | 
	
		
			
				|  |  | +import io.swagger.annotations.*;
 | 
	
		
			
				|  |  | +import org.apache.commons.collections.CollectionUtils;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.PostMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.Collection;
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@RequestMapping("schoolTeacherAttendance")
 | 
	
		
			
				|  |  | +@Api(tags = "学校端教师考勤服务")
 | 
	
		
			
				|  |  | +@RestController
 | 
	
		
			
				|  |  | +public class SchoolTeacherAttendanceController extends BaseController {
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private TeacherAttendanceService teacherAttendanceService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "首页教师考勤列表查询----获取本学期课程关联的老师列表,以及老师考勤状况汇总")
 | 
	
		
			
				|  |  | +    @PostMapping("/queryTeacherAttendance")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<List<TeacherAttendanceSumDto>> queryTeacherAttendance(TeacherAttendanceQueryInfo queryInfo){
 | 
	
		
			
				|  |  | +        return succeed(teacherAttendanceService.queryTeacherAttendance(queryInfo));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取单个老师本学期考勤汇总")
 | 
	
		
			
				|  |  | +    @PostMapping("/getTeacherAttendance")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<TeacherAttendanceSumDto> getTeacherAttendance(TeacherAttendanceQueryDto queryDto){
 | 
	
		
			
				|  |  | +        TeacherAttendanceQueryInfo queryInfo = new TeacherAttendanceQueryInfo();
 | 
	
		
			
				|  |  | +        queryInfo.setSchoolId(queryDto.getSchoolId());
 | 
	
		
			
				|  |  | +        queryInfo.setTeacherId(queryDto.getTeacherId());
 | 
	
		
			
				|  |  | +        queryInfo.setClassGroupId(queryDto.getClassGroupId());
 | 
	
		
			
				|  |  | +        List<TeacherAttendanceSumDto> sumDtos = teacherAttendanceService.queryTeacherAttendance(queryInfo);
 | 
	
		
			
				|  |  | +        return succeed(CollectionUtils.isEmpty(sumDtos)?new TeacherAttendanceSumDto():sumDtos.get(0));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiImplicitParams({
 | 
	
		
			
				|  |  | +            @ApiImplicitParam(name = "courseId", dataType = "Long", required = true, value = "课程编号"),
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "课时获取单节课老师考勤详情----获取课程老师考勤")
 | 
	
		
			
				|  |  | +    @GetMapping("/getCourseTeacherAttendance")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<TeacherAttendanceDto> getCourseTeacherAttendance(Long courseId) {
 | 
	
		
			
				|  |  | +        return succeed(teacherAttendanceService.getCourseTeacherAttendance(courseId));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @ApiImplicitParams({
 | 
	
		
			
				|  |  | +            @ApiImplicitParam(name = "classGroupId", dataType = "Integer", required = true, value = "班级编号"),
 | 
	
		
			
				|  |  | +            @ApiImplicitParam(name = "teacherId", dataType = "Integer", required = true, value = "老师编号"),
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +    @ApiOperation(value = "获取单个老师所在班级考勤列表----获取本学期当前班级老师所有课程考勤")
 | 
	
		
			
				|  |  | +    @GetMapping("/getClassTeacherAttendance")
 | 
	
		
			
				|  |  | +    public HttpResponseResult<List<TeacherAttendanceListDto>> getClassTeacherAttendance(Integer classGroupId, Integer teacherId) {
 | 
	
		
			
				|  |  | +        return succeed(teacherAttendanceService.getClassTeacherAttendance(classGroupId,teacherId));
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +}
 |