diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs index 57156aedf..296063800 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/PlanReader.cs @@ -132,6 +132,7 @@ public class PlanReader : IReader ? EnumOrderStatus.Open : EnumOrderStatus.Close, Remark = plan.PlanMemo, + Lot="", // PoLine = "", // SupplierPackUom = plan.Unit, // SupplierPackQty = plan.Qty, 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/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PurchaseOrder/PurchaseOrderDetailExchangeDto.cs b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PurchaseOrder/PurchaseOrderDetailExchangeDto.cs index 536ca066a..d6b6be50d 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PurchaseOrder/PurchaseOrderDetailExchangeDto.cs +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/WMS/PurchaseOrder/PurchaseOrderDetailExchangeDto.cs @@ -44,4 +44,10 @@ public class PurchaseOrderDetailExchangeDto /// [Display(Name = "备注")] public string Remark { get; set; } + + /// + /// 生产批次 + /// + [Display(Name = "明细-生产批次")] + public string Lot { get; set; } } diff --git a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml index 89fa4a1e8..35fdcdbee 100644 --- a/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml +++ b/be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Application.Contracts/Win_in.Sfs.Wms.DataExchange.Application.Contracts.xml @@ -941,6 +941,11 @@ 备注 + + + 生产批次 + + 订单号 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, ICou var entityDetail = entity.Details.FirstOrDefault(p => p.Id == detail.Id); //新增盘点明细 - if (entityDetail == null) + if (entityDetail == null||entityDetail.Id==Guid.Empty) { var jobDetail = ObjectMapper.Map(detail); - + var number =await GetNumber(); + jobDetail.SetIdAndNumber(GuidGenerator,entity.Id, number); jobDetail.CountLabel = GuidGenerator.Create().ToString(); //CountJobDetail jobDetail = new CountJobDetail() { }; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs index 965a025b8..2d8f34e8f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Orders/PurchaseOrders/PurchaseOrderManager.cs @@ -52,9 +52,11 @@ public class PurchaseOrderManager : SfsStoreManagerBase diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs index 33ae076d8..4d426ce79 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CountJobEventHandler.cs @@ -43,7 +43,7 @@ public class CountJobEventHandler : } private async Task BuildCountPlanJobUpdateDTO(CountJob entity) - { + { var countPlanUpdateInput = ObjectMapper.Map(entity); foreach (var detail in countPlanUpdateInput.Details) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs index 373067035..3f6729e85 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Orders/PurchaseOrderEventHandler.cs @@ -125,10 +125,10 @@ public class PurchaseOrderEventHandler foreach (var itemCode in itemCodes)//查询 { - var itemPackDtos = await _itemPackAppService.GetListByItemCodeAsync(itemCode).ConfigureAwait(false); - var itemPackDto = itemPackDtos.First(); + //var itemPackDtos = await _itemPackAppService.GetListByItemCodeAsync(itemCode).ConfigureAwait(false); + //var itemPackDto = itemPackDtos.First(); + //ItemPacks.Add(itemPackDto); var supplierItem = await _supplierItemAppService.GetBySupplierCodeAndItemCodeAsync(purchaseOrder.SupplierCode, itemCode).ConfigureAwait(false); - ItemPacks.Add(itemPackDto); supplierItemDtos.Add(supplierItem); } @@ -158,7 +158,12 @@ public class PurchaseOrderEventHandler //供应商时间窗口 var dayOfWeek = new List() { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; 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; //生效日期