Procházet zdrojové kódy

数据库字段调整

deason před 6 roky
rodič
revize
ee5d02b519

+ 17 - 2
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/ExamStructure.java

@@ -19,8 +19,7 @@ import javax.persistence.Table;
  */
 @Entity
 @Table(name = "ec_prt_exam_structure", indexes = {
-        @Index(name = "INDEX_PRT_EXAM_STRUCTURE_01", columnList = "orgId"),
-        @Index(name = "INDEX_PRT_EXAM_STRUCTURE_02", columnList = "examId")})
+        @Index(name = "INDEX_PRT_EXAM_STRUCTURE_01", columnList = "orgId,examId", unique = true)})
 public class ExamStructure extends IdEntity {
     /**
      * 考试ID
@@ -47,6 +46,14 @@ public class ExamStructure extends IdEntity {
      */
     @Column(length = 50)
     private String examType;
+    /**
+     * @See QuestionStatistic.java
+     * <p>
+     * 试题结构内容(JSON格式):
+     * [{"questionType":"abc","total":20},{"questionType":"xyz","total":10}]
+     */
+    @Column(length = 500)
+    private String struct;
 
     public Long getExamId() {
         return examId;
@@ -88,4 +95,12 @@ public class ExamStructure extends IdEntity {
         this.examType = examType;
     }
 
+    public String getStruct() {
+        return struct;
+    }
+
+    public void setStruct(String struct) {
+        this.struct = struct;
+    }
+
 }

+ 8 - 28
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/entity/QuestionStatistic.java

@@ -7,43 +7,23 @@
 
 package cn.com.qmth.examcloud.core.print.entity;
 
-import cn.com.qmth.examcloud.core.print.common.IdEntity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Index;
-import javax.persistence.Table;
+import java.io.Serializable;
 
 /**
  * 试题统计信息
  */
-@Entity
-@Table(name = "ec_prt_question_statistic", indexes = {
-        @Index(name = "INDEX_PRT_QUESTION_STATISTIC_01", columnList = "examStructureId")})
-public class QuestionStatistic extends IdEntity {
-    /**
-     * 考试试卷结构ID
-     */
-    private Long examStructureId;
+public class QuestionStatistic implements Serializable {
+    private static final long serialVersionUID = 1L;
     /**
      * 试题类型
      *
      * @See QuesStructType.java
      */
-    @Column(length = 50)
     private String questionType;
     /**
      * 试题数量
      */
-    private Integer questionTotal;
-
-    public Long getExamStructureId() {
-        return examStructureId;
-    }
-
-    public void setExamStructureId(Long examStructureId) {
-        this.examStructureId = examStructureId;
-    }
+    private Integer total;
 
     public String getQuestionType() {
         return questionType;
@@ -53,12 +33,12 @@ public class QuestionStatistic extends IdEntity {
         this.questionType = questionType;
     }
 
-    public Integer getQuestionTotal() {
-        return questionTotal;
+    public Integer getTotal() {
+        return total;
     }
 
-    public void setQuestionTotal(Integer questionTotal) {
-        this.questionTotal = questionTotal;
+    public void setTotal(Integer total) {
+        this.total = total;
     }
 
 }

+ 0 - 18
examcloud-core-print-dao/src/main/java/cn/com/qmth/examcloud/core/print/repository/QuestionStatisticRepository.java

@@ -1,18 +0,0 @@
-/*
- * *************************************************
- * Copyright (c) 2018 QMTH. All Rights Reserved.
- * Created by Deason on 2018-10-17 16:28:20.
- * *************************************************
- */
-
-package cn.com.qmth.examcloud.core.print.repository;
-
-import cn.com.qmth.examcloud.core.print.entity.QuestionStatistic;
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.stereotype.Repository;
-
-@Repository
-public interface QuestionStatisticRepository extends JpaRepository<QuestionStatistic, Long>, JpaSpecificationExecutor<QuestionStatistic> {
-
-}

+ 0 - 16
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/QuestionStatisticService.java

@@ -1,16 +0,0 @@
-/*
- * *************************************************
- * Copyright (c) 2018 QMTH. All Rights Reserved.
- * Created by Deason on 2018-10-22 15:30:39.
- * *************************************************
- */
-
-package cn.com.qmth.examcloud.core.print.service;
-
-/**
- * @author: fengdesheng
- * @since: 2018/10/22
- */
-public interface QuestionStatisticService {
-
-}

+ 0 - 24
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/impl/QuestionStatisticServiceImpl.java

@@ -1,24 +0,0 @@
-/*
- * *************************************************
- * Copyright (c) 2018 QMTH. All Rights Reserved.
- * Created by Deason on 2018-10-22 15:30:28.
- * *************************************************
- */
-
-package cn.com.qmth.examcloud.core.print.service.impl;
-
-import cn.com.qmth.examcloud.core.print.repository.QuestionStatisticRepository;
-import cn.com.qmth.examcloud.core.print.service.QuestionStatisticService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author: fengdesheng
- * @since: 2018/10/17
- */
-@Service
-public class QuestionStatisticServiceImpl implements QuestionStatisticService {
-    @Autowired
-    private QuestionStatisticRepository questionTypeNumRepository;
-
-}