he2802 2 年 前
コミット
d2270212fe

+ 8 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -216,6 +216,14 @@ public class CourseController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("旧系统查询用户学习进度列表")
+    @GetMapping("/goodsStudyProgress")
+    public TableDataInfo<GoodsUserVo> goodsStudyProgressList(CourseQueryBo bo) {
+        startPage();
+        List<GoodsUserVo> list = iCourseService.goodsStudyProgressList(bo);
+        return getDataTable(list);
+    }
+
     @ApiOperation("批量查询用户拥有的商品进度")
     @PostMapping("/goodsBatchList")
     public AjaxResult<List<GoodsBatchListVo>> goodsBatchList(@RequestBody CourseQueryBo bo) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -36,6 +36,8 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
+    List<GoodsUserVo> goodsStudyProgressList(CourseQueryBo bo);
+
     List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
 
     List<CourseUserVo> courseList(CourseQueryBo bo);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -74,6 +74,8 @@ public interface ICourseService extends IService<Course> {
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
+	List<GoodsUserVo> goodsStudyProgressList(CourseQueryBo bo);
+
 	List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
 
 	List<CourseUserVo> courseList(CourseQueryBo bo);

+ 21 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -588,6 +588,27 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return goodsUserVos;
     }
 
+    @Override
+    public List<GoodsUserVo> goodsStudyProgressList(CourseQueryBo bo) {
+        List<GoodsUserVo> goodsUserVos = baseMapper.goodsStudyProgressList(bo);
+        for (GoodsUserVo goodsUserVo : goodsUserVos) {
+            Long secLong = 0L;
+            Long studyLong = 0L;
+            SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(goodsUserVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(goodsUserVo.getUserId());
+            subjectStudyRecordQueryBo.setGradeId(goodsUserVo.getGradeId());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
+            for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
+                secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
+                studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
+            }
+            goodsUserVo.setSecAllNum(secLong);
+            goodsUserVo.setStuAllNum(studyLong);
+        }
+        return goodsUserVos;
+    }
+
     @Override
     public List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo) {
         List<GoodsUserVo> goodsUserVos = baseMapper.goodsHandoutsList(bo);

+ 17 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -398,4 +398,21 @@ public class GoodsUserVo {
 	private Boolean erJianErZao;
 	@ApiModelProperty("是否可以预约标识:1未参加考试 2已参加考试 3考试成绩未通过")
 	private Integer subscribeSign;
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	/** 学员编码 */
+	@Excel(name = "学员身份证")
+	@ApiModelProperty("学员身份证")
+	private String idCard;
+
+	/** 学员编码 */
+	@Excel(name = "学员电话")
+	@ApiModelProperty("学员电话")
+	private String telPhone;
+
+	@ApiModelProperty("大于0开始学习")
+	private Integer studyStatus;
 }

+ 78 - 2
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -212,6 +212,10 @@
         <result property="subjectNames" column="subject_names"/>
         <result property="sectionNum" column="section_num"/>
         <result property="goodsLearningOrder" column="goods_learning_order"/>
+        <result property="realName" column="realname"/>
+        <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
+        <result property="telPhone" column="telphone" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
+        <result property="studyStatus" column="study_status"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -539,7 +543,8 @@
         (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name,
         (SELECT `status` from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_status,
         (case WHEN(SELECT COUNT(1) from profile_tp where `status`=1 and FIND_IN_SET(g.goods_id,goods_ids) ) >0 then 1 ELSE 0 end) as profile_tp_status,
-        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
+        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names,
+        (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id) as study_status
         <if test="userId != null and userId != ''">
         ,
         us.exam_status  as sub_exam_status,
@@ -592,7 +597,78 @@
         <if test="studyStatus != null and studyStatus == 1">
             and (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id ) =0
         </if>
-        order by o.create_time desc
+        order by og.create_time desc
+    </select>
+
+    <select id="goodsStudyProgressList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">
+        SELECT
+        g.*,
+        u.realname,
+        u.id_card,
+        u.telphone,
+        o.user_id,
+        og.order_goods_id,
+        og.grade_id,
+        IFNULL(ge.exam_num,0) as exam_num,
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.grade_id = og.grade_id and ubr.user_id = o.user_id and ubr.current_status = 1) as record_num
+        FROM
+        `order` o
+        LEFT JOIN `user` u ON u.user_id = o.user_id
+        LEFT JOIN order_goods og ON og.order_sn = o.order_sn
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_business cb on g.business_id = cb.id
+        LEFT JOIN (SELECT
+        COUNT( m.id ) AS exam_num,
+        c.goods_id
+        FROM
+        course_menu_exam m
+        LEFT JOIN goods_course c ON m.course_id = c.course_id
+        where
+        m.type in (1,3)
+        GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
+        where 1=1
+        AND og.`status` = 1
+        --         AND og.refund_status in (0,1,3)
+        AND og.refund_status in (0,3)
+        AND og.pay_status in (2,3,4)
+        AND g.goods_type =1
+        <if test="userId != null and userId != ''">
+            and o.user_id = #{userId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND og.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND og.goods_id = #{goodsId}
+        </if>
+        <if test="oldCompanyId != null and oldCompanyId != ''">
+            AND o.old_company_id = #{oldCompanyId}
+        </if>
+        <if test="oldInstitutionId != null and oldInstitutionId != ''">
+            AND o.old_institution_id = #{oldInstitutionId}
+        </if>
+        <if test="oldCustomerId != null and oldCustomerId != ''">
+            AND o.old_customer_id = #{oldCustomerId}
+        </if>
+        <if test="userId != null and userId != ''">
+            and o.user_id = #{userId}
+        </if>
+        <if test="realname != null and realname !='' ">
+            AND u.realname like concat('%', #{realname}, '%')
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="telphone != null and telphone !='' ">
+            AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        order by og.create_time desc
     </select>
 
     <select id="goodsHandoutsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">