|
@@ -393,20 +393,10 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
hours = Integer.parseInt(str);
|
|
hours = Integer.parseInt(str);
|
|
}
|
|
}
|
|
|
|
|
|
- int earliestTimeForLeave = 7;
|
|
|
|
- SysConfig earliestTimeForLeaveConfig = sysConfigService.findByParamName(SysConfigService.EARLIEST_TIME_FOR_LEAVE);
|
|
|
|
- if (Objects.nonNull(earliestTimeForLeaveConfig)) {
|
|
|
|
- earliestTimeForLeave = Integer.parseInt(earliestTimeForLeaveConfig.getParanValue());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (DateUtil.addHours(date, hours).after(courseSchedule.getStartClassTime())) {
|
|
if (DateUtil.addHours(date, hours).after(courseSchedule.getStartClassTime())) {
|
|
throw new BizException("开课{}小时之前才可以请假", hours);
|
|
throw new BizException("开课{}小时之前才可以请假", hours);
|
|
}
|
|
}
|
|
|
|
|
|
- if (DateUtil.addDays(DateUtils.truncate(date, Calendar.DAY_OF_MONTH), earliestTimeForLeave).compareTo(courseSchedule.getClassDate())<=0) {
|
|
|
|
- throw new BizException("请在开课前{}天内请假", earliestTimeForLeave);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
StudentAttendance studentAttendance = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, courseScheduleId.intValue());
|
|
StudentAttendance studentAttendance = studentAttendanceDao.findByStatusAndCourseScheduleId(userId, courseScheduleId.intValue());
|
|
if (Objects.isNull(studentAttendance)) {
|
|
if (Objects.isNull(studentAttendance)) {
|
|
studentAttendance = new StudentAttendance();
|
|
studentAttendance = new StudentAttendance();
|