WANG 5 lat temu
rodzic
commit
e62cf2c2e1

+ 6 - 3
examcloud-task-service/src/main/java/cn/com/qmth/examcloud/task/service/job/ExamStudentImportDataProcessingTask.java

@@ -9,6 +9,7 @@ import java.util.Map;
 
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.PageRequest;
 import org.springframework.data.domain.Pageable;
@@ -252,9 +253,11 @@ public class ExamStudentImportDataProcessingTask extends AbstractTask {
 			saveStudentReq.setOrgCode(entity.getOrgCode());
 			saveStudentReq.setOrgId(entity.getOrgId());
 			saveStudentReq.setRootOrgId(rootOrgId);
-			List<String> studentCodeList = Lists.newArrayList();
-			studentCodeList.add(entity.getStudentCode());
-			saveStudentReq.setStudentCodeList(studentCodeList);
+			if (StringUtils.isNotBlank(entity.getStudentCode())) {
+				List<String> studentCodeList = Lists.newArrayList();
+				studentCodeList.add(entity.getStudentCode());
+				saveStudentReq.setStudentCodeList(studentCodeList);
+			}
 
 			SaveStudentResp saveStudentResp = studentCloudService.saveStudent(saveStudentReq);