wangwei 6 years ago
parent
commit
185a7c1642

+ 13 - 12
examcloud-task-service/src/main/java/cn/com/qmth/examcloud/task/service/job/ExamStudentImportDataProcessingTask.java

@@ -27,10 +27,10 @@ import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
 import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
 import cn.com.qmth.examcloud.core.basic.api.request.GetCourseReq;
 import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
-import cn.com.qmth.examcloud.core.basic.api.request.InsertOrUpdateStudentReq;
+import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetCourseResp;
 import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
-import cn.com.qmth.examcloud.core.basic.api.response.InsertOrUpdateStudentResp;
+import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentResp;
 import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
 import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
 import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
@@ -244,7 +244,7 @@ public class ExamStudentImportDataProcessingTask extends AbstractTask {
 		}
 
 		try {
-			InsertOrUpdateStudentReq saveStudentReq = new InsertOrUpdateStudentReq();
+			SaveStudentReq saveStudentReq = new SaveStudentReq();
 			saveStudentReq.setIdentityNumber(entity.getIdentityNumber());
 			saveStudentReq.setName(entity.getName());
 			saveStudentReq.setPhoneNumber(entity.getPhone());
@@ -253,27 +253,28 @@ public class ExamStudentImportDataProcessingTask extends AbstractTask {
 			saveStudentReq.setRootOrgId(rootOrgId);
 			saveStudentReq.setStudentCode(entity.getStudentCode());
 
-			InsertOrUpdateStudentResp insertOrUpdateStudentResp = studentCloudService
-					.insertOrUpdateStudent(saveStudentReq);
+			SaveStudentResp saveStudentResp = studentCloudService.saveStudent(saveStudentReq);
 
-			Long studentId = insertOrUpdateStudentResp.getStudentId();
+			Long studentId = saveStudentResp.getStudentId();
 
 			SaveExamStudentReq sReq = new SaveExamStudentReq();
-			sReq.setCourseLevel(entity.getCourseLevel());
 
-			sReq.setCourseLevel(entity.getCourseLevel());
+			sReq.setCourseId(entity.getCourseId());
 			sReq.setCourseCode(entity.getCourseCode());
-			sReq.setCourseName(entity.getCourseName());
+
 			sReq.setExamId(entity.getExamId());
+			sReq.setRootOrgId(rootOrgId);
+
 			sReq.setStudentId(studentId);
 			sReq.setIdentityNumber(entity.getIdentityNumber());
-			sReq.setPaperType(entity.getPaperType());
-			sReq.setRootOrgId(rootOrgId);
-			sReq.setStudentCode(entity.getStudentCode());
 			sReq.setStudentName(entity.getName());
+			sReq.setStudentCode(entity.getStudentCode());
+
 			sReq.setSpecialtyName(entity.getSpecialtyName());
+			sReq.setPaperType(entity.getPaperType());
 			sReq.setGrade(entity.getGrade());
 			sReq.setInfoCollector(entity.getInfoCollector());
+
 			examStudentCloudService.saveExamStudent(sReq);
 
 			entity.setStudentId(studentId);

+ 2 - 2
examcloud-task-service/src/main/java/cn/com/qmth/examcloud/task/service/job/ExamStudentImportParsingFileTask.java

@@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
-import cn.com.qmth.examcloud.commons.base.helpers.poi.ExcelParser;
+import cn.com.qmth.examcloud.commons.base.helpers.poi.ExcelReader;
 import cn.com.qmth.examcloud.commons.base.util.PathUtil;
 import cn.com.qmth.examcloud.task.base.AbstractTask;
 import cn.com.qmth.examcloud.task.base.ScheduleJob;
@@ -105,7 +105,7 @@ public class ExamStudentImportParsingFileTask extends AbstractTask {
 			return;
 		}
 
-		List<String[]> lineList = ExcelParser.readSheetBySax(PathUtil.getCanonicalPath(file), 1,
+		List<String[]> lineList = ExcelReader.readSheetBySax(PathUtil.getCanonicalPath(file), 1,
 				13);
 
 		if (CollectionUtils.isEmpty(lineList)) {