ustcyc
2025-01-07 de5d55508afd27fb2b47e6d4d6fd9984525c222c
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
package com.zhitan.web.controller.peakvalley;
 
 
import com.zhitan.common.core.controller.BaseController;
import com.zhitan.common.core.domain.AjaxResult;
import com.zhitan.common.utils.poi.ExcelUtil;
import com.zhitan.peakvalley.domain.dto.PeakValleyDTO;
import com.zhitan.peakvalley.domain.vo.peakvalley.PeakValleyHourDataVO;
import com.zhitan.peakvalley.service.IPeakValleyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
 
/**
 * 尖峰平谷数据Controller
 *
 * @author ruoyi
 * @date 2024-06-19
 */
@RestController
@RequestMapping("/peakValley")
@Api(tags = "尖峰平谷数据")
public class PeakValleyController extends BaseController {
 
    @Resource
    private IPeakValleyService rulesService;
 
 
    /**
     * 获取尖峰平谷数据统计 - 按小时统计
     */
    @GetMapping("/segmentAnalysis/hour")
    @ApiOperation(value = "获取尖峰平谷分时统计")
    public AjaxResult segmentAnalysisHour(PeakValleyDTO dto) {
        return AjaxResult.success(rulesService.segmentAnalysisHour(dto));
    }
 
    /**
     * 获取尖峰平谷数据统计 - 按小时统计
     */
    @PostMapping("/segmentAnalysis/hour/export")
    @ApiOperation(value = "获取尖峰平谷分时统计")
    public void segmentAnalysisHourExport(HttpServletResponse response, PeakValleyDTO dto) {
        List<PeakValleyHourDataVO> list = rulesService.segmentAnalysisHourExport(dto);
        ExcelUtil<PeakValleyHourDataVO> util = new ExcelUtil<PeakValleyHourDataVO>(PeakValleyHourDataVO.class);
        util.exportExcel(response, list, "尖峰平谷分时统计数据");
    }
 
    /**
     * 获取尖峰平谷数据统计 - 按天统计
     */
    @GetMapping("/segmentAnalysis/day")
    @ApiOperation(value = "获取尖峰平谷分时统计")
    public AjaxResult segmentAnalysisDay(PeakValleyDTO dto) {
        return AjaxResult.success(rulesService.segmentAnalysisDay(dto));
    }
 
 
}