|
@@ -7,6 +7,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
import javax.xml.bind.JAXBElement;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuesPkgPathRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.*;
|
|
|
|
|
@@ -39,6 +40,7 @@ import cn.com.qmth.examcloud.core.questions.dao.PaperDetailUnitRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.PaperRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuesRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuestionAudioRepo;
|
|
|
+import cn.com.qmth.examcloud.core.questions.service.PaperService;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.QuesService;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.QuestionAudioService;
|
|
|
import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
|
|
@@ -73,6 +75,9 @@ public class QuesServiceImpl implements QuesService{
|
|
|
@Autowired
|
|
|
private PaperRepo paperRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PaperService paperService;
|
|
|
+
|
|
|
private static WordprocessingMLPackage wordMLPackage = null;
|
|
|
|
|
|
static{
|
|
@@ -600,7 +605,8 @@ public class QuesServiceImpl implements QuesService{
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void updateProByPapers(List<String> paperList,Double difficultyDegree, Boolean publicity) {
|
|
|
+ public void updateProByPapers(List<String> paperList,Double difficultyDegree, Boolean publicity,User user) {
|
|
|
+ List<Paper> papers = new ArrayList<Paper>();
|
|
|
String difficulty = "";
|
|
|
if(difficultyDegree>0 && difficultyDegree<0.4){
|
|
|
difficulty = "难";
|
|
@@ -628,6 +634,7 @@ public class QuesServiceImpl implements QuesService{
|
|
|
}
|
|
|
quesIds.add(question.getId());
|
|
|
}
|
|
|
+ papers.add(paper);
|
|
|
}
|
|
|
quesRepo.save(subQues);
|
|
|
if(quesIds != null && quesIds.size()>0){
|
|
@@ -638,6 +645,10 @@ public class QuesServiceImpl implements QuesService{
|
|
|
//Update update = Update.update("subQuestions.$.difficultyDegree", difficultyDegree).set("subQuestions.$.publicity", publicity);
|
|
|
this.mongoTemplate.updateMulti(query, update, Question.class);
|
|
|
}
|
|
|
+ for(Paper paper:papers){
|
|
|
+ paperService.formatPaper(paper, user);
|
|
|
+ }
|
|
|
+ paperRepo.save(papers);
|
|
|
}
|
|
|
|
|
|
@Override
|