|
|
@ -5,13 +5,16 @@ using System.Text.Json; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Label.Application.Contracts; |
|
|
|
using Win_in.Sfs.Label.Domain.Shared; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.Domain.Shared; |
|
|
|
using Win_in.Sfs.Wms.DataExchange.WMS.SuppplierAsn; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Domain; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent; |
|
|
|
|
|
|
@ -24,6 +27,9 @@ public class ShipConverter : IIncomingConverter |
|
|
|
private readonly IItemPackAppService _itemPackAppService; |
|
|
|
private readonly ILogger<ShipConverter> _logger; |
|
|
|
private readonly IConfiguration _configuration; |
|
|
|
private readonly ISupplierAppService _supplierAppService; |
|
|
|
private readonly ISupplierItemAppService _supplierItemAppService; |
|
|
|
|
|
|
|
public ShipConverter( |
|
|
|
IIncomingToWmsManager incomingToWmsManager |
|
|
|
, IObjectMapper objectMapper |
|
|
@ -31,8 +37,9 @@ public class ShipConverter : IIncomingConverter |
|
|
|
, IItemPackAppService itemPackAppService |
|
|
|
, ILogger<ShipConverter> logger, |
|
|
|
IConfiguration configuration, |
|
|
|
IIncomingFromExternalManager incomingFromExternalManager |
|
|
|
) |
|
|
|
IIncomingFromExternalManager incomingFromExternalManager, |
|
|
|
ISupplierAppService supplierAppService, |
|
|
|
ISupplierItemAppService supplierItemAppService) |
|
|
|
{ |
|
|
|
_incomingFromExternalManager = incomingFromExternalManager; |
|
|
|
_incomingToWmsManager = incomingToWmsManager; |
|
|
@ -41,6 +48,8 @@ public class ShipConverter : IIncomingConverter |
|
|
|
_itemPackAppService = itemPackAppService; |
|
|
|
_logger = logger; |
|
|
|
_configuration = configuration; |
|
|
|
_supplierAppService = supplierAppService; |
|
|
|
_supplierItemAppService = supplierItemAppService; |
|
|
|
} |
|
|
|
|
|
|
|
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList) |
|
|
@ -95,13 +104,55 @@ public class ShipConverter : IIncomingConverter |
|
|
|
{ |
|
|
|
purchaseLabel.ItemName = item.Name; |
|
|
|
purchaseLabel.ItemDesc1 = item.Desc1; |
|
|
|
|
|
|
|
purchaseLabel.Uom = item.BasicUom; |
|
|
|
purchaseLabel.ItemDesc2 = item.Desc2; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
purchaseLabel.ItemName = ""; |
|
|
|
purchaseLabel.ItemDesc1 = ""; |
|
|
|
purchaseLabel.Uom = ""; |
|
|
|
purchaseLabel.ItemDesc2 = ""; |
|
|
|
} |
|
|
|
purchaseLabel.LabelType = EnumLabelType.PurchaseLabel; |
|
|
|
var supplierDto = await _supplierAppService.GetByCodeAsync(exchangeAsn.SupplierCode).ConfigureAwait(false); |
|
|
|
purchaseLabel.SupplierCode = exchangeAsn.SupplierCode; |
|
|
|
purchaseLabel.PoNumber = exchangeAsn.PoNumber; |
|
|
|
purchaseLabel.Qty = exchangeAsn.Detail.Qty; |
|
|
|
|
|
|
|
var supplierItemDTO=await _supplierItemAppService.GetBySupplierCodeAndItemCodeAsync(exchangeAsn.SupplierCode, purchaseLabel.ItemCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
purchaseLabel.ProduceDate = exchangeAsn.Detail.ProduceDate; |
|
|
|
purchaseLabel.ArriveDate = exchangeAsn.Detail.ArriveDate; |
|
|
|
purchaseLabel.FullBarcodeString = exchangeAsn.Detail.PackingCode; |
|
|
|
purchaseLabel.LocationErpCode = exchangeAsn.Detail.LocationErpCode; |
|
|
|
purchaseLabel.Lot = exchangeAsn.Detail.Lot; |
|
|
|
purchaseLabel.RecommendLocationCode = exchangeAsn.Detail.LocationErpCode; |
|
|
|
purchaseLabel.Remark = exchangeAsn.Detail.Remark; |
|
|
|
purchaseLabel.Code = exchangeAsn.Detail.PackingCode; |
|
|
|
purchaseLabel.PlanArriveDate = exchangeAsn.PlanArriveDate; |
|
|
|
|
|
|
|
purchaseLabel.SupplierItemCode = supplierItemDTO.SupplierItemCode; |
|
|
|
purchaseLabel.SupplierItemName = supplierItemDTO.ItemName; |
|
|
|
|
|
|
|
|
|
|
|
purchaseLabel.ExpireDate = DateTime.Now.AddDays(item.GetValidateDays()); |
|
|
|
purchaseLabel.ExtraProperties = new ExtraPropertyDictionary(); |
|
|
|
purchaseLabel.LabelStatus = LabelStatus.Enable; |
|
|
|
purchaseLabel.Specifications = item.Color; |
|
|
|
purchaseLabel.StdPackQty = item.StdPackQty; |
|
|
|
purchaseLabel.SupplierName = supplierDto.Name; |
|
|
|
purchaseLabel.SupplierSimpleName = supplierDto.ShortName; |
|
|
|
purchaseLabel.Team = string.Empty; |
|
|
|
purchaseLabel.ProdLine = string.Empty; |
|
|
|
purchaseLabel.QLevel = string.Empty; |
|
|
|
purchaseLabel.QualityFile = string.Empty; |
|
|
|
purchaseLabel.Shift = string.Empty; |
|
|
|
purchaseLabel.ContainerCode = string.Empty; |
|
|
|
|
|
|
|
purchaseLabel.RpNumber = string.Empty; |
|
|
|
purchaseLabel.SupplierBatch = string.Empty; |
|
|
|
|
|
|
|
return purchaseLabel; |
|
|
|
} |
|
|
|
|
|
|
|