Browse Source

fix 身份证号不能超过20个字符

deason 10 months ago
parent
commit
ebde8ab1e7

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

@@ -94,6 +94,9 @@ public class StudentServiceImpl implements StudentService {
         if (StringUtils.isBlank(identityNumber)) {
             throw new StatusException("160012", "身份证号不能为空");
         }
+        if (StringUtils.length(identityNumber) > 20) {
+            throw new StatusException("160012", "身份证号不能超过20个字符");
+        }
 
         StudentEntity student = studentRepo.findByIdentityNumberAndRootOrgId(identityNumber,
                 rootOrgId);