From 9a7ee496344f044c89deddb70600b7e4d6017e1f Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 09 七月 2024 17:37:16 +0800
Subject: [PATCH] 密码强制修改实现

---
 src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java
index 4ceda84..755ede6 100644
--- a/src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java
+++ b/src/main/java/com/ycl/jxkg/service/impl/QuestionServiceImpl.java
@@ -5,19 +5,22 @@
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ycl.jxkg.domain.entity.Question;
-import com.ycl.jxkg.domain.enums.QuestionTypeEnum;
-import com.ycl.jxkg.domain.enums.general.StatusEnum;
 import com.ycl.jxkg.domain.other.KeyValue;
 import com.ycl.jxkg.domain.question.QuestionItemObject;
 import com.ycl.jxkg.domain.question.QuestionObject;
+import com.ycl.jxkg.domain.vo.admin.exam.QuestionExportVO;
+import com.ycl.jxkg.domain.vo.admin.exam.QuestionImportVO;
 import com.ycl.jxkg.domain.vo.admin.question.QuestionEditItemVO;
 import com.ycl.jxkg.domain.vo.admin.question.QuestionEditRequestVO;
 import com.ycl.jxkg.domain.vo.admin.question.QuestionPageRequestVO;
 import com.ycl.jxkg.domain.vo.admin.question.QuestionResponseVO;
+import com.ycl.jxkg.enums.QuestionTypeEnum;
+import com.ycl.jxkg.enums.general.StatusEnum;
 import com.ycl.jxkg.mapper.QuestionMapper;
 import com.ycl.jxkg.service.QuestionService;
 import com.ycl.jxkg.utils.DateTimeUtil;
 import com.ycl.jxkg.utils.ExamUtil;
+import com.ycl.jxkg.utils.HtmlUtil;
 import com.ycl.jxkg.utils.JsonUtil;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.BeanUtils;
@@ -60,6 +63,9 @@
         question.setDifficult(model.getDifficult());
         question.setContent(questionObject);
         question.setCreateUser(userId);
+        question.setTitle(HtmlUtil.clear(model.getTitle()));
+        question.setAudioFile(model.getAudioFile());
+        question.setOriginalFile(model.getOriginalFile());
         questionMapper.insert(question);
         return question;
     }
@@ -74,6 +80,9 @@
         //棰樺共銆佽В鏋愩�侀�夐」绛� 鏇存柊
         String questionObject = setQuestionInfoFromVM(model);
         question.setContent(questionObject);
+        question.setTitle(HtmlUtil.clear(model.getTitle()));
+        question.setAudioFile(model.getAudioFile());
+        question.setOriginalFile(model.getOriginalFile());
         questionMapper.updateById(question);
         return question;
     }
@@ -98,6 +107,7 @@
         switch (questionTypeEnum) {
             case SingleChoice:
             case TrueFalse:
+            case Audio:
                 questionEditRequestVO.setCorrect(question.getCorrect());
                 break;
             case MultipleChoice:
@@ -108,6 +118,8 @@
                 questionEditRequestVO.setCorrectArray(correctContent);
                 break;
             case ShortAnswer:
+            case Calculate:
+            case Analysis:
                 questionEditRequestVO.setCorrect(questionObject.getCorrect());
                 break;
             default:
@@ -169,4 +181,9 @@
                 .update();
     }
 
+    @Override
+    public List<QuestionImportVO> export(QuestionExportVO query) {
+        return questionMapper.export(query);
+    }
+
 }

--
Gitblit v1.8.0