|
|
@ -499,33 +499,40 @@ public class BalanceController : AbpController |
|
|
|
{ |
|
|
|
var productionLineItemDto = await _productionLineItemAppService.GetByProductLineCodeAndItemCodeAsync(productLine, itemCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
var locationList = new List<string>(); |
|
|
|
if (productionLineItemDto.RawLocationCodeListJson != null&& |
|
|
|
productionLineItemDto.RawLocationCodeListJson.Length > 0) |
|
|
|
if (productionLineItemDto != null ) |
|
|
|
{ |
|
|
|
var temp=JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson); |
|
|
|
locationList.AddRange(temp); |
|
|
|
} |
|
|
|
var locationList = new List<string>(); |
|
|
|
if (productionLineItemDto.RawLocationCodeListJson != null && |
|
|
|
productionLineItemDto.RawLocationCodeListJson.Length > 0) |
|
|
|
{ |
|
|
|
var temp = JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson); |
|
|
|
locationList.AddRange(temp); |
|
|
|
} |
|
|
|
|
|
|
|
if (productionLineItemDto.ProductLocationCodeListJson != null && |
|
|
|
productionLineItemDto.ProductLocationCodeListJson.Length > 0) |
|
|
|
{ |
|
|
|
var temp = JsonSerializer.Deserialize<List<string>>(productionLineItemDto.ProductLocationCodeListJson); |
|
|
|
locationList.AddRange(temp); |
|
|
|
} |
|
|
|
if (productionLineItemDto.ProductLocationCodeListJson != null && |
|
|
|
productionLineItemDto.ProductLocationCodeListJson.Length > 0) |
|
|
|
{ |
|
|
|
var temp = JsonSerializer.Deserialize<List<string>>(productionLineItemDto.ProductLocationCodeListJson); |
|
|
|
locationList.AddRange(temp); |
|
|
|
} |
|
|
|
|
|
|
|
//获取可用库存
|
|
|
|
var input = new RecommendBalanceRequestInput |
|
|
|
{ |
|
|
|
ItemCode = itemCode, |
|
|
|
Qty = decimal.MaxValue, |
|
|
|
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK }, |
|
|
|
Locations = locationList, |
|
|
|
IsPackingCode = isPackingCode |
|
|
|
}; |
|
|
|
//获取可用库存
|
|
|
|
var input = new RecommendBalanceRequestInput |
|
|
|
{ |
|
|
|
ItemCode = itemCode, |
|
|
|
Qty = decimal.MaxValue, |
|
|
|
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK }, |
|
|
|
Locations = locationList, |
|
|
|
IsPackingCode = isPackingCode |
|
|
|
}; |
|
|
|
|
|
|
|
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); |
|
|
|
return await SortByFifoAsync(usableList).ConfigureAwait(false); |
|
|
|
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); |
|
|
|
return await SortByFifoAsync(usableList).ConfigureAwait(false); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"未找到 生产线【{productLine}】零件【{itemCode}】关系"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|