优化
This commit is contained in:
@@ -19,5 +19,14 @@ namespace WMS.Web.Domain.IService
|
||||
/// <param name="isTransaction"></param>
|
||||
/// <returns></returns>
|
||||
Task<Result> GenerateInventoryDetails(List<InventoryDetailsGenerateDto> dtos, bool isTransaction);
|
||||
|
||||
/// <summary>
|
||||
/// 获取即时库存明细汇总
|
||||
/// </summary>
|
||||
/// <param name="mids"></param>
|
||||
/// <param name="stockCodes"></param>
|
||||
/// <param name="orgCodes"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<InventoryDetailsSummaryResponse>> GetInventoryDetailsSummary(List<int> mids, List<string> stockCodes, List<string> orgCodes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,6 +1354,7 @@ namespace WMS.Web.Domain.Services
|
||||
var boxIds = out_SerialNumbers.GroupBy(x => x.BoxId).Select(x => x.Key).ToList();
|
||||
var boxInventorys = await _boxInventoryRepositories.GetList(boxIds);
|
||||
|
||||
_logger.LogInformation("盘点-箱库存变更:第二步-》" + JsonConvert.SerializeObject(out_SerialNumbers));
|
||||
var delete_ids1 = new List<int>();
|
||||
var update_entitys1 = new List<BoxInventory>();
|
||||
var InventoryDetailsGenerateDto1 = new List<InventoryDetailsGenerateDto>();
|
||||
@@ -1399,6 +1400,7 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
var isSuccess = true;
|
||||
//4.数据库更新操作:更新和添加
|
||||
_logger.LogInformation("盘点-箱库存变更:第二步-》更新的条目:" + update_entitys1.Count);
|
||||
if (update_entitys1.Count != 0)
|
||||
{
|
||||
isSuccess = await _boxInventoryRepositories.UpdateRange(update_entitys1, isTransaction);
|
||||
|
||||
@@ -104,5 +104,26 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
return Result.ReSuccess();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取即时库存明细汇总
|
||||
/// </summary>
|
||||
/// <param name="mids"></param>
|
||||
/// <param name="stockCodes"></param>
|
||||
/// <param name="orgCodes"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<InventoryDetailsSummaryResponse>> GetInventoryDetailsSummary(List<int> mids, List<string> stockCodes, List<string> orgCodes)
|
||||
{
|
||||
var inventoryDetails = await _inventoryDetailsRepositories.GetListBy(mids, stockCodes, orgCodes);
|
||||
var resultList = inventoryDetails.GroupBy(x => new { MaterialId = x.MaterialId, StockCode = x.StockCode, OrgCode = x.OrgCode })
|
||||
.Select(x => new InventoryDetailsSummaryResponse()
|
||||
{
|
||||
MaterialId=x.Key.MaterialId,
|
||||
StockCode=x.Key.StockCode,
|
||||
OrgCode=x.Key.OrgCode,
|
||||
Qty=x.Sum(t=>t.Qty)
|
||||
}).ToList();
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user