diff --git a/aucma-report/src/main/java/com/aucma/report/controller/ReportDayDnbController.java b/aucma-report/src/main/java/com/aucma/report/controller/ReportDayDnbController.java index a48d713..ea3bb0f 100644 --- a/aucma-report/src/main/java/com/aucma/report/controller/ReportDayDnbController.java +++ b/aucma-report/src/main/java/com/aucma/report/controller/ReportDayDnbController.java @@ -1,19 +1,15 @@ package com.aucma.report.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.aucma.common.utils.DateUtils; +import com.aucma.report.domain.EnergyStatisticalReport; +import com.aucma.report.domain.ProductTraceabilityReport; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.aucma.common.annotation.Log; import com.aucma.common.core.controller.BaseController; import com.aucma.common.core.domain.AjaxResult; @@ -100,4 +96,26 @@ public class ReportDayDnbController extends BaseController { public AjaxResult remove(@PathVariable Long[] objIds) { return toAjax(reportDayDnbService.deleteReportDayDnbByObjIds(objIds)); } + + /** + * 统计能耗报表 + * @param hashMap + * @return + */ + @GetMapping("/energyStatisticalReportList") + public TableDataInfo energyStatisticalReportList(@RequestParam(required = false) Map hashMap) { + startPage(); + List list = reportDayDnbService.energyStatisticalReportList(hashMap); + return getDataTable(list); + } + + /** + * 导出统计能耗报表 + */ + @PostMapping("/energyStatisticalReportList/export" ) + public void export(HttpServletResponse response, @RequestParam(required = false) Map hashMap) { + List list = reportDayDnbService.energyStatisticalReportList(hashMap); + ExcelUtil util = new ExcelUtil<>(EnergyStatisticalReport. class); + util.exportExcel(response, list, "统计能耗报表" ); + } } diff --git a/aucma-report/src/main/java/com/aucma/report/domain/EnergyStatisticalReport.java b/aucma-report/src/main/java/com/aucma/report/domain/EnergyStatisticalReport.java new file mode 100644 index 0000000..79b6f19 --- /dev/null +++ b/aucma-report/src/main/java/com/aucma/report/domain/EnergyStatisticalReport.java @@ -0,0 +1,113 @@ +package com.aucma.report.domain; + +import com.aucma.common.annotation.Excel; +import com.aucma.common.core.domain.BaseEntity; + +import java.math.BigDecimal; + + +/** + * 统计能耗报表 + * + * @author Yinq + * @date 2023-10-12 + */ +public class EnergyStatisticalReport extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 统计单元编号 + */ + @Excel(name = "统计单元编号") + private String workUnitCode; + + /** + * 统计单元名称 + */ + @Excel(name = "统计单元名称") + private String workUnitName; + + /** + * 耗量(kwh) + */ + @Excel(name = "耗量(kwh)") + private BigDecimal expend; + + /** + * 开始日期 + */ + @Excel(name = "开始日期") + private String beginTime; + + /** + * 结束日期 + */ + @Excel(name = "结束日期") + private String endTime; + + /** + * 仪表值(kwh) + */ + @Excel(name = "仪表值(kwh)") + private BigDecimal instrumentValue; + + 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 BigDecimal getInstrumentValue() { + return instrumentValue; + } + + public void setInstrumentValue(BigDecimal instrumentValue) { + this.instrumentValue = instrumentValue; + } + + public BigDecimal getExpend() { + return expend; + } + + public void setExpend(BigDecimal expend) { + this.expend = expend; + } + + public String getBeginTime() { + return beginTime; + } + + public void setBeginTime(String beginTime) { + this.beginTime = beginTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + @Override + public String toString() { + return "EnergyStatisticalReport{" + + "workUnitCode='" + workUnitCode + '\'' + + ", workUnitName='" + workUnitName + '\'' + + ", instrumentValue=" + instrumentValue + + ", expend=" + expend + + ", beginTime='" + beginTime + '\'' + + ", endTime='" + endTime + '\'' + + '}'; + } +} diff --git a/aucma-report/src/main/java/com/aucma/report/mapper/ReportDayDnbMapper.java b/aucma-report/src/main/java/com/aucma/report/mapper/ReportDayDnbMapper.java index 1f78c1e..bb08b6f 100644 --- a/aucma-report/src/main/java/com/aucma/report/mapper/ReportDayDnbMapper.java +++ b/aucma-report/src/main/java/com/aucma/report/mapper/ReportDayDnbMapper.java @@ -1,6 +1,9 @@ package com.aucma.report.mapper; import java.util.List; +import java.util.Map; + +import com.aucma.report.domain.EnergyStatisticalReport; import com.aucma.report.domain.ReportDayDnb; /** @@ -58,4 +61,11 @@ public interface ReportDayDnbMapper * @return 结果 */ public int deleteReportDayDnbByObjIds(Long[] objIds); + + /** + * 统计能耗报表 + * @param hashMap + * @return + */ + List energyStatisticalReportList(Map hashMap); } diff --git a/aucma-report/src/main/java/com/aucma/report/service/IReportDayDnbService.java b/aucma-report/src/main/java/com/aucma/report/service/IReportDayDnbService.java index 5c1273d..f710fcb 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/IReportDayDnbService.java +++ b/aucma-report/src/main/java/com/aucma/report/service/IReportDayDnbService.java @@ -1,6 +1,10 @@ package com.aucma.report.service; import java.util.List; +import java.util.Map; + +import com.aucma.report.domain.EnergyStatisticalReport; +import com.aucma.report.domain.ProductTraceabilityReport; import com.aucma.report.domain.ReportDayDnb; /** @@ -58,4 +62,11 @@ public interface IReportDayDnbService * @return 结果 */ public int deleteReportDayDnbByObjId(Long objId); + + /** + * 统计能耗报表 + * @param hashMap + * @return + */ + List energyStatisticalReportList(Map hashMap); } diff --git a/aucma-report/src/main/java/com/aucma/report/service/impl/ReportDayDnbServiceImpl.java b/aucma-report/src/main/java/com/aucma/report/service/impl/ReportDayDnbServiceImpl.java index aafa3d3..9345c16 100644 --- a/aucma-report/src/main/java/com/aucma/report/service/impl/ReportDayDnbServiceImpl.java +++ b/aucma-report/src/main/java/com/aucma/report/service/impl/ReportDayDnbServiceImpl.java @@ -1,6 +1,9 @@ package com.aucma.report.service.impl; import java.util.List; +import java.util.Map; + +import com.aucma.report.domain.EnergyStatisticalReport; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.aucma.report.mapper.ReportDayDnbMapper; @@ -90,4 +93,18 @@ public class ReportDayDnbServiceImpl implements IReportDayDnbService { return reportDayDnbMapper.deleteReportDayDnbByObjId(objId); } + + /** + * 统计能耗报表 + * @param hashMap + * @return + */ + @Override + public List energyStatisticalReportList(Map hashMap) { + if (!hashMap.containsKey("dateType")){ + return null; + } + hashMap.put("timeSub", Integer.parseInt(String.valueOf(hashMap.get("dateType")))); + return reportDayDnbMapper.energyStatisticalReportList(hashMap); + } } diff --git a/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml b/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml index 4a80c0c..b9c076e 100644 --- a/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml +++ b/aucma-report/src/main/resources/mapper/report/ReportDayDnbMapper.xml @@ -122,4 +122,26 @@ #{objId} + + \ No newline at end of file