Commit 99eb06b2 by 涂亚平

年前上线版本

1 parent 1babf734
...@@ -6,6 +6,7 @@ import com.subsidy.model.VodPlayHistoryDO; ...@@ -6,6 +6,7 @@ import com.subsidy.model.VodPlayHistoryDO;
import com.subsidy.vo.administer.MemberStudyLogVO; import com.subsidy.vo.administer.MemberStudyLogVO;
import com.subsidy.vo.member.ContentVodNewVO; import com.subsidy.vo.member.ContentVodNewVO;
import com.subsidy.vo.sign.ClassSignInfoVO; import com.subsidy.vo.sign.ClassSignInfoVO;
import com.subsidy.vo.vod.ClassMemberPlayLengthVO;
import com.subsidy.vo.vod.GetMemberStudyInfoVO; import com.subsidy.vo.vod.GetMemberStudyInfoVO;
import com.subsidy.vo.vod.StudyHistoryVO; import com.subsidy.vo.vod.StudyHistoryVO;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -84,7 +85,7 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> { ...@@ -84,7 +85,7 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
/** /**
* 以班级、人的维度查询某个人的视频观看时长 * 以班级、人的维度查询某个人的视频观看时长
*/ */
List<VodPlayHistoryDO> classMemberPlayLength(Long classId); List<ClassMemberPlayLengthVO> classMemberPlayLength(Long classId);
} }
...@@ -68,6 +68,7 @@ import com.subsidy.vo.done.GetMaxScoreVO; ...@@ -68,6 +68,7 @@ import com.subsidy.vo.done.GetMaxScoreVO;
import com.subsidy.vo.done.TestScoreInfoVO; import com.subsidy.vo.done.TestScoreInfoVO;
import com.subsidy.vo.member.ClassSignVO; import com.subsidy.vo.member.ClassSignVO;
import com.subsidy.vo.sign.AnswerRecordVO; import com.subsidy.vo.sign.AnswerRecordVO;
import com.subsidy.vo.vod.ClassMemberPlayLengthVO;
import com.subsidy.vo.vod.ClassVodCompleteInfoVO; import com.subsidy.vo.vod.ClassVodCompleteInfoVO;
import com.subsidy.vo.vod.DayInfoItemVO; import com.subsidy.vo.vod.DayInfoItemVO;
import com.subsidy.vo.vod.GetMemberStudyInfoVO; import com.subsidy.vo.vod.GetMemberStudyInfoVO;
...@@ -927,16 +928,22 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -927,16 +928,22 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
public void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO){ public void exportClassVodDailyInfo(ClassVodDailyInfoDTO classVodDailyInfoDTO){
//查看班级里有多少人 //查看班级里有多少人
Page pager = new Page(1,-1L); Page pager = new Page(1, -1L);
ClassDictDO classDictDO = classDictMapper.selectById(classVodDailyInfoDTO.getClassId());
//查询所有视频 //查询所有视频
List<VodDictDO> vodDictDOS = vodDictMapper.getCourseVods(classVodDailyInfoDTO.getClassId(),null); List<VodDictDO> vodDictDOS = vodDictMapper.getCourseVods(classDictDO.getCourseId(), null);
HashMap<String, Integer> vodHashmap = new HashMap<>();
for (VodDictDO vodDictDO : vodDictDOS) {
vodHashmap.put(vodDictDO.getVodName(), vodDictDO.getVodLength());
}
// 表头 // 表头
List<String> title = new ArrayList<>(); List<String> title = new ArrayList<>();
title.add("姓名"); title.add("姓名");
title.add("合计完成率"); title.add("合计完成率");
for (VodDictDO vodDictDO : vodDictDOS){ for (VodDictDO vodDictDO : vodDictDOS) {
title.add(vodDictDO.getVodName()); title.add(vodDictDO.getVodName());
} }
...@@ -946,15 +953,16 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis ...@@ -946,15 +953,16 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
List<ClassDailyInfoVO> classDailyInfoVOS = classDailyInfoVOIPage.getRecords(); List<ClassDailyInfoVO> classDailyInfoVOS = classDailyInfoVOIPage.getRecords();
//获取班级、每个学员维度的视频播放总时长 //获取班级、每个学员维度的视频播放总时长
List<VodPlayHistoryDO> vodPlayHistoryDOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId()); List<ClassMemberPlayLengthVO> classMemberPlayLengthVOS = vodPlayHistoryMapper.classMemberPlayLength(classVodDailyInfoDTO.getClassId());
HashMap<String, Integer> hashMap = new HashMap<>(); HashMap<String, Integer> hashMap = new HashMap<>();
//存在一个map里 //存在一个map里
for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { for (ClassMemberPlayLengthVO classMemberPlayLengthVO : classMemberPlayLengthVOS) {
hashMap.put(vodPlayHistoryDO.getMemberId() + "-" + vodPlayHistoryDO.getVodId(), vodPlayHistoryDO.getPlayLength()); hashMap.put(classMemberPlayLengthVO.getMemberId() + "-" + classMemberPlayLengthVO.getVodName(), classMemberPlayLengthVO.getPlayLength());
} }
writeVodExcel(classDailyInfoVOS, hashMap, title, vodHashmap);
} }
......
package com.subsidy.vo.vod;
import lombok.Data;
@Data
public class ClassMemberPlayLengthVO {
private Long id;
/**
* 班级id
*/
private Long classId;
/**
* 视频id
*/
private Long vodId;
/**
* 学生id
*/
private Long memberId;
/**
* 观看时长
*/
private Integer playLength;
private String vodName;
}
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
order by t.play_date desc order by t.play_date desc
</select> </select>
<select id="classMemberPlayLength" parameterType="long" resultType="com.subsidy.model.VodPlayHistoryDO"> <select id="classMemberPlayLength" parameterType="long" resultType="com.subsidy.vo.vod.ClassMemberPlayLengthVO">
SELECT SELECT
t.member_id, t.member_id,
t.vod_id, t.vod_id,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!