|
|
@ -19,8 +19,8 @@ namespace WebStarter.Controllers;
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
[Route("api/[controller]")]
|
|
|
|
public class BinInfoController : ControllerBase
|
|
|
|
public class BinInfoController : ControllerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
private readonly BinInfoRepository _BinInfoRepository;
|
|
|
|
private readonly BinInfoRepository _BinInfoRepository;
|
|
|
|
|
|
|
|
|
|
|
|
public BinInfoController(BinInfoRepository infoRepository)
|
|
|
|
public BinInfoController(BinInfoRepository infoRepository)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_BinInfoRepository = infoRepository;
|
|
|
|
_BinInfoRepository = infoRepository;
|
|
|
@ -37,7 +37,7 @@ public class BinInfoController : ControllerBase
|
|
|
|
[HttpGet("UpdateCanChargeFlag/{id}/{flag}")]
|
|
|
|
[HttpGet("UpdateCanChargeFlag/{id}/{flag}")]
|
|
|
|
public Result<bool> UpdateCanChargeFlag(int id, int flag)
|
|
|
|
public Result<bool> UpdateCanChargeFlag(int id, int flag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_BinInfoRepository.Update(it=>it.CanChargeFlag==flag,it=>it.Id==id);
|
|
|
|
_BinInfoRepository.Update(it => it.CanChargeFlag == flag, it => it.Id == id);
|
|
|
|
return Result<bool>.Success();
|
|
|
|
return Result<bool>.Success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ public class BinInfoController : ControllerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
No = "10"
|
|
|
|
No = "10"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
BinInfo queryByClause = _BinInfoRepository.QueryByClause(i=>i.Id==16);
|
|
|
|
BinInfo queryByClause = _BinInfoRepository.QueryByClause(i => i.Id == 16);
|
|
|
|
return Result<bool>.Success();
|
|
|
|
return Result<bool>.Success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -64,10 +64,19 @@ public class BinInfoController : ControllerBase
|
|
|
|
[HttpGet("UpdateCanSwapFlag/{id}/{flag}")]
|
|
|
|
[HttpGet("UpdateCanSwapFlag/{id}/{flag}")]
|
|
|
|
public async Task<Result<bool>> UpdateCanSwapFlag(int id, int flag)
|
|
|
|
public async Task<Result<bool>> UpdateCanSwapFlag(int id, int flag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
_BinInfoRepository.Update(it => it.CanSwapFlag == flag, it => it.Id == id);
|
|
|
|
_BinInfoRepository.Update(it=>it.CanSwapFlag==flag,it=>it.Id==id);
|
|
|
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
return Result<bool>.Success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 风机控制 1000:全部打开
|
|
|
|
|
|
|
|
///1010:全部关闭
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
[HttpGet("AirBlowerControl/{cmd}")]
|
|
|
|
|
|
|
|
public Result<bool> AirBlower(ushort cmd)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return PlcMgr.AirBlowerControl(cmd) ? Result<bool>.Success() : Result<bool>.Fail();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|