|
@@ -80,7 +80,7 @@ public class PaperController extends ControllerSupport {
|
|
@ApiOperation(value = "根据Id获取试卷", notes = "根据Id获取试卷")
|
|
@ApiOperation(value = "根据Id获取试卷", notes = "根据Id获取试卷")
|
|
@GetMapping(value = "/paper/{paperId}")
|
|
@GetMapping(value = "/paper/{paperId}")
|
|
public ResponseEntity<Object> getPaperById(@PathVariable String paperId) {
|
|
public ResponseEntity<Object> getPaperById(@PathVariable String paperId) {
|
|
- return new ResponseEntity<Object>(paperService.getPaperDto(paperId), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getPaperDto(paperId), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -96,9 +96,9 @@ public class PaperController extends ControllerSupport {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
Map<String, Object> msgMap = paperService.savePaper(paper, user);
|
|
Map<String, Object> msgMap = paperService.savePaper(paper, user);
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
if ("success".equals(msgMap.get("msg"))) {
|
|
- return new ResponseEntity<Object>(msgMap, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<Object>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
|
|
+ return new ResponseEntity<>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,7 +118,7 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable int pageSize) {
|
|
@PathVariable int pageSize) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
- return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -127,7 +127,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> getImportPapersNotSuccess(@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();
|
|
User user = getAccessUser();
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
- return new ResponseEntity<Object>(paperService.getImportPapersNotSuccess(paperSearchInfo, curPage, pageSize),
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getImportPapersNotSuccess(paperSearchInfo, curPage, pageSize),
|
|
HttpStatus.OK);
|
|
HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -164,7 +164,7 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable int curPage, @PathVariable int pageSize) {
|
|
@PathVariable int curPage, @PathVariable int pageSize) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
- return new ResponseEntity<Object>(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -182,10 +182,10 @@ public class PaperController extends ControllerSupport {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
if (ids != null && ids.length > 0) {
|
|
if (ids != null && ids.length > 0) {
|
|
- return new ResponseEntity<Object>(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.GENERATE),
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.GENERATE),
|
|
HttpStatus.OK);
|
|
HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<Object>(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getGenPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -202,9 +202,9 @@ public class PaperController extends ControllerSupport {
|
|
List<String> paperList = Stream.of(paperIds.split(",")).collect(Collectors.toList());
|
|
List<String> paperList = Stream.of(paperIds.split(",")).collect(Collectors.toList());
|
|
Map<String, Object> msgMap = paperService.deletePapers(paperList);
|
|
Map<String, Object> msgMap = paperService.deletePapers(paperList);
|
|
if (msgMap.get("msg").equals("success")) {
|
|
if (msgMap.get("msg").equals("success")) {
|
|
- return new ResponseEntity<Object>(msgMap, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(msgMap, HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<Object>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
|
|
|
|
+ return new ResponseEntity<>(msgMap, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -220,7 +220,7 @@ public class PaperController extends ControllerSupport {
|
|
@PutMapping(value = "/paper/pass")
|
|
@PutMapping(value = "/paper/pass")
|
|
public ResponseEntity<Object> passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
public ResponseEntity<Object> passPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
paperService.passPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
paperService.passPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -234,7 +234,7 @@ public class PaperController extends ControllerSupport {
|
|
@PutMapping(value = "/paper/noPass")
|
|
@PutMapping(value = "/paper/noPass")
|
|
public ResponseEntity<Object> noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
public ResponseEntity<Object> noPassPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
paperService.noPassPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
paperService.noPassPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -248,7 +248,7 @@ public class PaperController extends ControllerSupport {
|
|
@PutMapping(value = "/paper/draft")
|
|
@PutMapping(value = "/paper/draft")
|
|
public ResponseEntity<Object> initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
public ResponseEntity<Object> initPapers(@RequestBody PaperSearchInfo paperSearchInfo) {
|
|
paperService.backPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
paperService.backPapers(Arrays.asList(paperSearchInfo.getPaperIds()));
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -282,7 +282,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
public ResponseEntity<Object> joinExamPaper(@PathVariable String examId, @PathVariable String courseCode,
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
paperService.joinToExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
paperService.joinToExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -301,7 +301,7 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
@PathVariable String groupCode, @PathVariable String paperId) {
|
|
|
|
|
|
paperService.releaseExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
paperService.releaseExamPaper(Long.parseLong(examId), courseCode, groupCode, paperId);
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -332,7 +332,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
|
|
public ResponseEntity<Object> deleteGroup(@PathVariable String examId, @PathVariable String courseCode,
|
|
@PathVariable String groupCode) {
|
|
@PathVariable String groupCode) {
|
|
paperService.deletGroupCode(Long.parseLong(examId), courseCode, groupCode);
|
|
paperService.deletGroupCode(Long.parseLong(examId), courseCode, groupCode);
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -347,7 +347,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String questionId) {
|
|
public ResponseEntity<Object> deleteImportPaperQuestion(@PathVariable String questionId) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
List<String> paperNames = paperService.deleteImportQuestionById(questionId, user);
|
|
List<String> paperNames = paperService.deleteImportQuestionById(questionId, user);
|
|
- return new ResponseEntity<Object>(paperNames, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperNames, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -364,7 +364,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> insertQuestionToPaper(@PathVariable String paperId,
|
|
public ResponseEntity<Object> insertQuestionToPaper(@PathVariable String paperId,
|
|
@PathVariable String paperDetailId, @RequestBody Question question) {
|
|
@PathVariable String paperDetailId, @RequestBody Question question) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
- return new ResponseEntity<Object>(paperService.insertQuestionToPaper(paperId, paperDetailId, question, user),
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.insertQuestionToPaper(paperId, paperDetailId, question, user),
|
|
HttpStatus.OK);
|
|
HttpStatus.OK);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -430,7 +430,7 @@ public class PaperController extends ControllerSupport {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return new ResponseEntity<Object>(reduplicateId, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(reduplicateId, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -443,7 +443,7 @@ public class PaperController extends ControllerSupport {
|
|
@ApiOperation(value = "获取试题所在的试卷名称", notes = "获取试题所在的试卷名称")
|
|
@ApiOperation(value = "获取试题所在的试卷名称", notes = "获取试题所在的试卷名称")
|
|
@GetMapping(value = "/paper/listNames/{questionId}")
|
|
@GetMapping(value = "/paper/listNames/{questionId}")
|
|
public ResponseEntity<Object> getPaperNamesByQuesId(@PathVariable String questionId) {
|
|
public ResponseEntity<Object> getPaperNamesByQuesId(@PathVariable String questionId) {
|
|
- return new ResponseEntity<Object>(paperService.getPaperNamesByQuestionId(questionId), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getPaperNamesByQuestionId(questionId), HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -462,14 +462,14 @@ public class PaperController extends ControllerSupport {
|
|
@RequestParam(name = "quesBody") String quesBody) {
|
|
@RequestParam(name = "quesBody") String quesBody) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
if (user == null) {
|
|
if (user == null) {
|
|
- return new ResponseEntity<Object>(new PageImpl<Question>(new ArrayList<Question>()), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(new PageImpl<Question>(new ArrayList<Question>()), HttpStatus.OK);
|
|
}
|
|
}
|
|
QuesStructType quesStructType = null;
|
|
QuesStructType quesStructType = null;
|
|
if (StringUtils.isNotEmpty(quesType)) {
|
|
if (StringUtils.isNotEmpty(quesType)) {
|
|
quesStructType = QuesStructType.valueOf(quesType);
|
|
quesStructType = QuesStructType.valueOf(quesType);
|
|
}
|
|
}
|
|
Page<Question> questionPageList = paperService.listQuestionforSelect(paperId, curPage, pageSize, quesStructType, user, quesBody);
|
|
Page<Question> questionPageList = paperService.listQuestionforSelect(paperId, curPage, pageSize, quesStructType, user, quesBody);
|
|
- return new ResponseEntity<Object>(questionPageList, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(questionPageList, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -486,7 +486,7 @@ public class PaperController extends ControllerSupport {
|
|
public ResponseEntity<Object> selectQuestionsToPaper(@PathVariable String paperId,
|
|
public ResponseEntity<Object> selectQuestionsToPaper(@PathVariable String paperId,
|
|
@PathVariable String paperDetailId, @RequestBody List<Question> questions) {
|
|
@PathVariable String paperDetailId, @RequestBody List<Question> questions) {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
- return new ResponseEntity<Object>(paperService.selectQuestionsToPaper(paperId, paperDetailId, questions, user),
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.selectQuestionsToPaper(paperId, paperDetailId, questions, user),
|
|
HttpStatus.OK);
|
|
HttpStatus.OK);
|
|
|
|
|
|
}
|
|
}
|
|
@@ -506,10 +506,10 @@ public class PaperController extends ControllerSupport {
|
|
User user = getAccessUser();
|
|
User user = getAccessUser();
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
paperSearchInfo.setOrgId(user.getRootOrgId().toString());
|
|
if (ids != null && ids.length > 0) {
|
|
if (ids != null && ids.length > 0) {
|
|
- return new ResponseEntity<Object>(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.IMPORT),
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getPapersNotInIds(paperSearchInfo, ids, curPage, pageSize, PaperType.IMPORT),
|
|
HttpStatus.OK);
|
|
HttpStatus.OK);
|
|
} else {
|
|
} else {
|
|
- return new ResponseEntity<Object>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperService.getImportPapers(paperSearchInfo, curPage, pageSize), HttpStatus.OK);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -526,7 +526,7 @@ public class PaperController extends ControllerSupport {
|
|
paperService.formatPaperSearchInfo(paperSearchInfo);
|
|
paperService.formatPaperSearchInfo(paperSearchInfo);
|
|
Paper importPaper = BeanCopierUtil.copyProperties(paperSearchInfo, Paper.class);
|
|
Paper importPaper = BeanCopierUtil.copyProperties(paperSearchInfo, Paper.class);
|
|
importPaper.setPaperType(PaperType.IMPORT);
|
|
importPaper.setPaperType(PaperType.IMPORT);
|
|
- return new ResponseEntity<Object>(paperRepo.findAll(Example.of(importPaper)), HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(paperRepo.findAll(Example.of(importPaper)), HttpStatus.OK);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -551,7 +551,7 @@ public class PaperController extends ControllerSupport {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
paperService.useBasePaper(paperIds, user.getDisplayName());
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new StatusException("Q-160537", e.getMessage());
|
|
throw new StatusException("Q-160537", e.getMessage());
|
|
}
|
|
}
|
|
@@ -653,7 +653,7 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable String orgId,
|
|
@PathVariable String orgId,
|
|
@PathVariable String examId) {
|
|
@PathVariable String examId) {
|
|
paperService.sendPrint(paperId, orgId, examId);
|
|
paperService.sendPrint(paperId, orgId, examId);
|
|
- return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -663,7 +663,7 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable Integer publicityType,
|
|
@PathVariable Integer publicityType,
|
|
@PathVariable Integer difficultyType) {
|
|
@PathVariable Integer difficultyType) {
|
|
int total = paperService.getQuestionTypeNumbers(paperId, publicityType, difficultyType);
|
|
int total = paperService.getQuestionTypeNumbers(paperId, publicityType, difficultyType);
|
|
- return new ResponseEntity<Object>(total, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(total, HttpStatus.OK);
|
|
}
|
|
}
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@@ -673,6 +673,6 @@ public class PaperController extends ControllerSupport {
|
|
@PathVariable Integer publicityType,
|
|
@PathVariable Integer publicityType,
|
|
@PathVariable Integer difficultyType) {
|
|
@PathVariable Integer difficultyType) {
|
|
double total = paperService.getQuestionTypeScore(paperId, publicityType, difficultyType);
|
|
double total = paperService.getQuestionTypeScore(paperId, publicityType, difficultyType);
|
|
- return new ResponseEntity<Object>(total, HttpStatus.OK);
|
|
|
|
|
|
+ return new ResponseEntity<>(total, HttpStatus.OK);
|
|
}
|
|
}
|
|
}
|
|
}
|