22 changed files with 585 additions and 178 deletions
@ -0,0 +1,58 @@ |
|||||||
|
package com.mh.web.controller.energy; |
||||||
|
|
||||||
|
import com.mh.common.core.controller.BaseController; |
||||||
|
import com.mh.common.core.page.PageDomain; |
||||||
|
import com.mh.common.core.page.TableDataInfo; |
||||||
|
import com.mh.common.core.page.TableSupport; |
||||||
|
import com.mh.system.service.energy.IEnergyQueryService; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project EEMCS |
||||||
|
* @description 中央热水收益分析 |
||||||
|
* @date 2026-05-13 08:37:12 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/hot_water_revenue") |
||||||
|
public class HowWaterRevenueEnergyController extends BaseController { |
||||||
|
|
||||||
|
private final IEnergyQueryService energyQueryService; |
||||||
|
|
||||||
|
public HowWaterRevenueEnergyController(IEnergyQueryService iEnergyQueryService) { |
||||||
|
this.energyQueryService = iEnergyQueryService; |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping(value = "/energySum") |
||||||
|
public TableDataInfo queryEnergySum(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||||
|
@RequestParam(value = "startDate", required = false) String startDate, |
||||||
|
@RequestParam(value = "endDate", required = false) String endDate, |
||||||
|
@RequestParam(value = "type", required = true) Integer type) { |
||||||
|
startPage(); |
||||||
|
List<?> result = energyQueryService.queryRevenueEnergyDataSumList(buildingId, startDate, endDate, type); |
||||||
|
return getDataTable(result); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/query") |
||||||
|
public TableDataInfo queryEnergy(@RequestParam(value = "buildingId", required = false) String buildingId, |
||||||
|
@RequestParam(value = "startDate", required = false) String startDate, |
||||||
|
@RequestParam(value = "endDate", required = false) String endDate, |
||||||
|
@RequestParam(value = "type") int type) { |
||||||
|
startPage(); |
||||||
|
List<?> result = energyQueryService.queryRevenueEnergyDataList(buildingId, startDate, endDate, type); |
||||||
|
TableDataInfo dataTable = getDataTable(result); |
||||||
|
// 或者总条数数据
|
||||||
|
PageDomain pageDomain = TableSupport.buildPageRequest(); |
||||||
|
pageDomain.setPageNum(0); |
||||||
|
List<?> result1 = energyQueryService.queryRevenueEnergyDataList(buildingId, startDate, endDate, type); |
||||||
|
dataTable.setTotal(result1.size()); |
||||||
|
return dataTable; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,77 @@ |
|||||||
|
package com.mh.common.core.domain.dto; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.StringJoiner; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project EEMCS |
||||||
|
* @description 热水收益总的收益情况 |
||||||
|
* @date 2026-05-13 09:33:27 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class HotWaterRevenueSumDTO { |
||||||
|
|
||||||
|
/** |
||||||
|
* 时间 |
||||||
|
*/ |
||||||
|
private String curDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 建筑id |
||||||
|
*/ |
||||||
|
private String buildingId; |
||||||
|
|
||||||
|
// 电表用量
|
||||||
|
private BigDecimal totalUseEleAmount; |
||||||
|
|
||||||
|
// 电量单价
|
||||||
|
private BigDecimal electPrice; |
||||||
|
|
||||||
|
// 用电金额
|
||||||
|
private BigDecimal totalUseEle; |
||||||
|
|
||||||
|
// 水表用量
|
||||||
|
private BigDecimal totalUseWaterAmount; |
||||||
|
|
||||||
|
// 水价
|
||||||
|
private BigDecimal waterPrice; |
||||||
|
|
||||||
|
// 用水金额
|
||||||
|
private BigDecimal totalUseWater; |
||||||
|
|
||||||
|
// 平均电表用量
|
||||||
|
private BigDecimal avgUseEle; |
||||||
|
|
||||||
|
// 平均水表用量
|
||||||
|
private BigDecimal avgUseWater; |
||||||
|
|
||||||
|
// 单耗
|
||||||
|
private BigDecimal unitConsumption; |
||||||
|
|
||||||
|
// 收益总额
|
||||||
|
private BigDecimal totalIncome; |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return new StringJoiner(", ", HotWaterRevenueSumDTO.class.getSimpleName() + "[", "]") |
||||||
|
.add("curDate='" + curDate + "'") |
||||||
|
.add("buildingId='" + buildingId + "'") |
||||||
|
.add("totalUseEleAmount=" + totalUseEleAmount) |
||||||
|
.add("electPrice=" + electPrice) |
||||||
|
.add("totalUseEle=" + totalUseEle) |
||||||
|
.add("totalUseWaterAmount=" + totalUseWaterAmount) |
||||||
|
.add("waterPrice=" + waterPrice) |
||||||
|
.add("totalUseWater=" + totalUseWater) |
||||||
|
.add("avgUseEle=" + avgUseEle) |
||||||
|
.add("avgUseWater=" + avgUseWater) |
||||||
|
.add("unitConsumption=" + unitConsumption) |
||||||
|
.add("totalIncome=" + totalIncome) |
||||||
|
.toString(); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,70 @@ |
|||||||
|
package com.mh.common.core.domain.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author LJF |
||||||
|
* @version 1.0 |
||||||
|
* @project EEMCS |
||||||
|
* @description 热水Sum基础类 |
||||||
|
* @date 2026-05-13 09:50:45 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class EnergyBaseSum { |
||||||
|
|
||||||
|
private String id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 时间 |
||||||
|
*/ |
||||||
|
private String curDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 建筑id |
||||||
|
*/ |
||||||
|
private String buildingId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 补水 |
||||||
|
*/ |
||||||
|
private BigDecimal fillWater; |
||||||
|
|
||||||
|
/** |
||||||
|
* 补水与昨日比 |
||||||
|
*/ |
||||||
|
private String fillWaterP; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用水 |
||||||
|
*/ |
||||||
|
private BigDecimal waterValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用水与昨日比 |
||||||
|
*/ |
||||||
|
private String waterP; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用电量 |
||||||
|
*/ |
||||||
|
private BigDecimal electValue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用电与昨日比 |
||||||
|
*/ |
||||||
|
private String electP; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单耗 |
||||||
|
*/ |
||||||
|
private BigDecimal electWater; |
||||||
|
|
||||||
|
/** |
||||||
|
* 单耗与昨日比 |
||||||
|
*/ |
||||||
|
private String electWaterP; |
||||||
|
} |
||||||
Loading…
Reference in new issue