using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Threading.Tasks; using Volo.Abp.Domain.Services; using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Mes; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg; public class IssueNoteManager : DomainService, IIssueNoteManager { private readonly IIssueRepository _repository; public IssueNoteManager(IIssueRepository repository) { _repository = repository; } public async Task> GetToBeProcessedListAsync() { var issues = await _repository.GetListAsync(p => p.IsReceive == 1.ToString(CultureInfo.InvariantCulture) && p.WmsState == 0).ConfigureAwait(false); return issues; } public virtual async Task PostListAsync(List entities) { await _repository.InsertManyAsync(entities).ConfigureAwait(false); } public virtual async Task UpdateProcessedListAsync(List entities) { var ids = entities.Select(p => p.DeliverNumber); var issues = await _repository.GetListAsync(p => ids.Contains(p.DeliverNumber)).ConfigureAwait(false); issues.ForEach(p => { p.WmsState = 1; p.WmsDate = DateTime.Now; }); await _repository.UpdateManyAsync(issues).ConfigureAwait(false); } }