ustcyc
2025-01-07 5fd51c437819f1c9d027a936db4ba2ee7cd2e053
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
99
100
101
102
103
104
105
106
package com.zhitan.web.controller.homepage;
 
import com.zhitan.common.core.controller.BaseController;
import com.zhitan.common.core.domain.AjaxResult;
import com.zhitan.consumptionanalysis.domain.vo.RankingEnergyData;
import com.zhitan.home.domain.vo.HomeEnergyConsumptionTrendVO;
import com.zhitan.home.domain.vo.HomePeakValleyVO;
import com.zhitan.home.service.impl.IHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * HomePageController
 *
 * @author hmj
 * @date 2024-10-08
 */
@RestController
@RequestMapping("/homepage")
public class HomePageController extends BaseController {
 
    @Autowired
    public IHomePageService homepageService;
   /**
    * @description: 全厂能耗统计
    * @param timeType
    * @return
    * @author: hmj
    * @date: 2024/10/8 13:41
    */
   @GetMapping("/energyConsumptionSummation")
   public AjaxResult energyConsumptionSummation(String timeType) {
       try {
//           String modelcode = "Composite_Indicators";
           String modelcode = "COMPREHENSIVE_CODE";
           return AjaxResult.success(homepageService.energyConsumptionSummation(timeType,modelcode));
       } catch (Exception ex) {
           logger.error("获取出错!", ex);
           return AjaxResult.error("获取出错!");
       }
   }
 
 
    /**
     * @description: 能耗趋势
     * @param timeType
     * @return
     * @author: hmj
     * @date: 2024/10/8 13:41
     */
    @GetMapping("/energyConsumptionTrend")
    public AjaxResult energyConsumptionTrend(String timeType) {
        try {
            String modelcode = "COMPREHENSIVE_CODE";
            HomeEnergyConsumptionTrendVO vo = homepageService.energyConsumptionTrend(timeType,modelcode);
 
            return AjaxResult.success(vo);
        } catch (Exception ex) {
            logger.error("获取出错!", ex);
            return AjaxResult.error("获取出错!");
        }
    }
 
    /**
     * @description: 科室能耗排名
     * @param timeType
     * @return
     * @author: hmj
     * @date: 2024/10/8 13:41
     */
    @GetMapping("/energyConsumptionRanking")
    public AjaxResult energyConsumptionRanking(String timeType) {
        try {
            String modelcode = "COMPREHENSIVE_CODE";
            List<RankingEnergyData> consumptionAnalysisVO = homepageService.energyConsumptionRanking(modelcode,timeType);
            return AjaxResult.success(consumptionAnalysisVO);
        } catch (Exception ex) {
            logger.error("获取出错!", ex);
            return AjaxResult.error("获取出错!");
        }
    }
 
    /**
     * @description: 峰平谷占比
     * @param timeType
     * @return
     * @author: hmj
     * @date: 2024/10/8 13:41
     */
    @GetMapping("/peakValley")
    public AjaxResult peakValley(String timeType) {
        try {
//            String modelcode = "Composite_Indicators";
            String modelcode = "COMPREHENSIVE_CODE";
            List<HomePeakValleyVO> vo = homepageService.peakValley(timeType,modelcode);
            return AjaxResult.success(vo);
        } catch (Exception ex) {
            logger.error("获取出错!", ex);
            return AjaxResult.error("获取出错!");
        }
    }
}