Procházet zdrojové kódy

教研分析最新代码合并

wangliang před 3 roky
rodič
revize
f95b8afa33
19 změnil soubory, kde provedl 181 přidání a 11 odebrání
  1. 38 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  2. 11 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicCourse.java
  3. 11 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysOrg.java
  4. 11 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysUser.java
  5. 14 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/RoleTypeEnum.java
  6. 4 8
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/AnswerDetailBean.java
  7. 12 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/query/BasicAnswerDto.java
  8. 3 1
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TAExamCourseCollegeTeacherResult.java
  9. 12 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/enums/TestStatusEnum.java
  10. 12 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseRecordModMapper.java
  11. 7 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseRecordModService.java
  12. 9 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExaminationRelationService.java
  13. 9 0
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseRecordModServiceImpl.java
  14. 1 1
      teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExaminationRelationServiceImpl.java
  15. 1 0
      teachcloud-report-business/src/main/resources/mapper/TAExamCourseClazzMapper.xml
  16. 19 1
      teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordDioMapper.xml
  17. 1 0
      teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordModMapper.xml
  18. 6 0
      teachcloud-report-business/src/main/resources/mapper/TAPaperStructMapper.xml
  19. 0 0
      teachcloud-report-business/src/main/resources/mapper/TBExamMapper.xml

+ 38 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -13,6 +13,7 @@ import java.io.File;
 import java.lang.reflect.Field;
 import java.nio.charset.Charset;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 系统常量
@@ -483,4 +484,41 @@ public class SystemConstant {
         map.computeIfAbsent(SystemConstant.FLOW_SUBMIT, v -> flowSubmit);
         return map;
     }
+
+    /**
+     * 跨步数组(将list集合按照数量拆分成多个集合)
+     *
+     * @param datasource 数据源(初始大数据集合)
+     * @param step       跨步(多少个元素一个集合)
+     * @param <T>        泛型
+     * @return 拆分好地集合的集合
+     */
+    public static <T> List<List<T>> getStepList(List<T> datasource, int step) {
+        List<List<T>> result = new ArrayList<>();
+        int size = datasource.size();
+        for (int i = 0; i < size; i = i + step) {
+            List<T> cell = datasource.stream().skip(i).limit(step).collect(Collectors.toList());
+            result.add(cell);
+        }
+        return result;
+    }
+
+    /**
+     * 跨步数组(将list集合按照cpu核心数量拆分成多个集合)
+     *
+     * @param datasource 数据源
+     * @param <T>        泛型
+     * @return 拆分好地集合的集合
+     */
+    public static <T> List<List<T>> getStepList(List<T> datasource) {
+        int cpuNum = Runtime.getRuntime().availableProcessors();
+        int step = datasource.size() / cpuNum + 1;
+        List<List<T>> result = new ArrayList<>();
+        int size = datasource.size();
+        for (int i = 0; i < size; i = i + step) {
+            List<T> cell = datasource.stream().skip(i).limit(step).collect(Collectors.toList());
+            result.add(cell);
+        }
+        return result;
+    }
 }

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicCourse.java

@@ -50,6 +50,17 @@ public class BasicCourse extends BaseEntity implements Serializable {
     @TableField("enable")
     private Boolean enable;
 
+    @ApiModelProperty("历史课程名称")
+    private String historicName;
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysOrg.java

@@ -59,6 +59,17 @@ public class SysOrg extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private Long campusId;
 
+    @ApiModelProperty("历史机构名")
+    private String historicName;
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
     public Long getCampusId() {
         return campusId;
     }

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysUser.java

@@ -113,6 +113,17 @@ public class SysUser extends BaseEntity implements Serializable {
     @TableField("sync_status")
     private SyncStatusEnum syncStatus;
 
+    @ApiModelProperty("历史用户名")
+    private String historicName;
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
     @Override
     public void insertInfo(Long userId) {
         super.insertInfo(userId);

+ 14 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/RoleTypeEnum.java

@@ -50,4 +50,18 @@ public enum RoleTypeEnum {
         return list;
     }
 
+    /**
+     * 根据desc查找枚举类
+     * @param desc desc
+     * @return 枚举类
+     */
+    public static RoleTypeEnum convertDescToEnum(String desc){
+        RoleTypeEnum res = null;
+        for (RoleTypeEnum value : RoleTypeEnum.values()) {
+            if (desc.equals(value.getDesc())) {
+                res = value;
+            }
+        }
+        return res;
+    }
 }

+ 4 - 8
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/AnswerDetailBean.java

@@ -51,7 +51,7 @@ public class TAExamCourseExportDto implements Serializable {
     private String currentNotPassRateBefore;
 
     @ExcelProperty(name = "赋分系数", width = 30, index = 12)
-    private BigDecimal coefficient;
+    private String coefficient;
 
     @ExcelProperty(name = "总体平均分-赋分后", width = 50, index = 13)
     private BigDecimal avgScoreAfter;
@@ -237,15 +237,11 @@ public class TAExamCourseExportDto implements Serializable {
         this.currentNotPassRateBefore = currentNotPassRateBefore;
     }
 
-    public BigDecimal getCoefficient() {
-        if (Objects.nonNull(coefficient)) {
-            return coefficient.setScale(SystemConstant.FINAL_SCALE, BigDecimal.ROUND_HALF_UP);
-        } else {
-            return coefficient;
-        }
+    public String getCoefficient() {
+        return coefficient;
     }
 
-    public void setCoefficient(BigDecimal coefficient) {
+    public void setCoefficient(String coefficient) {
         this.coefficient = coefficient;
     }
 

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/query/BasicAnswerDto.java

@@ -7,6 +7,7 @@ import com.qmth.teachcloud.report.business.entity.TAExamCourseCollegeInspect;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  * @Description: 参考课程考查学院维度分析 result
@@ -31,6 +32,17 @@ public class TAExamCourseCollegeInspectResult extends TAExamCourseCollegeInspect
     @ApiModelProperty(value = "考试名称")
     private String examName;
 
+    @ApiModelProperty(value = "试卷分数")
+    private BigDecimal fullScore;
+
+    public BigDecimal getFullScore() {
+        return fullScore;
+    }
+
+    public void setFullScore(BigDecimal fullScore) {
+        this.fullScore = fullScore;
+    }
+
     public String getExamTime() {
         return examTime;
     }

+ 3 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/result/TAExamCourseCollegeTeacherResult.java

@@ -13,7 +13,9 @@ public enum SemesterEnum {
 
     FIRST("2020-2021学年度第1学期"),
 
-    SECOND("2020-2021学年度第2学期");
+    SECOND("2020-2021学年度第2学期"),
+
+    THIRD("2021-2022学年度第1学期");
 
     private String title;
 

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/enums/TestStatusEnum.java

@@ -7,6 +7,8 @@ import com.qmth.teachcloud.report.business.entity.TAExamCourseRecordDio;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -21,4 +23,14 @@ public interface TAExamCourseRecordDioMapper extends BaseMapper<TAExamCourseReco
     List<ModuleDetailResult> listDiosBySchoolIdAndExamIdAndCourseCodeAndModuleName(@Param("schoolId") Long schoolId, @Param("examId") String examId, @Param("courseCode") String courseCode, @Param("moduleName") String moduleName, @Param("studentCode") String studentCode);
 
     List<DimensionDetailResult> listSubDiosBySchoolIdAndExamIdAndStudentCodeAndCourseCodeAndModuleName(@Param("schoolId") Long schoolId, @Param("examId") String examId, @Param("studentCode") String studentCode, @Param("courseCode") String courseCode, @Param("moduleName") String moduleName);
+
+    /**
+     * 查询每个人的每个考察点情况
+     *
+     * @param schoolId   学校id
+     * @param examId     考试id
+     * @param courseCode 课程编号
+     * @return 结果
+     */
+    Set<String> findDimensionTypesByCourseCode(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 }

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TAExamCourseRecordModMapper.java

@@ -3,6 +3,10 @@ package com.qmth.teachcloud.report.business.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseRecordDio;
 
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * <p>
  * 参考课程考生各考查点维度分析表 服务类
@@ -13,4 +17,12 @@ import com.qmth.teachcloud.report.business.entity.TAExamCourseRecordDio;
  */
 public interface TAExamCourseRecordDioService extends IService<TAExamCourseRecordDio> {
 
+    /**
+     * 优化查询每个学生每个知识点得分
+     * @param schoolId 学校id
+     * @param examId 考试id
+     * @param courseCode 课程编号
+     * @return 大集合
+     */
+    Set<String> findDimensionTypesByCourseCode(Long schoolId, Long examId, String courseCode);
 }

+ 7 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TAExamCourseRecordModService.java

@@ -18,4 +18,11 @@ public interface TBExamService extends IService<TBExam> {
      * @return 教研分析考试信息
      */
     TBExam findByCloudExamId(Long cloudExamId);
+
+    /**
+     * 根据考试id查询学校id
+     * @param examId 考试id
+     * @return 学校id
+     */
+    Long findSchoolIdByExamId(Long examId);
 }

+ 9 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExaminationRelationService.java

@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.teachcloud.report.business.entity.TAExamCourseRecordDio;
 import com.qmth.teachcloud.report.business.mapper.TAExamCourseRecordDioMapper;
 import com.qmth.teachcloud.report.business.service.TAExamCourseRecordDioService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
+import java.util.Set;
+
 /**
  * <p>
  * 参考课程考生各考查点维度分析表 服务实现类
@@ -16,5 +20,10 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class TAExamCourseRecordDioServiceImpl extends ServiceImpl<TAExamCourseRecordDioMapper, TAExamCourseRecordDio> implements TAExamCourseRecordDioService {
+    private final Logger log = LoggerFactory.getLogger(TAExamCourseRecordDioServiceImpl.class);
 
+    @Override
+    public Set<String> findDimensionTypesByCourseCode(Long schoolId, Long examId, String courseCode) {
+        return this.baseMapper.findDimensionTypesByCourseCode(schoolId, examId, courseCode);
+    }
 }

+ 9 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TAExamCourseRecordModServiceImpl.java

@@ -35,4 +35,13 @@ public class TBExamServiceImpl extends ServiceImpl<TBExamMapper, TBExam> impleme
         }
         return tbExam;
     }
+
+    @Override
+    public Long findSchoolIdByExamId(Long examId) {
+        TBExam tbExam = this.getById(examId);
+        if (Objects.isNull(tbExam)){
+            throw ExceptionResultEnum.ERROR.exception("未找到考试id为 : " + examId + " 的考试");
+        }
+        return tbExam.getSchoolId();
+    }
 }

+ 1 - 1
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExaminationRelationServiceImpl.java

@@ -30,7 +30,7 @@
                 INNER JOIN t_a_exam_course pap ON col.exam_id = pap.exam_id
                 AND col.course_code = pap.course_code
                 AND col.school_id = pap.school_id
-            join t_b_exam_course tbec on
+            join t_b_exam_course tbec on tbec.exam_id = col.exam_id and
 		        tbec.course_code = col.course_code
         WHERE
             col.exam_id = #{examId}

+ 1 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseClazzMapper.xml

@@ -110,6 +110,7 @@
                 LEFT JOIN
             t_b_exam b ON a.exam_id = b.id
             join t_b_exam_course tbec on
+                tbec.exam_id = a.exam_id and
                 tbec.course_code = a.course_code
         <where>
             <if test="schoolId != null">

+ 19 - 1
teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordDioMapper.xml

@@ -79,9 +79,27 @@
         <where>
             and a.school_id = #{schoolId}
             and a.exam_id = #{examId}
-            and a.student_code = #{studentCode}
             and a.course_code = #{courseCode}
             and a.dimension_type = #{moduleName}
+            and a.student_code = #{studentCode}
+        </where>
+    </select>
+    <select id="findDimensionTypesByCourseCode"
+            resultType="java.lang.String">
+        SELECT
+            distinct (dimension_type)
+        FROM
+            t_a_exam_course_record_dio
+        <where>
+            <if test="schoolId != null and schoolId != ''">
+                AND school_id = #{schoolId}
+            </if>
+            <if test="examId != null and examId != ''">
+                AND exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                AND course_code = #{courseCode}
+            </if>
         </where>
     </select>
 </mapper>

+ 1 - 0
teachcloud-report-business/src/main/resources/mapper/TAExamCourseRecordModMapper.xml

@@ -58,6 +58,7 @@
         LEFT JOIN
         t_b_exam b ON a.exam_id = b.id
         join t_b_exam_course tbec on
+        tbec.exam_id = a.exam_id and
         tbec.course_code = a.course_code
         <where>
             and b.school_id = #{schoolId}

+ 6 - 0
teachcloud-report-business/src/main/resources/mapper/TAPaperStructMapper.xml

@@ -26,6 +26,12 @@
             <if test="schoolId != null and schoolId != ''">
                 and bc.school_id = #{schoolId}
             </if>
+            <if test="absent != null and absent != ''">
+                and tbs.absent = #{absent}
+            </if>
+            <if test="current != null and current != ''">
+                and tbs.student_current = #{current}
+            </if>
             <if test="collegeIds != null and collegeIds != ''">
                 <choose>
                     <when test="inspect != null and inspect == true">

+ 0 - 0
teachcloud-report-business/src/main/resources/mapper/TBExamMapper.xml