|
@@ -17,6 +17,7 @@ import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
@@ -24,11 +25,11 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
@@ -36,7 +37,6 @@ import cn.com.qmth.examcloud.core.questions.dao.PaperRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailExp;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperDetailUnitExp;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
|
|
|
-import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionAllTypeDto;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.Paper;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.PaperSearchInfo;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
@@ -47,6 +47,7 @@ import cn.com.qmth.examcloud.core.questions.base.StringSimilarityUtils;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.PaperType;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
|
import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
|
+import cn.com.qmth.examcloud.commons.base.util.JsonUtil;
|
|
|
import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -56,7 +57,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
* updated by weiwenhai on 2018.9.28
|
|
|
* @code 160
|
|
|
*/
|
|
|
-@RestController
|
|
|
+@Controller
|
|
|
@RequestMapping("${api_cqb}/")
|
|
|
public class PaperController extends ControllerSupport{
|
|
|
|
|
@@ -81,6 +82,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperId
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "根据Id获取试卷", notes = "根据Id获取试卷")
|
|
|
@GetMapping(value = "/paper/{paperId}")
|
|
|
public ResponseEntity<Object> getPaperById(@PathVariable String paperId) {
|
|
@@ -93,6 +95,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paper
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "保存试卷", notes = "保存试卷")
|
|
|
@PutMapping(value = "/paper")
|
|
|
public ResponseEntity<Object> savePaperById(@RequestBody PaperExp paper) {
|
|
@@ -113,6 +116,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询所有导入试卷", notes = "查询所有导入试卷")
|
|
|
@GetMapping(value = "/importPaper/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> getImportPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
@@ -123,6 +127,7 @@ public class PaperController extends ControllerSupport{
|
|
|
return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询所有待审核和审核不通过的导入试卷", notes = "查询所有待审核和审核不通过的导入试卷")
|
|
|
@GetMapping(value = "/importPaperNotSuccess/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> getImportPapersNotSuccess(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable int curPage, @PathVariable int pageSize) {
|
|
@@ -132,6 +137,7 @@ public class PaperController extends ControllerSupport{
|
|
|
HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "根据条件查询导入试卷", notes = "根据条件查询导入试卷")
|
|
|
@GetMapping(value = "/getImportPaper")
|
|
|
public ResponseEntity<List<Paper>> getImportPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
@@ -140,6 +146,7 @@ public class PaperController extends ControllerSupport{
|
|
|
return new ResponseEntity<List<Paper>>(paperService.getImportPapersBySearch(paperSearchInfo), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "根据条件查询已组试卷", notes = "根据条件查询已组试卷")
|
|
|
@GetMapping(value = "/getGenPaper")
|
|
|
public ResponseEntity<List<Paper>> getGenPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
@@ -156,6 +163,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询所有已组试卷", notes = "查询所有已组试卷")
|
|
|
@GetMapping(value = "/genPaper/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> getGenPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
@@ -174,6 +182,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
|
|
|
@GetMapping(value = "/genPaper/{ids}/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> getGenPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
@@ -194,6 +203,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperIds
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "删除试卷", notes = "删除试卷")
|
|
|
@DeleteMapping(value = "/paper/{paperIds}")
|
|
|
public ResponseEntity<Object> delPaper(@PathVariable String paperIds) {
|
|
@@ -213,6 +223,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperSearchInfo
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "批量通过试卷", notes = "批量通过试卷")
|
|
|
@PutMapping(value = "/paper/pass")
|
|
|
public ResponseEntity<Object> passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
@@ -226,6 +237,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperSearchInfo
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "批量不通过试卷", notes = "批量不通过试卷")
|
|
|
@PutMapping(value = "/paper/noPass")
|
|
|
public ResponseEntity<Object> noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
@@ -239,6 +251,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperSearchInfo
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "批量待审核试卷", notes = "批量待审核试卷")
|
|
|
@PutMapping(value = "/paper/draft")
|
|
|
public ResponseEntity<Object> initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
@@ -254,6 +267,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param groupCode
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "获取卷库考试试卷", notes = "获取卷库考试试卷")
|
|
|
@GetMapping(value = "/paper/list/{examId}/{courseCode}/{groupCode}")
|
|
|
public List<Paper> listPaperById(@PathVariable String examId, @PathVariable String courseCode,
|
|
@@ -270,6 +284,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperId
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "新增考试试卷", notes = "新增考试试卷")
|
|
|
@PostMapping(value = "/paper/join/{examId}/{courseCode}/{groupCode}/{paperId}")
|
|
|
public ResponseEntity<Object> joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
@@ -287,6 +302,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperId
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "删除考试试卷", notes = "删除考试试卷")
|
|
|
@DeleteMapping(value = "/paper/release/{examId}/{courseCode}/{groupCode}/{paperId}")
|
|
|
public ResponseEntity<Object> releaseExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
@@ -303,6 +319,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param courseCode
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "获取考试试卷类型集合", notes = "获取考试试卷类型集合")
|
|
|
@GetMapping(value = "/paper/groupCode/{examId}/{courseCode}")
|
|
|
public Set<String> listGroup(@PathVariable String examId, @PathVariable String courseCode) {
|
|
@@ -317,6 +334,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param groupCode
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "删除考试试卷类型", notes = "删除考试试卷类型")
|
|
|
@DeleteMapping(value = "/paper/groupCode/{examId}/{courseCode}/{groupCode}")
|
|
|
public ResponseEntity<Object> deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
|
|
@@ -331,6 +349,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param questionId
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "删除导入试卷中的试题", notes = "删除导入试卷中的试题")
|
|
|
@DeleteMapping(value = "/paper/deleteQuestion/{questionId}")
|
|
|
public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String questionId) {
|
|
@@ -347,6 +366,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param question
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
|
|
|
@PostMapping(value = "/paper/addQuestion/{paperId}/{paperDetailId}")
|
|
|
public ResponseEntity<Object> insertQuestionToPaper(@PathVariable String paperId,
|
|
@@ -357,6 +377,7 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "获取试卷的重复试题", notes = "获取试卷的重复试题")
|
|
|
@GetMapping(value = "/paper/{paperId}/reduplicate-questions")
|
|
|
public ResponseEntity<Object> reduplicateQuestions(@PathVariable String paperId) {
|
|
@@ -425,6 +446,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "获取试题所在的试卷名称", notes = "获取试题所在的试卷名称")
|
|
|
@GetMapping(value = "/paper/listNames/{questionId}")
|
|
|
public ResponseEntity<Object> getPaperNamesByQuesId(@PathVariable String questionId) {
|
|
@@ -437,6 +459,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询用于选题的试题列表", notes = "查询用于选题的试题列表")
|
|
|
@GetMapping(value = "/paper/listQuestion/{paperId}/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> listQuestionforSelect(@PathVariable String paperId,
|
|
@@ -463,6 +486,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param questions
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
|
|
|
@PostMapping(value = "/paper/selectQuestions/{paperId}/{paperDetailId}")
|
|
|
public ResponseEntity<Object> selectQuestionsToPaper(@PathVariable String paperId,
|
|
@@ -481,6 +505,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param pageSize
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
|
|
|
@GetMapping(value = "/importPaper/{ids}/{curPage}/{pageSize}")
|
|
|
public ResponseEntity<Object> getImportPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable String[] ids, @PathVariable int curPage,
|
|
@@ -501,6 +526,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperSearchInfo
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "查询该课程的所有导入试卷", notes = "查询该课程的所有导入试卷")
|
|
|
@GetMapping(value = "/importPaper/course")
|
|
|
public ResponseEntity<Object> getImportPapersByCourseNo(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
@@ -518,6 +544,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param paperIds
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value = "复制导入试卷为组卷", notes = "复制导入试卷为组卷")
|
|
|
@PutMapping(value = "/useBasePaper/{paperIds}")
|
|
|
public ResponseEntity<Object> useBasePaper(@PathVariable String paperIds){
|
|
@@ -544,6 +571,7 @@ public class PaperController extends ControllerSupport{
|
|
|
* @param filesName
|
|
|
* @return
|
|
|
*/
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value="上传音频文件检查",notes="上传音频文件检查")
|
|
|
@PostMapping(value="/checkRadioFile/{paperId}")
|
|
|
public ResponseEntity<Object> checkRadioFile(@PathVariable String paperId,@RequestBody List<String> filesName){
|
|
@@ -551,6 +579,7 @@ public class PaperController extends ControllerSupport{
|
|
|
return new ResponseEntity<Object>(errorMessage,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value="上传音频文件", notes="上传音频文件")
|
|
|
@PostMapping(value="/uploadRadio/{paperId}")
|
|
|
public ResponseEntity<Object> uploadRadio(List<MultipartFile> files,@PathVariable String paperId){
|
|
@@ -570,37 +599,35 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value="根据id获取试卷的html片段集合", notes="根据id获取试卷的html片段集合")
|
|
|
@GetMapping(value="/paper/pdf/{paperId}")
|
|
|
- public ResponseEntity<Object> getPaperPDFById(@PathVariable String paperId){
|
|
|
+ public ModelAndView getPaperPDFById(@PathVariable String paperId){
|
|
|
+ ModelAndView view = new ModelAndView("pdf");
|
|
|
Map<String, Object> mag;
|
|
|
try {
|
|
|
mag = paperService.getPaperPDF(paperId);
|
|
|
- return new ResponseEntity<Object>(mag,HttpStatus.OK);
|
|
|
+ view.addObject("htmlList", JsonUtil.toJson(mag.get("htmlList")));
|
|
|
+ view.addObject("courseName", mag.get("courseName"));
|
|
|
+ view.addObject("courseNo", mag.get("courseNo"));
|
|
|
+ return view;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new ResponseEntity<Object>(e.getMessage(),HttpStatus.OK);
|
|
|
+ return view;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="传送到印刷平台", notes="传送到印刷平台")
|
|
|
- @GetMapping(value="/sendPrint/{paperId}/{paperHtmlUrl}/{examId}")
|
|
|
+ @GetMapping(value="/sendPrint/{paperId}/{examId}/{orgId}")
|
|
|
public ResponseEntity<Object> sendPrint(@PathVariable String paperId,
|
|
|
- @PathVariable String paperHtmlUrl,
|
|
|
+ @PathVariable String orgId,
|
|
|
@PathVariable String examId){
|
|
|
User user = getAccessUser();
|
|
|
if(user == null){
|
|
|
return new ResponseEntity<Object>(HttpStatus.NOT_FOUND);
|
|
|
}
|
|
|
- String message = paperService.sendPrint(paperId,paperHtmlUrl,examId,user);
|
|
|
+ String message = paperService.sendPrint(paperId,orgId,examId,user);
|
|
|
return new ResponseEntity<Object>(message,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value="根据试卷id查询主观题与客观题数量", notes="根据试卷id查询主观题与客观题数量")
|
|
|
- @GetMapping(value="/questionStructure")
|
|
|
- public QuestionAllTypeDto findQuestionStructure(@RequestParam("paperId") String paperId, @RequestHeader("user_token") String user_token) throws Exception{
|
|
|
- User user = getAccessUser();
|
|
|
- return paperService.findQuestionStructure(paperId,user);
|
|
|
- }
|
|
|
-
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value="根绝试卷id查询不同类型,题的数量")
|
|
|
@GetMapping(value="/paper/questionNumbers/{paperId}/{publicityType}/{difficultyType}")
|
|
|
public ResponseEntity<Object> questionNumbers(@PathVariable String paperId,
|
|
@@ -610,6 +637,7 @@ public class PaperController extends ControllerSupport{
|
|
|
return new ResponseEntity<Object>(total,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ResponseBody
|
|
|
@ApiOperation(value="根绝试卷id查询不同类型,题的数量")
|
|
|
@GetMapping(value="/paper/questionScores/{paperId}/{publicityType}/{difficultyType}")
|
|
|
public ResponseEntity<Object> questionScores(@PathVariable String paperId,
|