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.
37 lines
1.0 KiB
37 lines
1.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Volo.Abp.Domain.Services;
|
|
|
|
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
|
|
|
|
public class PlanManager : DomainService, IPlanManager
|
|
{
|
|
private readonly IPlanRepository _repository;
|
|
|
|
public PlanManager(IPlanRepository repository)
|
|
{
|
|
_repository = repository;
|
|
}
|
|
public virtual async Task<List<Plan>> GetToBeProcessedListAsync()
|
|
{
|
|
var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false);
|
|
|
|
return plans;
|
|
|
|
}
|
|
|
|
public virtual async Task UpdateProcessedListAsync(List<Plan> entities)
|
|
{
|
|
var ids = entities.Select(p => p.Id);
|
|
var plans = await _repository.GetListAsync(p => ids.Contains(p.Id)).ConfigureAwait(false);
|
|
plans.ForEach(p =>
|
|
{
|
|
p.WmsState = 1;
|
|
p.WmsDate = Clock.Now;
|
|
});
|
|
await _repository.BulkUpdateAsync(plans).ConfigureAwait(false);
|
|
}
|
|
}
|
|
|