|
|
@@ -0,0 +1,514 @@
|
|
|
+package com.fs.course.controller;
|
|
|
+
|
|
|
+import com.fs.app.cusrole.service.IAppCustomerRoleService;
|
|
|
+import com.fs.app.watchlog.dto.AppCourseWatchLogDto;
|
|
|
+import com.fs.app.watchlog.param.AppCourseWatchLogListParam;
|
|
|
+import com.fs.app.watchlog.service.IAppCourseWatchLogService;
|
|
|
+import com.fs.common.annotation.Log;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.domain.model.LoginUser;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.company.vo.OptionVO;
|
|
|
+import com.fs.course.service.IFsCourseWatchLogService;
|
|
|
+import com.fs.his.domain.FsExportTask;
|
|
|
+import com.fs.his.service.IFsExportTaskService;
|
|
|
+import com.fs.qw.param.QwWatchLogStatisticsListParam;
|
|
|
+import com.fs.qw.service.IQwWatchLogService;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.time.temporal.ChronoUnit;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 短链课程看课记录Controller
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2024-10-24
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/course/appCourseWatchLog")
|
|
|
+public class FsAppCourseWatchLogController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private IFsCourseWatchLogService fsCourseWatchLogService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IQwWatchLogService qwWatchLogService;
|
|
|
+ @Autowired
|
|
|
+ private IFsExportTaskService exportTaskService;
|
|
|
+ @Autowired
|
|
|
+ private IAppCourseWatchLogService appCourseWatchLogService;
|
|
|
+ @Autowired
|
|
|
+ private IAppCustomerRoleService appCustomerRoleService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询app课程看课记录列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:courseWatchLog:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(AppCourseWatchLogListParam param) {
|
|
|
+ startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+
|
|
|
+ List<AppCourseWatchLogDto> list = appCourseWatchLogService.selectAppCourseWatchLogListVO(param);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 查询短链课程 我的部门 看课记录列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:deptList')")
|
|
|
+// @GetMapping("/deptList")
|
|
|
+// public TableDataInfo deptList(FsCourseWatchLogListParam param) {
|
|
|
+//
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+//
|
|
|
+//
|
|
|
+// List<Long> combinedList = new ArrayList<>();
|
|
|
+// //本部门
|
|
|
+// Long deptId = loginUser.getUser().getDeptId();
|
|
|
+// if (deptId!=null){
|
|
|
+// combinedList.add(deptId);
|
|
|
+// }
|
|
|
+// //本部门的下级部门
|
|
|
+// List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
+// if (!deptList.isEmpty()){
|
|
|
+// combinedList.addAll(deptList);
|
|
|
+// }
|
|
|
+//
|
|
|
+// param.setCuDeptIdList(combinedList);
|
|
|
+// param.setUserType(loginUser.getUser().getUserType());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+//
|
|
|
+// startPage();
|
|
|
+// List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
|
|
|
+//
|
|
|
+// TableDataInfo rspData = new TableDataInfo();
|
|
|
+// rspData.setCode(HttpStatus.SUCCESS);
|
|
|
+// rspData.setMsg("查询成功");
|
|
|
+// rspData.setRows(list);
|
|
|
+// rspData.setTotal(fsCourseWatchLogService.selectFsCourseWatchLogListVOCount(param));
|
|
|
+// return rspData;
|
|
|
+// }
|
|
|
+// /**
|
|
|
+// * 查询短链课程看课记录列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:myList')")
|
|
|
+// @GetMapping("/myList")
|
|
|
+// public TableDataInfo myList(FsCourseWatchLogListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+// List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
|
|
|
+//
|
|
|
+// TableDataInfo rspData = new TableDataInfo();
|
|
|
+// rspData.setCode(HttpStatus.SUCCESS);
|
|
|
+// rspData.setMsg("查询成功");
|
|
|
+// rspData.setRows(list);
|
|
|
+// rspData.setTotal(fsCourseWatchLogService.selectFsCourseWatchLogListVOCount(param));
|
|
|
+// return rspData;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断传入的日期是否是7天之前
|
|
|
+ * @param dateStr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public boolean isDateBefore7Days(String dateStr) {
|
|
|
+ // 定义日期格式
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+
|
|
|
+ // 解析输入日期
|
|
|
+ LocalDate inputDate = LocalDate.parse(dateStr, formatter);
|
|
|
+
|
|
|
+ // 获取当前日期(2025-05-23)
|
|
|
+ LocalDate currentDate = LocalDate.now();
|
|
|
+
|
|
|
+ // 计算日期差
|
|
|
+ long daysBetween = ChronoUnit.DAYS.between(inputDate, currentDate);
|
|
|
+
|
|
|
+ // 判断是否超过7天
|
|
|
+ return daysBetween >= 7;
|
|
|
+ }
|
|
|
+
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:statisticsList')")
|
|
|
+// @GetMapping("/statisticsList")
|
|
|
+// public TableDataInfo statisticsList(FsCourseWatchLogStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<FsCourseWatchLogStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/qwWatchLogStatisticsList")
|
|
|
+// public TableDataInfo qwWatchLogStatisticsList(QwWatchLogStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<QwWatchLogStatisticsListVO> list = qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/exportWatchLogStatistics")
|
|
|
+// public AjaxResult exportWatchLogStatistics(QwWatchLogStatisticsListParam param) {
|
|
|
+//
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setExcelName("进线客户统计记录导出");
|
|
|
+//
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return AjaxResult.error("请筛选时间后导出");
|
|
|
+// }
|
|
|
+//
|
|
|
+// boolean res = qwWatchLogService.dateDifferenceMoreThan7Days(param.getSTime(), param.getETime());
|
|
|
+//
|
|
|
+// if (res) {
|
|
|
+// return AjaxResult.error("导出数据时间差不能超过七天");
|
|
|
+// }
|
|
|
+// AjaxResult returnRes = new AjaxResult();
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// try {
|
|
|
+// Class<? extends IQwWatchLogService> clazz = qwWatchLogService.getClass();
|
|
|
+// returnRes = exportCommon(
|
|
|
+// param,
|
|
|
+// loginUser.getUser().getUserId(),
|
|
|
+// "进线客户统计记录",
|
|
|
+// 10000L,
|
|
|
+// "getQwWatchLogStatisticsCount",
|
|
|
+// "exportQwWatchLogStatistics",
|
|
|
+// clazz);
|
|
|
+// } catch (Exception ex) {
|
|
|
+// ex.printStackTrace();
|
|
|
+// return AjaxResult.error("导出报错了");
|
|
|
+// }
|
|
|
+// return returnRes;
|
|
|
+
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setExcelName("进线客户统计记录导出");
|
|
|
+// return exportQwWatchLogStatistics(param, loginUser.getUser().getUserId());
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/myQwWatchLogStatisticsList")
|
|
|
+// public TableDataInfo myQwWatchLogStatisticsList(QwWatchLogStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<QwWatchLogStatisticsListVO> list = qwWatchLogService.selectQwWatchLogStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+ public AjaxResult exportQwWatchLogStatistics(QwWatchLogStatisticsListParam param,Long userId){
|
|
|
+
|
|
|
+ if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+ return AjaxResult.error("请筛选时间后导出");
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean res = qwWatchLogService.dateDifferenceMoreThan7Days(param.getSTime(), param.getETime());
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ return AjaxResult.error("导出数据时间差不能超过七天");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long count = qwWatchLogService.getQwWatchLogStatisticsCount(param);
|
|
|
+ if (count > 10000) {
|
|
|
+ return AjaxResult.error("导出数据不可超过1w条");
|
|
|
+ }
|
|
|
+// Long userId = loginUser.getUser().getUserId();
|
|
|
+ FsExportTask task = new FsExportTask();
|
|
|
+ task.setTaskType(2);
|
|
|
+ task.setStatus(0);
|
|
|
+ task.setStartTime(new Date());
|
|
|
+ task.setRemark("客户统计记录");
|
|
|
+ task.setSysType(2);
|
|
|
+ task.setCompanyUserId(userId);
|
|
|
+ exportTaskService.insertFsExportTask(task);
|
|
|
+ param.setTaskId(task.getTaskId());
|
|
|
+ qwWatchLogService.exportQwWatchLogStatistics(param, count);
|
|
|
+
|
|
|
+ return new AjaxResult(200, "后台正在导出,请等待...任务ID:" + task.getTaskId(), task.getTaskId());
|
|
|
+ }
|
|
|
+
|
|
|
+// @GetMapping("/exportMyQwWatchLogStatistics")
|
|
|
+// public AjaxResult exportMyQwWatchLogStatistics(QwWatchLogStatisticsListParam param) {
|
|
|
+//
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+// param.setExcelName("我的客户统计记录导出");
|
|
|
+// return exportQwWatchLogStatistics(param, loginUser.getUser().getUserId());
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// @GetMapping("/qwWatchLogAllStatisticsList")
|
|
|
+// public TableDataInfo qwWatchLogAllStatisticsList(QwWatchLogStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<QwWatchLogAllStatisticsListVO> list = qwWatchLogService.selectQwWatchLogAllStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/myQwWatchLogAllStatisticsList")
|
|
|
+// public TableDataInfo myQwWatchLogAllStatisticsList(QwWatchLogStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<QwWatchLogAllStatisticsListVO> list = qwWatchLogService.selectQwWatchLogAllStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
+ public AjaxResult exportQwWatchLogAllStatistics(QwWatchLogStatisticsListParam param, Long userId) {
|
|
|
+
|
|
|
+ if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+ return AjaxResult.error("请筛选时间后导出");
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean res = qwWatchLogService.dateDifferenceMoreThan7Days(param.getSTime(), param.getETime());
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ return AjaxResult.error("导出数据时间差不能超过七天");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long count = qwWatchLogService.getQwWatchLogStatisticsCount(param);
|
|
|
+ if (count > 10000) {
|
|
|
+ return AjaxResult.error("导出数据不可超过1w条");
|
|
|
+ }
|
|
|
+// Long userId = loginUser.getUser().getUserId();
|
|
|
+ FsExportTask task = new FsExportTask();
|
|
|
+ task.setTaskType(2);
|
|
|
+ task.setStatus(0);
|
|
|
+ task.setStartTime(new Date());
|
|
|
+ task.setRemark("我的客户统计记录");
|
|
|
+ task.setSysType(2);
|
|
|
+ task.setCompanyUserId(userId);
|
|
|
+ exportTaskService.insertFsExportTask(task);
|
|
|
+ param.setTaskId(task.getTaskId());
|
|
|
+ qwWatchLogService.exportQwWatchLogAllStatistics(param, count);
|
|
|
+
|
|
|
+ return new AjaxResult(200, "后台正在导出,请等待...任务ID:" + task.getTaskId(), task.getTaskId());
|
|
|
+ }
|
|
|
+
|
|
|
+// @GetMapping("/exportMyQwWatchLogAllStatistics")
|
|
|
+// public AjaxResult exportMyQwWatchLogAllStatistics(QwWatchLogStatisticsListParam param) {
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+// param.setExcelName("我的数据汇总记录导出");
|
|
|
+// return exportQwWatchLogAllStatistics(param, loginUser.getUser().getUserId());
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/exportQwWatchLogStatisticsAll")
|
|
|
+// public AjaxResult exportQwWatchLogStatisticsAll(QwWatchLogStatisticsListParam param) {
|
|
|
+//
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// param.setExcelName("数据汇总记录导出");
|
|
|
+// return exportQwWatchLogAllStatistics(param, loginUser.getUser().getUserId());
|
|
|
+//
|
|
|
+// }
|
|
|
+
|
|
|
+// @GetMapping("/watchLogStatistics")
|
|
|
+// public TableDataInfo watchLogStatistics(FsCourseOverParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<FsCourseOverVO> list = fsCourseWatchLogService.selectFsCourseWatchLogOverStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+//
|
|
|
+// @GetMapping("/watchLogStatisticsExport")
|
|
|
+// public AjaxResult watchLogStatisticsExport(FsCourseOverParam param) {
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return AjaxResult.error("请选择时间");
|
|
|
+// }
|
|
|
+// List<FsCourseOverVO> list = fsCourseWatchLogService.selectFsCourseWatchLogOverStatisticsListVO(param);
|
|
|
+// ExcelUtil<FsCourseOverVO> util = new ExcelUtil<FsCourseOverVO>(FsCourseOverVO.class);
|
|
|
+// return util.exportExcel(list, "完课数据");
|
|
|
+// }
|
|
|
+
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:userStatisticsList')")
|
|
|
+// @GetMapping("/userStatisticsList")
|
|
|
+// public TableDataInfo userStatisticsList(FsCourseUserStatisticsListParam param) {
|
|
|
+// startPage();
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+// param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+// if (param.getSTime() == null || param.getETime() == null) {
|
|
|
+// return getDataTable(new ArrayList<>());
|
|
|
+// }
|
|
|
+// List<FsCourseUserStatisticsListVO> list = fsCourseWatchLogService.selectFsCourseUserStatisticsListVO(param);
|
|
|
+// return getDataTable(list);
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出短链课程看课记录列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:courseWatchLog:export')")
|
|
|
+ @Log(title = "短链课程看课记录", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult export(AppCourseWatchLogListParam param)
|
|
|
+ {
|
|
|
+ // 导出
|
|
|
+ List<AppCourseWatchLogDto> list = appCourseWatchLogService.selectAppCourseWatchLogListVO(param);
|
|
|
+ ExcelUtil<AppCourseWatchLogDto> util = new ExcelUtil<AppCourseWatchLogDto>(AppCourseWatchLogDto.class);
|
|
|
+ return util.exportExcel(list, "短链课程看课记录数据");
|
|
|
+// return exportCourseWatchLog(param);// 放导出任务
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出短链课程看客记录
|
|
|
+ *
|
|
|
+ * @param param 参数
|
|
|
+ * @return AjaxResult
|
|
|
+ */
|
|
|
+ private AjaxResult exportCourseWatchLog(AppCourseWatchLogListParam param) {
|
|
|
+ LoginUser loginUser = getLoginUser();
|
|
|
+ logger.info("导出看课记录");
|
|
|
+ if (appCourseWatchLogService.isEntityNull(param)) {
|
|
|
+ return AjaxResult.error("请筛选数据导出");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long userId = loginUser.getUser().getUserId();
|
|
|
+ Integer exportType = exportTaskService.isExportType1(userId);
|
|
|
+ if (exportType > 0) {
|
|
|
+ return AjaxResult.error("你已经有正在导出的任务");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(param.getSTime() == null || param.getETime() == null || (param.getSTime().getTime() > param.getETime().getTime())) {
|
|
|
+ return AjaxResult.error("导出任务的创建时间范围只能是一天!");
|
|
|
+ }
|
|
|
+
|
|
|
+ Long count = appCourseWatchLogService.selectAppCourseWatchLogListVOCount(param);
|
|
|
+ if (count > 10000) {
|
|
|
+ return AjaxResult.error("导出数据不可超过1w条");
|
|
|
+ }
|
|
|
+
|
|
|
+ FsExportTask task = new FsExportTask();
|
|
|
+ task.setTaskType(2);
|
|
|
+ task.setStatus(0);
|
|
|
+ task.setStartTime(new Date());
|
|
|
+ task.setRemark("app短链课程看课记录");
|
|
|
+ task.setSysType(1);
|
|
|
+ task.setCompanyUserId(userId);
|
|
|
+ exportTaskService.insertFsExportTask(task);
|
|
|
+ param.setTaskId(task.getTaskId());
|
|
|
+
|
|
|
+ appCourseWatchLogService.exportData(param, count);
|
|
|
+ return new AjaxResult(200, "后台正在导出,请等待...任务ID:" + task.getTaskId(), task.getTaskId());
|
|
|
+ }
|
|
|
+
|
|
|
+// private AjaxResult exportCommon(Object param, Long userId, String remark, Long limitCount, String getCountMethodName, String exportMethodName, Class<?> clazz) {
|
|
|
+// AjaxResult res = new AjaxResult();
|
|
|
+// try {
|
|
|
+// res = fsCourseWatchLogService.exportCommon(param, userId, remark, limitCount, getCountMethodName, exportMethodName, clazz);
|
|
|
+// } catch (Exception ex) {
|
|
|
+// ex.printStackTrace();
|
|
|
+// }
|
|
|
+// return res;
|
|
|
+// }
|
|
|
+
|
|
|
+// /**
|
|
|
+// * 导出短链课程看课记录列表
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:myExport')")
|
|
|
+// @Log(title = "短链课程看课记录", businessType = BusinessType.EXPORT)
|
|
|
+// @GetMapping("/myExport")
|
|
|
+// public AjaxResult myExport(FsCourseWatchLogListParam param)
|
|
|
+// {
|
|
|
+// // 导出
|
|
|
+// return exportCourseWatchLog(param);
|
|
|
+// }
|
|
|
+// /**
|
|
|
+// * 获取短链课程看课记录详细信息
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:query')")
|
|
|
+// @GetMapping(value = "/{logId}")
|
|
|
+// public AjaxResult getInfo(@PathVariable("logId") Long logId) {
|
|
|
+// return AjaxResult.success(fsCourseWatchLogService.selectFsCourseWatchLogByLogId(logId));
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 新增短链课程看课记录
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:add')")
|
|
|
+// @Log(title = "短链课程看课记录", businessType = BusinessType.INSERT)
|
|
|
+// @PostMapping
|
|
|
+// public AjaxResult add(@RequestBody FsCourseWatchLog fsCourseWatchLog) {
|
|
|
+// return toAjax(fsCourseWatchLogService.insertFsCourseWatchLog(fsCourseWatchLog));
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 修改短链课程看课记录
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:edit')")
|
|
|
+// @Log(title = "短链课程看课记录", businessType = BusinessType.UPDATE)
|
|
|
+// @PutMapping
|
|
|
+// public AjaxResult edit(@RequestBody FsCourseWatchLog fsCourseWatchLog) {
|
|
|
+// return toAjax(fsCourseWatchLogService.updateFsCourseWatchLog(fsCourseWatchLog));
|
|
|
+// }
|
|
|
+//
|
|
|
+// /**
|
|
|
+// * 删除短链课程看课记录
|
|
|
+// */
|
|
|
+// @PreAuthorize("@ss.hasPermi('course:courseWatchLog:remove')")
|
|
|
+// @Log(title = "短链课程看课记录", businessType = BusinessType.DELETE)
|
|
|
+// @DeleteMapping("/{logIds}")
|
|
|
+// public AjaxResult remove(@PathVariable Long[] logIds) {
|
|
|
+// return toAjax(fsCourseWatchLogService.deleteFsCourseWatchLogByLogIds(logIds));
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 昵称模糊查询客服分页
|
|
|
+ */
|
|
|
+ @GetMapping("/getCustomerListLikeName")
|
|
|
+ public R getCustomerListLikeName(@RequestParam(required = false) String name,
|
|
|
+ @RequestParam(required = false, defaultValue = "1") Integer pageNum,
|
|
|
+ @RequestParam(required = false, defaultValue = "10") Integer pageSize) {
|
|
|
+ PageHelper.startPage(pageNum,pageSize);
|
|
|
+ List<OptionVO> appCustomerRoles = appCustomerRoleService.getCustomerListLikeName(name);
|
|
|
+ return R.ok().put("data",new PageInfo<>(appCustomerRoles));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|