From 20ff254a9dc73ed27d725f81514e49adf0cb778d Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 26 Jun 2024 18:17:16 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E5=B3=B0=E5=B9=B3=E8=B0=B7?= =?UTF-8?q?=E8=80=97=E9=87=8F=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EmsReportController.java | 25 +++- .../domain/PeaksValleysConsumptionReport.java | 113 ++++++++++++++++++ .../os/ems/report/mapper/EmsReportMapper.java | 8 ++ .../ems/report/service/IEmsReportService.java | 8 ++ .../service/impl/EmsReportServiceImpl.java | 11 ++ .../mapper/ems/report/EmsReportMapper.xml | 34 ++++++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 os-ems/src/main/java/com/os/ems/report/domain/PeaksValleysConsumptionReport.java diff --git a/os-ems/src/main/java/com/os/ems/report/controller/EmsReportController.java b/os-ems/src/main/java/com/os/ems/report/controller/EmsReportController.java index dc35ec8..9ae33b2 100644 --- a/os-ems/src/main/java/com/os/ems/report/controller/EmsReportController.java +++ b/os-ems/src/main/java/com/os/ems/report/controller/EmsReportController.java @@ -7,6 +7,7 @@ import com.os.common.core.page.TableDataInfo; import com.os.common.enums.BusinessType; 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.service.IEmsReportPointDnbService; import com.os.ems.report.service.IEmsReportService; import org.springframework.beans.factory.annotation.Autowired; @@ -46,10 +47,32 @@ public class EmsReportController extends BaseController { * 导出统计能耗报表 */ @PostMapping("/energyStatisticalReportList/export" ) - public void export(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + public void energyStatisticalReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { List list = emsReportService.energyStatisticalReportList(hashMap); ExcelUtil util = new ExcelUtil<>(EnergyStatisticalReport. class); util.exportExcel(response, list, "统计能耗报表" ); } + /** + * 峰平谷耗量报表 + * @param hashMap + * @return + */ + @GetMapping("/peaksValleysConsumptionReportList") + public TableDataInfo peaksValleysConsumptionReportList(@RequestParam(required = false) Map hashMap) { + startPage(); + List list = emsReportService.peaksValleysConsumptionReportList(hashMap); + return getDataTable(list); + } + + /** + * 导出峰平谷耗量报表 + */ + @PostMapping("/peaksValleysConsumptionReportList/export" ) + public void peaksValleysConsumptionReportListExport(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + List list = emsReportService.peaksValleysConsumptionReportList(hashMap); + ExcelUtil util = new ExcelUtil<>(PeaksValleysConsumptionReport. class); + util.exportExcel(response, list, "峰平谷耗量报表" ); + } + } diff --git a/os-ems/src/main/java/com/os/ems/report/domain/PeaksValleysConsumptionReport.java b/os-ems/src/main/java/com/os/ems/report/domain/PeaksValleysConsumptionReport.java new file mode 100644 index 0000000..88d7468 --- /dev/null +++ b/os-ems/src/main/java/com/os/ems/report/domain/PeaksValleysConsumptionReport.java @@ -0,0 +1,113 @@ +package com.os.ems.report.domain; + + +import com.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + + +/** + * 峰平谷耗量报表 + * + * @author Yinq + * @date 2023-10-12 + */ +public class PeaksValleysConsumptionReport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 统计单元编号 + */ + @Excel(name = "统计单元编号") + private String workUnitCode; + + /** + * 统计单元名称 + */ + @Excel(name = "统计单元名称") + private String workUnitName; + + /** + * 统计日期 + */ + @Excel(name = "统计日期") + private String pointTime; + + /** + * 分时类型 + */ + @Excel(name = "分时类型") + private String priceType; + + /** + * 耗量(kwh) + */ + @Excel(name = "耗量(kwh)") + private BigDecimal expend; + + /** + * 价格 + */ + @Excel(name = "价格") + private BigDecimal price; + + public String getWorkUnitCode() { + return workUnitCode; + } + + public void setWorkUnitCode(String workUnitCode) { + this.workUnitCode = workUnitCode; + } + + public String getWorkUnitName() { + return workUnitName; + } + + public void setWorkUnitName(String workUnitName) { + this.workUnitName = workUnitName; + } + + public String getPointTime() { + return pointTime; + } + + public void setPointTime(String pointTime) { + this.pointTime = pointTime; + } + + public String getPriceType() { + return priceType; + } + + public void setPriceType(String priceType) { + this.priceType = priceType; + } + + public BigDecimal getExpend() { + return expend; + } + + public void setExpend(BigDecimal expend) { + this.expend = expend; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + @Override + public String toString() { + return "PeaksValleysConsumptionReport{" + + "workUnitCode='" + workUnitCode + '\'' + + ", workUnitName='" + workUnitName + '\'' + + ", pointTime='" + pointTime + '\'' + + ", priceType='" + priceType + '\'' + + ", expend=" + expend + + '}'; + } +} diff --git a/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportMapper.java b/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportMapper.java index 76f659a..448ee2c 100644 --- a/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportMapper.java +++ b/os-ems/src/main/java/com/os/ems/report/mapper/EmsReportMapper.java @@ -2,6 +2,7 @@ package com.os.ems.report.mapper; import com.os.ems.report.domain.EnergyStatisticalReport; +import com.os.ems.report.domain.PeaksValleysConsumptionReport; import java.util.List; import java.util.Map; @@ -21,4 +22,11 @@ public interface EmsReportMapper * @return */ List energyStatisticalReportList(Map hashMap); + + /** + * 峰平谷耗量报表 + * @param hashMap + * @return + */ + List peaksValleysConsumptionReportList(Map hashMap); } diff --git a/os-ems/src/main/java/com/os/ems/report/service/IEmsReportService.java b/os-ems/src/main/java/com/os/ems/report/service/IEmsReportService.java index 47c686a..95bb856 100644 --- a/os-ems/src/main/java/com/os/ems/report/service/IEmsReportService.java +++ b/os-ems/src/main/java/com/os/ems/report/service/IEmsReportService.java @@ -2,6 +2,7 @@ package com.os.ems.report.service; import com.os.ems.report.domain.EnergyStatisticalReport; +import com.os.ems.report.domain.PeaksValleysConsumptionReport; import java.util.List; import java.util.Map; @@ -20,4 +21,11 @@ public interface IEmsReportService { * @return */ List energyStatisticalReportList(Map hashMap); + + /** + * 峰平谷耗量报表 + * @param hashMap + * @return + */ + List peaksValleysConsumptionReportList(Map hashMap); } diff --git a/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportServiceImpl.java b/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportServiceImpl.java index a9a3a59..7f33b1f 100644 --- a/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportServiceImpl.java +++ b/os-ems/src/main/java/com/os/ems/report/service/impl/EmsReportServiceImpl.java @@ -1,6 +1,7 @@ package com.os.ems.report.service.impl; import com.os.ems.report.domain.EnergyStatisticalReport; +import com.os.ems.report.domain.PeaksValleysConsumptionReport; import com.os.ems.report.mapper.EmsReportMapper; import com.os.ems.report.service.IEmsReportService; import org.springframework.beans.factory.annotation.Autowired; @@ -35,4 +36,14 @@ public class EmsReportServiceImpl implements IEmsReportService { hashMap.put("timeSub", Integer.parseInt(String.valueOf(hashMap.get("dateType")))); return emsReportMapper.energyStatisticalReportList(hashMap); } + + /** + * 峰平谷耗量报表 + * @param hashMap + * @return + */ + @Override + public List peaksValleysConsumptionReportList(Map hashMap) { + return emsReportMapper.peaksValleysConsumptionReportList(hashMap); + } } diff --git a/os-ems/src/main/resources/mapper/ems/report/EmsReportMapper.xml b/os-ems/src/main/resources/mapper/ems/report/EmsReportMapper.xml index 9248b3d..2bba69b 100644 --- a/os-ems/src/main/resources/mapper/ems/report/EmsReportMapper.xml +++ b/os-ems/src/main/resources/mapper/ems/report/EmsReportMapper.xml @@ -26,4 +26,38 @@ GROUP BY WU.WORK_UNIT_CODE, WU.WORK_UNIT_NAME, SUBSTRING(FORMAT(RPD.BEGIN_TIME, 'yyyy-MM-dd HH:mm:ss'), 1, DT.TIMESUB) ORDER BY beginTime, workUnitCode + + \ No newline at end of file