123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- package com.bizmatics.controller.web;
- import com.bizmatics.common.core.bean.ApiResult;
- import com.bizmatics.model.vo.DataManagementOneVO;
- import com.bizmatics.model.vo.SingleLoopReportOneVo;
- import com.bizmatics.service.HtAnalogDataService;
- import com.bizmatics.service.vo.CommonIcoVO;
- import com.bizmatics.service.vo.HadCountVO;
- import com.bizmatics.service.vo.RealScoreVO;
- import com.bizmatics.service.vo.TimeShareVO;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.util.Date;
- import java.util.List;
- /**
- * 历史消费组模拟量
- *
- * @author ya
- * @since 2021-07-07
- */
- @RestController
- @RequestMapping("/htAnalogData")
- public class HtAnalogDataController {
- @Autowired
- private HtAnalogDataService htAnalogDataService;
- /**
- * 首页日/月/年用电量
- *
- * @return
- */
- @GetMapping("count")
- public ApiResult<HadCountVO> count() {
- return ApiResult.success(htAnalogDataService.selectCount());
- }
- /**
- * 今日/昨日用电趋势
- *
- * @param siteId 站点id
- * @return
- */
- @GetMapping("eptrendIco")
- public ApiResult<List<CommonIcoVO>> getTrendByDate(@RequestParam(required = false) Integer siteId) {
- return ApiResult.success(htAnalogDataService.selectTrendByDate(siteId));
- }
- /**
- * 当月用电趋势图
- *
- * @return
- */
- @GetMapping("eptrendIcoMonth")
- public ApiResult<List<CommonIcoVO>> getTrendByMonth() {
- return ApiResult.success(htAnalogDataService.selectTrendByMonth());
- }
- /**
- * 站点日/月/年用电量
- *
- * @param siteId 站点id
- * @return
- */
- @GetMapping("dayMonthYearEp")
- public ApiResult<HadCountVO> getCountBySite(@RequestParam Integer siteId) {
- return ApiResult.success(htAnalogDataService.getCountBySite(siteId));
- }
- /**
- * 分时电量
- *
- * @param siteId 站点id
- * @param type 时间
- * @return
- */
- @GetMapping("timeShare")
- public ApiResult<TimeShareVO> getTimeShare(@RequestParam Integer siteId, @RequestParam Integer type) {
- return ApiResult.success(htAnalogDataService.getTimeShare(siteId, type));
- }
- /**
- * 需量趋势图
- *
- * @param siteId 站点id
- * @return
- */
- @GetMapping("demandIco")
- public ApiResult<List<CommonIcoVO>> getDemandIco(@RequestParam Integer siteId) {
- return ApiResult.success(htAnalogDataService.getDemandIco(siteId));
- }
- /**
- * 历史记录电流电压
- *
- * @param siteId 站点id
- * @param date 时间
- * @return
- */
- @GetMapping("electricIco")
- public ApiResult<List<CommonIcoVO>> getElectricIco(@RequestParam Integer siteId, @RequestParam Date date) {
- return ApiResult.success(htAnalogDataService.getElectricIco(siteId, date));
- }
- /**
- * 历史电流电压评分
- *
- * @param deviceCode
- * @param startTime
- * @param endTime
- * @return
- */
- @GetMapping("rtRealScore")
- public ApiResult<List<RealScoreVO>> rtRealScore(@RequestParam String deviceCode,
- @RequestParam Date startTime,
- @RequestParam Date endTime) {
- return ApiResult.success(htAnalogDataService.rtRealScore(deviceCode, startTime, endTime));
- }
- /**
- * 数据管理-同比分析报表-统计图数据查询
- *
- * @param dataManagementOneVO
- * @return
- */
- @PostMapping("yearOnYearList")
- public ApiResult<List<CommonIcoVO>> yearOnYearList(@RequestBody DataManagementOneVO dataManagementOneVO) {
- return ApiResult.success(htAnalogDataService.yearOnYearList(dataManagementOneVO));
- }
- /**
- * 数据管理-环比分析报表-统计图数据查询
- *
- * @param dataManagementOneVO
- * @return
- */
- @PostMapping("ringRatioList")
- public ApiResult<List<CommonIcoVO>> ringRatioList(@RequestBody DataManagementOneVO dataManagementOneVO) {
- return ApiResult.success(htAnalogDataService.ringRatioList(dataManagementOneVO));
- }
- /**
- * 数据管理-用能月报-统计图数据查询
- *
- * @param deviceCode 设备编号
- * @param cycle 1.日报表 2.月报表 3.年报表
- * @param startTime 开始时间
- * @param endTime 结束时间
- * @return
- */
- @GetMapping("monthlyReport")
- public ApiResult<List<CommonIcoVO>> monthlyReport(@RequestParam String deviceCode,
- @RequestParam int cycle,
- @RequestParam String startTime,
- @RequestParam String endTime) {
- return ApiResult.success(htAnalogDataService.monthlyReport(deviceCode, cycle, startTime, endTime));
- }
- /**
- * 数据管理-需量分析-统计图数据查询
- *
- * @param deviceCode 设备编号
- * @param cycle 1.电费结算周期 2.自然月
- * @param monthDate 时间 xxxx-xx
- * @return
- */
- @GetMapping("demandAnalysis")
- public ApiResult<List<CommonIcoVO>> demandAnalysis(@RequestParam String deviceCode,
- @RequestParam int cycle,
- @RequestParam String monthDate) {
- return ApiResult.success(htAnalogDataService.demandAnalysis(deviceCode, monthDate, cycle));
- }
- /**
- * 数据管理-用能月报-导出
- *
- * @param deviceCode 设备编号
- * @param cycle 1.日报表 2.月报表 3.年报表
- * @param startTime 开始时间
- * @param endTime 结束时间
- * @return
- */
- @GetMapping("monthlyReportExport")
- public ApiResult<String> monthlyReportExport(@RequestParam String deviceCode,
- @RequestParam int cycle,
- @RequestParam String startTime,
- @RequestParam String endTime) {
- return ApiResult.success(htAnalogDataService.monthlyReportExport(deviceCode, startTime, endTime, cycle));
- }
- /**
- * 电能质量(单回路报告)
- *
- * @param deviceCode 设备编号
- * @param time 时间 type为1时时间格式 yyyy-MM-dd type为2时时间格式 yyyy-MM
- * @param type 类型 1:日 2:月
- * @return
- */
- @GetMapping("SingleLoopReportData")
- public ApiResult<SingleLoopReportOneVo> SingleLoopReportData(@RequestParam String deviceCode,
- @RequestParam Date time,
- @RequestParam int type) {
- return ApiResult.success(htAnalogDataService.SingleLoopReportData(deviceCode, time, type));
- }
- }
|