update 初始化看板接口
parent
bbc11b8e06
commit
0b26f7752f
@ -0,0 +1,45 @@
|
||||
package com.os.ems.report.controller;
|
||||
|
||||
import com.os.common.core.controller.BaseController;
|
||||
import com.os.common.core.domain.AjaxResult;
|
||||
import com.os.common.core.page.TableDataInfo;
|
||||
import com.os.common.utils.poi.ExcelUtil;
|
||||
import com.os.ems.report.domain.EnergyStatisticalReport;
|
||||
import com.os.ems.report.domain.PeaksValleysConsumptionReport;
|
||||
import com.os.ems.report.domain.RealTimeDataBo;
|
||||
import com.os.ems.report.service.IEmsBoardService;
|
||||
import com.os.ems.report.service.IEmsReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 能源看板Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ems/board")
|
||||
public class EmsBoardController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEmsBoardService emsBoardService;
|
||||
|
||||
/**
|
||||
* 统计能耗报表
|
||||
* @param hashMap
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/energyStatisticalReportList")
|
||||
public AjaxResult energyStatisticalReportList(@RequestParam(required = false) Map hashMap) {
|
||||
List<RealTimeDataBo> list = emsBoardService.energyStatisticalReportList(hashMap);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.os.ems.report.service;
|
||||
|
||||
|
||||
import com.os.ems.report.domain.EnergyStatisticalReport;
|
||||
import com.os.ems.report.domain.PeaksValleysConsumptionReport;
|
||||
import com.os.ems.report.domain.RealTimeDataBo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 能源报表Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-22
|
||||
*/
|
||||
public interface IEmsBoardService {
|
||||
|
||||
/**
|
||||
* 统计能耗报表
|
||||
* @param hashMap
|
||||
* @return
|
||||
*/
|
||||
List<RealTimeDataBo> energyStatisticalReportList(Map hashMap);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.os.ems.report.service.impl;
|
||||
|
||||
import com.os.ems.base.domain.EmsBaseWorkUnit;
|
||||
import com.os.ems.base.mapper.EmsBaseMonitorWorkUnitMapper;
|
||||
import com.os.ems.base.mapper.EmsBaseWorkUnitMapper;
|
||||
import com.os.ems.report.domain.EnergyStatisticalReport;
|
||||
import com.os.ems.report.domain.PeaksValleysConsumptionReport;
|
||||
import com.os.ems.report.domain.RealTimeDataBo;
|
||||
import com.os.ems.report.mapper.EmsReportMapper;
|
||||
import com.os.ems.report.service.IEmsBoardService;
|
||||
import com.os.ems.report.service.IEmsReportService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.os.common.utils.DateUtils.getTimeIntervals;
|
||||
|
||||
|
||||
/**
|
||||
* 能源报表Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-05-22
|
||||
*/
|
||||
@Service
|
||||
public class EmsBoardServiceImpl implements IEmsBoardService {
|
||||
@Autowired
|
||||
private EmsReportMapper emsReportMapper;
|
||||
|
||||
@Autowired
|
||||
private EmsBaseMonitorWorkUnitMapper emsBaseMonitorWorkUnitMapper;
|
||||
|
||||
@Autowired
|
||||
private EmsBaseWorkUnitMapper emsBaseWorkUnitMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 统计能耗报表
|
||||
*
|
||||
* @param hashMap
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RealTimeDataBo> energyStatisticalReportList(Map hashMap) {
|
||||
if (!hashMap.containsKey("dateType") && !hashMap.containsKey("energyType")) {
|
||||
return null;
|
||||
}
|
||||
hashMap.put("timeSub", Integer.parseInt(String.valueOf(hashMap.get("dateType"))));
|
||||
List<EnergyStatisticalReport> reportList = new ArrayList<>();
|
||||
|
||||
if (Objects.equals(String.valueOf(hashMap.get("energyType")), "2")) {
|
||||
reportList = emsReportMapper.energyStatisticalDnbReportList(hashMap);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue