|
@@ -317,7 +317,7 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
//获取当前课程的所有连堂课列表
|
|
//获取当前课程的所有连堂课列表
|
|
String courseClassDate = DateUtil.format(cs.getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
String courseClassDate = DateUtil.format(cs.getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
String courseEndDateTime = DateUtil.format(cs.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
String courseEndDateTime = DateUtil.format(cs.getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
-// Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
|
|
|
+ Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
cs = courseScheduleDao.queryContinueCourse(cs,continueCourseTime,courseClassDate + " " + courseEndDateTime);
|
|
cs = courseScheduleDao.queryContinueCourse(cs,continueCourseTime,courseClassDate + " " + courseEndDateTime);
|
|
//存在连堂课
|
|
//存在连堂课
|
|
if(cs != null){
|
|
if(cs != null){
|
|
@@ -334,35 +334,41 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
|
|
totalMinutes -= firstMinutes;
|
|
totalMinutes -= firstMinutes;
|
|
if(totalMinutes > 0){
|
|
if(totalMinutes > 0){
|
|
String courseClassDate;
|
|
String courseClassDate;
|
|
-// String courseStartDateTime;
|
|
|
|
|
|
+ String courseStartDateTime;
|
|
String courseEndDateTime;
|
|
String courseEndDateTime;
|
|
for (int i = 0; i < courseSchedules.size(); i++) {
|
|
for (int i = 0; i < courseSchedules.size(); i++) {
|
|
courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
courseClassDate = DateUtil.format(courseSchedules.get(i).getClassDate(), DateUtil.DEFAULT_PATTERN);
|
|
-// courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
|
|
|
|
+ courseStartDateTime = DateUtil.format(courseSchedules.get(i).getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
courseEndDateTime = DateUtil.format(courseSchedules.get(i).getEndClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
|
|
-// Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
|
|
|
|
+ Date startDateTime = DateUtil.stringToDate(courseClassDate + " " + courseStartDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
Date endDateTime = DateUtil.stringToDate(courseClassDate + " " + courseEndDateTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
|
|
-// Date signOutTime = date;
|
|
|
|
-// if(i < courseSchedules.size() - 1 && date.after(endDateTime)){
|
|
|
|
|
|
+ Date signOutTime = date;
|
|
|
|
+ if(date.before(startDateTime)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if(i < courseSchedules.size() - 1 && date.after(endDateTime)){
|
|
//不是最后一节连堂课,并且签退时间大于课程结束时间,签退时间等于课程结束时间
|
|
//不是最后一节连堂课,并且签退时间大于课程结束时间,签退时间等于课程结束时间
|
|
-// signOutTime = endDateTime;
|
|
|
|
-// }
|
|
|
|
|
|
+ signOutTime = endDateTime;
|
|
|
|
+ }
|
|
//如果签退时间大于课程结束时间
|
|
//如果签退时间大于课程结束时间
|
|
//如果当前课程没有签退记录,那么正常更新
|
|
//如果当前课程没有签退记录,那么正常更新
|
|
- TeacherAttendance personalAttendance = teacherAttendanceDao.getTeacherPersonalAttendance(courseSchedules.get(i).getId().intValue());
|
|
|
|
|
|
+ TeacherAttendance personalAttendance = teacherAttendanceDao.findByTeacherAttendanceInfo(userId.longValue(),courseSchedules.get(i).getId());
|
|
if(personalAttendance != null && personalAttendance.getSignOutStatus() == YesOrNoEnum.NO){
|
|
if(personalAttendance != null && personalAttendance.getSignOutStatus() == YesOrNoEnum.NO){
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ //如果当前课程有签到时间,那么只更新签退时间和状态
|
|
|
|
+ if(personalAttendance.getSignInTime() != null){
|
|
|
|
+ startDateTime = null;
|
|
|
|
+ }
|
|
if(date.after(endDateTime)){
|
|
if(date.after(endDateTime)){
|
|
- teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),signInTime,date,1);
|
|
|
|
|
|
+ teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,1);
|
|
}else if (date.equals(endDateTime)){
|
|
}else if (date.equals(endDateTime)){
|
|
- teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),signInTime,date,1);
|
|
|
|
- break;
|
|
|
|
|
|
+ teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,1);
|
|
}else {
|
|
}else {
|
|
- teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),signInTime,date,0);
|
|
|
|
- break;
|
|
|
|
|
|
+ teacherAttendanceDao.cuntinueCourseSign(courseSchedules.get(i).getId(),startDateTime,signOutTime,0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ date = classEndDateTime;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}else {
|
|
}else {
|