he2802 2 år sedan
förälder
incheckning
8ec85c3537

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -14,6 +14,7 @@ import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.base.service.ICertificateTpService;
@@ -526,6 +527,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         if(Validator.isNotEmpty(business7)&&goodsVo.getBusinessId().longValue()==business7.getId().longValue()){
             studyRec.setCourseType(17);
         }
+        String TenantId = ServletUtils.getRequest().getHeader("TenantId");
+        studyRec.setTenantId(TenantId);
         studyRec.setCourseName(goodsVo.getGoodsName());
         studyRec.setMajorName(goodsVo.getSubjectNames());
         studyRec.setName(userVo.getRealname());

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

@@ -38,6 +38,8 @@ public class SyncUserCourseStudyRec {
 
     private String MajorName;
 
+    private String TenantId;
+
     private List<SyncUserChapterList> ChapterList;
 
 }

+ 26 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -674,4 +674,30 @@
         WHERE
             gc.course_id = #{courseId}
     </select>
+
+
+    <select id="gradeIdSelect" parameterType="map"  resultMap="ClassGradeVoResult" >
+        SELECT
+        (SELECT
+        COUNT( m.id )
+        FROM
+        goods_course c  LEFT JOIN  course_menu_exam m ON m.course_id = c.course_id
+        where
+        m.type in (1,3)
+        and c.goods_id = #{goodsId}) as exam_num,
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
+        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
+        cgu.grade_id,
+        cgu.user_id
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
+        LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id
+        WHERE
+        1=1
+        <if test="gradeId != null and gradeId != ''">
+            and cg.grade_id = #{gradeId}
+        </if>
+        and cg.`status` =1  and cgu.change_grade = 0 and cgu.`status` = 1
+    </select>
 </mapper>

+ 4 - 4
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -871,10 +871,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="queryGradeList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeVoResult">
         SELECT
-            *
+            cg.*,cgg.goods_id
         FROM
-             class_grade where
-            class_end_time > #{startTime}
-            AND #{endTime} >= class_end_time
+             class_grade cg LEFT JOIN class_grade_goods cgg on cg.grade_id = cgg.grade_id where
+            cg.class_end_time > #{startTime}
+            AND #{endTime} >= cg.class_end_time
     </select>
 </mapper>