diff --git a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs index a5990abd1..0463e5d8a 100644 --- a/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs +++ b/be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/CountAdjustNoteConverter.cs @@ -75,7 +75,7 @@ public class CountAdjustNoteConverter : IOutgoingConverter DestinationDataId = "", }; outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); - var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); + var exchangeIssue = BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); var arrive = BuildWip(exchangeIssue, departmentCode); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); @@ -103,7 +103,7 @@ public class CountAdjustNoteConverter : IOutgoingConverter DestinationDataId = "", }; outgoingToExternal.SetEffectiveDate(outgoingFromWms.EffectiveDate); - var exchangeIssue = await BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail).ConfigureAwait(false); + var exchangeIssue = BuildPurchaseReceiptExchangeDtoAsync(wmsCountAdjust, detail); outgoingToExternal.SourceDataContent = JsonSerializer.Serialize(exchangeIssue); var arrive = BuildIssue(exchangeIssue, departmentCode); outgoingToExternal.DestinationDataContent = JsonSerializer.Serialize(arrive); @@ -159,7 +159,7 @@ public class CountAdjustNoteConverter : IOutgoingConverter }; return counta; } - private async Task BuildPurchaseReceiptExchangeDtoAsync( + private CountAdjustNoteExchangeDto BuildPurchaseReceiptExchangeDtoAsync( CountAdjustNoteDTO wmsCountAdjust, CountAdjustNoteDetailExchangeDto wmsCountAdjustDetail) { var exchangeCountAdjust = _objectMapper.Map(wmsCountAdjust); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs index e56660a5e..3297f432b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs @@ -320,28 +320,30 @@ public class CountJobManager : SfsJobManagerBase, ICou jobDepDetail.SetIdAndNumber(GuidGenerator, entity.Id, number); jobDepDetail.CountLabel = GuidGenerator.Create().ToString(); entity.DepDetails.Add(jobDepDetail); - - if (detail == null) - { - var jobDetail = ObjectMapper.Map(depDetail); - jobDetail.ArriveDate = DateTime.Now; - jobDetail.ProduceDate = DateTime.Now; - jobDetail.ExpireDate = DateTime.Parse("9999-12-31 23:59:59.9999999"); - jobDetail.InventoryQty = 0; - var detailNumber = await GetNumber().ConfigureAwait(false); - jobDetail.SetIdAndNumber(GuidGenerator, entity.Id, detailNumber); - jobDetail.CountLabel = GuidGenerator.Create().ToString(); - entity.Details.Add(jobDetail); - } - else + if (detail != null) { jobDepDetail.ArriveDate = detail.ArriveDate; jobDepDetail.ProduceDate = detail.ProduceDate; jobDepDetail.ExpireDate = detail.ExpireDate; - await entity.SetDetail(detail.Id, detail.SupplierBatch, detail.ArriveDate, detail.ProduceDate, detail.ExpireDate, detail.LocationCode, countCount, detail.CountTime, detail.CountOperator, detail.CountDescription) - .ConfigureAwait(false); } - } + } + if (detail == null) + { + var jobDetail = ObjectMapper.Map(depDetail); + jobDetail.ArriveDate = DateTime.Now; + jobDetail.ProduceDate = DateTime.Now; + jobDetail.ExpireDate = DateTime.Parse("9999-12-31 23:59:59.9999999"); + jobDetail.InventoryQty = 0; + var detailNumber = await GetNumber().ConfigureAwait(false); + jobDetail.SetIdAndNumber(GuidGenerator, entity.Id, detailNumber); + jobDetail.CountLabel = GuidGenerator.Create().ToString(); + entity.Details.Add(jobDetail); + } + else + { + await entity.SetDetail(detail.Id, detail.SupplierBatch, detail.ArriveDate, detail.ProduceDate, detail.ExpireDate, detail.LocationCode, countCount, detail.CountTime, detail.CountOperator, detail.CountDescription) + .ConfigureAwait(false); + } } //移除原有明细里没有,并且第二次扫描以处的项目 entity.Details.RemoveAll(r => r.InventoryQty == 0 && r.CountQty == 0 && r.InventoryStage == entity.InventoryStage);