ReportController.java
3.86 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
90
91
92
93
94
95
96
97
98
package com.ruoyi.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.global.Result;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.pojo.request.ReportViewRequestVo;
import com.ruoyi.pojo.request.ReportErrorRequestVo;
import com.ruoyi.pojo.response.ExportReportViewResponseVo;
import com.ruoyi.pojo.response.ReportErrorResponseVo;
import com.ruoyi.pojo.vo.PersonSignDataResponseVo;
import com.ruoyi.service.ReportService;
import com.ruoyi.system.domain.SysNotice;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author 20412
*/
@RestController
@RequestMapping("/report")
@Api(tags = "报表管理")
public class ReportController {
@Resource
private ReportService reportService;
@ApiOperation("签到报表集合查询")
@GetMapping("/list")
public AjaxResult getList(HttpServletResponse response, @ApiParam @ModelAttribute ReportViewRequestVo requestVo) {
return AjaxResult.success(reportService.getReportScrollViewTable(requestVo, response));
}
@ApiOperation("签到报表集合查询")
@GetMapping("/bigView")
public AjaxResult getBigView(HttpServletResponse response, @ApiParam @ModelAttribute ReportViewRequestVo requestVo) {
return AjaxResult.success(reportService.getBigView(requestVo, response));
}
@ApiOperation("获取详情")
@GetMapping("/detail")
public AjaxResult getDetail(HttpServletResponse response, @ApiParam @ModelAttribute @Validated ReportViewRequestVo requestVo) {
return AjaxResult.success(reportService.getReportDetail(requestVo, response));
}
@ApiOperation("异常报表集合查询")
@GetMapping("/error/list")
public AjaxResult getErrorList(@ApiParam @ModelAttribute ReportErrorRequestVo request) {
return AjaxResult.success(reportService.getErrorReportList(request));
}
@ApiOperation("签到报表导出")
@PostMapping("/export")
public void exportReport(@ApiParam ReportViewRequestVo requestVo, HttpServletResponse response) {
reportService.exportReportList(requestVo, response);
}
@ApiOperation("告警通知")
@GetMapping("/alarm/notice")
public Result<?> getAlarmNotice(@RequestParam(value = "type", required = false) Integer type) {
return Result.OK(reportService.getAlarmNoticeByType(type));
}
@ApiOperation("确认通知")
@PostMapping("/sureNotice")
public Result<?> sureNotice(@Validated @RequestBody SysNotice notice) {
return Result.OK(reportService.sureNotice(notice));
}
@ApiOperation("异常报表导出")
@PostMapping("/error/export")
public void exportErrorReport(@ApiParam ReportErrorRequestVo requestVo, HttpServletResponse response) {
List<ReportErrorResponseVo> list = reportService.getErrorReportList(requestVo);
ExcelUtil<ReportErrorResponseVo> util = new ExcelUtil<ReportErrorResponseVo>(ReportErrorResponseVo.class);
util.exportEasyExcel(response, list, "异常报表");
}
@ApiOperation("提供给人事用接口(获取当月所有签到记录)")
@GetMapping("/list/{month}")
public Result<PersonSignDataResponseVo> listReportMonth(@PathVariable("month") String month, HttpServletRequest request) {
return reportService.listReportMonth(month, request);
}
@ApiOperation("提供给人事用接口(获取当天所有签到记录)")
@GetMapping("/list/day/{date}")
public Result<PersonSignDataResponseVo> listReportDay(@PathVariable("date") String date, HttpServletRequest request) {
return reportService.listReportDay(date, request);
}
}