he2802 2 yıl önce
ebeveyn
işleme
db39cf1a26

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java

@@ -209,6 +209,8 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 
 	@ApiModelProperty("试卷ID")
 	private Long examId;
+	@ApiModelProperty("题卷类型 1章卷 2节卷 3模块卷")
+	private Integer examType;
 	@Override
 	public int compareTo(ClassPeriodVo o) {
 		if(o.getCourseSort()==this.getCourseSort()){

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -89,6 +89,8 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
 
     Integer getStudyStatus(ClassPeriodVo bo);
 
+    Integer getStudyExamStatus(ClassPeriodVo bo);
+
     List<SectionStudyRecordVo> listUserRecord(UserStudyRecordQueryBo bo);
 
     SectionStudyRecordVo getLastLive(UserStudyRecordQueryBo bo);

+ 12 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -786,7 +786,18 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             section.setGradeId(bo.getGradeId());
             section.setUserId(bo.getUserId());
             section.setCourseId(bo.getCourseId());
-            section.setStudyStatus(baseMapper.getStudyStatus(section));
+            if(section.getType()<4){
+                section.setStudyStatus(baseMapper.getStudyStatus(section));
+            }else{
+                if(section.getType()==4){
+                    section.setExamType(1);
+                }
+                if(section.getType()==5){
+                    section.setExamType(3);
+                }
+                section.setStudyStatus(baseMapper.getStudyExamStatus(section));
+            }
+
         }
         return sectionList;
     }

+ 38 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -1371,6 +1371,44 @@
         AND current_status = 1
     </select>
 
+    <select id="getStudyExamStatus" parameterType="com.zhongzheng.modules.grade.vo.ClassPeriodVo" resultType="Integer">
+        SELECT
+        IFNULL(MAX(report_status),-1)
+        FROM
+        user_bank_record
+        WHERE
+        1=1
+        <if test="userId != null and userId !='' ">
+            AND user_id = #{userId}
+        </if>
+        <if test="gradeId != null and gradeId !='' ">
+            AND grade_id = #{gradeId}
+        </if>
+        <if test="courseId != null and courseId !='' ">
+            AND course_id = #{courseId}
+        </if>
+        <if test="moduleId != null and moduleId !='' ">
+            AND module_id = #{moduleId}
+        </if>
+        <if test="chapterId != null and chapterId !='' ">
+            AND chapter_id = #{chapterId}
+        </if>
+        <if test="sectionId != null and sectionId !='' ">
+            AND section_id = #{sectionId}
+        </if>
+        <if test="goodsId != null and goodsId !='' ">
+            AND goods_id = #{goodsId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="examType != null and examType !='' ">
+            AND `type` = #{examType}
+        </if>
+        AND `status` = 1
+        AND current_status = 1
+    </select>
+
     <select id="listUserRecord" parameterType="com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo"
             resultMap="SectionStudyRecordVoResult">
         SELECT cs.`name` as section_name,