54 changed files with 440 additions and 89 deletions
@ -0,0 +1,8 @@ |
|||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
|
public class CoatingIssueJobCheckInput : SfsJobCheckInputBase |
||||
|
{ |
||||
|
|
||||
|
} |
@ -1,7 +1,8 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 发料任务
|
/// 发料任务
|
@ -1,7 +1,8 @@ |
|||||
using Volo.Abp.Authorization.Permissions; |
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
public static class CoatingIssueJobPermissions |
public static class CoatingIssueJobPermissions |
||||
{ |
{ |
@ -1,6 +0,0 @@ |
|||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|
||||
|
|
||||
public class CoatingIssueJobCheckInput : SfsJobCheckInputBase |
|
||||
{ |
|
||||
|
|
||||
} |
|
@ -1,8 +1,9 @@ |
|||||
using System; |
using System; |
||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
public class CoatingIssueNoteDTO : SfsStoreDTOBase<CoatingIssueNoteDetailDTO>, IHasJobNumber, IHasRequestNumber |
public class CoatingIssueNoteDTO : SfsStoreDTOBase<CoatingIssueNoteDetailDTO>, IHasJobNumber, IHasRequestNumber |
||||
{ |
{ |
@ -1,8 +1,9 @@ |
|||||
using System; |
using System; |
||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
public class CoatingIssueNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase |
public class CoatingIssueNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase |
||||
{ |
{ |
@ -1,8 +1,9 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
public class CoatingIssueNoteEditInput : SfsStoreCreateOrUpdateInputBase |
public class CoatingIssueNoteEditInput : SfsStoreCreateOrUpdateInputBase |
||||
{ |
{ |
@ -1,6 +1,7 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
public class CoatingIssueNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber |
public class CoatingIssueNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber |
||||
{ |
{ |
@ -1,7 +1,8 @@ |
|||||
using Volo.Abp.Authorization.Permissions; |
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
public static class CoatingIssueNotePermissions |
public static class CoatingIssueNotePermissions |
||||
{ |
{ |
@ -1,6 +1,7 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
public class CoatingMaterialRequestDTO : SfsStoreRequestDTOBase<CoatingMaterialRequestDetailDTO>, IHasNumber |
public class CoatingMaterialRequestDTO : SfsStoreRequestDTOBase<CoatingMaterialRequestDetailDTO>, IHasNumber |
||||
{ |
{ |
@ -1,8 +1,9 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
public class CoatingMaterialRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase |
public class CoatingMaterialRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase |
||||
{ |
{ |
@ -1,8 +1,9 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Application.Contracts; |
using Win_in.Sfs.Shared.Application.Contracts; |
||||
using Win_in.Sfs.Shared.Domain.Shared; |
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
[Display(Name = "叫料申请")] |
[Display(Name = "叫料申请")] |
||||
public class CoatingMaterialRequestImportInput : SfsStoreImportInputBase |
public class CoatingMaterialRequestImportInput : SfsStoreImportInputBase |
@ -1,7 +1,7 @@ |
|||||
using Volo.Abp.Authorization.Permissions; |
using Volo.Abp.Authorization.Permissions; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
public static class CoatingMaterialRequestPermissions |
public static class CoatingMaterialRequestPermissions |
||||
{ |
{ |
@ -1,7 +1,6 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
|
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application; |
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
@ -1,7 +1,7 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
using Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNote; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
using Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNotes; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application; |
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
@ -1,8 +1,7 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
using Win_in.Sfs.Shared.Domain.Shared; |
using Win_in.Sfs.Shared.Domain.Shared; |
||||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
using Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
using Win_in.Sfs.Wms.Store.Domain; |
|
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Application; |
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
@ -1,8 +1,9 @@ |
|||||
using System; |
using System; |
||||
using System.Linq.Expressions; |
using System.Linq.Expressions; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
public interface ICoatingIssueJobManager : IJobManager<CoatingIssueJob> |
public interface ICoatingIssueJobManager : IJobManager<CoatingIssueJob> |
||||
{ |
{ |
@ -0,0 +1,8 @@ |
|||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
|
public interface ICoatingIssueJobRepository : ISfsJobRepositoryBase<CoatingIssueJob> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -1,7 +1,8 @@ |
|||||
using Volo.Abp.Timing; |
using Volo.Abp.Timing; |
||||
using Win_in.Sfs.Shared.Domain.Shared; |
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs.CoatingIssueJobs; |
||||
|
|
||||
public static class CoatingIssueExtension |
public static class CoatingIssueExtension |
||||
{ |
{ |
@ -1,6 +0,0 @@ |
|||||
namespace Win_in.Sfs.Wms.Store.Domain; |
|
||||
|
|
||||
public interface ICoatingIssueJobRepository : ISfsJobRepositoryBase<CoatingIssueJob> |
|
||||
{ |
|
||||
|
|
||||
} |
|
@ -1,7 +1,8 @@ |
|||||
using System; |
using System; |
||||
using Win_in.Sfs.Shared.Domain.Shared; |
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNote; |
||||
|
|
||||
public class CoatingIssueNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase |
public class CoatingIssueNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase |
||||
{ |
{ |
@ -0,0 +1,8 @@ |
|||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNote; |
||||
|
|
||||
|
public interface ICoatingIssueNoteRepository : ISfsStoreRepositoryBase<CoatingIssueNote> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -1,7 +1,8 @@ |
|||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes.CoatingIssueNote; |
||||
|
|
||||
public interface ICoatingIssueNoteManager : ISfsStoreManager<CoatingIssueNote, CoatingIssueNoteDetail> |
public interface ICoatingIssueNoteManager : ISfsStoreManager<CoatingIssueNote, CoatingIssueNoteDetail> |
||||
{ |
{ |
@ -1,6 +0,0 @@ |
|||||
namespace Win_in.Sfs.Wms.Store.Domain; |
|
||||
|
|
||||
public interface ICoatingIssueNoteRepository : ISfsStoreRepositoryBase<CoatingIssueNote> |
|
||||
{ |
|
||||
|
|
||||
} |
|
@ -1,11 +1,12 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
using Win_in.Sfs.Shared.Domain.Entities; |
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// 要料申请
|
/// 喷涂要料申请
|
||||
/// </summary>
|
/// </summary>
|
||||
public class CoatingMaterialRequest : SfsStoreRequestAggregateRootBase<CoatingMaterialRequestDetail> |
public class CoatingMaterialRequest : SfsStoreRequestAggregateRootBase<CoatingMaterialRequestDetail> |
||||
{ |
{ |
@ -0,0 +1,308 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using DocumentFormat.OpenXml.Math; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using static Win_in.Sfs.Wms.Store.Domain.Shared.StoreSettings; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
|
public class CoatingMaterialRequestManager |
||||
|
: SfsStoreRequestManagerBase<CoatingMaterialRequest, CoatingMaterialRequestDetail> |
||||
|
, ICoatingMaterialRequestManager |
||||
|
{ |
||||
|
private readonly ICoatingMaterialRequestRepository _repository; |
||||
|
private readonly ICoatingIssueJobRepository _issueJobRepository; |
||||
|
|
||||
|
public CoatingMaterialRequestManager( |
||||
|
ICoatingMaterialRequestRepository repository |
||||
|
, ICoatingIssueJobRepository issueJobRepository |
||||
|
) : base(repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
_issueJobRepository = issueJobRepository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建
|
||||
|
/// </summary>
|
||||
|
/// <param name="entity"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task<CoatingMaterialRequest> CreateBynNumberAsync(CoatingMaterialRequest entity) |
||||
|
{ |
||||
|
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(CoatingMaterialRequest), entity.ActiveDate).ConfigureAwait(false) : entity.Number; |
||||
|
entity.SetIdAndNumberWithDetails(GuidGenerator, number); |
||||
|
entity.Submit(); |
||||
|
entity.Agree(); |
||||
|
entity.RequestStatus = EnumRequestStatus.Partial; |
||||
|
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<CoatingMaterialRequest>(entity), false) |
||||
|
.ConfigureAwait(false); |
||||
|
await _repository.InsertAsync(entity).ConfigureAwait(false); |
||||
|
return entity; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task UpdateDetailsAsync(CoatingMaterialRequest newEntity) |
||||
|
{ |
||||
|
var oldEntity = await Repository.FindAsync(newEntity.Id, true).ConfigureAwait(false); |
||||
|
if (oldEntity != null) |
||||
|
{ |
||||
|
foreach (var newDetail in newEntity.Details) |
||||
|
{ |
||||
|
oldEntity.ReplaceDetail(newDetail.Id, newDetail); |
||||
|
} |
||||
|
|
||||
|
foreach (var detail in oldEntity.Details) |
||||
|
{ |
||||
|
SetMaterialRequestDetailStatus(detail); |
||||
|
} |
||||
|
|
||||
|
await SetMaterialRequestStatus(oldEntity).ConfigureAwait(false); |
||||
|
|
||||
|
await Repository.UpdateAsync(oldEntity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
private void SetMaterialRequestDetailStatus(CoatingMaterialRequestDetail detail) |
||||
|
{ |
||||
|
if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数
|
||||
|
{ |
||||
|
detail.Status = EnumStatus.Close; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
detail.Status = EnumStatus.Open; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task SetMaterialRequestStatus(CoatingMaterialRequest materialRequest) |
||||
|
{ |
||||
|
if (materialRequest.Details.All(p => p.Status == EnumStatus.Close)) |
||||
|
{ |
||||
|
materialRequest.RequestStatus = EnumRequestStatus.Completed; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false); |
||||
|
if (issueJobs.Count > 0) |
||||
|
{ |
||||
|
if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled)) |
||||
|
{ |
||||
|
if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty)) |
||||
|
{ |
||||
|
materialRequest.RequestStatus = EnumRequestStatus.Completed; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
materialRequest.RequestStatus = EnumRequestStatus.Partial; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
materialRequest.RequestStatus = EnumRequestStatus.Partial; |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
materialRequest.RequestStatus = EnumRequestStatus.Partial; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public virtual async Task CompleteAsync(string number) |
||||
|
{ |
||||
|
var entity = await GetByNumberAsync(number).ConfigureAwait(false); |
||||
|
if (entity != null && !entity.Details.Any(p => p.ToBeIssuedQty > 0)) |
||||
|
{ |
||||
|
await CompleteAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#region 公有
|
||||
|
|
||||
|
/* |
||||
|
// /// <summary>
|
||||
|
// /// 处理
|
||||
|
// /// </summary>
|
||||
|
// /// <returns></returns>
|
||||
|
// public virtual async Task<bool> Handle(Guid id)
|
||||
|
// {
|
||||
|
// var entity =await Repository.GetAsync(id);
|
||||
|
// if (entity == null)
|
||||
|
// {
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// entity.Handle();
|
||||
|
// await Repository.UpdateAsync(entity);
|
||||
|
//
|
||||
|
// await HandledPublishAsync(entity);
|
||||
|
// return true;
|
||||
|
// }
|
||||
|
//
|
||||
|
// private async Task HandledPublishAsync(MaterialRequest entity)
|
||||
|
// {
|
||||
|
// //发布,以生成发料任务
|
||||
|
// var eto = BuildMaterialRequestHandledETO(entity);
|
||||
|
// await DistributedEventBus.PublishAsync(eto);
|
||||
|
// }
|
||||
|
//
|
||||
|
// /// <summary>
|
||||
|
// /// 关闭
|
||||
|
// /// </summary>
|
||||
|
// /// <returns></returns>
|
||||
|
// public virtual async Task<bool> Close(Guid id)
|
||||
|
// {
|
||||
|
// var entity = await Repository.GetAsync(id);
|
||||
|
// if (entity == null)
|
||||
|
// {
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// entity.Close();
|
||||
|
// await Repository.UpdateAsync(entity);
|
||||
|
//
|
||||
|
// //发布,以关闭发料任务
|
||||
|
// var eto = BuildMaterialRequestClosedETO(entity);
|
||||
|
// await DistributedEventBus.PublishAsync(eto);
|
||||
|
// return true;
|
||||
|
// }
|
||||
|
//
|
||||
|
// /// <summary>
|
||||
|
// /// 打开
|
||||
|
// /// </summary>
|
||||
|
// /// <returns></returns>
|
||||
|
// public virtual async Task<bool> Open(Guid id)
|
||||
|
// {
|
||||
|
// var entity = await Repository.GetAsync(id);
|
||||
|
// if (entity == null)
|
||||
|
// {
|
||||
|
// return false;
|
||||
|
// }
|
||||
|
// entity.Open();
|
||||
|
//
|
||||
|
// await Repository.UpdateAsync(entity);
|
||||
|
//
|
||||
|
// //发布,以打开发料任务
|
||||
|
// var eto = BuildMaterialRequestOpenedETO(entity);
|
||||
|
// await DistributedEventBus.PublishAsync(eto);
|
||||
|
// return true;
|
||||
|
// }
|
||||
|
|
||||
|
public virtual async Task<MaterialRequest> CreateAndHandleAsync(MaterialRequest entity) |
||||
|
{ |
||||
|
|
||||
|
await base.CreateAsync(entity); |
||||
|
|
||||
|
await base.HandleAsync(entity.Id); |
||||
|
|
||||
|
return entity; |
||||
|
} |
||||
|
*/ |
||||
|
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region Import
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行导入
|
||||
|
/// </summary>
|
||||
|
public virtual async Task ImportDataAsync(List<CoatingMaterialRequest> mergeEntities, List<CoatingMaterialRequest> deleteEntities = null) |
||||
|
{ |
||||
|
if (deleteEntities != null && deleteEntities.Count > 0) |
||||
|
{ |
||||
|
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
await CreateManyAsync(mergeEntities).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
/* |
||||
|
#region 私有
|
||||
|
|
||||
|
private MaterialRequestOpenedETO BuildMaterialRequestOpenedETO(MaterialRequest materialRequest) |
||||
|
{ |
||||
|
var materialRequestETO = new MaterialRequestOpenedETO() |
||||
|
{ |
||||
|
Number = materialRequest.Number, |
||||
|
Workshop = materialRequest.Workshop, |
||||
|
Status = materialRequest.Status, |
||||
|
Details = BuildMaterialRequestDetailETO(materialRequest.Details) |
||||
|
}; |
||||
|
return materialRequestETO; |
||||
|
} |
||||
|
|
||||
|
private MaterialRequestClosedETO BuildMaterialRequestClosedETO(MaterialRequest materialRequest) |
||||
|
{ |
||||
|
var materialRequestETO = new MaterialRequestClosedETO() |
||||
|
{ |
||||
|
Company = materialRequest.Company, |
||||
|
Number = materialRequest.Number |
||||
|
}; |
||||
|
return materialRequestETO; |
||||
|
} |
||||
|
|
||||
|
private MaterialRequestHandledETO BuildMaterialRequestHandledETO(MaterialRequest materialRequest) |
||||
|
{ |
||||
|
var materialRequestETO = new MaterialRequestHandledETO() |
||||
|
{ |
||||
|
Company = materialRequest.Company, |
||||
|
Number = materialRequest.Number, |
||||
|
Workshop = materialRequest.Workshop, |
||||
|
Status = materialRequest.Status, |
||||
|
Details = BuildMaterialRequestDetailETO(materialRequest.Details) |
||||
|
}; |
||||
|
return materialRequestETO; |
||||
|
} |
||||
|
|
||||
|
private List<MaterialRequestDetailETO> BuildMaterialRequestDetailETO(List<MaterialRequestDetail> materialRequestDetail) |
||||
|
{ |
||||
|
var list = new List<MaterialRequestDetailETO>(); |
||||
|
foreach (var detail in materialRequestDetail) |
||||
|
{ |
||||
|
var materialRequestDetailETO = new MaterialRequestDetailETO() |
||||
|
{ |
||||
|
Number = detail.Number, |
||||
|
Item = detail.Item, |
||||
|
ItemCode = detail.ItemCode, |
||||
|
Qty = detail.Qty, |
||||
|
ToLocationCode = detail.ToLocationCode, |
||||
|
ProdLine = detail.ProdLine, |
||||
|
WorkStation = detail.WorkStation, |
||||
|
ExpiredTime = detail.ExpiredTime, |
||||
|
Status = detail.Status |
||||
|
}; |
||||
|
list.Add(materialRequestDetailETO); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
*/ |
||||
|
} |
||||
|
|
||||
|
///// <summary>
|
||||
|
///// 为了解决补料时 无法拿到订阅错误信息
|
||||
|
///// </summary>
|
||||
|
///// <param name="entity"></param>
|
||||
|
///// <param name="flag"></param>
|
||||
|
///// <returns></returns>
|
||||
|
//public virtual async Task<MaterialRequest> CreateAndHandleAsync(MaterialRequest entity, bool flag)
|
||||
|
//{
|
||||
|
// await entity.Handle();
|
||||
|
// foreach (var detail in entity.Details)
|
||||
|
// {
|
||||
|
// detail.Status = EnumStoreStatus.Handle;
|
||||
|
// }
|
||||
|
// await base.CreateAsync(entity);
|
||||
|
|
||||
|
// //发布,以打开发料任务??
|
||||
|
// //var eto = BuildMaterialRequestHandledETO(entity);
|
||||
|
// //await DistributedEventBus.PublishAsync(eto);
|
||||
|
|
||||
|
// return entity;
|
||||
|
//}
|
@ -1,6 +1,7 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
|
@ -1,6 +1,7 @@ |
|||||
using Win_in.Sfs.Shared.Domain; |
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
namespace Win_in.Sfs.Wms.Store.Domain; |
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests; |
||||
|
|
||||
public interface ICoatingMaterialRequestRepository : ISfsStoreRepositoryBase<CoatingMaterialRequest>, |
public interface ICoatingMaterialRequestRepository : ISfsStoreRepositoryBase<CoatingMaterialRequest>, |
||||
ISfsBulkRepositoryBase<CoatingMaterialRequest> |
ISfsBulkRepositoryBase<CoatingMaterialRequest> |
Loading…
Reference in new issue