仓位手动预约

zw
tq 6 months ago
parent 36419e8b24
commit d3d83ec9c8

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

@ -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>

Loading…
Cancel
Save