beetlsql3-dev
Mlxa0324 2 years ago
parent 18d29bf4ad
commit b97ba59b1f

@ -7,7 +7,6 @@ import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.admin.core.web.JsonResult; import com.ibeetl.admin.core.web.JsonResult;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.beetl.sql.clazz.kit.BeetlSQLException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController; import org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController;
import org.springframework.boot.web.error.ErrorAttributeOptions; import org.springframework.boot.web.error.ErrorAttributeOptions;
@ -175,7 +174,7 @@ public class CustomErrorController extends AbstractErrorController {
} }
protected String getErrorMessage(Throwable ex) { protected String getErrorMessage(Throwable ex) {
if(ex instanceof RuntimeException || ex instanceof PlatformException || ex instanceof IllegalArgumentException || ex instanceof BeetlSQLException if(ex instanceof PlatformException || ex instanceof IllegalArgumentException
|| ex instanceof ConstraintViolationException) { || ex instanceof ConstraintViolationException) {
return defaultIfNull(ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(), "服务器错误,请联系管理员"); return defaultIfNull(ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage(), "服务器错误,请联系管理员");
} else{ } else{

@ -306,6 +306,8 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
signinLogQuery.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN); signinLogQuery.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
signinLogQuery.setSchoolClassId(student.getClassId()); signinLogQuery.setSchoolClassId(student.getClassId());
signinLogQuery.setStudentId(student.getStudentId()); signinLogQuery.setStudentId(student.getStudentId());
signinLogQuery.setOrgId(student.getOrgId());
signinLogQuery.setUserId(student.getUserId());
// 学生签到记录添加 // 学生签到记录添加
add(signinLogQuery); add(signinLogQuery);
@ -382,6 +384,8 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
signinLogQuery.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN); signinLogQuery.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
signinLogQuery.setStudentId(student.getStudentId()); signinLogQuery.setStudentId(student.getStudentId());
signinLogQuery.setSchoolClassId(student.getClassId()); signinLogQuery.setSchoolClassId(student.getClassId());
signinLogQuery.setOrgId(student.getOrgId());
signinLogQuery.setUserId(student.getUserId());
// 学生签到记录添加 // 学生签到记录添加
add(signinLogQuery); add(signinLogQuery);
@ -561,7 +565,7 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
public void manualSigninAdd(@NotNull(message = "手动签到参数不能为空!") TeacherOpenCourseStudentSigninLogManualMergeDTO dto) { public void manualSigninAdd(@NotNull(message = "手动签到参数不能为空!") TeacherOpenCourseStudentSigninLogManualMergeDTO dto) {
// 获取当前登录用户信息 // 获取当前登录用户信息
final CoreUser user = getUser(); final CoreUser operatorUser = getUser();
final HttpServletRequest request = getRequest(); final HttpServletRequest request = getRequest();
// 添加我签到配置 // 添加我签到配置
@ -579,8 +583,8 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
entity.setTeacherOpenCourseStudentSigninSettingType(manual_signin.name()); entity.setTeacherOpenCourseStudentSigninSettingType(manual_signin.name());
entity.setTeacherOpenCourseStudentSigninSettingStartStatus(StartStatusEnum.READY); entity.setTeacherOpenCourseStudentSigninSettingStartStatus(StartStatusEnum.READY);
entity.setTeacherOpenCourseStudentSigninSettingStatus(1); entity.setTeacherOpenCourseStudentSigninSettingStatus(1);
entity.setOrgId(user.getOrgId()); entity.setOrgId(operatorUser.getOrgId());
entity.setUserId(user.getId()); entity.setUserId(operatorUser.getId());
teacherOpenCourseStudentSigninSettingDao.insert(entity); teacherOpenCourseStudentSigninSettingDao.insert(entity);
@ -603,8 +607,8 @@ public class TeacherOpenCourseStudentSigninLogService extends CoreBaseService<Te
teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN); teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninLogTag(SIGN_IN);
teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninSettingSessionTime(now); teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninSettingSessionTime(now);
teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninSettingId(settingId); teacherOpenCourseStudentSigninLog.setTeacherOpenCourseStudentSigninSettingId(settingId);
teacherOpenCourseStudentSigninLog.setOrgId(user.getOrgId()); teacherOpenCourseStudentSigninLog.setOrgId(operatorUser.getOrgId());
teacherOpenCourseStudentSigninLog.setUserId(user.getId()); teacherOpenCourseStudentSigninLog.setUserId(studentInfo.getUserId());
// 拷贝前端传过来的值 // 拷贝前端传过来的值
BeanUtil.copyProperties(item, teacherOpenCourseStudentSigninLog); BeanUtil.copyProperties(item, teacherOpenCourseStudentSigninLog);
return teacherOpenCourseStudentSigninLog; return teacherOpenCourseStudentSigninLog;

@ -1,7 +1,6 @@
package com.ibeetl.jlw.web; package com.ibeetl.jlw.web;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.jlw.Interceptor.SCoreUser; import cn.jlw.Interceptor.SCoreUser;
@ -69,6 +68,7 @@ public class TeacherOpenCourseStudentSigninSettingController{
return JsonResult.failMessage("请登录后再操作"); return JsonResult.failMessage("请登录后再操作");
}else{ }else{
PageQuery page = condition.getPageQuery(); PageQuery page = condition.getPageQuery();
condition.setCurrentUserId(coreUser.getId());
teacherOpenCourseStudentSigninSettingService.queryByConditionQuery(page); teacherOpenCourseStudentSigninSettingService.queryByConditionQuery(page);
return JsonResult.success(page); return JsonResult.success(page);
} }

@ -74,6 +74,7 @@ public class TeacherOpenCourseStudentSigninSettingQuery extends PageParam {
private String teacherOpenCourseIdPlural; private String teacherOpenCourseIdPlural;
private String orgIdPlural; private String orgIdPlural;
private String userIdPlural; private String userIdPlural;
private Long currentUserId;
private String teacherOpenCourseStudentSigninSettingJsonStr;//json格式 private String teacherOpenCourseStudentSigninSettingJsonStr;//json格式

@ -87,6 +87,15 @@ queryByConditionQuery
select select
@pageTag(){ @pageTag(){
t.* t.*
@if(!isEmpty(currentUserId)) {
,(select za.teacher_open_course_student_signin_log_tag
from teacher_open_course_student_signin_log za
where 1
and za.teacher_open_course_student_signin_setting_id = t.teacher_open_course_student_signin_setting_id
and za.user_id = #currentUserId#
order by za.teacher_open_course_student_signin_log_add_time desc
limit 1) as teacher_open_course_student_signin_log_tag
@}
@} @}
from teacher_open_course_student_signin_setting t from teacher_open_course_student_signin_setting t
where 1=1 where 1=1

Loading…
Cancel
Save