l3能源成本分摊(部分完成留存)
This commit is contained in:
@@ -2,6 +2,7 @@ package com.klp.ems.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.klp.ems.domain.bo.EmsEnergyConsumptionQueryBo;
|
||||
import com.klp.ems.domain.vo.*;
|
||||
@@ -80,6 +81,14 @@ public class EmsEnergyConsumptionController extends BaseController {
|
||||
return R.ok(iEmsEnergyConsumptionService.getChainAnalysis(queryBo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取能耗统计信息
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public R<Map<String, Object>> getStatistics(EmsEnergyConsumptionBo bo) {
|
||||
return R.ok(iEmsEnergyConsumptionService.getStatistics(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询能耗记录列表
|
||||
*/
|
||||
@@ -109,6 +118,31 @@ public class EmsEnergyConsumptionController extends BaseController {
|
||||
return R.ok(iEmsEnergyConsumptionService.queryById(energyConsumptionId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备的上次抄表记录(用于自动填充起始数据)
|
||||
* 如果是首次抄表,返回null;否则返回上次抄表的结束读数作为本次的起始读数
|
||||
*
|
||||
* @param meterId 设备ID
|
||||
*/
|
||||
@GetMapping("/lastReading/{meterId}")
|
||||
public R<EmsEnergyConsumptionVo> getLastReading(@NotNull(message = "设备ID不能为空")
|
||||
@PathVariable Long meterId) {
|
||||
EmsEnergyConsumptionVo lastReading = iEmsEnergyConsumptionService.getLastReadingForMeter(meterId);
|
||||
return R.ok(lastReading);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备本月的累计消耗量
|
||||
*
|
||||
* @param meterId 设备ID
|
||||
*/
|
||||
@GetMapping("/monthlyConsumption/{meterId}")
|
||||
public R<Double> getMonthlyConsumption(@NotNull(message = "设备ID不能为空")
|
||||
@PathVariable Long meterId) {
|
||||
Double monthlyConsumption = iEmsEnergyConsumptionService.getMonthlyConsumption(meterId);
|
||||
return R.ok(monthlyConsumption);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增能耗记录
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user