using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Services; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS; public class PlanManager : DomainService, IPlanManager { private readonly IPlanRepository _repository; public PlanManager(IPlanRepository repository) { _repository = repository; } public virtual async Task> GetToBeProcessedListAsync() { var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false); return plans; } public virtual async Task UpdateProcessedListAsync(List entities) { var ids = entities.Select(p => p.Id); var plans = await _repository.GetListAsync(p => ids.Contains(p.Id)).ConfigureAwait(false); plans.ForEach(p => { p.WmsState = 1; p.WmsDate = Clock.Now; }); await _repository.BulkUpdateAsync(plans).ConfigureAwait(false); } }