|
@@ -30,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -132,7 +131,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public void buildImportObjects(Map<String, Object> map) throws IOException, NoSuchFieldException {
|
|
|
|
|
|
+ public void buildImportObjects(Map<String, Object> map) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -155,7 +154,17 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
public void deleteBatch(List<Long> idList) {
|
|
public void deleteBatch(List<Long> idList) {
|
|
- this.removeByIds(idList);
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(idList)) {
|
|
|
|
+ List<BasicExamStudent> basicExamStudentList = this.listByIds(idList);
|
|
|
|
+
|
|
|
|
+ List<String> boundStudentNameList = this.baseMapper.findBoundBasicExamStudentNames(idList);
|
|
|
|
+ if (CollectionUtils.isNotEmpty(boundStudentNameList)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
+ String.format("学生[%s]已经被绑定", String.join(",", boundStudentNameList)));
|
|
|
|
+ }
|
|
|
|
+ this.removeByIds(idList);
|
|
|
|
+ basicExamStudentList.stream().map(BasicExamStudent::getClazzId).distinct().forEach(e -> basicTeachClazzService.deleteFreeClazz(e));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -214,13 +223,13 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
}
|
|
}
|
|
|
|
|
|
Long teacherId = null;
|
|
Long teacherId = null;
|
|
- if (SystemConstant.strNotNull(teacherCode) && !SystemConstant.strNotNull(teacherName)){
|
|
|
|
|
|
+ if (SystemConstant.strNotNull(teacherCode) && !SystemConstant.strNotNull(teacherName)) {
|
|
errorMsgList.add("存在任课老师工号,但缺少任课老师姓名");
|
|
errorMsgList.add("存在任课老师工号,但缺少任课老师姓名");
|
|
}
|
|
}
|
|
- if (SystemConstant.strNotNull(teacherName) && !SystemConstant.strNotNull(teacherCode)){
|
|
|
|
|
|
+ if (SystemConstant.strNotNull(teacherName) && !SystemConstant.strNotNull(teacherCode)) {
|
|
errorMsgList.add("存在任课老师姓名,但缺少任课老师工号");
|
|
errorMsgList.add("存在任课老师姓名,但缺少任课老师工号");
|
|
}
|
|
}
|
|
- if (SystemConstant.strNotNull(teacherName) && SystemConstant.strNotNull(teacherCode)){
|
|
|
|
|
|
+ if (SystemConstant.strNotNull(teacherName) && SystemConstant.strNotNull(teacherCode)) {
|
|
// 存在教师信息,根据工号查询,不存在报错(缺少机构信息没法直接创建教师)
|
|
// 存在教师信息,根据工号查询,不存在报错(缺少机构信息没法直接创建教师)
|
|
SysUser teacher = sysUserService.getOne(
|
|
SysUser teacher = sysUserService.getOne(
|
|
new QueryWrapper<SysUser>().lambda().eq(SysUser::getSchoolId, schoolId)
|
|
new QueryWrapper<SysUser>().lambda().eq(SysUser::getSchoolId, schoolId)
|
|
@@ -268,14 +277,12 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
|
|
basicExamStudent.setStudentCode(studentCode);
|
|
basicExamStudent.setStudentCode(studentCode);
|
|
basicExamStudent.setCollege(college);
|
|
basicExamStudent.setCollege(college);
|
|
basicExamStudent.setMajor(major);
|
|
basicExamStudent.setMajor(major);
|
|
- if (SystemConstant.strNotNull(paperNumber)) {
|
|
|
|
- basicExamStudent.setPaperNumber(paperNumber);
|
|
|
|
- basicExamStudent.setTeacherId(teacherId);
|
|
|
|
- basicExamStudent.setExamStartTime(examStartTime);
|
|
|
|
- basicExamStudent.setExamEndTime(examEndTime);
|
|
|
|
- basicExamStudent.setExamPlace(examPlace);
|
|
|
|
- basicExamStudent.setExamRoom(examRoom);
|
|
|
|
- }
|
|
|
|
|
|
+ basicExamStudent.setPaperNumber(paperNumber);
|
|
|
|
+ basicExamStudent.setTeacherId(teacherId);
|
|
|
|
+ basicExamStudent.setExamStartTime(examStartTime);
|
|
|
|
+ basicExamStudent.setExamEndTime(examEndTime);
|
|
|
|
+ basicExamStudent.setExamPlace(examPlace);
|
|
|
|
+ basicExamStudent.setExamRoom(examRoom);
|
|
|
|
|
|
if (SystemConstant.longNotNull(id)) {
|
|
if (SystemConstant.longNotNull(id)) {
|
|
// 编辑 (学号不可更改)
|
|
// 编辑 (学号不可更改)
|