|
@@ -103,7 +103,13 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
|
Date date = new Date();
|
|
|
SysConfig attendanceTimeRange;
|
|
|
if (courseSchedule.getGroupType().equals(GroupType.MUSIC)) {
|
|
|
- attendanceTimeRange = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE);
|
|
|
+ TeacherAttendance teacherAttendanceInfo = teacherAttendanceDao.findByTeacherAttendanceInfo(sysUser.getId().longValue(), courseSchedule.getId());
|
|
|
+ if(Objects.isNull(teacherAttendanceInfo)||Objects.isNull(teacherAttendanceInfo.getSignInStatus())){
|
|
|
+ throw new BizException("您还未签到");
|
|
|
+ }
|
|
|
+ if (!DateUtil.isSameDay(courseSchedule.getEndClassTime(), date)) {
|
|
|
+ throw new BizException("乐团课禁止跨天点名");
|
|
|
+ }
|
|
|
} else {
|
|
|
SysConfig beforeAttendanceTimeRange = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_BEFOR_COURSE_START_TIME_RANGE_VIP);
|
|
|
int courseStartTime = DateUtil.minutesBetween(date, courseSchedule.getStartClassTime());
|
|
@@ -111,13 +117,13 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
|
throw new BizException("VIP课开课前{}分钟禁止点名", beforeAttendanceTimeRange.getParanValue(Integer.class));
|
|
|
}
|
|
|
attendanceTimeRange = sysConfigService.findByParamName(SysConfigService.ENABLE_STUDENT_ATTENDANCE_TIME_RANGE_VIP);
|
|
|
+
|
|
|
+ int courseEndTime = DateUtil.minutesBetween(courseSchedule.getEndClassTime(), date);
|
|
|
+ if (date.after(courseSchedule.getEndClassTime()) && courseEndTime > attendanceTimeRange.getParanValue(Integer.class)) {
|
|
|
+ throw new BizException("VIP课结束{}分钟后禁止点名",attendanceTimeRange.getParanValue(Integer.class));
|
|
|
+ }
|
|
|
}
|
|
|
- int courseEndTime = DateUtil.minutesBetween(courseSchedule.getEndClassTime(), date);
|
|
|
- if (date.after(courseSchedule.getEndClassTime()) && courseEndTime > attendanceTimeRange.getParanValue(Integer.class)) {
|
|
|
- throw new BizException("{}课结束{}分钟后禁止点名",
|
|
|
- courseSchedule.getGroupType().equals(GroupType.MUSIC) ? "乐团" : "VIP",
|
|
|
- attendanceTimeRange.getParanValue(Integer.class));
|
|
|
- }
|
|
|
+
|
|
|
studentAttendanceDao.deleteStudentAttendancesByCourse(courseScheduleId);
|
|
|
int classTimes = courseScheduleDao.countClassTimes(courseSchedule.getClassGroupId().longValue(), courseSchedule.getStartClassTime());
|
|
|
studentAttendances.forEach(studentAttendance -> {
|