he2802 1 年之前
父节点
当前提交
9b1f34f6b6

+ 6 - 4
zhongzheng-admin-data/src/main/java/com/zhongzheng/controller/common/UserStudyLogController.java

@@ -168,10 +168,12 @@ public class UserStudyLogController extends BaseController {
         /*if (!ToolsUtils.checkSignFromOldSys(bo.getStamp(), bo.getSign())) {
             throw new CustomException("签名错误");
         }*/
-    //    iClassGradeUserService.exportListVideoUserPeriod(451L,"D:\\test\\网课");
-    //    iClassGradeUserService.exportListBKUserPeriod(451L,"D:\\test\\网课");
-    //    iClassGradeUserService.exportCertificateList(451L,"D:\\test\\网课");
-        iClassGradeUserService.exportLiveStudyList(451L,"D:\\test\\网课");
+    //    iClassGradeUserService.exportListVideoUserPeriod(451L,"D:\\test\\网课");  //网课
+    //    iClassGradeUserService.exportListBKUserPeriod(451L,"D:\\test\\网课");  //报考
+    //    iClassGradeUserService.exportCertificateList(451L,"D:\\test\\网课");  //证书
+    //    iClassGradeUserService.exportLiveStudyList(451L,"D:\\test\\网课"); //直播
+    //    iClassGradeUserService.exportHandoutsStudyList(454L,"D:\\test\\网课"); //资料
+        iClassGradeUserService.exportExamStudyList(454L,"D:\\test\\网课"); //题库
         return AjaxResult.success();
     }
 }

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

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

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

@@ -4454,6 +4454,59 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return true;
     }
 
+    @Override
+    public Boolean exportHandoutsStudyList(Long userId, String dirPath) {
+        dirPath = dirPath+"/资料记录";
+        File rootDir = new File(dirPath);
+        if(!rootDir.exists()){
+            rootDir.mkdirs();
+        }
+        UserQueryBo queryBo = new UserQueryBo();
+        queryBo.setUserId(userId);
+        List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnHandoutsStudy(queryBo);
+        List<DangAnHandoutsListExportVo> exportList = new ArrayList<>();
+        for(ExamStudyRecordVo vo : list){
+            DangAnHandoutsListExportVo item = BeanUtil.toBean(vo, DangAnHandoutsListExportVo.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"));
+            exportList.add(item);
+        }
+        ExcelUtil<DangAnHandoutsListExportVo> util = new ExcelUtil<DangAnHandoutsListExportVo>(DangAnHandoutsListExportVo.class);
+        String filePath = dirPath+"/资料记录.xlsx";
+        util.exportEasyExcelUtil(exportList,DangAnHandoutsListExportVo.class,filePath);
+        return true;
+    }
+
+    @Override
+    public Boolean exportExamStudyList(Long userId, String dirPath) {
+        dirPath = dirPath+"/题库记录";
+        File rootDir = new File(dirPath);
+        if(!rootDir.exists()){
+            rootDir.mkdirs();
+        }
+        UserQueryBo queryBo = new UserQueryBo();
+        queryBo.setUserId(userId);
+        List<DangAnExamListExportVo> exportList = new ArrayList<>();
+        List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnExamStudy(queryBo);
+        for(ExamStudyRecordVo vo : list){
+            DangAnExamListExportVo item = BeanUtil.toBean(vo, DangAnExamListExportVo.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.getExamNum());
+            item.setStudyTimeTxt(DateUtils.timestampToDateFormat(vo.getStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+DateUtils.timestampToDateFormat(vo.getEndTime(),"yyyy-MM-dd HH:mm:ss"));
+            exportList.add(item);
+        }
+        ExcelUtil<DangAnExamListExportVo> util = new ExcelUtil<DangAnExamListExportVo>(DangAnExamListExportVo.class);
+        String filePath = dirPath+"/题库记录.xlsx";
+        util.exportEasyExcelUtil(exportList,DangAnExamListExportVo.class,filePath);
+
+        //next
+        for(ExamStudyRecordVo vo : list){
+            String goodsDirPath = dirPath+"/"+vo.getGoodsName();
+        }
+        return true;
+    }
+
     @Override
     public List<UserUsbRecordVo> getListUserSubscribe(UserUsbRecordBo bo) {
         if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() == 6){

+ 57 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/DangAnExamListExportVo.java

@@ -0,0 +1,57 @@
+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 DangAnExamListExportVo {
+	private static final long serialVersionUID = 1L;
+	/** 学员编码 */
+	@Excel(name = "姓名")
+	@ApiModelProperty("姓名")
+	private String realname;
+
+	/** 学员编码 */
+	@Excel(name = "身份证号码")
+	@ApiModelProperty("身份证号码")
+	private String idCard;
+	@Excel(name = "练习时间")
+	private String studyTimeTxt;
+
+	@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 moduleExamNum;
+	@ApiModelProperty("章卷")
+	private Long chapterExamNum;
+	@ApiModelProperty("试卷")
+	private Long examNum;
+
+	@Excel(name = "总进度(题目节)")
+	private String process;
+
+	@Excel(name = "视频总进度")
+	private String videoProcess;
+}

+ 47 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/DangAnHandoutsListExportVo.java

@@ -0,0 +1,47 @@
+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 DangAnHandoutsListExportVo {
+	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;
+
+
+	@Excel(name = "文件")
+	private Long fileNum;
+}

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/ExamStudyRecordVo.java

@@ -118,4 +118,8 @@ public class ExamStudyRecordVo {
     private Integer status;
     @ApiModelProperty("文件数量")
     private Long fileNum;
+    @ApiModelProperty("姓名")
+    private String realname;
+    @ApiModelProperty("身份证")
+    private String idCard;
 }

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

@@ -734,6 +734,8 @@
         SELECT
         DISTINCT g.goods_id,
         #{userId} as user_id,
+        u.realname,
+        u.id_card,
         s.create_time,
         g.goods_name,
         g.`year`,
@@ -768,6 +770,7 @@
         goods g
         LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3,4)
         LEFT JOIN `order` o ON o.order_sn = s.order_sn
+        LEFT JOIN `user` u ON u.user_id = o.user_id
         WHERE
         g.goods_type =2
         <if test="userId != null and userId !=''">
@@ -801,6 +804,8 @@
             resultMap="ExamStudyRecordVoResult">
         SELECT
         g.goods_id,
+        u.realname,
+        u.id_card,
         #{userId} as user_id,
         s.create_time,
         g.goods_name,
@@ -820,6 +825,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)