|
@@ -1,11 +1,15 @@
|
|
|
package com.ym.mec.web.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import com.microsvc.toolkit.common.response.paging.QueryInfo;
|
|
|
import com.ym.mec.biz.dal.entity.StudentCoursewarePlayRecord;
|
|
|
+import com.ym.mec.biz.dal.enums.ExportEnum;
|
|
|
import com.ym.mec.biz.dal.wrapper.StudentCoursewarePlayRecordWrapper;
|
|
|
+import com.ym.mec.biz.service.ExportService;
|
|
|
import com.ym.mec.biz.service.StudentCoursewarePlayRecordService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
import com.ym.mec.common.entity.HttpResponseResult;
|
|
@@ -14,6 +18,7 @@ import com.ym.mec.common.page.PageUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
@@ -24,7 +29,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
|
@Validated
|
|
@@ -36,6 +43,9 @@ public class StudentCoursewarePlayRecordController extends BaseController {
|
|
|
@Autowired
|
|
|
private StudentCoursewarePlayRecordService studentCoursewarePlayRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExportService exportService;
|
|
|
+
|
|
|
@ApiOperation(value = "详情", notes = "学生课件播放统计记录-根据详情ID查询单条, 传入id")
|
|
|
@PreAuthorize("@pcs.hasPermissions('studentCoursewarePlayRecord/detail')")
|
|
|
// @GetMapping("/detail/{id}")
|
|
@@ -91,6 +101,18 @@ public class StudentCoursewarePlayRecordController extends BaseController {
|
|
|
return succeed(studentCoursewarePlayRecordService.statList(statQuery));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 练习统计导出
|
|
|
+ */
|
|
|
+ @PostMapping("/exportStatList")
|
|
|
+// @PreAuthorize("@pcs.hasPermissions('studentCoursewarePlayRecord/exportStatList')")
|
|
|
+ public HttpResponseResult<List<StudentCoursewarePlayRecordWrapper.StatQueryData>> exportStatList(@RequestBody StudentCoursewarePlayRecordWrapper.StatQuery statQuery) {
|
|
|
+ exportService.getExportManageFuncMap().get(ExportEnum.VIDEO_PLAY_STAT).apply(JSON.parseObject(JSON.toJSONString(statQuery), Map.class));
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 练习详情统计
|
|
|
*/
|
|
@@ -99,4 +121,16 @@ public class StudentCoursewarePlayRecordController extends BaseController {
|
|
|
public HttpResponseResult<PageInfo<StudentCoursewarePlayRecordWrapper.StatQueryData>> statDetailPage(@RequestBody StudentCoursewarePlayRecordWrapper.StatQuery statQuery) {
|
|
|
return succeed(PageUtil.pageInfo(studentCoursewarePlayRecordService.statDetailPage(statQuery)));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 练习统计详情导出
|
|
|
+ */
|
|
|
+ @PostMapping("/exportStatDetailPage")
|
|
|
+// @PreAuthorize("@pcs.hasPermissions('studentCoursewarePlayRecord/exportStatDetailPage')")
|
|
|
+ public HttpResponseResult<List<StudentCoursewarePlayRecordWrapper.StatQueryData>> exportStatDetailPage(@RequestBody StudentCoursewarePlayRecordWrapper.StatQuery statQuery) {
|
|
|
+ statQuery.setPage(1);
|
|
|
+ statQuery.setRows(9999);
|
|
|
+ exportService.getExportManageFuncMap().get(ExportEnum.VIDEO_PLAY_DETAIL_STAT).apply(JSON.parseObject(JSON.toJSONString(statQuery), Map.class));
|
|
|
+ return succeed();
|
|
|
+ }
|
|
|
}
|