ToDoController.java
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.skua.modules.system.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.modules.system.service.ISysUserService;
import com.skua.modules.system.vo.ToDoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import springfox.documentation.annotations.ApiIgnore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* 待办事项
*/
@Slf4j
@Api(tags="待办事项")
@RestController
@ApiIgnore
@RequestMapping("/v1/system/todo")
public class ToDoController {
@Autowired
private ISysUserService sysUserService;
/**
* 待办事项
* @param toDoVO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "待办事项分页列表")
@ApiOperation(value="待办事项分页列表", notes="待办事项分页列表")
@GetMapping(value = "/list")
public Result<IPage<ToDoVO>> queryPageList(ToDoVO toDoVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<ToDoVO>> result = new Result<IPage<ToDoVO>>();
Page<ToDoVO> pageList = new Page<ToDoVO>(pageNo,pageSize);
pageList = sysUserService.queryToDoPageList(pageList,toDoVO);//自定义查询
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "待办事项分页列表")
@ApiOperation(value="待办事项分页列表", notes="待办事项分页列表")
@GetMapping(value = "/deskList")
public Result<Map<String,Object>> queryDeskList(ToDoVO toDoVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String, Object> map = new HashMap<>();
Map<String, Object> countMap = new HashMap<>();
Page<ToDoVO> pageList = new Page<ToDoVO>(pageNo,pageSize);
pageList = sysUserService.queryDeskList(pageList,toDoVO);//自定义查询
countMap = sysUserService.dataCount(toDoVO);
map.put("list",pageList);
map.put("count",countMap);
result.setSuccess(true);
result.setResult(map);
return result;
}
@AutoLog(value = "待办事项详细")
@ApiOperation(value="待办事项详细", notes="待办事项详细")
@GetMapping(value = "/getToDoInfo")
public Result<Map<String,Object>> getToDoInfo(String reportId, String dataId, String toDoType){
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String, Object> map = new HashMap<>();
map = sysUserService.getToDoInfo(reportId, dataId, toDoType);
result.setResult(map);
result.setSuccess(true);
return result;
}
}