|
|
@@ -4376,6 +4376,84 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Boolean exportLiveStudyList(Long userId, String dirPath) {
|
|
|
+ dirPath = dirPath+"/直播记录";
|
|
|
+ File rootDir = new File(dirPath);
|
|
|
+ if(!rootDir.exists()){
|
|
|
+ rootDir.mkdirs();
|
|
|
+ }
|
|
|
+ UserQueryBo queryBo = new UserQueryBo();
|
|
|
+ queryBo.setUserId(userId);
|
|
|
+ List<DangAnLiveListExportVo> exportList = new ArrayList<>();
|
|
|
+ List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnLiveStudy(queryBo);
|
|
|
+ for(ExamStudyRecordVo vo : list){
|
|
|
+ DangAnLiveListExportVo item = BeanUtil.toBean(vo, DangAnLiveListExportVo.class);
|
|
|
+ item.setBusinessName(vo.getEducationName()+"-"+vo.getProjectName()+"-"+vo.getBusinessName());
|
|
|
+ item.setServiceTimeTxt(DateUtils.timestampToDateFormat(vo.getServiceStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(vo.getServiceEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ item.setProcess(vo.getStuAllNum()+"/"+vo.getSectionNum());
|
|
|
+ item.setVideoProcess(vo.getStuAllNum()+"/"+vo.getSectionNum());
|
|
|
+ exportList.add(item);
|
|
|
+ }
|
|
|
+ ExcelUtil<DangAnLiveListExportVo> util = new ExcelUtil<DangAnLiveListExportVo>(DangAnLiveListExportVo.class);
|
|
|
+ String filePath = dirPath+"/直播记录.xlsx";
|
|
|
+ util.exportEasyExcelUtil(exportList,DangAnLiveListExportVo.class,filePath);
|
|
|
+
|
|
|
+ //next
|
|
|
+ for (ExamStudyRecordVo classPeriodStudentVo : list) {
|
|
|
+ String goodsDirPath = dirPath+"/"+classPeriodStudentVo.getGoodsName();
|
|
|
+ List<DangAnStudentExportAllVo> studyList = new ArrayList<>();
|
|
|
+ ClassGradeUserQueryBo classGradeUserQueryBo1 = new ClassGradeUserQueryBo();
|
|
|
+ classGradeUserQueryBo1.setUserId(classPeriodStudentVo.getUserId());
|
|
|
+ classGradeUserQueryBo1.setGoodsId(classPeriodStudentVo.getGoodsId());
|
|
|
+ classGradeUserQueryBo1.setOrderGoodsId(classPeriodStudentVo.getOrderGoodsId());
|
|
|
+ List<UserPeriodExportV2Vo> periodVoList = listUserStudyRecordV2Week(classGradeUserQueryBo1);
|
|
|
+ for (UserPeriodExportV2Vo cVo : periodVoList) {
|
|
|
+ for (UserPeriodItemExportVo rVo : cVo.getRecordList()) {
|
|
|
+ DangAnStudentExportAllVo item = BeanUtil.toBean(classPeriodStudentVo, DangAnStudentExportAllVo.class);
|
|
|
+ item.setBusinessName(classPeriodStudentVo.getEducationName()+"-"+classPeriodStudentVo.getProjectName()+"-"+classPeriodStudentVo.getBusinessName());
|
|
|
+ item.setModuleName(cVo.getModuleName());
|
|
|
+ item.setChapterName(cVo.getChapterName());
|
|
|
+ item.setSectionName(cVo.getSectionName());
|
|
|
+ item.setStudyTimeTxt(DateUtils.timestampToDateFormat(rVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(rVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss" ));
|
|
|
+ if(Validator.isNotEmpty(rVo.getVideoCurrentTime())){
|
|
|
+ item.setStudyTimeLongTxt(DateUtils.secToTime(rVo.getVideoCurrentTime().intValue()));
|
|
|
+ }
|
|
|
+ item.setScore(rVo.getScore());
|
|
|
+ if(Validator.isNotEmpty(rVo.getRightRate())){
|
|
|
+ item.setRate(rVo.getRightRate()+"");
|
|
|
+ }
|
|
|
+ if(rVo.getFromPlat()==1){
|
|
|
+ item.setPlat("小程序");
|
|
|
+ }
|
|
|
+ if(rVo.getFromPlat()==2){
|
|
|
+ item.setPlat("PC");
|
|
|
+ }
|
|
|
+ if(rVo.getFromPlat()==3){
|
|
|
+ item.setPlat("h5");
|
|
|
+ }
|
|
|
+ if(rVo.getSectionType()==1){
|
|
|
+ item.setSectionType("录播");
|
|
|
+ }
|
|
|
+ if(rVo.getSectionType()==2){
|
|
|
+ item.setSectionType("直播");
|
|
|
+ }
|
|
|
+ if(rVo.getSectionType()==3){
|
|
|
+ item.setSectionType("回放");
|
|
|
+ }
|
|
|
+ if(rVo.getSectionType()==4){
|
|
|
+ item.setSectionType("题卷");
|
|
|
+ }
|
|
|
+ studyList.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ExcelUtil<DangAnStudentExportAllVo> util2 = new ExcelUtil<DangAnStudentExportAllVo>(DangAnStudentExportAllVo.class);
|
|
|
+ String filePath2 = goodsDirPath+"/直播记录.xlsx";
|
|
|
+ util2.exportEasyExcelUtil(studyList,DangAnStudentExportAllVo.class,filePath2);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<UserUsbRecordVo> getListUserSubscribe(UserUsbRecordBo bo) {
|
|
|
if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() == 6){
|