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.
 
 
 
 
 
 

28 lines
1.0 KiB

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
public class ScontrolManager : DomainService, IScontrolManager
{
private readonly IScontrolRepository _repository;
private readonly IScmsendRepository _detailRepository;
public ScontrolManager(IScontrolRepository repository, IScmsendRepository detailRepository)
{
_repository = repository;
_detailRepository = detailRepository;
}
public virtual async Task PostListAsync(List<Scontrol> entities, List<Scmsend> detailEntities)
{
await _detailRepository.InsertManyAsync(detailEntities, true).ConfigureAwait(false);
var details = await _detailRepository.GetListAsync(r => r.scmsend_nbr == entities.First().scontrol_nbr).ConfigureAwait(false);
var maxid = details.Select(r => r.Id).Max();
entities.First().scontrol_id = maxid;
await _repository.InsertManyAsync(entities).ConfigureAwait(false);
}
}