|
|
@ -20,10 +20,13 @@ namespace WebStarter.Controllers;
|
|
|
|
public class BinInfoController : ControllerBase
|
|
|
|
public class BinInfoController : ControllerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly BinInfoRepository _BinInfoRepository;
|
|
|
|
private readonly BinInfoRepository _BinInfoRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly EquipInfoRepository _equipInfoRepository;
|
|
|
|
|
|
|
|
|
|
|
|
public BinInfoController(BinInfoRepository infoRepository)
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|