|
@@ -53,7 +53,6 @@ import cn.com.qmth.examcloud.core.questions.dao.PaperDetailRepo;
|
|
|
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.PropertyRepo;
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.QuesPkgPathRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.QuesRepo;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.Course;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.CourseProperty;
|
|
@@ -67,7 +66,6 @@ import cn.com.qmth.examcloud.core.questions.dao.entity.QuesOption;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.QuesProperty;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.Question;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.QuestionAudio;
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.entity.QuestionPkgPath;
|
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.QuestionType;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.config.SysProperty;
|
|
|
import cn.com.qmth.examcloud.core.questions.service.impl.CourseService;
|
|
@@ -115,8 +113,8 @@ public class ImportPaperService {
|
|
|
@Autowired
|
|
|
QuesTypeNameService quesTypeNameService;
|
|
|
|
|
|
- @Autowired
|
|
|
- QuesPkgPathRepo quesPkgPathRepo;
|
|
|
+// @Autowired
|
|
|
+// QuesPkgPathRepo quesPkgPathRepo;
|
|
|
|
|
|
@Autowired
|
|
|
CoursePropertyRepo coursePropertyRepo;
|
|
@@ -377,11 +375,11 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
// 设置WordMlPackage二进制数据
|
|
|
- byte[] pkgByte = getZipResource(wordMLPackage, question);
|
|
|
- QuestionPkgPath quesPkgPath = quesPkgPathRepo.save(new QuestionPkgPath(pkgByte));
|
|
|
- question.setQuesPkgPathId(quesPkgPath.getId());
|
|
|
- pkgByte = null;
|
|
|
- quesPkgPath.setQuesPkg(null);
|
|
|
+// byte[] pkgByte = getZipResource(wordMLPackage, question);
|
|
|
+// QuestionPkgPath quesPkgPath = quesPkgPathRepo.save(new QuestionPkgPath(pkgByte));
|
|
|
+// question.setQuesPkgPathId(quesPkgPath.getId());
|
|
|
+// pkgByte = null;
|
|
|
+// quesPkgPath.setQuesPkg(null);
|
|
|
// 设置question与Unit集合数据
|
|
|
question.setCourse(paper.getCourse());
|
|
|
question.setOrgId(user.getRootOrgId().toString());
|
|
@@ -419,16 +417,16 @@ public class ImportPaperService {
|
|
|
return paper;
|
|
|
}
|
|
|
|
|
|
- private byte[] getZipResource(WordprocessingMLPackage wordMLPackage, Question question) throws Exception {
|
|
|
- List<String> wordXmls = getWordXmlByQuestion(question);
|
|
|
- List<Question> subQuestions = question.getSubQuestions();
|
|
|
- if (subQuestions != null && subQuestions.size() > 0) {
|
|
|
- for (Question subQuestion : subQuestions) {
|
|
|
- wordXmls.addAll(getWordXmlByQuestion(subQuestion));
|
|
|
- }
|
|
|
- }
|
|
|
- return DocxProcessUtil.getWordBytesByQuestion(wordMLPackage, wordXmls);
|
|
|
- }
|
|
|
+// private byte[] getZipResource(WordprocessingMLPackage wordMLPackage, Question question) throws Exception {
|
|
|
+// List<String> wordXmls = getWordXmlByQuestion(question);
|
|
|
+// List<Question> subQuestions = question.getSubQuestions();
|
|
|
+// if (subQuestions != null && subQuestions.size() > 0) {
|
|
|
+// for (Question subQuestion : subQuestions) {
|
|
|
+// wordXmls.addAll(getWordXmlByQuestion(subQuestion));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return DocxProcessUtil.getWordBytesByQuestion(wordMLPackage, wordXmls);
|
|
|
+// }
|
|
|
|
|
|
public List<String> getWordXmlByQuestion(Question question) {
|
|
|
List<String> wordXmls = new ArrayList<>();
|
|
@@ -1941,11 +1939,11 @@ public class ImportPaperService {
|
|
|
User user) {
|
|
|
Question oldQuestion = oldPaperDetailUnit.getQuestion();
|
|
|
Question newQuestion = BeanCopierUtil.copyProperties(oldQuestion, Question.class);
|
|
|
- QuestionPkgPath oldQuesPkgPath = quesPkgPathRepo.findFirstById(oldQuestion.getQuesPkgPathId());
|
|
|
- QuestionPkgPath newQuestionPkgPath = BeanCopierUtil.copyProperties(oldQuesPkgPath, QuestionPkgPath.class);
|
|
|
- newQuestionPkgPath.setId(null);
|
|
|
- newQuestionPkgPath = quesPkgPathRepo.save(newQuestionPkgPath);
|
|
|
- newQuestion.setQuesPkgPathId(newQuestionPkgPath.getId());
|
|
|
+// QuestionPkgPath oldQuesPkgPath = quesPkgPathRepo.findFirstById(oldQuestion.getQuesPkgPathId());
|
|
|
+// QuestionPkgPath newQuestionPkgPath = BeanCopierUtil.copyProperties(oldQuesPkgPath, QuestionPkgPath.class);
|
|
|
+// newQuestionPkgPath.setId(null);
|
|
|
+// newQuestionPkgPath = quesPkgPathRepo.save(newQuestionPkgPath);
|
|
|
+// newQuestion.setQuesPkgPathId(newQuestionPkgPath.getId());
|
|
|
newQuestion.setCourse(course);
|
|
|
newQuestion.setId(null);
|
|
|
newQuestion.setQuesProperties(null);
|