diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs index f66228193..207931f9a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Outgoing/ArriveConverter.cs @@ -1,8 +1,10 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Text.Json; using System.Threading.Tasks; using Volo.Abp.ObjectMapping; +using Win_in.Sfs.Label.Application.Contracts; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; using Win_in.Sfs.Wms.DataExchange.Domain.Shared; @@ -17,6 +19,7 @@ public class ArriveConverter : IOutgoingConverter private readonly IOutgoingToExternalManager _outgoingToExternalManager; private readonly ISupplierAsnAppService _supplierAsnAppService; private readonly IObjectMapper _objectMapper; + private readonly IInventoryLabelAppService _inventoryLabelAppService; public ArriveConverter( @@ -24,8 +27,10 @@ public class ArriveConverter : IOutgoingConverter , IOutgoingToExternalManager outgoingToExternalManager , ISupplierAsnAppService supplierAsnAppService , IObjectMapper objectMapper + , IInventoryLabelAppService inventoryLabelAppService ) { + _inventoryLabelAppService = inventoryLabelAppService; _outgoingFromWmsManager = outgoingFromWmsManager; _outgoingToExternalManager = outgoingToExternalManager; _supplierAsnAppService = supplierAsnAppService; @@ -60,6 +65,12 @@ public class ArriveConverter : IOutgoingConverter var exchangeReceipt = await BuildPutawayExchangeDtoAsync(wmsReceipt, detail).ConfigureAwait(false); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeReceipt); var arrive = BuildArrive(exchangeReceipt); + + var label = await _inventoryLabelAppService.GetByCodeAsync(arrive.DetailMatNo).ConfigureAwait(false); + if (label != null) + { + arrive.ShipBillNo = label.AsnNumber; + } outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); outgoingToExternalList.Add(outgoingToExternal); @@ -87,7 +98,7 @@ public class ArriveConverter : IOutgoingConverter DocNo = exchangeReceipt.Number, DetailMatNo = detail.ToPackingCode, ERP = detail.ItemCode, - Qty = detail.ShippedQty, + Qty = detail.Qty, HgQty = detail.Qty, ProductDate = detail.ProduceDate, ProductBatch = detail.ToLot, diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs index a50d73ebf..5583c701c 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging; using Volo.Abp.Guids; using Volo.Abp.ObjectMapping; using Win_in.Sfs.Basedata.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Wms.DataExchange.Domain; using Win_in.Sfs.Wms.DataExchange.WMS.ItemBasic; @@ -69,6 +70,7 @@ public class ItemBasicConverter : IIncomingConverter incomingToWms.SetEffectiveDate(item.EffectiveDate); var exchangeItemBasicRequest = JsonSerializer.Deserialize(item.DestinationDataContent); var wmsMaterialRequest = _objectMapper.Map(exchangeItemBasicRequest); + wmsMaterialRequest.ValidityUnit = EnumValidityUnit.Infinite; incomingToWms.DataContent = JsonSerializer.Serialize(wmsMaterialRequest); incomingToWmsList.Add(incomingToWms); } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicReader.cs index de94dfad5..ecab2e62a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicReader.cs @@ -121,25 +121,6 @@ public class ItemBasicReader : IReader catch (Exception) { } - string type = ""; - switch (product.mes_product_code) - { - case "10C01": - type = "成品"; - break; - case "10C02": - type = "成品"; - break; - case "10C03": - type = "物料"; - break; - case "10C04": - type = "半成品"; - break; - default: - type = "无"; - break; - } var itemBasicRequest = new ItemBasicExchangeDto() { @@ -157,7 +138,7 @@ public class ItemBasicReader : IReader IsRecycled = product.mes_product_mfg == "10406" ? true : false, //10406 回收 #endregion - Type = type,//10C01成品、10C02原料、10C03物料、10C04半成品 + Type = product.mes_product_code,//10C01成品、10C02原料、10C03物料、10C04半成品 Configuration = product.mes_product_spec, BasicUom = product.mes_product_unit, AbcClass = "", diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs index c6860062c..41daaedb0 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/ItemBasic/ItemBasicExchangeDto.cs @@ -89,13 +89,13 @@ public class ItemBasicExchangeDto ItemBasicExchangeDto itembasic = obj as ItemBasicExchangeDto; return Code == itembasic.Code && Desc1 == itembasic.Desc1 && Desc2 == itembasic.Desc2 && Configuration == itembasic.Configuration && Type == itembasic.Type && CanMake == itembasic.CanMake && CanBuy == itembasic.CanBuy && CanOutsourcing == itembasic.CanOutsourcing && IsRecycled == itembasic.IsRecycled && - BasicUom == itembasic.BasicUom; + BasicUom == itembasic.BasicUom&& StdPackQty==itembasic.StdPackQty; } return false; } public override int GetHashCode() { - return Code.GetHashCode() ^ (Desc1 == null ? 0 : Desc1.GetHashCode()) ^ (Desc2 == null ? 0 : Desc2.GetHashCode()) ^ (Configuration == null ? 0 : Configuration.GetHashCode()) ^ (Type == null ? 0 : Type.GetHashCode()) ^ CanMake.GetHashCode() ^ CanBuy.GetHashCode() ^ CanOutsourcing.GetHashCode() ^ IsRecycled.GetHashCode() ^ BasicUom.GetHashCode(); + return Code.GetHashCode() ^ (Desc1 == null ? 0 : Desc1.GetHashCode()) ^ (Desc2 == null ? 0 : Desc2.GetHashCode()) ^ (Configuration == null ? 0 : Configuration.GetHashCode()) ^ (Type == null ? 0 : Type.GetHashCode()) ^ CanMake.GetHashCode() ^ CanBuy.GetHashCode() ^ CanOutsourcing.GetHashCode() ^ IsRecycled.GetHashCode() ^ BasicUom.GetHashCode() ^ StdPackQty.GetHashCode(); } } diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs index 444f4c83c..2b466b511 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Inventories/BalanceController.cs @@ -286,11 +286,11 @@ public class BalanceController : AbpController } } - //if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) - //{ - // input.Condition.Filters.Add( - // new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); - //} + if (listInput.inventoryStatuses != null && listInput.inventoryStatuses.Any()) + { + input.Condition.Filters.Add( + new Filter("Status", JsonSerializer.Serialize(listInput.inventoryStatuses), "In")); + } var balanceDTOs = await _balanceAppService.GetPagedListByFilterAsync(input, false).ConfigureAwait(false); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Items/ItemBasicEfCoreRepository.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Items/ItemBasicEfCoreRepository.cs index 023b05f31..4b4bedc65 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Items/ItemBasicEfCoreRepository.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/Items/ItemBasicEfCoreRepository.cs @@ -22,11 +22,12 @@ public class ItemBasicEfCoreRepository : SfsBaseDataEfCoreRepositoryBase() { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; var chineseWeek= dayOfWeek[Clock.Now.DayOfWeek.GetHashCode()]; //中文星期 - var dateTimeWindowDto=supplierTimeWindowDtos.First(p => p.Week == chineseWeek); + var dateTimeWindowDto=supplierTimeWindowDtos.FirstOrDefault(p => p.Week == chineseWeek); + if (dateTimeWindowDto == null) + { + throw new UserFriendlyException($"供应商时间窗口当前时间【{chineseWeek}】不存在"); + } + supplierAsnEditInput.TimeWindow = dateTimeWindowDto.TimeSlot; //生效日期