|
|
@ -7,20 +7,27 @@ using System.Threading.Tasks; |
|
|
|
using DocumentFormat.OpenXml.Office.CustomUI; |
|
|
|
using DocumentFormat.OpenXml.Office2010.Excel; |
|
|
|
using Microsoft.EntityFrameworkCore; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Domain.Repositories; |
|
|
|
using Volo.Abp.Users; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|
|
|
using Win_in.Sfs.Wms.Inventory.Domain; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Store.Domain; |
|
|
|
|
|
|
|
public class UnplannedIssueJobManager : SfsJobManagerBase<UnplannedIssueJob, UnplannedIssueJobDetail>, IUnplannedIssueJobManager |
|
|
|
{ |
|
|
|
|
|
|
|
private readonly IBalanceRepository _balanceRepository; |
|
|
|
public UnplannedIssueJobManager( |
|
|
|
IBalanceRepository balanceRepository, |
|
|
|
|
|
|
|
IUnplannedIssueJobRepository repository |
|
|
|
) : base(repository) |
|
|
|
{ |
|
|
|
_balanceRepository = balanceRepository; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -39,23 +46,44 @@ public class UnplannedIssueJobManager : SfsJobManagerBase<UnplannedIssueJob, Unp |
|
|
|
entity.DeptName = input.DeptName; |
|
|
|
entity.CompleteUserName = input.CompleteUserName; |
|
|
|
entity.CompleteUserId = input.CompleteUserId; |
|
|
|
|
|
|
|
var first= entity.FacDetails.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var detail in input.Details) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var first= entity.FacDetails.FirstOrDefault(); |
|
|
|
if (input.UnplannedIssueType == EnumUnplannedIssueType.Raw) |
|
|
|
{ |
|
|
|
detail.SetIdAndNumber(GuidGenerator, input.Id, input.Number); |
|
|
|
detail.ReasonCode = first.ReasonCode; |
|
|
|
detail.CaseCode = first.CaseCode; |
|
|
|
detail.ProjCapacityCode = first.ProjCapacityCode; |
|
|
|
detail.OnceBusiCode = first.OnceBusiCode; |
|
|
|
detail.Explain = first.Explain; |
|
|
|
detail.Status = EnumInventoryStatus.OK; |
|
|
|
|
|
|
|
entity.AddDetail(detail); |
|
|
|
//发料子任务 赋值实际转移
|
|
|
|
foreach (var detail in input.Details) |
|
|
|
{ |
|
|
|
detail.SetIdAndNumber(GuidGenerator, input.Id, input.Number); |
|
|
|
detail.ReasonCode = first.ReasonCode; |
|
|
|
detail.CaseCode = first.CaseCode; |
|
|
|
detail.ProjCapacityCode = first.ProjCapacityCode; |
|
|
|
detail.OnceBusiCode = first.OnceBusiCode; |
|
|
|
detail.Explain = first.Explain; |
|
|
|
detail.Status = EnumInventoryStatus.OK; |
|
|
|
entity.AddDetail(detail); |
|
|
|
//发料子任务 赋值实际转移
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
foreach (var detail in input.Details) |
|
|
|
{ |
|
|
|
detail.SetIdAndNumber(GuidGenerator, input.Id, input.Number); |
|
|
|
detail.ReasonCode = first.ReasonCode; |
|
|
|
detail.CaseCode = first.CaseCode; |
|
|
|
detail.ProjCapacityCode = first.ProjCapacityCode; |
|
|
|
detail.OnceBusiCode = first.OnceBusiCode; |
|
|
|
detail.Explain = first.Explain; |
|
|
|
detail.Status = EnumInventoryStatus.OK; |
|
|
|
detail.RecommendArriveDate = DateTime.Now; |
|
|
|
detail.RecommendProduceDate = DateTime.Now; |
|
|
|
detail.RecommendExpireDate = DateTime.MaxValue; |
|
|
|
entity.AddDetail(detail); |
|
|
|
//发料子任务 赋值实际转移
|
|
|
|
} |
|
|
|
} |
|
|
|
return await base.CompleteAsync(entity, user).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|