Pārlūkot izejas kodu

提交导出试卷BUG

chenken 8 gadi atpakaļ
vecāks
revīzija
5f254a0182

+ 13 - 15
cqb-paper/src/main/java/com/qmth/cqb/paper/service/export/SxsfExportPaperService.java

@@ -95,31 +95,29 @@ public class SxsfExportPaperService extends ExportPaperAbstractService {
         }
     }
 
-
 	@Override
     public void uploadFile(ExtractConfig extractConfig,String paperId,ExportStructure exportStructure,AccessUser accessUser) throws Exception{
     	PaperExp paperExp = initExportPaper(paperId);
         if (paperExp!=null) {
         	String currNum = CommonUtils.getCurNum();
         	List<PaperDetailExp> objectiveDetails = paperExp.getObjectiveDetails();
-        	if(exportStructure==null||exportStructure.getExportType()==ExportType.NORMAL){
-        		List<QuestionTypeNum> questionTypeNums = new ArrayList<QuestionTypeNum>();
-        		if(exportStructure!=null){
-        			questionTypeNums = exportStructure.getQuestionTypeNums();
-        		}
-        		//检查客观题的数量是否大于试卷导出设置中的客观题数量
-            	if(questionTypeNums.size()>0){
-            		checkObjectiveDetailsNum(paperExp,objectiveDetails,questionTypeNums);
-            	}
+        	//没有试卷结构导出设置
+        	if(exportStructure==null){
+        		//上传试卷
+	        	uploadPaperWord(paperExp,extractConfig,paperId,accessUser,currNum);
+	        	//上传答案
+	        	uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
+        	}else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.NORMAL){
+        		List<QuestionTypeNum> questionTypeNums = exportStructure.getQuestionTypeNums();
+        		//检查试卷中客观题的数量是否大于试卷导出设置中的设置的数量
+        		checkObjectiveDetailsNum(paperExp,objectiveDetails,questionTypeNums);
 	    		//上传试卷
 	        	uploadPaperWord(paperExp,extractConfig,paperId,accessUser,currNum);
 	        	//上传答案
 	        	uploadAnswerWord(paperExp,extractConfig,paperId,accessUser,currNum);
-	        	//上传试卷结构
-	        	if(questionTypeNums.size()>0){
-	        		uploadPaperStructure(paperExp,extractConfig,paperId,accessUser,currNum,questionTypeNums);
-	        	}
-        	}else if(exportStructure.getExportType()==ExportType.ONLINE){
+				//上传试卷结构   不能在上传试卷和答案之前
+        		uploadPaperStructure(paperExp,extractConfig,paperId,accessUser,currNum,questionTypeNums);
+        	}else if(exportStructure!=null&&exportStructure.getExportType()==ExportType.ONLINE){
         		//上传机考JSON文件
         		uploadComputerTestFile(extractConfig,accessUser);
         	}