Pārlūkot izejas kodu

提交音频次数设置代码

chenken 7 gadi atpakaļ
vecāks
revīzija
b7355cedb3

+ 14 - 1
cqb-paper/src/main/java/com/qmth/cqb/paper/model/computerTestModel/ComputerTestPaper.java

@@ -24,6 +24,10 @@ public class ComputerTestPaper {
 	 * 课程code
 	 */
 	private String courseCode;
+	/**
+	 * 试卷类型   A、B卷
+	 */
+	private String groupCode;
 	/**
 	 * 课程名称
 	 */
@@ -50,7 +54,7 @@ public class ComputerTestPaper {
 		
 	}
 	
-	public ComputerTestPaper(Paper paper){
+	public ComputerTestPaper(Paper paper,String groupCode){
 		this.id = paper.getId();
 		this.name = paper.getName();
 		this.courseCode = paper.getCourse().getCode();
@@ -62,6 +66,7 @@ public class ComputerTestPaper {
 		}else{
 			this.hasVideo = 1;
 		}
+		this.groupCode = groupCode;
 	}
 	
 	public String getId() {
@@ -116,6 +121,14 @@ public class ComputerTestPaper {
 	public void setCourseName(String courseName) {
 		this.courseName = courseName;
 	}
+
+	public String getGroupCode() {
+		return groupCode;
+	}
+
+	public void setGroupCode(String groupCode) {
+		this.groupCode = groupCode;
+	}
 	
 }
 

+ 6 - 3
cqb-paper/src/main/java/com/qmth/cqb/paper/service/export/ExportPaperAbstractService.java

@@ -688,16 +688,18 @@ public abstract class ExportPaperAbstractService {
 		}
     }
     
-    private void getBodyAndOptionAudioFile(ComputerTestQuestion question,Sections bodySections,String jsonDirectoryPath){
+    private void getBodyAndOptionAudioFile(ComputerTestQuestion computerTestQuestion,Sections bodySections,String jsonDirectoryPath){
     	List<Section> sectionList = bodySections.getSections();
 		for(Section section:sectionList){
 			List<Block> blocks = section.getBlocks();
 			for(Block block:blocks){
 				if("audio".equals(block.getType())){
-					PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(question.getId());
+					PaperDetailUnit paperDetailUnit = paperDetailUnitRepo.findById(computerTestQuestion.getId());
 					QuestionAudio audio = questionAudioService.findByQuestionIdAndFileName(paperDetailUnit.getQuestion().getId(),block.getValue());
 					if(audio!=null){
 						FileDisposeUtil.saveUrlAs(downloadUrl+audio.getFileUrl(),jsonDirectoryPath+File.separator+block.getValue());
+						
+						
 					}
 				}
 			}
@@ -714,11 +716,12 @@ public abstract class ExportPaperAbstractService {
     	List<ComputerTestPaper> computerTestPapers = new ArrayList<ComputerTestPaper>();
     	//循环得到试卷
     	for(ExamPaper examPaper:examPapers){
+    		
     		Paper paper = examPaper.getPaper();
     		//得到所有旧对象的大题对象
     		List<PaperDetail> paperDetails = paperService.findPaperDetailsById(paper.getId());
     		//通过 paper 对象 ,生成新的  ComputerTestPaper 对象
-    		ComputerTestPaper computerTestPaper = new ComputerTestPaper(paper);
+    		ComputerTestPaper computerTestPaper = new ComputerTestPaper(paper,examPaper.getGroupCode());
     		List<ComputerTestPaperDetail> details = new ArrayList<ComputerTestPaperDetail>();
     		//遍历所有旧大题对象,得到小题对象的集合
     		for(PaperDetail paperDetail:paperDetails){