|
@@ -111,6 +111,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
|
teacherAttendance.setClassGroupId(currentCourseDetail.getClassId());
|
|
|
teacherAttendance.setRemark(teacherSignOutDto.getTeacherAttendanceInfo().getRemark());
|
|
|
int advanceSignMinutes = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES));
|
|
|
+ int offlineSignInEarlyForwardTime = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.OFFLINE_SIGN_IN_EARLY_FORWARD_TIME));
|
|
|
|
|
|
CourseSchedule courseSchedule = courseScheduleDao.get(teacherAttendance.getCourseScheduleId());
|
|
|
teacherAttendance.setGroupType(courseSchedule.getGroupType());
|
|
@@ -131,6 +132,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
|
Date classStartDateTime = DateUtil.stringToDate(classDate + " " + startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
Date classEndDateTime = DateUtil.stringToDate(classDate + " " + endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
Date classEndDateAdd60Minutes = DateUtil.addMinutes(classEndDateTime, 180);
|
|
|
+ Date add60Minutes = DateUtil.addMinutes(classStartDateTime, offlineSignInEarlyForwardTime * -1);
|
|
|
Date add20Minutes = DateUtil.addMinutes(classStartDateTime, advanceSignMinutes * -1);
|
|
|
if(teacherAttendance.getSignInTime() == null && teacherSignOutDto.getTeacherAttendanceInfo().getStatus().equals(SignStatusEnum.SIGN_IN.getCode())){
|
|
|
|
|
@@ -165,24 +167,25 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
|
throw new BizException("该课程已结束,不能进行签到!");
|
|
|
}
|
|
|
|
|
|
- YesOrNoEnum yesOrNoEnum = YesOrNoEnum.NO;
|
|
|
+ boolean enableIgnoreAttendanceTime = false;
|
|
|
if(Objects.nonNull(courseSchedule.getSchoolId())){
|
|
|
- yesOrNoEnum = courseScheduleService.enableOnlyNormalAttendance(currentCourseDetail.getStartClassTime(),
|
|
|
- user.getId().longValue(),
|
|
|
- true,
|
|
|
+ enableIgnoreAttendanceTime = courseScheduleService.enableIgnoreAttendanceTime(currentCourseDetail.getStartClassTime(),
|
|
|
+ user.getId(),
|
|
|
currentCourseDetail.getSchoolId().intValue());
|
|
|
}
|
|
|
teacherAttendance.setSignInTime(date);
|
|
|
teacherAttendance.setSignInStatus(YesOrNoEnum.YES);
|
|
|
result.put("signInStatus",0);
|
|
|
- if(yesOrNoEnum == YesOrNoEnum.YES){
|
|
|
- //连堂课
|
|
|
- }else if(DateUtil.minutesBetween(date,add20Minutes) >= 0){
|
|
|
+ if(!isInScore){
|
|
|
+ teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
|
|
|
+ }else if(enableIgnoreAttendanceTime){
|
|
|
+ //连堂课,可忽略正常时间签到范围
|
|
|
+ }else if(date.compareTo(add20Minutes) <= 0&&date.compareTo(add60Minutes)>=0){
|
|
|
//正常签到范围(开始前60分钟 ~ 开始之前20分钟)
|
|
|
if(!isInScore){
|
|
|
teacherAttendance.setSignInStatus(YesOrNoEnum.NO);
|
|
|
}
|
|
|
- }else if(DateUtil.minutesBetween(add20Minutes,date) > 0){
|
|
|
+ }else if(date.compareTo(add20Minutes) > 0&&date.compareTo(add60Minutes) < 0){
|
|
|
if(StringUtils.isEmpty(teacherAttendance.getRemark())&&!teacherSignOutDto.isNotRturnErrorInfo()){
|
|
|
//当前为异常签到,请填写原因!
|
|
|
result.put("status",2);
|