|
@@ -0,0 +1,121 @@
|
|
|
+package com.fs.qw;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+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.page.TableDataInfo;
|
|
|
+import com.fs.common.enums.BusinessType;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.core.security.LoginUser;
|
|
|
+import com.fs.core.web.service.TokenService;
|
|
|
+import com.fs.course.mapper.FsCourseWatchLogMapper;
|
|
|
+import com.fs.qw.domain.QwWorkTask;
|
|
|
+import com.fs.qw.param.QwWorkTaskListParam;
|
|
|
+import com.fs.qw.service.IQwWorkTaskService;
|
|
|
+import com.fs.qw.vo.QwWorkTaskListVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 企微任务看板Controller
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2025-03-25
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/qw/QwWorkTask")
|
|
|
+public class QwQwWorkTaskController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private IQwWorkTaskService qwWorkTaskService;
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+ @Autowired
|
|
|
+ private FsCourseWatchLogMapper fsCourseWatchLogMapper;
|
|
|
+ /**
|
|
|
+ * 查询企微任务看板列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(QwWorkTaskListParam qwWorkTask)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ qwWorkTask.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ if(ObjectUtils.isNull(qwWorkTask.getCompanyUserId())) {
|
|
|
+ qwWorkTask.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
+ }
|
|
|
+ List<QwWorkTaskListVO> list = qwWorkTaskService.selectQwWorkTaskListVONew(qwWorkTask);
|
|
|
+ for (QwWorkTaskListVO qwWorkTaskListVO : list) {
|
|
|
+ qwWorkTaskListVO.setLogs(fsCourseWatchLogMapper.selectFsCourseWatchLog7DayByExtId(qwWorkTaskListVO.getExtId()));
|
|
|
+ }
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出企微任务看板列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:export')")
|
|
|
+ @Log(title = "企微任务看板", businessType = BusinessType.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ public AjaxResult export(QwWorkTask qwWorkTask)
|
|
|
+ {
|
|
|
+ List<QwWorkTask> list = qwWorkTaskService.selectQwWorkTaskList(qwWorkTask);
|
|
|
+ ExcelUtil<QwWorkTask> util = new ExcelUtil<QwWorkTask>(QwWorkTask.class);
|
|
|
+ return util.exportExcel(list, "企微任务看板数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取企微任务看板详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return AjaxResult.success(qwWorkTaskService.selectQwWorkTaskById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增企微任务看板
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:add')")
|
|
|
+ @Log(title = "企微任务看板", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody QwWorkTask qwWorkTask)
|
|
|
+ {
|
|
|
+ return toAjax(qwWorkTaskService.insertQwWorkTask(qwWorkTask));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改企微任务看板
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:edit')")
|
|
|
+ @Log(title = "企微任务看板处理", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody QwWorkTask qwWorkTask)
|
|
|
+ {
|
|
|
+ QwWorkTask task = new QwWorkTask();
|
|
|
+ task.setId(qwWorkTask.getId());
|
|
|
+ task.setRemark(qwWorkTask.getRemark());
|
|
|
+ task.setStatus(1);
|
|
|
+ task.setUpdateTime(new Date());
|
|
|
+ return toAjax(qwWorkTaskService.updateQwWorkTask(task));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除企微任务看板
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:QwWorkTask:remove')")
|
|
|
+ @Log(title = "企微任务看板", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
+ {
|
|
|
+ return toAjax(qwWorkTaskService.deleteQwWorkTaskByIds(ids));
|
|
|
+ }
|
|
|
+}
|