|
@@ -2,6 +2,7 @@ package com.wtkj.controller;
|
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.wtkj.entity.Task;
|
|
|
+import com.wtkj.entity.WorkStatus;
|
|
|
import com.wtkj.service.IIndexService;
|
|
|
import com.wtkj.service.IWorkStatusService;
|
|
|
import com.wtkj.wrapper.IndexTaskScheduleWrapper;
|
|
@@ -12,10 +13,7 @@ import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
-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 org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -41,17 +39,26 @@ public class IndexController {
|
|
|
@GetMapping("/work-status")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "我的状态", notes = "")
|
|
|
- public R wordStatus() {
|
|
|
+ public R workStatus() {
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
return R.data(workStatus.workStatus(userId));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改工作状态
|
|
|
+ */
|
|
|
+ @PostMapping("/submit-work-status")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "新增或者修改工作状态", notes = "")
|
|
|
+ public R submit(@RequestBody WorkStatus status) {
|
|
|
+ return R.status(workStatus.saveOrUpdate(status));
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 首页统计
|
|
|
*/
|
|
|
@GetMapping("/project-and-task")
|
|
|
- @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "项目和任务统计", notes = "")
|
|
|
public R projectAndTask(@RequestParam Long topDept) {
|
|
|
return R.data(indexService.projectAndTaskSummary(topDept));
|
|
@@ -61,7 +68,7 @@ public class IndexController {
|
|
|
* 待办事项
|
|
|
*/
|
|
|
@GetMapping("/todo-list")
|
|
|
- @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
@ApiOperation(value = "待办事项", notes = "传入isRead查看状态 0:全部 1:已读 2: 未读 默认未读,分页参数")
|
|
|
public R todoList(@RequestParam(defaultValue = "2") Integer isRead, Query query) {
|
|
|
return R.data(indexService.todoList(isRead, Condition.getPage(query)));
|
|
@@ -71,7 +78,7 @@ public class IndexController {
|
|
|
* 学习资料
|
|
|
*/
|
|
|
@GetMapping("/study-list")
|
|
|
- @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "学习资料", notes = "")
|
|
|
public R noticeList(Query query) {
|
|
|
return R.data(indexService.studyList(Condition.getPage(query)));
|
|
@@ -81,7 +88,7 @@ public class IndexController {
|
|
|
* 阅读消息
|
|
|
*/
|
|
|
@GetMapping("/message-detail")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "阅读消息", notes = "传入id")
|
|
|
public R messageDetail(@RequestParam Long id) {
|
|
|
return R.data(indexService.messageDetail(id));
|
|
@@ -91,7 +98,7 @@ public class IndexController {
|
|
|
* 工作日程
|
|
|
*/
|
|
|
@GetMapping("/user-schedule")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
@ApiOperation(value = "用户工作日程", notes = "传入登录用户的顶级机构id,日期字符串")
|
|
|
public R schedule(@RequestParam Long topDept, String date) {
|
|
|
return R.data(indexService.schedule(topDept, date));
|
|
@@ -101,7 +108,7 @@ public class IndexController {
|
|
|
* 工作日程展开
|
|
|
*/
|
|
|
@GetMapping("/user-schedule-expand")
|
|
|
- @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
@ApiOperation(value = "用户工作日程展开", notes = "传入用户id,日期字符串")
|
|
|
public R scheduleExpand(@RequestParam Long userId, String date) {
|
|
|
List<Task> taskList = indexService.scheduleExpand(userId, date);
|
|
@@ -113,7 +120,7 @@ public class IndexController {
|
|
|
* 任务分布
|
|
|
*/
|
|
|
@GetMapping("/task-statistics")
|
|
|
- @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "任务分布统计", notes = "传入日期")
|
|
|
public R taskTaskStatistics(@RequestParam Long topDept, @RequestParam String date) {
|
|
|
String userRole = AuthUtil.getUserRole();
|