|
|
|
@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
|
import com.huoran.api.OccupationlabClient; |
|
|
|
|
import com.huoran.api.UserClient; |
|
|
|
|
import com.huoran.common.aop.annotation.NoRepeatSubmit; |
|
|
|
|
import com.huoran.common.entity.CopyExamPaperReq; |
|
|
|
|
import com.huoran.common.entity.EvaluationAssignedQuestionsDetails; |
|
|
|
@ -36,6 +35,7 @@ import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr; |
|
|
|
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge; |
|
|
|
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -109,9 +109,6 @@ public class ExamPaperController { |
|
|
|
|
@Autowired |
|
|
|
|
private QuestionVersionsToKnowledgePointsService versionsToKnowledgePointsService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private UserClient userClient; |
|
|
|
|
|
|
|
|
|
@PostMapping("/examPaperList") |
|
|
|
|
@ApiOperation(value = "试卷列表", response = ExamPaper.class) |
|
|
|
|
public R examPaperList(@RequestBody @Valid ExamPaperReq req) { |
|
|
|
@ -122,9 +119,7 @@ public class ExamPaperController { |
|
|
|
|
@ApiOperation(value = "新增或更新试卷") |
|
|
|
|
@Transactional |
|
|
|
|
public R saveExamPaper(@RequestBody @Valid ExamPaper examPaper) { |
|
|
|
|
/* if (examPaper.getPaperId() != null) { |
|
|
|
|
removeExamPaperCache(examPaper.getPaperId()); |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
examPaper.setSchoolId(TokenUtils.getSchoolId()); |
|
|
|
|
examPaper.setCreateUser(TokenUtils.getUserName()); |
|
|
|
|
boolean ok = examPaperService.checkRepeat(examPaper); |
|
|
|
@ -167,6 +162,9 @@ public class ExamPaperController { |
|
|
|
|
// examPaper.setMedianScore(median);
|
|
|
|
|
// examPaperService.updateById(examPaper);
|
|
|
|
|
// }
|
|
|
|
|
if (examPaper.getPaperId() != null) { |
|
|
|
|
examPaperService.removeExamPaperCache(examPaper.getPaperId()); |
|
|
|
|
} |
|
|
|
|
return saveOrUpdate ? R.ok() : R.error(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -191,16 +189,12 @@ public class ExamPaperController { |
|
|
|
|
|
|
|
|
|
@GetMapping("/examPaperDetails") |
|
|
|
|
@ApiOperation(value = "试卷详情") |
|
|
|
|
//@Cacheable(value = {"examPaperDetails"}, key = "#id")
|
|
|
|
|
@Cacheable(value = {"examPaperDetails"}, key = "#id") |
|
|
|
|
public R examPaperDetails(@RequestParam Integer id) { |
|
|
|
|
ExamPaper examPaper = getExamPaper(id); |
|
|
|
|
return R.ok().put("examPaper", examPaper); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @CacheEvict(value = "examPaperDetails", key = "#id") |
|
|
|
|
public void removeExamPaperCache(Integer id) {}*/ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据id获取试卷信息(含已经删除的) |
|
|
|
|
* |
|
|
|
|