Explorar el Código

Merge branch 'dev' of http://192.168.1.245:11111/jinjilong/onlineEducation-fwd into dev

honorfire hace 7 meses
padre
commit
7b5e40a2b4

+ 12 - 1
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/service/impl/ExamPaperAnswerServiceImpl.java

@@ -38,6 +38,8 @@ import java.util.Date;
 import java.util.List;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 
 
+import static vip.xiaonuo.exam.domain.enums.ExamPaperTypeEnum.Task;
+
 @Service
 @Service
 public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer> implements ExamPaperAnswerService {
 public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer> implements ExamPaperAnswerService {
 
 
@@ -74,7 +76,7 @@ public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer>
         ExamPaper examPaper = examPaperMapper.selectByPrimaryKey(examPaperSubmitVM.getId());
         ExamPaper examPaper = examPaperMapper.selectByPrimaryKey(examPaperSubmitVM.getId());
         ExamPaperTypeEnum paperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType());
         ExamPaperTypeEnum paperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType());
         //任务试卷只能做一次
         //任务试卷只能做一次
-        if (paperTypeEnum == ExamPaperTypeEnum.Task) {
+        if (paperTypeEnum == Task) {
             ExamPaperAnswer examPaperAnswer = examPaperAnswerMapper.getByPidUid(examPaperSubmitVM.getId(), user.getId());
             ExamPaperAnswer examPaperAnswer = examPaperAnswerMapper.getByPidUid(examPaperSubmitVM.getId(), user.getId());
             if (null != examPaperAnswer)
             if (null != examPaperAnswer)
                 return null;
                 return null;
@@ -110,6 +112,15 @@ public class ExamPaperAnswerServiceImpl extends BaseServiceImpl<ExamPaperAnswer>
             customerAnswers.setExamPaperAnswerId(examPaperAnswer.getId());
             customerAnswers.setExamPaperAnswerId(examPaperAnswer.getId());
         });
         });
         examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers);
         examPaperQuestionCustomerAnswerService.insertList(examPaperQuestionCustomerAnswers);
+        ExamPaperTypeEnum examPaperTypeEnum = ExamPaperTypeEnum.fromCode(examPaper.getPaperType());
+        if(Task.equals(examPaperTypeEnum)){
+            TaskExamCustomerAnswer taskExamCustomerAnswer = new TaskExamCustomerAnswer();
+            taskExamCustomerAnswer.setCreateUser(user.getId());
+            taskExamCustomerAnswer.setTaskExamId(examPaper.getTaskExamId());
+            taskExamCustomerAnswer.setCreateTime(now);
+            taskExamCustomerAnswer.setTextContentId(textContent.getId());
+            taskExamCustomerAnswerMapper.insertSelective(taskExamCustomerAnswer);
+        }
         return examPaperAnswerInfo;
         return examPaperAnswerInfo;
     }
     }