|
|
@ -107,6 +107,10 @@ public class PurchaseOrderEventHandler |
|
|
|
|
|
|
|
//供应商窗口
|
|
|
|
var supplierTimeWindowDtos = await _supplierTimeWindowAppService.GetListBySupplierCodeAsync(purchaseOrder.SupplierCode).ConfigureAwait(false); |
|
|
|
if (!supplierTimeWindowDtos.Any()) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"供应商窗口【{purchaseOrder.SupplierCode}】没设置"); |
|
|
|
} |
|
|
|
|
|
|
|
//一次性返回所有物品信息
|
|
|
|
var itemBasicDtos = await _itemBasicAppService.GetByCodesAsync(itemCodes).ConfigureAwait(false); |
|
|
@ -173,13 +177,13 @@ public class PurchaseOrderEventHandler |
|
|
|
|
|
|
|
//todo 一个物品多个包装?怎么取值
|
|
|
|
//标包数
|
|
|
|
var itemPackDto=ItemPacks.First(p => p.ItemCode == purchaseOrderDetaildetail.ItemCode); |
|
|
|
var itemPackDto = itemBasicDtos.First(p=>p.Code== purchaseOrderDetaildetail.ItemCode).StdPackQty; |
|
|
|
|
|
|
|
//总箱数
|
|
|
|
var itemPackingCount = (int)(itemQty / itemPackDto.Qty); |
|
|
|
if (itemQty > itemPackDto.Qty) |
|
|
|
var itemPackingCount = (int)(itemQty / itemPackDto); |
|
|
|
if (itemQty > itemPackDto) |
|
|
|
{ |
|
|
|
if (itemQty % itemPackDto.Qty != 0) |
|
|
|
if (itemQty % itemPackDto != 0) |
|
|
|
{ |
|
|
|
itemPackingCount++; |
|
|
|
} |
|
|
@ -214,7 +218,7 @@ public class PurchaseOrderEventHandler |
|
|
|
supplierAsnDetailInput.ItemDesc2 = itemBasicDto.Desc2; |
|
|
|
|
|
|
|
//标包
|
|
|
|
supplierAsnDetailInput.StdPackQty = itemPackDto.Qty; |
|
|
|
supplierAsnDetailInput.StdPackQty = itemPackDto; |
|
|
|
|
|
|
|
supplierAsnDetailInput.SupplierPackQty = supplierItemDto.SupplierPackQty; |
|
|
|
supplierAsnDetailInput.SupplierPackUom = supplierItemDto.SupplierPackUom; |
|
|
@ -228,11 +232,11 @@ public class PurchaseOrderEventHandler |
|
|
|
supplierAsnDetailInput.RecommendErpCode = purchaseOrderDetaildetail.LocationErpCode; |
|
|
|
|
|
|
|
supplierAsnDetailInput.PoNumber = purchaseOrder.Number; |
|
|
|
supplierAsnDetailInput.Qty = itemQty>itemPackDto.Qty ? itemPackDto.Qty : itemQty; |
|
|
|
supplierAsnDetailInput.Qty = itemQty>itemPackDto ? itemPackDto : itemQty; |
|
|
|
|
|
|
|
itemQty-=itemPackDto.Qty; |
|
|
|
itemQty-=itemPackDto; |
|
|
|
|
|
|
|
var InventoryLabelEditInput = await BuildInventoryLabelEditInputAsync(supplierAsnEditInput, supplierAsnDetailInput, supplierDto, itemBasicDto, supplierItemDto, itemPackDto).ConfigureAwait(false); |
|
|
|
var InventoryLabelEditInput = await BuildInventoryLabelEditInputAsync(supplierAsnEditInput, supplierAsnDetailInput, supplierDto, itemBasicDto, supplierItemDto).ConfigureAwait(false); |
|
|
|
inventoryLabelEditInputs.Add(InventoryLabelEditInput); |
|
|
|
|
|
|
|
supplierAsnEditInput.Details.Add(supplierAsnDetailInput); |
|
|
@ -260,8 +264,7 @@ public class PurchaseOrderEventHandler |
|
|
|
SupplierAsnDetailInput supplierAsnDetail, |
|
|
|
SupplierDTO supplierDto, |
|
|
|
ItemBasicDTO itemBasicDto, |
|
|
|
SupplierItemDTO supplierItemDto, |
|
|
|
ItemPackDTO itemPackDto) |
|
|
|
SupplierItemDTO supplierItemDto) |
|
|
|
{ |
|
|
|
if (itemBasicDto == null) |
|
|
|
|
|
|
@ -308,7 +311,7 @@ public class PurchaseOrderEventHandler |
|
|
|
inputLabel.LabelStatus = LabelStatus.Enable; |
|
|
|
|
|
|
|
inputLabel.Specifications = itemBasicDto.Color; |
|
|
|
inputLabel.StdPackQty = itemPackDto.Qty; |
|
|
|
inputLabel.StdPackQty = itemBasicDto.StdPackQty; |
|
|
|
|
|
|
|
inputLabel.SupplierItemCode = supplierItemDto.SupplierItemCode; |
|
|
|
inputLabel.SupplierItemName = supplierItemDto.ItemName; |
|
|
|