|
|
|
@ -255,6 +255,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
TeacherOpenCourseStudentSigninLog entity = new TeacherOpenCourseStudentSigninLog();
|
|
|
|
|
entity.setStudentId(student.getStudentId());
|
|
|
|
|
entity.setTeacherOpenCourseStudentSigninSettingId(signinSetting.getTeacherOpenCourseStudentSigninSettingId());
|
|
|
|
|
entity.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
|
|
|
|
|
Assert.isTrue(ObjectUtil.isEmpty(teacherOpenCourseStudentSigninLogDao.template(entity)), "该学生已经签到过了!");
|
|
|
|
|
|
|
|
|
|
// 判断是否加入到这个课程中
|
|
|
|
@ -323,15 +324,15 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
Date startTime = signinSetting.getTeacherOpenCourseStudentSigninSettingStartTime();
|
|
|
|
|
Date endTime = signinSetting.getTeacherOpenCourseStudentSigninSettingEndTime();
|
|
|
|
|
if (Objects.isNull(startTime)){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "未开始签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (startTime.getTime() > time.getTime()){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "未开始签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(endTime) && endTime.getTime() < time.getTime()){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "已结束签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取到真实的IP
|
|
|
|
@ -354,8 +355,23 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
signinLogQuery.setOrgId(student.getOrgId());
|
|
|
|
|
signinLogQuery.setUserId(student.getUserId());
|
|
|
|
|
|
|
|
|
|
// 学生签到记录添加
|
|
|
|
|
add(signinLogQuery);
|
|
|
|
|
TeacherOpenCourseStudentSigninLog single = teacherOpenCourseStudentSigninLogDao.getSQLManager()
|
|
|
|
|
.lambdaQuery(TeacherOpenCourseStudentSigninLog.class)
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getTeacherOpenCourseStudentSigninSettingId, signinSetting.getTeacherOpenCourseStudentSigninSettingId())
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getTeacherOpenCourseStudentSigninLogTag,UN_SIGN_IN)
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getStudentId,student.getStudentId())
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getSchoolClassId,student.getClassId())
|
|
|
|
|
.single();
|
|
|
|
|
if (ObjectUtil.isNotNull(single)){
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogRemark(null);
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogAddTime(new Date());
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogIp(myIpAddress);
|
|
|
|
|
teacherOpenCourseStudentSigninLogDao.upsertByTemplate(single);
|
|
|
|
|
}else {
|
|
|
|
|
// 学生签到记录添加
|
|
|
|
|
add(signinLogQuery);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -419,15 +435,15 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
Date startTime = signinSetting.getTeacherOpenCourseStudentSigninSettingStartTime();
|
|
|
|
|
Date endTime = signinSetting.getTeacherOpenCourseStudentSigninSettingEndTime();
|
|
|
|
|
if (Objects.isNull(startTime)){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "未开始签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (startTime.getTime() > time.getTime()){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "未开始签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Objects.isNull(endTime) && endTime.getTime() < time.getTime()){
|
|
|
|
|
Assert.notNull(student, "未开始签到");
|
|
|
|
|
Assert.notNull(null, "已结束签到");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 断言,验证码验证
|
|
|
|
@ -447,8 +463,23 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
signinLogQuery.setOrgId(student.getOrgId());
|
|
|
|
|
signinLogQuery.setUserId(student.getUserId());
|
|
|
|
|
|
|
|
|
|
// 学生签到记录添加
|
|
|
|
|
add(signinLogQuery);
|
|
|
|
|
TeacherOpenCourseStudentSigninLog single = teacherOpenCourseStudentSigninLogDao.getSQLManager()
|
|
|
|
|
.lambdaQuery(TeacherOpenCourseStudentSigninLog.class)
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getTeacherOpenCourseStudentSigninSettingId, signinSetting.getTeacherOpenCourseStudentSigninSettingId())
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getTeacherOpenCourseStudentSigninLogTag,UN_SIGN_IN)
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getStudentId,student.getStudentId())
|
|
|
|
|
.andEq(TeacherOpenCourseStudentSigninLog::getSchoolClassId,student.getClassId())
|
|
|
|
|
.single();
|
|
|
|
|
if (ObjectUtil.isNotNull(single)){
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogRemark(null);
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
|
|
|
|
|
single.setTeacherOpenCourseStudentSigninLogAddTime(new Date());
|
|
|
|
|
teacherOpenCourseStudentSigninLogDao.upsertByTemplate(single);
|
|
|
|
|
}else {
|
|
|
|
|
// 学生签到记录添加
|
|
|
|
|
add(signinLogQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult importTemplate(List<FileEntity> fileEntityList, List<Long>list, CoreUser coreUser){
|
|
|
|
@ -754,7 +785,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
|
|
|
|
|
signInLog.setTeacherOpenCourseStudentSigninLogIp(getIpAddr(Objects.requireNonNull(request)));
|
|
|
|
|
signInLog.setTeacherOpenCourseStudentSigninLogTag(UN_SIGN_IN);
|
|
|
|
|
signInLog.setOrgId(single.getOrgId());
|
|
|
|
|
signInLog.setUserId(single.getUserId());
|
|
|
|
|
signInLog.setUserId(item.getUserId());
|
|
|
|
|
teacherOpenCourseStudentSigninLogDao.insert(signInLog);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|