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.
46 lines
1.5 KiB
46 lines
1.5 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.MesOut;
|
|
|
|
public class MesOutManager : DomainService, IMesOutManager
|
|
{
|
|
private readonly IMesOutRepository _repository;
|
|
|
|
public MesOutManager(IMesOutRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
public virtual async Task<List<MesOut>> GetToBeProcessedListAsync()
|
|
{
|
|
var plans = await _repository.GetListAsync(p => p.Yl1 == 0).ConfigureAwait(false);
|
|
return plans;
|
|
|
|
}
|
|
public virtual async Task UpdateProcesseErrordListAsync(List<MesOut> entities)
|
|
{
|
|
var ids = entities.Select(p => p.Mesout_ref_nbr);
|
|
var plans = await _repository.GetListAsync(p => ids.Contains(p.Mesout_ref_nbr)).ConfigureAwait(false);
|
|
plans.ForEach(p =>
|
|
{
|
|
p.Yl1 = 2;
|
|
// p.WmsDate = Clock.Now;
|
|
});
|
|
await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
|
|
}
|
|
public virtual async Task UpdateProcessedListAsync(List<MesOut> entities)
|
|
{
|
|
var ids = entities.Select(p => p.Mesout_ref_nbr);
|
|
var plans = await _repository.GetListAsync(p => ids.Contains(p.Mesout_ref_nbr)).ConfigureAwait(false);
|
|
plans.ForEach(p =>
|
|
{
|
|
p.Yl1 = 1;
|
|
|
|
// p.WmsDate = Clock.Now;
|
|
});
|
|
await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
|
|
}
|
|
}
|
|
|