diff --git a/WebStarter/Controllers/Ammeter/AmmeterController.cs b/WebStarter/Controllers/Ammeter/AmmeterController.cs
index e919ea8..ce7d9ab 100644
--- a/WebStarter/Controllers/Ammeter/AmmeterController.cs
+++ b/WebStarter/Controllers/Ammeter/AmmeterController.cs
@@ -49,6 +49,7 @@ namespace WebStarter.Controllers.Ammeter
_emeterEnergyService = emeterEnergyService;
_emeterEnergyChangeService = emeterEnergyChangeService;
}
+
///
/// 七天电表用量
///
@@ -78,63 +79,54 @@ namespace WebStarter.Controllers.Ammeter
return Result.Success(resp,"成功");
}
#region 统计分析/电能表累计值信息
-
+
///
- /// 电能表累计值
+ /// 直流电能表累计值
///
///
[HttpGet("GetAllElectricalData")]
- public async Task> GetAllElectricalData()
+ public async Task>> GetAllElectricalData()
{
- EmeterEnergyResp resp = new EmeterEnergyResp();
- // 获取直流和交流表数据
- List Electrical = await _emeterEnergyService.GetAllElectricalData();
- List EnergyChanges = await _emeterEnergyChangeService.GetAllElectricalData();
-
- var config = new MapperConfiguration(cfg =>
- {
- cfg.CreateMap().ReverseMap();
- cfg.CreateMap().ReverseMap();
- });
- IMapper mapper = config.CreateMapper();
-
- List EnergyList = mapper.Map>(Electrical);
- List EmeterResps = mapper.Map>(EnergyChanges);
-
- resp.emeterEnergy = EnergyList;
- resp.emeterEnergyChange = EmeterResps;
-
- return Result.Success(resp,"成功");
+ // 直流表数据
+ return Result>.Success(await _emeterEnergyService.GetAllElectricalData(),"成功");
}
-
+
///
- /// 电能根据小时统计
+ /// 交流电能表累计值
///
///
- [HttpGet("GetTodayHourlyElectricalData")]
- public async Task> GetTodayHourlyElectricalData()
+ [HttpGet("GetAllEmeterEnergyChange")]
+ public async Task>> GetAllEmeterEnergyChange()
{
- EmeterEnergyResp resp = new EmeterEnergyResp();
- // 获取直流和交流表数据
-
- List Electrical = await _emeterEnergyService.GetTodayHourlyElectricalData();
- List EnergyChanges = await _emeterEnergyChangeService.GetTodayHourlyElectricalData();
-
- var config = new MapperConfiguration(cfg =>
- {
- cfg.CreateMap().ReverseMap();
- cfg.CreateMap().ReverseMap();
- });
- IMapper mapper = config.CreateMapper();
-
- List EnergyList = mapper.Map>(Electrical);
- List EmeterResps = mapper.Map>(EnergyChanges);
-
- resp.emeterEnergy = EnergyList;
- resp.emeterEnergyChange = EmeterResps;
-
- return Result.Success(resp,"成功");
+ // 交流表数据
+ return Result>.Success(await _emeterEnergyChangeService.GetAllElectricalData(),"成功");
+ }
+
+ ///
+ /// 直流电能表小时统计
+ ///
+ ///
+ [HttpGet("GetTodayHourlyEnergy")]
+ public async Task>> GetTodayHourlyElectricalData()
+ {
+ // 直流表数据
+ return Result>.Success(await _emeterEnergyService.GetTodayHourlyElectricalData(),"成功");
+ }
+
+
+ ///
+ /// 交流电能表小时统计
+ ///
+ ///
+ [HttpGet("GetTodayHourlyEnergyChange")]
+ public async Task>> GetTodayHourlyElectricalChangeData()
+ {
+ // 交流表数据
+ return Result>.Success(await _emeterEnergyChangeService.GetTodayHourlyElectricalData(),"成功");
}
+
+
+
///
/// 统计分析/电能表累计值信息
///