|
@@ -11,6 +11,7 @@ import org.springframework.data.annotation.Id;
|
|
|
|
|
|
import cn.com.qmth.examcloud.common.dto.em.enums.ExamType;
|
|
|
|
|
|
+import com.qmth.cqb.paper.model.computerTestModel.ComputerTestPaper;
|
|
|
import com.qmth.cqb.utils.enums.ExamFileType;
|
|
|
|
|
|
/**
|
|
@@ -89,7 +90,14 @@ public class ExamFile implements Serializable{
|
|
|
public ExamFile(){
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 普通
|
|
|
+ * @param paperId
|
|
|
+ * @param extractConfig
|
|
|
+ * @param filePath
|
|
|
+ * @param examFileType
|
|
|
+ * @param fileSuffix
|
|
|
+ */
|
|
|
public ExamFile(String paperId,ExtractConfig extractConfig,String filePath,ExamFileType examFileType,String fileSuffix){
|
|
|
this.orgId = extractConfig.getOrgId();
|
|
|
this.orgName = extractConfig.getOrgName();
|
|
@@ -98,28 +106,24 @@ public class ExamFile implements Serializable{
|
|
|
this.examType = ExamType.strToEnum(extractConfig.getExamType());
|
|
|
this.courseId = extractConfig.getCourseCode();
|
|
|
this.courseName = extractConfig.getCourseName();
|
|
|
-
|
|
|
- Map<String,String> paperIdMap = extractConfig.getFinishedPaperIdMap();
|
|
|
- Set<Entry<String,String>> entry = paperIdMap.entrySet();
|
|
|
- Iterator<Entry<String,String>> iterator = entry.iterator();
|
|
|
- String groupCode = "";
|
|
|
- while(iterator.hasNext()){
|
|
|
- Entry<String,String> next = iterator.next();
|
|
|
- if(paperId.equals(next.getValue())){
|
|
|
- groupCode = next.getKey();
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- this.groupCode = groupCode;
|
|
|
+ this.groupCode = findGroupCode(extractConfig,paperId);
|
|
|
this.fileName = extractConfig.getCourseName()+"_"+
|
|
|
extractConfig.getCourseCode()+"_"+
|
|
|
examFileType.getName()+"_"+
|
|
|
- groupCode+fileSuffix;
|
|
|
+ this.groupCode+fileSuffix;
|
|
|
this.filePath = filePath;
|
|
|
this.examFileType = examFileType;
|
|
|
}
|
|
|
|
|
|
- public ExamFile(ExtractConfig extractConfig,String filePath,ExamFileType examFileType,String paperName,String fileSuffix){
|
|
|
+ /**
|
|
|
+ * 机考
|
|
|
+ * @param extractConfig
|
|
|
+ * @param filePath
|
|
|
+ * @param examFileType
|
|
|
+ * @param computerTestPaper
|
|
|
+ * @param fileSuffix
|
|
|
+ */
|
|
|
+ public ExamFile(ComputerTestPaper computerTestPaper,ExtractConfig extractConfig,String filePath,ExamFileType examFileType,String fileSuffix){
|
|
|
this.orgId = extractConfig.getOrgId();
|
|
|
this.orgName = extractConfig.getOrgName();
|
|
|
this.examId = extractConfig.getExamId()+"";
|
|
@@ -127,11 +131,33 @@ public class ExamFile implements Serializable{
|
|
|
this.examType = ExamType.strToEnum(extractConfig.getExamType());
|
|
|
this.courseId = extractConfig.getCourseCode();
|
|
|
this.courseName = extractConfig.getCourseName();
|
|
|
- this.fileName = extractConfig.getCourseCode()+"_"+paperName+fileSuffix;
|
|
|
+ this.groupCode = findGroupCode(extractConfig,computerTestPaper.getId());
|
|
|
+ this.fileName = extractConfig.getCourseCode()+"_"+computerTestPaper.getName()+fileSuffix;
|
|
|
this.filePath = filePath;
|
|
|
this.examFileType = examFileType;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 筛选出groupCode
|
|
|
+ * @param extractConfig
|
|
|
+ * @param paperId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private String findGroupCode(ExtractConfig extractConfig,String paperId){
|
|
|
+ String groupCode = "";
|
|
|
+ Map<String,String> paperIdMap = extractConfig.getFinishedPaperIdMap();
|
|
|
+ Set<Entry<String,String>> entry = paperIdMap.entrySet();
|
|
|
+ Iterator<Entry<String,String>> iterator = entry.iterator();
|
|
|
+ while(iterator.hasNext()){
|
|
|
+ Entry<String,String> next = iterator.next();
|
|
|
+ if(paperId.equals(next.getValue())){
|
|
|
+ groupCode = next.getKey();
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return groupCode;
|
|
|
+ }
|
|
|
+
|
|
|
public ExamFile(String examId,String orgId){
|
|
|
this.examId = examId;
|
|
|
this.orgId = orgId;
|