|  | @@ -1192,15 +1192,23 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 | 
	
		
			
				|  |  |  			Date now = new Date();
 | 
	
		
			
				|  |  |  			String monday = DateUtil.dateToString(DateUtil.getWeekDayWithDate(now, Calendar.MONDAY), DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  |  			String sunday = DateUtil.dateToString(DateUtil.getWeekDayWithDate(now, Calendar.SUNDAY), DateUtil.ISO_EXPANDED_DATE_FORMAT);
 | 
	
		
			
				|  |  | +			//获取本周考勤列表
 | 
	
		
			
				|  |  |  			TeacherAttendanceQueryInfo info = new TeacherAttendanceQueryInfo();
 | 
	
		
			
				|  |  |  			info.setStartTerm(monday);
 | 
	
		
			
				|  |  |  			info.setEndTerm(sunday);
 | 
	
		
			
				|  |  |  			info.setMusicGroupIds(queryInfo.getMusicGroupIds());
 | 
	
		
			
				|  |  |  			List<TeacherAttendanceWrapper.CourseTeacherAttendance> courseTeacherAttendances = teacherAttendanceDao.queryTeacherAttendanceForWeek(info);
 | 
	
		
			
				|  |  | +			//获取本学期考勤
 | 
	
		
			
				|  |  | +			info.setStartTerm(startTerm);
 | 
	
		
			
				|  |  | +			info.setEndTerm(endTerm);
 | 
	
		
			
				|  |  | +			info.setMusicGroupIds(queryInfo.getMusicGroupIds());
 | 
	
		
			
				|  |  | +			List<TeacherAttendanceWrapper.CourseTeacherAttendance> termCourseTeacherAttendances = teacherAttendanceDao.queryTeacherAttendanceForWeek(info);
 | 
	
		
			
				|  |  |  			Map<Integer, List<TeacherAttendanceWrapper.CourseTeacherAttendance>> attendanceMap = new HashMap<>(dtoList.size());
 | 
	
		
			
				|  |  | +			Map<Integer, List<TeacherAttendanceWrapper.CourseTeacherAttendance>> termAttendanceMap = new HashMap<>(dtoList.size());
 | 
	
		
			
				|  |  |  			Map<Integer, School> idSchoolMap = new HashMap<>();
 | 
	
		
			
				|  |  |  			if(CollectionUtils.isNotEmpty(courseTeacherAttendances)){
 | 
	
		
			
				|  |  |  				attendanceMap = courseTeacherAttendances.stream().collect(Collectors.groupingBy(e -> e.getActualTeacherId()));
 | 
	
		
			
				|  |  | +				termAttendanceMap = termCourseTeacherAttendances.stream().collect(Collectors.groupingBy(e -> e.getActualTeacherId()));
 | 
	
		
			
				|  |  |  				Set<Integer> schoolIds = courseTeacherAttendances.stream().map(TeacherAttendanceWrapper.CourseTeacherAttendance::getSchoolId).collect(Collectors.toSet());
 | 
	
		
			
				|  |  |  				if(schoolIds != null && schoolIds.size() > 0){
 | 
	
		
			
				|  |  |  					List<School> schools = schoolDao.getSchools(new ArrayList<>(schoolIds));
 | 
	
	
		
			
				|  | @@ -1217,15 +1225,15 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 | 
	
		
			
				|  |  |  				if(CollectionUtils.isNotEmpty(attendances)){
 | 
	
		
			
				|  |  |  					dto.setTeacherAttendanceStatus(TeacherAttendanceQueryInfo.TeacherAttendanceEnum.NORMAL);
 | 
	
		
			
				|  |  |  					att:for (TeacherAttendanceWrapper.CourseTeacherAttendance attendance : attendances) {
 | 
	
		
			
				|  |  | -						if(attendance.getCourseStatus() == CourseStatusEnum.NOT_START){
 | 
	
		
			
				|  |  | -							continue att;
 | 
	
		
			
				|  |  | -						}
 | 
	
		
			
				|  |  |  						if(attendance.getSignInStatus() == 0 || attendance.getSignOutStatus() == 0){
 | 
	
		
			
				|  |  |  							dto.setTeacherAttendanceStatus(TeacherAttendanceQueryInfo.TeacherAttendanceEnum.ERR);
 | 
	
		
			
				|  |  |  							break att;
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  |  						if(attendance.getTeachMode() == TeachModeEnum.OFFLINE){
 | 
	
		
			
				|  |  |  							if(StringUtils.isEmpty(attendance.getSignInLongitudeLatitude()) || StringUtils.isEmpty(attendance.getSignOutLongitudeLatitude())){
 | 
	
		
			
				|  |  | +								dto.setTeacherAttendanceStatus(TeacherAttendanceQueryInfo.TeacherAttendanceEnum.ERR);
 | 
	
		
			
				|  |  | +								break att;
 | 
	
		
			
				|  |  | +							}else {
 | 
	
		
			
				|  |  |  								//计算考勤范围
 | 
	
		
			
				|  |  |  								School school = idSchoolMap.get(attendance.getSchoolId());
 | 
	
		
			
				|  |  |  								if(school != null){
 | 
	
	
		
			
				|  | @@ -1244,6 +1252,36 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  | +				List<TeacherAttendanceWrapper.CourseTeacherAttendance> termAttendances = termAttendanceMap.get(dto.getTeacherId());
 | 
	
		
			
				|  |  | +				if(CollectionUtils.isNotEmpty(termAttendances)){
 | 
	
		
			
				|  |  | +					int errCourseNum = 0;
 | 
	
		
			
				|  |  | +					att:for (TeacherAttendanceWrapper.CourseTeacherAttendance attendance : termAttendances) {
 | 
	
		
			
				|  |  | +						if(attendance.getSignInStatus() == 0 || attendance.getSignOutStatus() == 0){
 | 
	
		
			
				|  |  | +							errCourseNum++;
 | 
	
		
			
				|  |  | +							continue att;
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +						if(attendance.getTeachMode() == TeachModeEnum.OFFLINE){
 | 
	
		
			
				|  |  | +							if(StringUtils.isEmpty(attendance.getSignInLongitudeLatitude()) || StringUtils.isEmpty(attendance.getSignOutLongitudeLatitude())){
 | 
	
		
			
				|  |  | +								errCourseNum++;
 | 
	
		
			
				|  |  | +							}else {
 | 
	
		
			
				|  |  | +								//计算考勤范围
 | 
	
		
			
				|  |  | +								School school = idSchoolMap.get(attendance.getSchoolId());
 | 
	
		
			
				|  |  | +								if(school != null){
 | 
	
		
			
				|  |  | +									Boolean signRange = courseScheduleTeacherSalaryService.getSignRange(school.getLongitudeLatitude(), attendance.getSignInLongitudeLatitude(), attendanceRange);
 | 
	
		
			
				|  |  | +									if(!signRange){
 | 
	
		
			
				|  |  | +										errCourseNum++;
 | 
	
		
			
				|  |  | +										continue att;
 | 
	
		
			
				|  |  | +									}
 | 
	
		
			
				|  |  | +									signRange = courseScheduleTeacherSalaryService.getSignRange(school.getLongitudeLatitude(), attendance.getSignOutLongitudeLatitude(), attendanceRange);
 | 
	
		
			
				|  |  | +									if(!signRange){
 | 
	
		
			
				|  |  | +										errCourseNum++;
 | 
	
		
			
				|  |  | +									}
 | 
	
		
			
				|  |  | +								}
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +					dto.setErrCourseNum(errCourseNum);
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			if(queryInfo.getTeacherAttendanceStatus() != null){
 | 
	
		
			
				|  |  |  				dtoList = dtoList.stream().filter(e->e.getTeacherAttendanceStatus() == queryInfo.getTeacherAttendanceStatus()).collect(Collectors.toList());
 |