盘点没有箱库存 可以盘进库存

This commit is contained in:
18942506660
2024-06-19 15:17:35 +08:00
parent 3ce3b18b82
commit a165e8e71c
5 changed files with 58 additions and 7 deletions

View File

@@ -165,7 +165,7 @@ namespace WMS.Web.Domain.Services
//1.判断来源数据是否存在
if (dtoDatas == null || dtoDatas.Count == 0)
{
_logger.LogInformation("移箱-箱库存变更:失败->" + ResultCodes.InventoryNoSourceError.Item2+",参数->" + JsonConvert.SerializeObject(dtoDatas));
_logger.LogInformation("移箱-箱库存变更:失败->" + ResultCodes.InventoryNoSourceError.Item2 + ",参数->" + JsonConvert.SerializeObject(dtoDatas));
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
}
@@ -253,7 +253,7 @@ namespace WMS.Web.Domain.Services
//1.判断来源数据是否存在
if (dtoData == null)
{
_logger.LogInformation("入库回退上下架-箱库存的变更:失败->"+ ResultCodes.InventoryNoSourceError.Item2+",参数->"+ JsonConvert.SerializeObject(dtoData));
_logger.LogInformation("入库回退上下架-箱库存的变更:失败->" + ResultCodes.InventoryNoSourceError.Item2 + ",参数->" + JsonConvert.SerializeObject(dtoData));
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
}
@@ -334,7 +334,7 @@ namespace WMS.Web.Domain.Services
//1.判断来源数据是否存在
if (dtoDatas == null || dtoDatas.Count == 0)
{
_logger.LogInformation("盘点单-箱库存的变更:失败->"+ ResultCodes.InventoryNoSourceError.Item2 +",参数->"+ JsonConvert.SerializeObject(dtoDatas));
_logger.LogInformation("盘点单-箱库存的变更:失败->" + ResultCodes.InventoryNoSourceError.Item2 + ",参数->" + JsonConvert.SerializeObject(dtoDatas));
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
}
@@ -453,7 +453,7 @@ namespace WMS.Web.Domain.Services
//1.判断来源数据是否存在
if (dtoData == null)
{
_logger.LogInformation("入库单-箱库存的变更:失败->"+ ResultCodes.InventoryNoSourceError.Item2+",参数->" + JsonConvert.SerializeObject(dtoData));
_logger.LogInformation("入库单-箱库存的变更:失败->" + ResultCodes.InventoryNoSourceError.Item2 + ",参数->" + JsonConvert.SerializeObject(dtoData));
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
}
@@ -535,7 +535,7 @@ namespace WMS.Web.Domain.Services
//1.判断来源数据是否存在
if (dtoData == null)
{
_logger.LogInformation("出库单-箱库存的变更:失败->" + ResultCodes.InventoryNoSourceError.Item2+",参数->"+ JsonConvert.SerializeObject(dtoData));
_logger.LogInformation("出库单-箱库存的变更:失败->" + ResultCodes.InventoryNoSourceError.Item2 + ",参数->" + JsonConvert.SerializeObject(dtoData));
return Result.ReFailure(ResultCodes.InventoryNoSourceError);
}
@@ -640,7 +640,7 @@ namespace WMS.Web.Domain.Services
}
}
_logger.LogInformation("出库单-箱库存的变更:成功,参数->" + JsonConvert.SerializeObject(dtoData));
var lastBoxInventList= await _boxInventoryRepositories.GetList(boxIds);
var lastBoxInventList = await _boxInventoryRepositories.GetList(boxIds);
_logger.LogInformation("出库单-箱库存的变更:成功,处理后的箱是否存在的箱->" + JsonConvert.SerializeObject(lastBoxInventList));
return Result.ReSuccess();
}
@@ -1324,8 +1324,22 @@ namespace WMS.Web.Domain.Services
{
//3.1入库的时候:盘点-箱一定是存在于库存
var boxInvent = boxInventorys.Where(x => x.BoxId == dto.BoxId).FirstOrDefault();
//if (boxInvent == null)
// return Result.ReFailure(ResultCodes.BoxInventoryHaveInventoryError);
//v1.0.6版本 如果没有箱库存就添加
if (boxInvent == null)
return Result.ReFailure(ResultCodes.BoxInventoryHaveInventoryError);
{
BoxInventory box_add = new BoxInventory()
{
BoxId = dto.BoxId,
OrgCode = dto.OrgCode,
StockCode = dto.StockCode,
SubStockCode = dto.SubStockCode
};
boxInvent = await _boxInventoryRepositories.Add(box_add);
if (boxInvent == null) return Result.ReFailure(ResultCodes.DateWriteError);
boxInventorys.Add(boxInvent);
}
//3.2组装要新增的箱库存信息:箱和明细和序列号
var updateEntity = boxInvent;