Browse Source

调试器具申请接口

dev_DY_CC
周红军 1 year ago
parent
commit
7e5a3e97e7
  1. 8
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobType.cs
  2. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs
  3. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobEditInput.cs
  4. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs
  5. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs
  6. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs
  7. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDTO.cs
  8. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestEditInput.cs
  9. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestImportInput.cs
  10. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAutoMapperProfile.cs
  11. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAppService.cs
  12. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJob.cs
  13. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobDetail.cs
  14. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs
  15. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequest.cs
  16. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobDbContextModelCreatingExtensions.cs
  17. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestDbContextModelCreatingExtensions.cs
  18. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs
  19. 45
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs
  20. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs

8
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobType.cs

@ -91,5 +91,11 @@ public enum EnumJobType
/// 转移
/// </summary>
[Display(Name = "转移")]
Transfer = 14,
Transfer = 15,
/// <summary>
/// 器具转移
/// </summary>
[Display(Name = "转移")]
ContainerTransferJob = 16,
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs

@ -31,13 +31,13 @@ public class ContainerJobDTO : SfsJobDTOBase<ContainerJobDetailDTO>
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobEditInput.cs

@ -30,14 +30,14 @@ public class ContainerJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateI
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 上游任务编号

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs

@ -26,14 +26,14 @@ public class ContainerNoteDTO : SfsStoreDTOBase<ContainerNoteDetailDTO>, IHasJob
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 已确认

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs

@ -36,14 +36,14 @@ public class ContainerNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 明细列表

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs

@ -24,12 +24,12 @@ public class ContainerNoteImportInput : SfsStoreImportInputBase, IHasJobNumber
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDTO.cs

@ -20,11 +20,11 @@ public class ContainerRequestDTO : SfsStoreRequestDTOBase<ContainerRequestDetail
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestEditInput.cs

@ -24,11 +24,11 @@ public class ContainerRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
[Display(Name = "器具类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
[Display(Name = "器具规格")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
[Display(Name = "明细列表")]
public List<ContainerRequestDetailInput> Details { get; set; }

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestImportInput.cs

@ -24,7 +24,7 @@ public class ContainerRequestImportInput : SfsStoreImportInputBase
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "器具类型")]
[ExporterHeader(DisplayName = "器具类型")]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
@ -33,7 +33,7 @@ public class ContainerRequestImportInput : SfsStoreImportInputBase
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "器具规格")]
[ExporterHeader(DisplayName = "器具规格")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAutoMapperProfile.cs

@ -8,7 +8,7 @@ namespace Win_in.Sfs.Wms.Store.Application;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void ContainerJobAutoMapperProfile()
{
{
CreateMap<ContainerJob, ContainerJobDTO>();
CreateMap<ContainerJobDTO, ContainerJob>();

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAppService.cs

@ -56,6 +56,12 @@ public class ContainerRequestAppService :
[HttpPost("")]
public override async Task<ContainerRequestDTO> CreateAsync(ContainerRequestEditInput input)
{
input.AutoCompleteJob = false;
input.AutoAgree = true;
input.AutoHandle = true;
input.AutoSubmit = true;
input.DirectCreateNote = false;
var entity = ObjectMapper.Map<ContainerRequestEditInput, ContainerRequest>(input);
await _containerRequestManager.CreateAsync(entity).ConfigureAwait(false);

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJob.cs

@ -29,13 +29,13 @@ public class ContainerJob : SfsJobAggregateRootBase<ContainerJobDetail>
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 任务明细

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobDetail.cs

@ -10,13 +10,13 @@ public class ContainerJobDetail : SfsJobRecommendFromDetailEntityBase
/// <summary>
/// 呼叫库位代码
/// </summary>
[IgnoreUpdate]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[IgnoreUpdate]
public string FromLocationCode { get; set; }
public void SetId(Guid id)

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs

@ -29,13 +29,13 @@ public class ContainerNote : SfsStoreAggregateRootBase<ContainerNoteDetail>, IHa
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 已确认

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequest.cs

@ -21,13 +21,13 @@ public class ContainerRequest : SfsStoreRequestAggregateRootBase<ContainerReques
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
public string ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
public string SpecificationsType { get; set; }
/// <summary>
/// 任务明细

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobDbContextModelCreatingExtensions.cs

@ -22,9 +22,10 @@ public static class ContainerJobDbContextModelCreatingExtensions
b.ConfigureJob<ContainerJob, ContainerJobDetail>();
//Properties
b.Property(q => q.ContainerRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.NameLength);
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestDbContextModelCreatingExtensions.cs

@ -20,8 +20,8 @@ public static class ContainerRequestDbContextModelCreatingExtensions
//Properties
b.Property(q => q.RequestLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.RequestStatus).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
@ -31,7 +31,7 @@ public static class ContainerRequestDbContextModelCreatingExtensions
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<DeliverRequestDetail>(b =>
builder.Entity<ContainerRequestDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(ContainerRequestDetail), options.Schema);

39
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs

@ -0,0 +1,39 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
public partial class StoreEventAutoMapperProfile : Profile
{
private void ContainerRequestMapperProfile()
{
CreateMap<ContainerRequest, ContainerJobEditInput>()
.ForMember(x => x.ContainerRequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.ContainerType, y => y.MapFrom(d => d.ContainerType))
.ForMember(x => x.SpecificationsType, y => y.MapFrom(d => d.SpecificationsType))
.ForMember(x => x.IsAutoComplete, y => y.MapFrom(d => d.AutoCompleteJob))
.ForMember(x => x.JobType, y => y.MapFrom(d => EnumJobType.ContainerTransferJob))
.ForMember(x => x.JobStatus, y => y.MapFrom(d => EnumJobStatus.Open))
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.UpStreamJobNumber)
.Ignore(x => x.JobDescription)
.Ignore(x => x.WorkGroupCode)
.Ignore(x => x.Priority)
.Ignore(x => x.PriorityIncrement)
.Ignore(x => x.AcceptUserId)
.Ignore(x => x.AcceptUserName)
.Ignore(x => x.AcceptTime)
.Ignore(x => x.CompleteUserId)
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.Details)
;
}
}

45
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs

@ -26,16 +26,16 @@ public class ContainerRequestEventHandler
{
private readonly IContainerJobAppService _ContainerJobApp;
private readonly IContainerJobAppService _containerJobApp;
private readonly IContainerRequestManager _containerRequestManager;
public ContainerRequestEventHandler(
IContainerJobAppService ContainerJobApp
IContainerJobAppService containerJobApp
, IContainerRequestManager containerRequestManager)
{
_ContainerJobApp = ContainerJobApp;
_containerJobApp = containerJobApp;
_containerRequestManager = containerRequestManager;
}
@ -48,10 +48,11 @@ public class ContainerRequestEventHandler
public async Task HandleEventAsync(SfsCreatedEntityEventData<ContainerRequest> eventData)
{
var entity = eventData.Entity;
if (entity.AutoSubmit)
{
await _containerRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
//if (entity.AutoSubmit)
//{
// await _containerRequestManager.SubmitAsync(entity).ConfigureAwait(false);
//}
}
/// <summary>
@ -105,8 +106,8 @@ public class ContainerRequestEventHandler
}
else
{
var ContainerJobCreateInputs = await BuildContainerJobsAsync(entity).ConfigureAwait(false);
await _ContainerJobApp.CreateManyAsync(ContainerJobCreateInputs).ConfigureAwait(false);
var containerJobCreateInputs = await BuildContainerJobsAsync(entity).ConfigureAwait(false);
await _containerJobApp.CreateAsync(containerJobCreateInputs).ConfigureAwait(false);
}
}
@ -114,17 +115,33 @@ public class ContainerRequestEventHandler
#region 私有
private async Task<List<ContainerJobEditInput>> BuildContainerJobsAsync(ContainerRequest request)
private async Task<ContainerJobEditInput> BuildContainerJobsAsync(ContainerRequest request)
{
var createInput = ObjectMapper.Map<ContainerRequest, ContainerJobEditInput>(request);
createInput.Details = new List<ContainerJobDetailInput>();
createInput.WarehouseCode = "T8";
ContainerJobDetailInput detail=new ContainerJobDetailInput();
detail.FromLocationCode = "123";
detail.ToLocationCode = "123";
detail.ItemCode = "123";
detail.ItemName = "123";
detail.RecommendPackingCode = "123";
detail.RecommendLot = "123";
detail.RecommendFromLocationCode = "123";
detail.RecommendFromLocationErpCode = "123";
detail.Uom = "123";
createInput.Details.Add(detail);
return new List<ContainerJobEditInput> { createInput };
return createInput ;
}
#endregion

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs

@ -60,6 +60,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CustomerReturnNoteAutoMapperProfile();
DeliverNoteAutoMapperProfile();
DeliverRequestMapperProfile();
ContainerRequestMapperProfile();
InspectNoteAutoMapperProfile();
InventoryTransferNoteAutoMapperProfile();
IsolationNoteAutoMapperProfile();

Loading…
Cancel
Save