using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp.Domain.Services; namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.CallMtl; public class CallMtlManager : DomainService, ICallMtlManager { private readonly ICallMtlRepository _repository; public CallMtlManager(ICallMtlRepository repository) { _repository = repository; } public virtual async Task> GetToBeProcessedListAsync() { var plans = await _repository.GetListAsync(p => p.Yl1 == 0).ConfigureAwait(false); return plans; } public virtual async Task UpdateProcesseErrordListAsync(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.Yl1 = 2; // p.WmsDate = Clock.Now; }); await _repository.UpdateManyAsync(plans).ConfigureAwait(false); } 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.Yl1 = 1; // p.WmsDate = Clock.Now; }); await _repository.UpdateManyAsync(plans).ConfigureAwait(false); } }