diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs index c65c7656b..7dc5b7715 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ItemTransformNoteConverter.cs @@ -53,46 +53,45 @@ public class ItemTransformNoteConverter : IOutgoingConverter string tyrpNumber = outgoingFromWms.TyrpNumber; var department = await _departmentAppService.GetByUsernameAsync(wmsCountAdjust.Worker).ConfigureAwait(false); var departmentCode = department == null ? "" : department.Code; - var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode, r.LocationErpCode, r.ToLocationCode }).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, LocationErpCode = p.Key.LocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); + var details = wmsCountAdjust.Details.GroupBy(r => new { r.ItemCode, r.ToItemCode,r.FromLocationErpCode, r.ToLocationErpCode}).Select(p => new ItemTransformNoteDetailExchangeDto { ToQty = p.Sum(itm => itm.ToQty), FromQty = p.Sum(itm => itm.FromQty), ItemCode = p.Key.ItemCode, ToItemCode = p.Key.ToItemCode, FromLocationErpCode = p.Key.FromLocationErpCode, ToLocationErpCode = p.Key.ToLocationErpCode, ReasonCode = String.Join("、", p.Select(x => x.ReasonCode).ToArray()) }); + List ItemTransform = new List(); + ItemTransformNoteDetailExchangeDto ItemTranss = new ItemTransformNoteDetailExchangeDto(); + ItemTranss.ItemCode = details.First().ToItemCode; + ItemTranss.LocationErpCode = details.First().ToLocationErpCode; + ItemTranss.FromQty = details.First().ToQty; + ItemTranss.ReasonCode = "20108"; + ItemTransform.Add(ItemTranss); foreach (var detail in details) - { - List ItemTransform = new List(); + { ItemTransformNoteDetailExchangeDto ItemTrans = new ItemTransformNoteDetailExchangeDto(); ItemTrans.ItemCode = detail.ItemCode; - ItemTrans.LocationErpCode = detail.LocationErpCode; + ItemTrans.LocationErpCode = detail.FromLocationErpCode; ItemTrans.FromQty = detail.FromQty - detail.FromQty - detail.FromQty; - ItemTrans.ReasonCode = detail.ReasonCode; - ItemTransform.Add(ItemTrans); - ItemTransformNoteDetailExchangeDto ItemTranss = new ItemTransformNoteDetailExchangeDto(); - ItemTranss.ItemCode = detail.ToItemCode; - ItemTranss.LocationErpCode = detail.LocationErpCode; - ItemTranss.FromQty = detail.ToQty; - ItemTranss.ReasonCode = detail.ReasonCode; - ItemTransform.Add(ItemTranss); - foreach (var Item in ItemTransform) + ItemTrans.ReasonCode = "20109"; + ItemTransform.Add(ItemTrans); + } + foreach (var Item in ItemTransform) + { + var outgoingToExternal = new OutgoingToExternal() { - var outgoingToExternal = new OutgoingToExternal() - { - DataType = outgoingFromWms.DataType, - DataAction = outgoingFromWms.DataAction, - SerialNumber= tyrpNumber, - SourceSystem = EnumSystemType.WMS.ToString(), - SourceDataId = wmsCountAdjust.Number, - SourceDataGroupCode = wmsCountAdjust.Number, - SourceDataDetailCode = Item.ItemCode, - Writer = nameof(TyrpOutgoingBackgroundWorker), - DestinationSystem = EnumSystemType.ERP.ToString(), - DestinationDataId = "", - }; - outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); - var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, Item).ConfigureAwait(false); - outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); - var arrive = BuildIssue(exchangeIssue, departmentCode); - outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); - - outgoingToExternalList.Add(outgoingToExternal); - } - + DataType = outgoingFromWms.DataType, + DataAction = outgoingFromWms.DataAction, + SerialNumber = tyrpNumber, + SourceSystem = EnumSystemType.WMS.ToString(), + SourceDataId = wmsCountAdjust.Number, + SourceDataGroupCode = wmsCountAdjust.Number, + SourceDataDetailCode = Item.ItemCode, + Writer = nameof(TyrpOutgoingBackgroundWorker), + DestinationSystem = EnumSystemType.ERP.ToString(), + DestinationDataId = "", + }; + outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); + var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, Item).ConfigureAwait(false); + outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); + var arrive = BuildIssue(exchangeIssue, departmentCode); + outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); + + outgoingToExternalList.Add(outgoingToExternal); } } } diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs index 7c3416941..72243a4cf 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/RecycledMaterialReceiptNoteConverter.cs @@ -120,7 +120,7 @@ public class RecycledMaterialReceiptNoteConverter : IOutgoingConverter wmsoutm_stat = "Y", wmsoutm_tyrp_dt = "", wmsoutm_user = "WMS", - wmsoutm_dept = "",//根据Worker从UserDepartment中获取 + wmsoutm_dept = "510800",//根据Worker从UserDepartment中获取 //wmsoutm_date = exchangeOrder.ActiveDate.ToString("yyyyMMdd"), wmsoutm_date = DateTime.Now.ToString("yyyyMMdd"), wmsoutm_cust = "", diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs index 8ff6d8625..ac8e65b82 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/ScrapNoteConVerter.cs @@ -80,7 +80,7 @@ IOutgoingFromWmsManager outgoingFromWmsManager { var detail = exchangeScrap.Detail; string asdtype = ""; - if (exchangeScrap.Type == EnumTransSubType.CountAdjust_WIP.ToString() && detail.FromLocationErpCode.ToLower() == "tv") + if ((exchangeScrap.Type == EnumTransSubType.CountAdjust_WIP.ToString() && detail.FromLocationErpCode.ToLower() == "tv")|| (exchangeScrap.Type == EnumTransSubType.Scrap_WIP.ToString() && detail.FromLocationErpCode.ToLower() == "bp")) { asdtype = "4004"; } diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs index 349ce69cc..ea9d22385 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ItemTransformNote/ItemTransformNoteDetailExchangeDto.cs @@ -16,6 +16,11 @@ public class ItemTransformNoteDetailExchangeDto [Display(Name = "ERP库位")] public string LocationErpCode { get; set; } /// + /// 来源储位 + /// + [Display(Name = "ERP库位")] + public string FromLocationErpCode { get; set; } + /// /// 原因代码 /// [Display(Name = "原因代码")] @@ -31,11 +36,11 @@ public class ItemTransformNoteDetailExchangeDto [Display(Name = "目标数量")] public decimal ToQty { get; set; } /// - /// 目标库位 + /// 目标储位 /// [Display(Name = "目标库位")] [Required(ErrorMessage = "{0}是必填项")] - public string ToLocationCode { get; set; } + public string ToLocationErpCode { get; set; } /// /// 目标ERP料号 /// diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs index 151736341..c772e5cf3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/PurchaseReceiptNoteEventHandler.cs @@ -38,7 +38,7 @@ public class PurchaseReceiptNoteEventHandler await detail.TrySetLocationAsync(LocationAclService, detail.LocationCode).ConfigureAwait(false); } //20230915tyrp无此接口 - var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); - await AddManyAsync(exchangeData).ConfigureAwait(false); + // var exchangeData = await BuildExchangeDataAsync(StoreEventConsts.WMS, StoreEventConsts.ERP, ExchangeDataType, dtos).ConfigureAwait(false); + //await AddManyAsync(exchangeData).ConfigureAwait(false); } }