Просмотр исходного кода

考试业务功能,加入相关类型绑定

zhaosongshan 7 месяцев назад
Родитель
Сommit
2caf5916a2

+ 6 - 2
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/domain/TExam.java

@@ -62,8 +62,8 @@ public class TExam {
     @TableField(fill = FieldFill.UPDATE)
     private Date updateTime;
 
-    /** 章节ID ,有此则为章节测 */
-    @ApiModelProperty(value = "章节ID ,有此则为章节测", position = 8)
+    /** 章节ID ,有此则为章节测 */
+    @ApiModelProperty(value = "章节ID ,有此则为章节测", position = 8)
     private String chapterId;
 
     /** 开始时间 */
@@ -87,4 +87,8 @@ public class TExam {
 
     @ApiModelProperty(value = "结束任务ID", position = 14)
     private String endJobId;
+
+    /** 考试类型 1 考试 2 章节测验 3 调查问卷  */
+    @ApiModelProperty(value = "考试类型", position = 15)
+    private String examType;
 }

+ 3 - 6
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/domain/exam/TExamAddParam.java

@@ -65,10 +65,7 @@ public class TExamAddParam {
     @ApiModelProperty(value = "试卷ID", position = 11)
     private String paperId;
 
-    /** 软删除 */
-    @ApiModelProperty(value = "软删除", position = 12)
-    private Integer deleted;
-
-    @ApiModelProperty(value = "任务ID", position = 13)
-    private String jobId;
+    /** 考试类型 1 考试 2 章节测验 3 调查问卷  */
+    @ApiModelProperty(value = "考试类型", position = 12)
+    private String examType;
 }

+ 4 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/domain/exam/TExamPageParam.java

@@ -79,4 +79,8 @@ public class TExamPageParam {
 
     /** 学生ID **/
     private String userId;
+
+    /** 考试类型 1 考试 2 章节测验 3 调查问卷  */
+    @ApiModelProperty(value = "考试类型", position = 12)
+    private String examType;
 }

+ 10 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/service/impl/TExamServiceImpl.java

@@ -84,6 +84,9 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
         if(ObjectUtil.isNotEmpty(tExamPageParam.getPaperId())) {
             queryWrapper.lambda().eq(TExam::getPaperId, tExamPageParam.getPaperId());
         }
+        if(ObjectUtil.isNotEmpty(tExamPageParam.getExamType())) {
+            queryWrapper.lambda().eq(TExam::getExamType, tExamPageParam.getExamType());
+        }
         if(ObjectUtil.isNotEmpty(tExamPageParam.getUserId())){
             queryWrapper.lambda().like(TExam::getStudentIds, tExamPageParam.getUserId());
         }
@@ -107,6 +110,13 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
         }
         TExam tExam = BeanUtil.toBean(tExamAddParam, TExam.class);
         tExam.setStudentIds("1935565895337304066");
+        if(tExam.getExamType() == null){
+            if(examPaper.getPaperType() == ExamPaperTypeEnum.Survey.getCode()){
+                tExam.setExamType("3"); // 调查问卷
+            }else{
+                tExam.setExamType("1"); // 普通考试
+            }
+        }
         this.save(tExam);
         if(tExamAddParam.getChapterId() != null && !tExamAddParam.getChapterId().isEmpty()){
             CourseChapterPaper cp = new CourseChapterPaper();