仓位手动预约

master
tq 5 months ago
parent 36419e8b24
commit d3d83ec9c8

@ -197,7 +197,7 @@ namespace Entity.DbModel.Station
/// <summary>
/// 电池入仓时间
/// </summary>
[SugarColumn(ColumnName = "int_time")]
[SugarColumn(ColumnName = "in_time")]
public DateTime? InTime { get; set; }
}
}

@ -28,7 +28,56 @@ public class ChargeMonitorController
_binInfoService = binInfoService;
_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>

Loading…
Cancel
Save