|
@@ -125,8 +125,8 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
if(exportStructure==null){
|
|
if(exportStructure==null){
|
|
throw new RuntimeException("该考试下的试卷结构导出设置未制定,不能导出");
|
|
throw new RuntimeException("该考试下的试卷结构导出设置未制定,不能导出");
|
|
}
|
|
}
|
|
- //查询该考试下是否所有课程都制定了调卷规则
|
|
|
|
- checkAllCourseByExamId(exportModel.getExamId());
|
|
|
|
|
|
+ //查询该考试下是否所有课程都制定了调卷规则和考试文件
|
|
|
|
+ checkAllCourseByExamId(exportModel.getExamId(),exportStructure.getExportType());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -143,7 +143,7 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
if(exportModel.getExportContentList().contains(ExamFileType.PAPER_STRUCTURE_OBJECTIVE.name())
|
|
if(exportModel.getExportContentList().contains(ExamFileType.PAPER_STRUCTURE_OBJECTIVE.name())
|
|
&&exportModel.getExportWay()==ExportWay.BATCH
|
|
&&exportModel.getExportWay()==ExportWay.BATCH
|
|
&&exportStructure.getExportType()==ExportType.NORMAL){
|
|
&&exportStructure.getExportType()==ExportType.NORMAL){
|
|
- paperIds = checkAllCourseByExamId(exportModel.getExamId());
|
|
|
|
|
|
+ paperIds = checkAllCourseByExamId(exportModel.getExamId(),exportStructure.getExportType());
|
|
//生成试卷结构到downloadDirectory目录
|
|
//生成试卷结构到downloadDirectory目录
|
|
if(paperIds.size()>0){
|
|
if(paperIds.size()>0){
|
|
//创建试卷结构Excel文件
|
|
//创建试卷结构Excel文件
|
|
@@ -172,7 +172,7 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
* 查询该考试下是否所有课程都制定了调卷规则
|
|
* 查询该考试下是否所有课程都制定了调卷规则
|
|
* @param examId
|
|
* @param examId
|
|
*/
|
|
*/
|
|
- private List<String> checkAllCourseByExamId(String examId) {
|
|
|
|
|
|
+ private List<String> checkAllCourseByExamId(String examId,ExportType exportType) {
|
|
List<String> paperIdList = new ArrayList<String>();
|
|
List<String> paperIdList = new ArrayList<String>();
|
|
List<ExamCourseDto> examCourseDtoList = examCourseClient.findExamCourseByExamId(examId);
|
|
List<ExamCourseDto> examCourseDtoList = examCourseClient.findExamCourseByExamId(examId);
|
|
for(ExamCourseDto examCourseDto:examCourseDtoList){
|
|
for(ExamCourseDto examCourseDto:examCourseDtoList){
|
|
@@ -186,7 +186,7 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
if(extractConfig.getIfFinish()==null||extractConfig.getIfFinish()==0){
|
|
if(extractConfig.getIfFinish()==null||extractConfig.getIfFinish()==0){
|
|
throw new RuntimeException("该考试下的课程“"+extractConfig.getCourseName()+"”考试文件没有生成,不能批量导出,请保存调卷规则生成文件");
|
|
throw new RuntimeException("该考试下的课程“"+extractConfig.getCourseName()+"”考试文件没有生成,不能批量导出,请保存调卷规则生成文件");
|
|
}
|
|
}
|
|
- checkExamFileExists(examId,examCourseDto);
|
|
|
|
|
|
+ checkExamFileExists(examId,examCourseDto,exportType);
|
|
Map<String,String> finishedPaperIdMap = extractConfig.getFinishedPaperIdMap();
|
|
Map<String,String> finishedPaperIdMap = extractConfig.getFinishedPaperIdMap();
|
|
Set<Entry<String,String>> entry = finishedPaperIdMap.entrySet();
|
|
Set<Entry<String,String>> entry = finishedPaperIdMap.entrySet();
|
|
Iterator<Entry<String,String>> iterator = entry.iterator();
|
|
Iterator<Entry<String,String>> iterator = entry.iterator();
|
|
@@ -203,7 +203,7 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
* @param examId
|
|
* @param examId
|
|
* @param examCourseDto
|
|
* @param examCourseDto
|
|
*/
|
|
*/
|
|
- private void checkExamFileExists(String examId,ExamCourseDto examCourseDto){
|
|
|
|
|
|
+ private void checkExamFileExists(String examId,ExamCourseDto examCourseDto,ExportType exportType){
|
|
ExamFile examFileCondition = new ExamFile();
|
|
ExamFile examFileCondition = new ExamFile();
|
|
examFileCondition.setExamId(examId);
|
|
examFileCondition.setExamId(examId);
|
|
examFileCondition.setCourseId(examCourseDto.getCourseCode());
|
|
examFileCondition.setCourseId(examCourseDto.getCourseCode());
|
|
@@ -212,14 +212,23 @@ public class ExtractConfigFileServiceImpl implements ExtractConfigFileService {
|
|
|
|
|
|
//检查是否都生成了试卷文件
|
|
//检查是否都生成了试卷文件
|
|
boolean paperFlag = false;
|
|
boolean paperFlag = false;
|
|
- for(ExamFile examFile:examfiles){
|
|
|
|
- if(examFile.getExamFileType()==ExamFileType.PAPER){
|
|
|
|
- paperFlag = true;
|
|
|
|
- continue;
|
|
|
|
|
|
+ if(exportType == ExportType.NORMAL){
|
|
|
|
+ for(ExamFile examFile:examfiles){
|
|
|
|
+ if(examFile.getExamFileType()==ExamFileType.PAPER){
|
|
|
|
+ paperFlag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ for(ExamFile examFile:examfiles){
|
|
|
|
+ if(examFile.getExamFileType()==ExamFileType.COMPUTERTEST_PACKAGE){
|
|
|
|
+ paperFlag = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if(!paperFlag){
|
|
if(!paperFlag){
|
|
- throw new RuntimeException("该考试下的课程“"+examCourseDto.getCourseName()+"”考试文件没有生成,不能批量导出,请重新保存调卷规则生成");
|
|
|
|
|
|
+ String message = exportType == ExportType.NORMAL?"考试文件":"机考数据包";
|
|
|
|
+ throw new RuntimeException("该考试下的课程“"+examCourseDto.getCourseName()+"”"+message+"没有生成,不能批量导出,请重新保存调卷规则生成");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|