|
|
@ -5,6 +5,7 @@ using System.Linq; |
|
|
|
using System.Linq.Expressions; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.ObjectMapping; |
|
|
|
using Volo.Abp.Users; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
@ -117,19 +118,41 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou |
|
|
|
} |
|
|
|
|
|
|
|
private async Task SetDetailsAsync(CountJob input, CountJob entity) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (var depDetail in input.DepDetails) |
|
|
|
{ |
|
|
|
var inputDetail = input.Details.FirstOrDefault(r => r.ItemCode == depDetail.ItemCode && r.PackingCode == depDetail.PackingCode); |
|
|
|
if (inputDetail != null) |
|
|
|
{ |
|
|
|
inputDetail.CountQty += depDetail.CountQty; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var jobDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDetail>(depDetail); |
|
|
|
var detailNumber = await GetNumber().ConfigureAwait(false); |
|
|
|
jobDetail.SetIdAndNumber(GuidGenerator, entity.Id, detailNumber); |
|
|
|
jobDetail.CountLabel = GuidGenerator.Create().ToString(); |
|
|
|
input.Details.Add(jobDetail); |
|
|
|
} |
|
|
|
|
|
|
|
var jobDepDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDependentDetail>(depDetail); |
|
|
|
var number = entity.Number; |
|
|
|
jobDepDetail.SetIdAndNumber(GuidGenerator, entity.Id, number); |
|
|
|
jobDepDetail.CountLabel = GuidGenerator.Create().ToString(); |
|
|
|
entity.DepDetails.Add(jobDepDetail); |
|
|
|
} |
|
|
|
foreach (var detail in input.Details) |
|
|
|
{ |
|
|
|
var entityDetail = entity.Details.FirstOrDefault(p => p.Id == detail.Id); |
|
|
|
|
|
|
|
//新增盘点明细
|
|
|
|
if (entityDetail == null||entityDetail.Id==Guid.Empty) |
|
|
|
if (entityDetail == null || entityDetail.Id == Guid.Empty) |
|
|
|
{ |
|
|
|
|
|
|
|
var jobDetail = ObjectMapper.Map<CountJobDetail, CountJobDetail>(detail); |
|
|
|
var number =await GetNumber(); |
|
|
|
jobDetail.SetIdAndNumber(GuidGenerator,entity.Id, number); |
|
|
|
jobDetail.CountLabel = GuidGenerator.Create().ToString(); |
|
|
|
//var number =await GetNumber();
|
|
|
|
//jobDetail.SetIdAndNumber(GuidGenerator,entity.Id, number);
|
|
|
|
//jobDetail.CountLabel = GuidGenerator.Create().ToString();
|
|
|
|
//CountJobDetail jobDetail = new CountJobDetail() { };
|
|
|
|
|
|
|
|
entity.AddDetail(jobDetail); |
|
|
@ -140,15 +163,6 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou |
|
|
|
.ConfigureAwait(false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
foreach (var depDetail in input.DepDetails) |
|
|
|
{ |
|
|
|
var jobDepDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDependentDetail>(depDetail); |
|
|
|
var number = entity.Number; |
|
|
|
jobDepDetail.SetIdAndNumber(GuidGenerator, entity.Id, number); |
|
|
|
jobDepDetail.CountLabel = GuidGenerator.Create().ToString(); |
|
|
|
entity.DepDetails.Add(jobDepDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public override void CheckDetails(CountJob entity, AbpValidationResult result) |
|
|
|