Quellcode durchsuchen

手机号查询学生

wangwei vor 5 Jahren
Ursprung
Commit
dc77b71b8a

+ 0 - 2
examcloud-core-basic-dao/src/main/java/cn/com/qmth/examcloud/core/basic/dao/StudentRepo.java

@@ -21,8 +21,6 @@ public interface StudentRepo
 
 	StudentEntity findByIdentityNumberAndRootOrgId(String identityNumber, Long rootOrgId);
 
-	StudentEntity findBySecurityPhoneAndRootOrgId(String securityPhone, Long rootOrgId);
-
 	StudentEntity findBySecurityPhone(String securityPhone);
 
 	int countByRootOrgId(Long rootOrgId);

+ 3 - 4
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/StudentServiceImpl.java

@@ -271,6 +271,9 @@ public class StudentServiceImpl implements StudentService {
 		if (null != studentId) {
 			count++;
 			s = GlobalHelper.getEntity(studentRepo, studentId, StudentEntity.class);
+		} else if (StringUtils.isNotBlank(securityPhone)) {
+			count++;
+			s = studentRepo.findBySecurityPhone(securityPhone);
 		} else if (null == rootOrgId) {
 			throw new StatusException("160250", "rootOrgId is null");
 		}
@@ -289,10 +292,6 @@ public class StudentServiceImpl implements StudentService {
 						StudentEntity.class);
 			}
 		}
-		if (StringUtils.isNotBlank(securityPhone)) {
-			count++;
-			s = studentRepo.findBySecurityPhoneAndRootOrgId(securityPhone, rootOrgId);
-		}
 
 		if (count > 1) {
 			throw new StatusException("160210",