|
|
@@ -1,15 +1,20 @@
|
|
|
package com.fs.course.controller;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.domain.model.LoginUser;
|
|
|
+import com.fs.common.utils.SecurityUtils;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.course.domain.DuplicateFans;
|
|
|
+import com.fs.course.domain.FsUserCourse;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
+import com.fs.his.domain.FsExportTask;
|
|
|
import com.fs.his.domain.FsStoreProductCategory;
|
|
|
+import com.fs.his.service.IFsExportTaskService;
|
|
|
import com.fs.his.vo.FsStoreProductCategoryVO;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
@@ -88,25 +93,33 @@ public class FsUserCourseCategoryController extends BaseController
|
|
|
return util.exportExcel(list, "课堂分类数据");
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IFsExportTaskService exportTaskService;
|
|
|
+
|
|
|
/**
|
|
|
* 导出重粉
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('course:userCourseCategory:fansExport')")
|
|
|
- @Log(title = "课堂分类重粉", businessType = BusinessType.EXPORT)
|
|
|
+ @Log(title = "课程管理导出重粉", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/exportFans")
|
|
|
- public AjaxResult exportFans(@RequestBody Map<String, List<Integer>> map) {
|
|
|
-
|
|
|
- List<Integer> ids = map.get("ids");
|
|
|
-
|
|
|
- List<DuplicateFans> list = fsUserCourseCategoryService.exportFans(ids);
|
|
|
-
|
|
|
- if (CollectionUtils.isEmpty(list)) {
|
|
|
- return AjaxResult.error("没有可导出的数据");
|
|
|
+ public AjaxResult exportFans(@RequestBody FsUserCourse param) {
|
|
|
+ Integer exportType1 = exportTaskService.isExportType1(SecurityUtils.getUserId());
|
|
|
+ if (exportType1 > 0) {
|
|
|
+ return AjaxResult.error("你已经有正在导出的任务");
|
|
|
}
|
|
|
|
|
|
- ExcelUtil<DuplicateFans> util = new ExcelUtil<>(DuplicateFans.class);
|
|
|
-
|
|
|
- return util.exportExcel(list, "课堂分类重粉数据");
|
|
|
+ FsExportTask task = new FsExportTask();
|
|
|
+ task.setTaskType(12);
|
|
|
+ task.setStatus(0);
|
|
|
+ task.setStartTime(new Date());
|
|
|
+ task.setRemark("课程管理导出重粉");
|
|
|
+ task.setSysType(1);
|
|
|
+ task.setUserId(SecurityUtils.getUserId());
|
|
|
+ exportTaskService.insertFsExportTask(task);
|
|
|
+ param.setTaskId(task.getTaskId());
|
|
|
+
|
|
|
+ fsUserCourseCategoryService.exportFans(param);
|
|
|
+ return new AjaxResult(200, "后台正在导出,请等待...任务ID:" + task.getTaskId(), task.getTaskId());
|
|
|
}
|
|
|
|
|
|
|