소스 검색

1.导入学生添加小组校验

yuanliang 1 년 전
부모
커밋
3184ed92e8
1개의 변경된 파일9개의 추가작업 그리고 6개의 파일을 삭제
  1. 9 6
      cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

+ 9 - 6
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/StudentServiceImpl.java

@@ -486,17 +486,20 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
             int msgRowNo = rowIndex + 1;
             student.checkValid().forEach(err -> errMsg.add(String.format("第%s行%s", msgRowNo, err)));
 
-            if (phoneMap.containsKey(student.getPhone())) {
-                errMsg.add(String.format("第%s行手机号重复", msgRowNo));
-            } else {
-                phoneMap.put(student.getPhone(), msgRowNo);
+            if (StringUtils.isNotEmpty(student.getPhone())) {
+                if (phoneMap.containsKey(student.getPhone())) {
+                    errMsg.add(String.format("第%s行手机号重复", msgRowNo));
+                } else {
+                    phoneMap.put(student.getPhone(), msgRowNo);
+                }
             }
 
-            if (!subjectNames.contains(student.getSubjectName())) {
+            if (StringUtils.isNotEmpty(student.getSubjectName()) && !subjectNames.contains(student.getSubjectName())) {
                 errMsg.add(String.format("第%s行声部不支持", msgRowNo));
             }
 
-            if (!groupNameIdMap.containsKey(student.getTenantGroupName())) {
+            if (StringUtils.isNotEmpty(student.getTenantGroupName()) &&
+                    !groupNameIdMap.containsKey(student.getTenantGroupName())) {
                 errMsg.add(String.format("第%s行小组不存在", msgRowNo));
             }