调整导入模板顺序和参数值

master
xiaoCJ 7 months ago
parent bbd8c85bd0
commit 97a589a1f1

@ -300,25 +300,16 @@ public class ObjectiveApi {
Cell cell10 = row.getCell(10); Cell cell10 = row.getCell(10);
Cell cell11 = row.getCell(11); Cell cell11 = row.getCell(11);
Cell cell12 = row.getCell(12); Cell cell12 = row.getCell(12);
if (cell0 == null) {
return false;
}
String type = this.getCellValue(cell0);//题型
if (type.equals("0") || type.equals("1")) {
if (cell1 == null || cell2 == null) {
return false;
}
}
//判断题的BCDE选项和解析可能为空 //判断题的BCDE选项和解析可能为空
if (cell7 == null || cell8 == null || cell10 == null || cell11 == null || cell12 == null) { if (cell0 == null || cell2 == null || cell3 == null || cell7 == null || cell8 == null || cell10 == null || cell11 == null || cell12 == null) {
return false; return false;
} }
String type = this.getCellValue(cell0);//题型
String content = this.getCellValue(cell1);//题干 String content = this.getCellValue(cell1);//题干
String a = cell2 != null ? this.getCellValue(cell2) : null; //选项A String a = this.getCellValue(cell2); //选项A
String b = cell3 != null ? this.getCellValue(cell3) : null;//选项B String b = this.getCellValue(cell3);//选项B
String answer = this.getCellValue(cell7);//答案 String answer = this.getCellValue(cell7);//答案
String score = this.getCellValue(cell8);//分值 String score = this.getCellValue(cell8);//分值
String oneName = this.getCellValue(cell10);//一级目录名称 String oneName = this.getCellValue(cell10);//一级目录名称
@ -334,21 +325,14 @@ public class ObjectiveApi {
String topicId = IdUtil.randomUUID(); String topicId = IdUtil.randomUUID();
obj.setObjectiveId(topicId); obj.setObjectiveId(topicId);
obj.setContent(content); obj.setContent(content);
obj.setAnswer(answer);
if (type.equals("单选题") || type.equals("单选")) { if (type.equals("单选题") || type.equals("单选")) {
obj.setType("0"); obj.setType("0");
} }
if (type.equals("多选题") || type.equals("多选")) { if (type.equals("多选题") || type.equals("多选")) {
obj.setType("1"); obj.setType("1");
} }
obj.setSource(schoolId);
obj.setQuestionA(a);
obj.setQuestionB(b);
obj.setQuestionC(c);
obj.setQuestionD(d);
obj.setQuestionE(e);
obj.setAnswer(answer);
if (type.equals("判断题") || type.equals("判断")) { if (type.equals("判断题") || type.equals("判断")) {
obj.setType("2"); obj.setType("2");
@ -359,13 +343,19 @@ public class ObjectiveApi {
obj.setAnswer("错"); obj.setAnswer("错");
} }
} }
obj.setSource(schoolId);
obj.setQuestionA(a);
obj.setQuestionB(b);
obj.setQuestionC(c);
obj.setQuestionD(d);
obj.setQuestionE(e);
obj.setAnalysis(analyze); obj.setAnalysis(analyze);
obj.setScore(BigDecimal.valueOf(Integer.parseInt(score))); obj.setScore(BigDecimal.valueOf(Integer.parseInt(score)));
obj.setCreateTime(new Date()); obj.setCreateTime(new Date());
obj.setIsDelete(false); obj.setIsDelete(false);
objectiveQuestionList.add(obj); objectiveQuestionList.add(obj);
//判断名称是否被查出来过 //判断名称是否被查出来过
String oneId = oneIdMap.get(oneName); String oneId = oneIdMap.get(oneName);
if (oneId == null) { if (oneId == null) {

Loading…
Cancel
Save