修复bug

This commit is contained in:
18942506660
2023-12-29 11:32:12 +08:00
parent f9db2c1b32
commit 9568c4770c
2 changed files with 12 additions and 2 deletions

View File

@@ -247,13 +247,22 @@ namespace WMS.Web.Domain.Services
{
_logger.LogInformation($"移箱:{JsonConvert.SerializeObject(dto)} 是否上架:{IsUp} 操作人:{loginInfo.UserInfo.StaffId}");
//1.下架时 需要验证箱是否在库存里
if (!IsUp)
{
var boxIds = dto.Select(s => s.BoxId).ToList();
var boxList = await _boxInventoryRepositories.GetList(boxIds);
if (!IsUp)
{
if (boxIds.Count() != boxList.Count())
return Result.ReFailure(ResultCodes.BoxInventoryNoDataError);
}
else
{
//上架时 箱子不能在库存里
if (boxList.Count() > 0)
{
var boxs = await _boxRepositories.GetEntityList(boxList.Select(s => s.BoxId).ToList());
return Result.ReFailure($"箱号{ string.Join(",", boxs.Select(s => s.BoxBillNo))} 已上架", 343433);
}
}
List<MoveBoxRecord> entityList = new List<MoveBoxRecord>();
foreach (var d in dto)
{

View File

@@ -66,6 +66,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> BoxInventoryHaveInventoryError = (800013, "箱号已上架入库");
public static ValueTuple<int, string> InventoryInOutDetailsWriteError = (800014, "写入物料收发明细失败!");
public static ValueTuple<int, string> InventoryDetailsWriteError = (800014, "写入即时库存明细失败!");
public static ValueTuple<int, string> MoveInventoryError = (800015, "箱已经上架,不能重复上架");
public static ValueTuple<int, string> SerialNumbersNoData = (610000, "序列号不存在");
public static ValueTuple<int, string> SerialNumbersBoxError = (610002, "序列号已经绑定箱");