|
@@ -9,8 +9,6 @@ import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -55,6 +53,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
|
* Created by songyue on 16/12/28.
|
|
|
+ * updated by weiwenhai on 2018.9.28
|
|
|
* @code 160
|
|
|
*/
|
|
|
@RestController
|
|
@@ -84,8 +83,8 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "根据Id获取试卷", notes = "根据Id获取试卷")
|
|
|
@GetMapping(value = "/paper/{paperId}")
|
|
|
- public ResponseEntity getPaperById(@PathVariable String paperId) {
|
|
|
- return new ResponseEntity(paperService.getPaperDto(paperId), HttpStatus.OK);
|
|
|
+ public ResponseEntity<Object> getPaperById(@PathVariable String paperId) {
|
|
|
+ return new ResponseEntity<Object>(paperService.getPaperDto(paperId), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -96,15 +95,14 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "保存试卷", notes = "保存试卷")
|
|
|
@PutMapping(value = "/paper")
|
|
|
- public ResponseEntity savePaperById(HttpServletRequest request, @RequestBody PaperExp paper) {
|
|
|
+ public ResponseEntity<Object> savePaperById(@RequestBody PaperExp paper) {
|
|
|
User user = getAccessUser();
|
|
|
Map<String, Object> msgMap = paperService.savePaper(paper, user);
|
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
|
- return new ResponseEntity(msgMap, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(msgMap, HttpStatus.OK);
|
|
|
} else {
|
|
|
- return new ResponseEntity(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -117,29 +115,26 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询所有导入试卷", notes = "查询所有导入试卷")
|
|
|
@GetMapping(value = "/importPaper/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity getImportPapers(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
+ public ResponseEntity<Object> getImportPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
@PathVariable int curPage,
|
|
|
@PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
- return new ResponseEntity(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询所有待审核和审核不通过的导入试卷", notes = "查询所有待审核和审核不通过的导入试卷")
|
|
|
@GetMapping(value = "/importPaperNotSuccess/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity getImportPapersNotSuccess(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable int curPage, @PathVariable int pageSize) {
|
|
|
+ public ResponseEntity<Object> getImportPapersNotSuccess(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable int curPage, @PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
- return new ResponseEntity(paperService.getImportPapersNotSuccess(paperSearchInfo, curPage, pageSize),
|
|
|
+ return new ResponseEntity<Object>(paperService.getImportPapersNotSuccess(paperSearchInfo, curPage, pageSize),
|
|
|
HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据条件查询导入试卷", notes = "根据条件查询导入试卷")
|
|
|
@GetMapping(value = "/getImportPaper")
|
|
|
- public ResponseEntity<List<Paper>> getImportPapersBySearch(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<List<Paper>> getImportPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
return new ResponseEntity<List<Paper>>(paperService.getImportPapersBySearch(paperSearchInfo), HttpStatus.OK);
|
|
@@ -147,8 +142,7 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value = "根据条件查询已组试卷", notes = "根据条件查询已组试卷")
|
|
|
@GetMapping(value = "/getGenPaper")
|
|
|
- public ResponseEntity<List<Paper>> getGenPapersBySearch(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<List<Paper>> getGenPapersBySearch(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
return new ResponseEntity<List<Paper>>(paperService.getGenPapersBySearch(paperSearchInfo), HttpStatus.OK);
|
|
@@ -164,11 +158,11 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询所有已组试卷", notes = "查询所有已组试卷")
|
|
|
@GetMapping(value = "/genPaper/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity getGenPapers(HttpServletRequest request, @ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
+ public ResponseEntity<Object> getGenPapers(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
@PathVariable int curPage, @PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
- return new ResponseEntity(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -182,7 +176,7 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
|
|
|
@GetMapping(value = "/genPaper/{ids}/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity<Object> getGenPapersNotInIds(HttpServletRequest request, @ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
+ public ResponseEntity<Object> getGenPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo,
|
|
|
@PathVariable String[] ids, @PathVariable int curPage, @PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
@@ -202,13 +196,13 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "删除试卷", notes = "删除试卷")
|
|
|
@DeleteMapping(value = "/paper/{paperIds}")
|
|
|
- public ResponseEntity delPaper(@PathVariable String paperIds) {
|
|
|
+ public ResponseEntity<Object> delPaper(@PathVariable String paperIds) {
|
|
|
List<String> paperList = Stream.of(paperIds.split(",")).collect(Collectors.toList());
|
|
|
Map<String, Object> msgMap = paperService.deletePapers(paperList);
|
|
|
if (msgMap.get("msg").equals("success")) {
|
|
|
- return new ResponseEntity(msgMap, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(msgMap, HttpStatus.OK);
|
|
|
} else {
|
|
|
- return new ResponseEntity(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -221,9 +215,9 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "批量通过试卷", notes = "批量通过试卷")
|
|
|
@PutMapping(value = "/paper/pass")
|
|
|
- public ResponseEntity passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<Object> passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
paperService.passPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -234,9 +228,9 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "批量不通过试卷", notes = "批量不通过试卷")
|
|
|
@PutMapping(value = "/paper/noPass")
|
|
|
- public ResponseEntity noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<Object> noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
paperService.noPassPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -247,9 +241,9 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "批量待审核试卷", notes = "批量待审核试卷")
|
|
|
@PutMapping(value = "/paper/draft")
|
|
|
- public ResponseEntity initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<Object> initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
|
paperService.backPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -278,10 +272,10 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "新增考试试卷", notes = "新增考试试卷")
|
|
|
@PostMapping(value = "/paper/join/{examId}/{courseCode}/{groupCode}/{paperId}")
|
|
|
- public ResponseEntity joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
+ public ResponseEntity<Object> joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
|
paperService.joinToExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -295,11 +289,11 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "删除考试试卷", notes = "删除考试试卷")
|
|
|
@DeleteMapping(value = "/paper/release/{examId}/{courseCode}/{groupCode}/{paperId}")
|
|
|
- public ResponseEntity releaseExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
+ public ResponseEntity<Object> releaseExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
|
|
|
|
paperService.releaseExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -325,10 +319,10 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "删除考试试卷类型", notes = "删除考试试卷类型")
|
|
|
@DeleteMapping(value = "/paper/groupCode/{examId}/{courseCode}/{groupCode}")
|
|
|
- public ResponseEntity deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
+ public ResponseEntity<Object> deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
|
|
|
@PathVariable String groupCode) {
|
|
|
paperService.deletGroupCode(Long.parseLong(examId), courseCode, groupCode);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -339,11 +333,10 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "删除导入试卷中的试题", notes = "删除导入试卷中的试题")
|
|
|
@DeleteMapping(value = "/paper/deleteQuestion/{questionId}")
|
|
|
- public ResponseEntity deleteImportPaperQuestion(HttpServletRequest request, @PathVariable String questionId) {
|
|
|
+ public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String questionId) {
|
|
|
User user = getAccessUser();
|
|
|
- //AccessUser user = (AccessUser) request.getAttribute("accessUser");
|
|
|
List<String> paperNames = paperService.deleteImportQuestionById(questionId, user);
|
|
|
- return new ResponseEntity(paperNames, HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(paperNames, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -356,7 +349,7 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
|
|
|
@PostMapping(value = "/paper/addQuestion/{paperId}/{paperDetailId}")
|
|
|
- public ResponseEntity<Object> insertQuestionToPaper(HttpServletRequest request, @PathVariable String paperId,
|
|
|
+ public ResponseEntity<Object> insertQuestionToPaper(@PathVariable String paperId,
|
|
|
@PathVariable String paperDetailId, @RequestBody Question question) {
|
|
|
User user = getAccessUser();
|
|
|
return new ResponseEntity<Object>(paperService.insertQuestionToPaper(paperId, paperDetailId, question, user),
|
|
@@ -366,12 +359,9 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value = "获取试卷的重复试题", notes = "获取试卷的重复试题")
|
|
|
@GetMapping(value = "/paper/{paperId}/reduplicate-questions")
|
|
|
- public ResponseEntity reduplicateQuestions(@PathVariable String paperId) {
|
|
|
-
|
|
|
+ public ResponseEntity<Object> reduplicateQuestions(@PathVariable String paperId) {
|
|
|
List<PaperDetailUnitExp> allPaperDetailUnitList = new ArrayList<>();
|
|
|
- // List<String> reduplicateId = new ArrayList<>();
|
|
|
List<Set<String>> reduplicateId = new ArrayList<>();
|
|
|
-
|
|
|
PaperExp paperExp = paperService.getPaperDto(paperId);
|
|
|
List<PaperDetailExp> paperDetailExpList = paperExp.getPaperDetails();
|
|
|
if (paperDetailExpList != null && paperDetailExpList.size() > 0) {
|
|
@@ -379,10 +369,8 @@ public class PaperController extends ControllerSupport{
|
|
|
if (paperDetailExp.getPaperDetailUnits() != null) {
|
|
|
allPaperDetailUnitList.addAll(paperDetailExp.getPaperDetailUnits());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
int length = allPaperDetailUnitList.size();
|
|
|
for (int i = 0; i < length - 1; i++) {
|
|
|
PaperDetailUnitExp paperDetailUnitExp1 = allPaperDetailUnitList.get(i);
|
|
@@ -417,7 +405,6 @@ public class PaperController extends ControllerSupport{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if (!found) {
|
|
|
Set<String> redupSet = new HashSet<>();
|
|
|
|
|
@@ -430,20 +417,18 @@ public class PaperController extends ControllerSupport{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return new ResponseEntity(reduplicateId, HttpStatus.OK);
|
|
|
-
|
|
|
+ return new ResponseEntity<Object>(reduplicateId, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据试题获取试卷名称
|
|
|
- *
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "获取试题所在的试卷名称", notes = "获取试题所在的试卷名称")
|
|
|
@GetMapping(value = "/paper/listNames/{questionId}")
|
|
|
- public ResponseEntity getPaperNamesByQuesId(@PathVariable String questionId) {
|
|
|
- return new ResponseEntity(paperService.getPaperNamesByQuestionId(questionId), HttpStatus.OK);
|
|
|
+ public ResponseEntity<Object> getPaperNamesByQuesId(@PathVariable String questionId) {
|
|
|
+ return new ResponseEntity<Object>(paperService.getPaperNamesByQuestionId(questionId), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -454,12 +439,11 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询用于选题的试题列表", notes = "查询用于选题的试题列表")
|
|
|
@GetMapping(value = "/paper/listQuestion/{paperId}/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity<Object> listQuestionforSelect(HttpServletRequest request,
|
|
|
- @PathVariable String paperId,
|
|
|
- @PathVariable int curPage,
|
|
|
- @PathVariable int pageSize,
|
|
|
- @RequestParam(name = "quesType") String quesType,
|
|
|
- @RequestParam(name = "quesBody") String quesBody) {
|
|
|
+ public ResponseEntity<Object> listQuestionforSelect(@PathVariable String paperId,
|
|
|
+ @PathVariable int curPage,
|
|
|
+ @PathVariable int pageSize,
|
|
|
+ @RequestParam(name = "quesType") String quesType,
|
|
|
+ @RequestParam(name = "quesBody") String quesBody) {
|
|
|
User user = getAccessUser();
|
|
|
if(user == null){
|
|
|
return new ResponseEntity<Object>(new PageImpl<Question>(new ArrayList<Question>()),HttpStatus.OK);
|
|
@@ -474,7 +458,6 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
/**
|
|
|
* 向试卷中某道大题插入多道试题(已存在的试题)
|
|
|
- *
|
|
|
* @param paperId
|
|
|
* @param paperDetailId
|
|
|
* @param questions
|
|
@@ -482,16 +465,15 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "向导入试卷中的新增试题", notes = "向导入试卷中的新增试题")
|
|
|
@PostMapping(value = "/paper/selectQuestions/{paperId}/{paperDetailId}")
|
|
|
- public ResponseEntity selectQuestionsToPaper(HttpServletRequest request, @PathVariable String paperId,
|
|
|
+ public ResponseEntity<Object> selectQuestionsToPaper(@PathVariable String paperId,
|
|
|
@PathVariable String paperDetailId, @RequestBody List<Question> questions) {
|
|
|
User user = getAccessUser();
|
|
|
- return new ResponseEntity(paperService.selectQuestionsToPaper(paperId, paperDetailId, questions, user),
|
|
|
+ return new ResponseEntity<Object>(paperService.selectQuestionsToPaper(paperId, paperDetailId, questions, user),
|
|
|
HttpStatus.OK);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @param request
|
|
|
* @param paperSearchInfo
|
|
|
* @param ids
|
|
@@ -501,16 +483,15 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询所有导入试卷(not in paperIds)", notes = "查询所有导入试卷(not in paperIds)")
|
|
|
@GetMapping(value = "/importPaper/{ids}/{curPage}/{pageSize}")
|
|
|
- public ResponseEntity getImportPapersNotInIds(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable String[] ids, @PathVariable int curPage,
|
|
|
+ public ResponseEntity<Object> getImportPapersNotInIds(@ModelAttribute PaperSearchInfo paperSearchInfo, @PathVariable String[] ids, @PathVariable int curPage,
|
|
|
@PathVariable int pageSize) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
if (ids != null && ids.length > 0) {
|
|
|
- return new ResponseEntity(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize,PaperType.IMPORT),
|
|
|
+ return new ResponseEntity<Object>(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize,PaperType.IMPORT),
|
|
|
HttpStatus.OK);
|
|
|
} else {
|
|
|
- return new ResponseEntity(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -522,14 +503,13 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "查询该课程的所有导入试卷", notes = "查询该课程的所有导入试卷")
|
|
|
@GetMapping(value = "/importPaper/course")
|
|
|
- public ResponseEntity getImportPapersByCourseNo(HttpServletRequest request,
|
|
|
- @ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
+ public ResponseEntity<Object> getImportPapersByCourseNo(@ModelAttribute PaperSearchInfo paperSearchInfo) {
|
|
|
User user = getAccessUser();
|
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
|
paperService.formatPaperSearchInfo(paperSearchInfo);
|
|
|
Paper importPaper = BeanCopierUtil.copyProperties(paperSearchInfo, Paper.class);
|
|
|
importPaper.setPaperType(PaperType.IMPORT);
|
|
|
- return new ResponseEntity(paperRepo.findAll(Example.of(importPaper)), HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(paperRepo.findAll(Example.of(importPaper)), HttpStatus.OK);
|
|
|
|
|
|
}
|
|
|
/**
|
|
@@ -540,22 +520,21 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value = "复制导入试卷为组卷", notes = "复制导入试卷为组卷")
|
|
|
@PutMapping(value = "/useBasePaper/{paperIds}")
|
|
|
- public ResponseEntity useBasePaper(HttpServletRequest request,@PathVariable String paperIds){
|
|
|
+ public ResponseEntity<Object> useBasePaper(@PathVariable String paperIds){
|
|
|
User user = getAccessUser();
|
|
|
try{
|
|
|
String[] paperIdArray = paperIds.split(",");
|
|
|
for(int i = 0;i<paperIdArray.length;i++){
|
|
|
Paper oldpaper = paperRepo.findOne(paperIdArray[i]);
|
|
|
- boolean result = paperService.checkPaperName(oldpaper.getName(), PaperType.GENERATE,user.getRootOrgId()+"");
|
|
|
+ boolean result = paperService.checkPaperName(oldpaper.getName(),PaperType.GENERATE,user.getRootOrgId()+"");
|
|
|
if(!result){
|
|
|
throw new StatusException("Q-160565","考试试卷:"+oldpaper.getName()+"已经存在");
|
|
|
- //return new ResponseEntity(new ErrorMsg("考试试卷:"+oldpaper.getName()+"已经存在"),HttpStatus.OK);
|
|
|
}
|
|
|
}
|
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}catch(Exception e){
|
|
|
- return new ResponseEntity(e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -567,21 +546,21 @@ public class PaperController extends ControllerSupport{
|
|
|
*/
|
|
|
@ApiOperation(value="上传音频文件检查",notes="上传音频文件检查")
|
|
|
@PostMapping(value="/checkRadioFile/{paperId}")
|
|
|
- public ResponseEntity checkRadioFile(@PathVariable String paperId,@RequestBody List<String> filesName){
|
|
|
+ public ResponseEntity<Object> checkRadioFile(@PathVariable String paperId,@RequestBody List<String> filesName){
|
|
|
Map<String, String> errorMessage = paperService.checkRadioFile(paperId, filesName);
|
|
|
- return new ResponseEntity(errorMessage,HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(errorMessage,HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value="上传音频文件", notes="上传音频文件")
|
|
|
@PostMapping(value="/uploadRadio/{paperId}")
|
|
|
- public ResponseEntity uploadRadio(List<MultipartFile> files,@PathVariable String paperId,HttpServletRequest request){
|
|
|
+ public ResponseEntity<Object> uploadRadio(List<MultipartFile> files,@PathVariable String paperId){
|
|
|
User user = getAccessUser();
|
|
|
try {
|
|
|
paperService.uploadRadio(files, paperId, user);
|
|
|
- return new ResponseEntity(HttpStatus.OK);
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- return new ResponseEntity(e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
+ return new ResponseEntity<Object>(e.getMessage(),HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -604,8 +583,7 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value="传送到印刷平台", notes="传送到印刷平台")
|
|
|
@GetMapping(value="/sendPrint/{paperId}/{paperHtmlUrl}/{examId}")
|
|
|
- public ResponseEntity<Object> sendPrint(HttpServletRequest request,
|
|
|
- @PathVariable String paperId,
|
|
|
+ public ResponseEntity<Object> sendPrint(@PathVariable String paperId,
|
|
|
@PathVariable String paperHtmlUrl,
|
|
|
@PathVariable String examId){
|
|
|
User user = getAccessUser();
|
|
@@ -618,7 +596,7 @@ public class PaperController extends ControllerSupport{
|
|
|
|
|
|
@ApiOperation(value="根据试卷id查询主观题与客观题数量", notes="根据试卷id查询主观题与客观题数量")
|
|
|
@GetMapping(value="/questionStructure")
|
|
|
- public QuestionAllTypeDto findQuestionStructure(HttpServletRequest request,@RequestParam("paperId") String paperId, @RequestHeader("user_token") String user_token) throws Exception{
|
|
|
+ public QuestionAllTypeDto findQuestionStructure(@RequestParam("paperId") String paperId, @RequestHeader("user_token") String user_token) throws Exception{
|
|
|
User user = getAccessUser();
|
|
|
return paperService.findQuestionStructure(paperId,user);
|
|
|
}
|