Przeglądaj źródła

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

deason 10 miesięcy temu
rodzic
commit
4eb261a631

+ 5 - 1
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -272,8 +272,12 @@ public class ExamStudentServiceImpl implements ExamStudentService {
         String identityNumber = examStudentInfo.getIdentityNumber();
 
         if (StringUtils.isBlank(identityNumber)) {
-            throw new StatusException("100003", "identityNumber is null");
+            throw new StatusException("100003", "身份证号不能为空");
         }
+        if (StringUtils.length(identityNumber) > 20) {
+            throw new StatusException("100003", "身份证号不能超过20个字符");
+        }
+
         GetStudentReq getStudentReq = new GetStudentReq();
         getStudentReq.setRootOrgId(rootOrgId);
         getStudentReq.setIdentityNumber(identityNumber);