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.
35 lines
1.0 KiB
35 lines
1.0 KiB
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.Mes;
|
|
|
|
public class ScrapManager : DomainService, IScrapManager
|
|
{
|
|
private readonly IScrapRepository _repository;
|
|
|
|
public ScrapManager(IScrapRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
public virtual async Task<List<Scrap>> GetToBeProcessedListAsync()
|
|
{
|
|
var scraps = await _repository.GetListAsync(p => p.Yl1 == 0).ConfigureAwait(false);
|
|
return scraps;
|
|
|
|
}
|
|
|
|
public virtual async Task UpdateProcessedListAsync(List<Scrap> entities)
|
|
{
|
|
var ids = entities.Select(p => p.mesout_asd_id);
|
|
var plans = await _repository.GetListAsync(p => ids.Contains(p.mesout_asd_id)).ConfigureAwait(false);
|
|
plans.ForEach(p =>
|
|
{
|
|
p.Yl1 = 1;
|
|
//p.WmsDate = Clock.Now;
|
|
});
|
|
await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
|
|
}
|
|
}
|
|
|