he2802 2 سال پیش
والد
کامیت
358ff9f65a

+ 2 - 1
zhongzheng-admin-data/src/main/java/com/zhongzheng/controller/common/UserStudyLogController.java

@@ -170,7 +170,8 @@ public class UserStudyLogController extends BaseController {
         }*/
     //    iClassGradeUserService.exportListVideoUserPeriod(451L,"D:\\test\\网课");
     //    iClassGradeUserService.exportListBKUserPeriod(451L,"D:\\test\\网课");
-        iClassGradeUserService.exportCertificateList(451L,"D:\\test\\网课");
+    //    iClassGradeUserService.exportCertificateList(451L,"D:\\test\\网课");
+        iClassGradeUserService.exportLiveStudyList(451L,"D:\\test\\网课");
         return AjaxResult.success();
     }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -158,5 +158,7 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	Boolean exportCertificateList(Long userId,String dirPath);
 
+	Boolean exportLiveStudyList(Long userId,String dirPath);
+
     List<UserUsbRecordVo> getListUserSubscribe(UserUsbRecordBo bo);
 }

+ 78 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -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){

+ 56 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/DangAnLiveListExportVo.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.modules.grade.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+public class DangAnLiveListExportVo {
+	private static final long serialVersionUID = 1L;
+	/** 学员编码 */
+	@Excel(name = "姓名")
+	@ApiModelProperty("姓名")
+	private String realname;
+
+	/** 学员编码 */
+	@Excel(name = "身份证号码")
+	@ApiModelProperty("身份证号码")
+	private String idCard;
+
+
+	@Excel(name = "直播")
+	private String goodsName;
+
+	@Excel(name = "业务类型")
+	private String businessName;
+
+	@Excel(name = "专业")
+	private String categoryName;
+
+
+	@Excel(name = "有效期")
+	private String serviceTimeTxt;
+
+	@Excel(name = "状态")
+	private String status;
+
+	@ApiModelProperty("模块")
+	private Long moduleNum;
+	@ApiModelProperty("章")
+	private Long chapterNum;
+	@ApiModelProperty("节")
+	private Long sectionNum;
+
+	@Excel(name = "总进度(节)")
+	private String process;
+
+	@Excel(name = "视频总进度")
+	private String videoProcess;
+}

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

@@ -129,6 +129,8 @@
         <result property="status" column="status"/>
         <result property="sectionNum" column="section_num"/>
         <result property="fileNum" column="file_num"/>
+        <result property="realname" column="realname"/>
+        <result property="idCard" column="id_card" typeHandler="com.zhongzheng.common.type.EncryptHandler"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
@@ -855,6 +857,8 @@
         SELECT
         g.goods_id,
         #{userId} as user_id,
+        u.realname,
+        u.id_card,
         s.create_time,
         g.goods_name,
         g.`year`,
@@ -923,6 +927,7 @@
         goods g
         LEFT JOIN order_goods s ON g.goods_id = s.goods_id
         LEFT JOIN `order` o ON o.order_sn = s.order_sn
+        LEFT JOIN `user` u ON u.user_id = o.user_id
         where 1=1
         AND s.refund_status in (0,1,3)
         AND s.pay_status in (2,3,4)