瀏覽代碼

提交使用原卷BUG

chenken 8 年之前
父節點
當前提交
8119c284a4

+ 39 - 0
cqb-paper/src/main/java/com/qmth/cqb/paper/web/ExamFileController.java

@@ -0,0 +1,39 @@
+package com.qmth.cqb.paper.web;
+
+import io.swagger.annotations.ApiOperation;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.qmth.cqb.paper.model.ExamFile;
+import com.qmth.cqb.paper.service.ExamFileService;
+
+/**
+ * @author  	chenken
+ * @date    	2017年7月25日 下午2:21:57
+ * @company 	QMTH
+ * @description ExamFileController.java
+ */
+@Controller
+@RequestMapping("${api_cqb}/")
+public class ExamFileController {
+	
+	@Autowired
+	private ExamFileService examFileService;
+	
+	@ApiOperation(value = "查询试卷文件", notes = "查询试卷文件")
+	@PostMapping(value = "/findExamFile")
+	public ResponseEntity findExamFile(@RequestBody ExamFile examFile){
+		List<ExamFile> examFiles = examFileService.findExamFileListByExamFile(examFile);
+		return new ResponseEntity(examFiles,HttpStatus.OK);
+	}
+}
+

+ 3 - 7
cqb-paper/src/main/java/com/qmth/cqb/paper/web/ExtractConfigController.java

@@ -29,7 +29,6 @@ import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
 import cn.com.qmth.examcloud.common.util.ErrorMsg;
 
 import com.qmth.cqb.paper.dto.ExportPaperInfoModel;
-import com.qmth.cqb.paper.model.ExamFile;
 import com.qmth.cqb.paper.model.ExtractConfig;
 import com.qmth.cqb.paper.service.ExtractConfigService;
 import com.qmth.cqb.utils.enums.ExportWay;
@@ -164,6 +163,7 @@ public class ExtractConfigController {
 		try {
 			extractConfigService.exportExamPaperInfo(exportModel,response);
 		} catch (Exception e) {
+			logger.error("Method:exportExamPaperInfo"+e.getMessage());
 			e.printStackTrace();
 		}
 	}
@@ -180,6 +180,7 @@ public class ExtractConfigController {
 			extractConfigService.exportExamPaperInfoCheck(exportModel,response);
 			return new ResponseEntity<String>(HttpStatus.OK);
 		} catch (Exception e) {
+			logger.error("Method:exportExamPaperInfoCheck"+e.getMessage());
 			return new ResponseEntity<String>(e.getMessage(),HttpStatus.OK);
 		}
 	}
@@ -203,14 +204,9 @@ public class ExtractConfigController {
 		try {
 			extractConfigService.exportExamPaperInfo(exportModel,response);
 		} catch (Exception e) {
+			logger.error("Method:exportExamPaperInfo"+e.getMessage());
 			e.printStackTrace();
 		}
 	}
 	
-	@ApiOperation(value = "检查该考试下该课程是否生成试卷文件", notes = "检查该考试下该课程是否生成试卷文件")
-	@GetMapping(value = "/findPaperStructure/{examId}/{courseId}")
-	public ResponseEntity findPaperStructure(@PathVariable String examId,@PathVariable String courseId){
-		List<ExamFile> examFiles = extractConfigService.findPaperStructure(examId,courseId);
-		return new ResponseEntity(examFiles,HttpStatus.OK);
-	}
 }	

+ 2 - 2
cqb-paper/src/main/java/com/qmth/cqb/paper/web/PaperController.java

@@ -551,13 +551,13 @@ public class PaperController {
         		Paper oldpaper = paperRepo.findOne(paperIdArray[i]);
         		boolean result = paperService.checkPaperName(oldpaper.getName(), PaperType.GENERATE,user.getRootOrgId()+"");
         		if(!result){
-        			return new ResponseEntity("考试试卷:"+oldpaper.getName()+"已经存在",HttpStatus.INTERNAL_SERVER_ERROR);
+        			return new ResponseEntity("考试试卷:"+oldpaper.getName()+"已经存在",HttpStatus.OK);
         		}
         	}
     		paperService.useBasePaper(paperIds, user.getName());
     		return new ResponseEntity(HttpStatus.OK);
     	}catch(Exception e){
-    		return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);
+    		return new ResponseEntity(e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
     	}
     }
 }