|
@@ -159,6 +159,9 @@ public class StudentServiceImpl implements StudentService {
|
|
|
|
|
|
String identityNumber = studentInfo.getIdentityNumber();
|
|
String identityNumber = studentInfo.getIdentityNumber();
|
|
String studentCode = studentInfo.getStudentCode();
|
|
String studentCode = studentInfo.getStudentCode();
|
|
|
|
+ if (StringUtils.isBlank(studentCode)) {
|
|
|
|
+ studentCode = null;
|
|
|
|
+ }
|
|
|
|
|
|
List<Student> list = studentRepo.findAllByIdentityNumberAndRootOrgId(identityNumber,
|
|
List<Student> list = studentRepo.findAllByIdentityNumberAndRootOrgId(identityNumber,
|
|
rootOrgId);
|
|
rootOrgId);
|
|
@@ -166,9 +169,12 @@ public class StudentServiceImpl implements StudentService {
|
|
throw new StatusException("B-160007",
|
|
throw new StatusException("B-160007",
|
|
"已经存在不同考生的身份证号相同的数据. identityNumber: " + identityNumber);
|
|
"已经存在不同考生的身份证号相同的数据. identityNumber: " + identityNumber);
|
|
}
|
|
}
|
|
- list = studentRepo.findAllByStudentCodeAndRootOrgId(studentCode, rootOrgId);
|
|
|
|
- if (1 < list.size()) {
|
|
|
|
- throw new StatusException("B-160008", "已经存在不同考生的学号相同的数据. studentCode: " + studentCode);
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(studentCode)) {
|
|
|
|
+ list = studentRepo.findAllByStudentCodeAndRootOrgId(studentCode, rootOrgId);
|
|
|
|
+ if (1 < list.size()) {
|
|
|
|
+ throw new StatusException("B-160008",
|
|
|
|
+ "已经存在不同考生的学号相同的数据. studentCode: " + studentCode);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
Student studentByIdentity = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber,
|
|
Student studentByIdentity = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber,
|
|
@@ -181,11 +187,14 @@ public class StudentServiceImpl implements StudentService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- Student studentByCode = studentRepo.findByStudentCodeAndRootOrgId(studentCode, rootOrgId);
|
|
|
|
- if (null != studentByCode) {
|
|
|
|
- String curIdentityNumber = studentByCode.getIdentityNumber();
|
|
|
|
- if (!curIdentityNumber.equals(identityNumber)) {
|
|
|
|
- throw new StatusException("B-160006", "studentCode is wrong");
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(studentCode)) {
|
|
|
|
+ Student studentByCode = studentRepo.findByStudentCodeAndRootOrgId(studentCode,
|
|
|
|
+ rootOrgId);
|
|
|
|
+ if (null != studentByCode) {
|
|
|
|
+ String curIdentityNumber = studentByCode.getIdentityNumber();
|
|
|
|
+ if (!curIdentityNumber.equals(identityNumber)) {
|
|
|
|
+ throw new StatusException("B-160006", "studentCode is wrong");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|