You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
1010 B

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.PullTask;
public class PullTaskManager : DomainService, IPullTaskManager
{
private readonly IPullTaskRepository _repository;
public PullTaskManager(IPullTaskRepository repository)
{
_repository = repository;
}
public virtual async Task<List<PullTask>> GetToBeProcessedListAsync()
{
var pullTasks = await _repository.GetListAsync(p => p.Yl1 == 0).ConfigureAwait(false);
return pullTasks;
}
public virtual async Task UpdateProcessedListAsync(List<PullTask> 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;
});
await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
}
}