充电功率

zw
tq 5 months ago
parent 473d409ec4
commit 0f46ce90d4

@ -62,6 +62,11 @@ namespace Entity.DbModel.Station
/// </summary>
[SugarColumn(ColumnName="auto_charge")]
public int? AutoCharge {get;set;}
/// <summary>
/// 充电功率
/// </summary>
[SugarColumn(ColumnName="charge_power")]
public float? ChargePower { get; set; }
}
}

@ -20,10 +20,13 @@ namespace WebStarter.Controllers;
public class BinInfoController : ControllerBase
{
private readonly BinInfoRepository _BinInfoRepository;
private readonly EquipInfoRepository _equipInfoRepository;
public BinInfoController(BinInfoRepository infoRepository)
public BinInfoController(BinInfoRepository infoRepository,EquipInfoRepository equipInfoRepository)
{
_BinInfoRepository = infoRepository;
_equipInfoRepository = equipInfoRepository;
}
/// <summary>
@ -92,4 +95,24 @@ public class BinInfoController : ControllerBase
{
return Result<ushort>.Success(PlcMgr.BlowerStatus());
}
/// <summary>
/// 获取仓位充电功率
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[HttpGet("ChargePower/{code}")]
public Result<float> ChargePower(string code)
{
EquipInfo equipInfo = _equipInfoRepository.QueryByClause(i => i.Code == code);
float? chargePower = equipInfo.ChargePower;
if (chargePower == null)
{
return Result<float>.Fail("该仓没有充电功率");
}
return Result<float>.Success((float)chargePower);
}
}
Loading…
Cancel
Save