|
@@ -86,16 +86,20 @@ public class CoursePaperServiceImpl implements CoursePaperService {
|
|
|
Check.isEmpty(coursePaper.getPaperId(), "试卷ID不能为空!");
|
|
|
Check.isEmpty(coursePaper.getPaperName(), "试卷名称不能为空!");
|
|
|
Check.isNull(coursePaper.getPaperP(), "试卷页数不能为空!");
|
|
|
- Check.isBlank(coursePaper.getPaperFileUrl(), "试卷文件地址不能为空!");
|
|
|
- Check.isBlank(coursePaper.getAnswerFileUrl(), "答案文件地址不能为空!");
|
|
|
+ Check.isBlank(coursePaper.getPaperWordUrl(), "试卷Word文件地址不能为空!");
|
|
|
+ Check.isBlank(coursePaper.getAnswerWordUrl(), "答案Word文件地址不能为空!");
|
|
|
+ Check.isBlank(coursePaper.getPaperPdfUrl(), "试卷PDF文件地址不能为空!");
|
|
|
+ Check.isBlank(coursePaper.getAnswerPdfUrl(), "答案PDF文件地址不能为空!");
|
|
|
|
|
|
CoursePaper oldCoursePaper = coursePaperRepository.findByExamIdAndPaperId(coursePaper.getExamId(), coursePaper.getPaperId());
|
|
|
if (oldCoursePaper != null) {
|
|
|
//存在则修改
|
|
|
oldCoursePaper.setPaperName(coursePaper.getPaperName());
|
|
|
oldCoursePaper.setPaperP(coursePaper.getPaperP());
|
|
|
- oldCoursePaper.setPaperFileUrl(coursePaper.getPaperFileUrl());
|
|
|
- oldCoursePaper.setAnswerFileUrl(coursePaper.getAnswerFileUrl());
|
|
|
+ oldCoursePaper.setPaperWordUrl(coursePaper.getPaperWordUrl());
|
|
|
+ oldCoursePaper.setAnswerWordUrl(coursePaper.getAnswerWordUrl());
|
|
|
+ oldCoursePaper.setPaperPdfUrl(coursePaper.getPaperPdfUrl());
|
|
|
+ oldCoursePaper.setAnswerPdfUrl(coursePaper.getAnswerPdfUrl());
|
|
|
coursePaperRepository.save(oldCoursePaper);
|
|
|
|
|
|
//更新试卷试题结构
|