|
@@ -334,8 +334,10 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
* @return 结果
|
|
* @return 结果
|
|
*/
|
|
*/
|
|
private List<BasicStudent> editEntityHelp(List<BasicStudentParams> basicStudentParamsList, SysUser sysUser) {
|
|
private List<BasicStudent> editEntityHelp(List<BasicStudentParams> basicStudentParamsList, SysUser sysUser) {
|
|
|
|
+
|
|
Long schoolId = sysUser.getSchoolId();
|
|
Long schoolId = sysUser.getSchoolId();
|
|
List<BasicStudent> editEntityList = new ArrayList<>();
|
|
List<BasicStudent> editEntityList = new ArrayList<>();
|
|
|
|
+ Map<String, BasicStudentParams> checkRepeatMap = new HashMap<>();
|
|
for (BasicStudentParams basicStudentParams : basicStudentParamsList) {
|
|
for (BasicStudentParams basicStudentParams : basicStudentParamsList) {
|
|
// 普通参数
|
|
// 普通参数
|
|
String studentName = basicStudentParams.getStudentName();
|
|
String studentName = basicStudentParams.getStudentName();
|
|
@@ -344,6 +346,28 @@ public class BasicStudentServiceImpl extends ServiceImpl<BasicStudentMapper, Bas
|
|
Long clazzId = basicStudentParams.getClazzId();
|
|
Long clazzId = basicStudentParams.getClazzId();
|
|
Long majorId = basicStudentParams.getMajorId();
|
|
Long majorId = basicStudentParams.getMajorId();
|
|
Long collegeId = basicStudentParams.getCollegeId();
|
|
Long collegeId = basicStudentParams.getCollegeId();
|
|
|
|
+ if (checkRepeatMap.containsKey(studentCode)) {
|
|
|
|
+ // 校验整个导入批次是否有重复数据
|
|
|
|
+ BasicStudentParams check = checkRepeatMap.get(studentCode);
|
|
|
|
+ if (!Objects.equals(studentName, check.getStudentName())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("导入批次学号为【" + studentCode + "】的学生,存在不同姓名");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(phoneNumber, check.getPhoneNumber())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("导入批次学号为【" + studentCode + "】的学生,存在不同电话");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(clazzId, check.getClazzId())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("导入批次学号为【" + studentCode + "】的学生,存在不同班级");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(majorId, check.getMajorId())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("导入批次学号为【" + studentCode + "】的学生,存在不同专业");
|
|
|
|
+ }
|
|
|
|
+ if (!Objects.equals(collegeId, check.getCollegeId())) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("导入批次学号为【" + studentCode + "】的学生,存在不同学院");
|
|
|
|
+ }
|
|
|
|
+ continue;
|
|
|
|
+ } else {
|
|
|
|
+ checkRepeatMap.put(studentCode, basicStudentParams);
|
|
|
|
+ }
|
|
|
|
|
|
// 班级验证
|
|
// 班级验证
|
|
if (SystemConstant.longNotNull(clazzId)) {
|
|
if (SystemConstant.longNotNull(clazzId)) {
|