Quellcode durchsuchen

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

yuanliang vor 1 Jahr
Ursprung
Commit
3184ed92e8

+ 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));
             }