|
|
@ -29,6 +29,55 @@ public class ChargeMonitorController
|
|
|
|
_monitorService = monitorService;
|
|
|
|
_monitorService = monitorService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 仓位预约
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="binNo">仓位</param>
|
|
|
|
|
|
|
|
/// <param name="amtLock"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
/// <exception cref="Exception"></exception>
|
|
|
|
|
|
|
|
[HttpPost("BinInfoMakeAnAppointment/{binNo}/{amtLock}")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> BinInfoMakeAnAppointment(string binNo,int amtLock)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BinInfo binInfo = await _binInfoService.QueryByClauseAsync(u => u.No == binNo);
|
|
|
|
|
|
|
|
if (binInfo == null)
|
|
|
|
|
|
|
|
throw new Exception("充电仓不存在");
|
|
|
|
|
|
|
|
binInfo.AmtLock = amtLock;
|
|
|
|
|
|
|
|
bool result = await _binInfoService.UpdateAsync(binInfo);
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
|
|
return Result<bool>.Success(result);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return Result<bool>.Fail(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 修改仓位电池编码
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="binNo"></param>
|
|
|
|
|
|
|
|
/// <param name="batteryNo"></param>
|
|
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
|
|
/// <exception cref="Exception"></exception>
|
|
|
|
|
|
|
|
[HttpPost("UpdateBatteryNo/{binNo}/{batteryNo}")]
|
|
|
|
|
|
|
|
public async Task<Result<bool>> UpdateBatteryNo(string binNo, string batteryNo)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BinInfo binInfo = await _binInfoService.QueryByClauseAsync(u => u.No == binNo);
|
|
|
|
|
|
|
|
if (binInfo == null)
|
|
|
|
|
|
|
|
throw new Exception("充电仓不存在");
|
|
|
|
|
|
|
|
BinInfo binInfoBatteryNo = await _binInfoService.QueryByClauseAsync(u => u.BatteryNo == batteryNo);
|
|
|
|
|
|
|
|
if (binInfoBatteryNo != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new Exception("已存在相同电池编码");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binInfo.BatteryNo = batteryNo;
|
|
|
|
|
|
|
|
bool result = await _binInfoService.UpdateAsync(binInfo);
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
|
|
|
return Result<bool>.Success(result);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return Result<bool>.Fail(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 充电仓查询:条件:仓位编号 仓位名称
|
|
|
|
/// 充电仓查询:条件:仓位编号 仓位名称
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|