From 1c266419af8744140209c2f42c99760e1e7f9289 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Mon, 27 May 2024 16:12:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=B9=E9=87=8F=20?= =?UTF-8?q?=E9=87=8D=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExchangeDatas/IExchangeDataAppService.cs | 1 + .../ExchangeDatas/ExchangeDataAppService.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ExchangeDatas/IExchangeDataAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ExchangeDatas/IExchangeDataAppService.cs index b0be81c89..b586e1b78 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ExchangeDatas/IExchangeDataAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/ExchangeDatas/IExchangeDataAppService.cs @@ -15,4 +15,5 @@ public interface IExchangeDataAppService Task> GetToBeProcessedListOnlyReadAsync(int batchSize); Task> UpdateStatusByIdListAsync(List list); Task> UpdateManyAsync(List dtos); + Task> ReSendByListAsync(List list); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/ExchangeDataAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/ExchangeDataAppService.cs index 499737da7..d37072cd9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/ExchangeDataAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/ExchangeDatas/ExchangeDataAppService.cs @@ -78,6 +78,44 @@ public class ExchangeDataAppService return new ExchangeDataDTO() { Id = entityNew.Id }; } + [HttpPost("re-send-by-list")] + public virtual async Task> ReSendByListAsync(List list) + { + var exchangeDataOldList = + await _repository.GetListAsync(p => list.Contains(p.TyrpNumber)).ConfigureAwait(false); + + var listnew = new List(); + + foreach (var exchangeDataOld in exchangeDataOldList) + { + exchangeDataOld.Status = EnumExchangeDataStatus.Error; + + var exchangeDataNew = new ExchangeData + { + DataAction = exchangeDataOld.DataAction, + DataContent = exchangeDataOld.DataContent, + DataIdentityCode = exchangeDataOld.DataIdentityCode, + DataType = exchangeDataOld.DataType, + DestinationSystem = exchangeDataOld.DestinationSystem, + EffectiveDate = exchangeDataOld.EffectiveDate, + Remark = exchangeDataOld.Remark, + SourceSystem = exchangeDataOld.SourceSystem, + WriteTime = DateTime.Now, + Writer = null + }; + + var entityNew = await _repository.InsertAsync(exchangeDataNew).ConfigureAwait(false); + + exchangeDataOld.Remark = $"在【{DateTime.Now}】时,重新生成了新的接口数据:ID为【{entityNew.Id}】"; + + await _repository.UpdateAsync(exchangeDataOld).ConfigureAwait(false); + + listnew.Add(entityNew.Id.ToString()); + } + + return listnew; + } + [HttpPost("by-batchsize-post")] public virtual async Task> GetToBeProcessedListPostAsync(int batchSize) {