充电功率

zw
tq 5 months ago
parent 473d409ec4
commit 0f46ce90d4

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

@ -21,9 +21,12 @@ public class BinInfoController : ControllerBase
{ {
private readonly BinInfoRepository _BinInfoRepository; private readonly BinInfoRepository _BinInfoRepository;
public BinInfoController(BinInfoRepository infoRepository) private readonly EquipInfoRepository _equipInfoRepository;
public BinInfoController(BinInfoRepository infoRepository,EquipInfoRepository equipInfoRepository)
{ {
_BinInfoRepository = infoRepository; _BinInfoRepository = infoRepository;
_equipInfoRepository = equipInfoRepository;
} }
/// <summary> /// <summary>
@ -92,4 +95,24 @@ public class BinInfoController : ControllerBase
{ {
return Result<ushort>.Success(PlcMgr.BlowerStatus()); 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