|
@@ -324,10 +324,20 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
|
|
|
hours = Integer.parseInt(str);
|
|
|
}
|
|
|
|
|
|
+ int earliestTimeForLeave = 168;
|
|
|
+ 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())){
|
|
|
throw new BizException("开课{}小时之前才可以请假",hours);
|
|
|
}
|
|
|
|
|
|
+ if(DateUtil.addHours(date, 168).before(courseSchedule.getStartClassTime())){
|
|
|
+ throw new BizException("请在开课前{}天内请假",earliestTimeForLeave/24);
|
|
|
+ }
|
|
|
+
|
|
|
StudentAttendance studentAttendance = studentAttendanceDao.findByStatusAndCourseScheduleId(userId,courseScheduleId.intValue());
|
|
|
if(Objects.isNull(studentAttendance)){
|
|
|
studentAttendance=new StudentAttendance();
|