Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
赵新宇 1 year ago
parent
commit
57abdc044f
  1. 6
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs
  2. 33
      be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs
  3. 8
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Job/EnumJobType.cs
  4. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs
  5. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobEditInput.cs
  6. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs
  7. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs
  8. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs
  9. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/SplitPacking_UpdateJobDetailInput.cs
  10. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDTO.cs
  11. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestEditInput.cs
  12. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestImportInput.cs
  13. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAutoMapperProfile.cs
  14. 48
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs
  15. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAppService.cs
  16. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJob.cs
  17. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobDetail.cs
  18. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs
  19. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequest.cs
  20. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobDbContextModelCreatingExtensions.cs
  21. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestDbContextModelCreatingExtensions.cs
  22. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ContainerRequestMapperProfile.cs
  23. 45
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs
  24. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/StoreEventAutoMapperProfile.cs

6
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application.Contracts/ExpectOuts/IExpectOutAppService.cs

@ -37,4 +37,10 @@ public interface IExpectOutAppService
/// <returns></returns>
Task<List<ExpectOutDTO>> SaveDetail_SplitPackingAsync(SplitPacking_UpdateDetailInput input);
/// <summary>
/// 根据任务号、箱码、数量、库位取预计出列表
/// </summary>
/// <returns></returns>
Task<List<ExpectOutDTO>> GetListByJobNumberAsync(SplitPacking_UpdateDetailInput input);
}

33
be/Modules/Inventory/src/Win_in.Sfs.Wms.Inventory.Application/ExpectOuts/ExpectOutAppService.cs

@ -189,12 +189,16 @@ public class ExpectOutAppService
[HttpPost("save-detail-split-packing")]
public virtual async Task<List<ExpectOutDTO>> SaveDetail_SplitPackingAsync(SplitPacking_UpdateDetailInput input)
{
var obj = await _repository.FindAsync(p => p.JobNumber == input.Number && p.PackingCode == input.FromPackingCode && p.Qty == input.FromQty && p.LocationCode == input.FromLocationCode).ConfigureAwait(false);
if (obj == null)
var lst = await ListByJobNumberAsync(input).ConfigureAwait(false);
if (lst == null || lst.Count == 0)
{
throw new UserFriendlyException($"预计出表没有数据:JobNumber={input.Number}|PackingCode={input.FromPackingCode}|Qty={input.FromQty}|LocationCode={input.FromLocationCode}");
}
if (lst.Count > 1)
{
throw new UserFriendlyException($"预计出表取到多条数据,应该取到一条数据:JobNumber={input.Number}|PackingCode={input.FromPackingCode}|Qty={input.FromQty}|LocationCode={input.FromLocationCode}");
}
var obj = lst[0];
//插入目标箱
var newObj = CommonHelper.CloneObj(obj);
newObj.SetId(GuidGenerator.Create());
@ -204,13 +208,28 @@ public class ExpectOutAppService
//修改源箱
obj.Qty = input.FromQty - input.ToQty;
var updRet = await _repository.UpdateAsync(obj).ConfigureAwait(false);
List<ExpectOut> lst = new List<ExpectOut>();
lst.Add(insRet);
lst.Add(updRet);
var ret = ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(lst);
List<ExpectOut> list = new List<ExpectOut>();
list.Add(insRet);
list.Add(updRet);
var ret = ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(list);
return ret;
}
/// <summary>
/// 根据任务号、箱码、数量、库位取预计出列表
/// </summary>
/// <returns></returns>
[HttpPost("get-list-by-job-number")]
public virtual async Task<List<ExpectOutDTO>> GetListByJobNumberAsync(SplitPacking_UpdateDetailInput input)
{
var lst = await ListByJobNumberAsync(input).ConfigureAwait(false);
var ret = ObjectMapper.Map<List<ExpectOut>, List<ExpectOutDTO>>(lst);
return ret;
}
private async Task<List<ExpectOut>> ListByJobNumberAsync(SplitPacking_UpdateDetailInput input)
{
return await _repository.GetListAsync(p => p.JobNumber == input.Number && p.PackingCode == input.FromPackingCode && p.Qty == input.FromQty && p.LocationCode == input.FromLocationCode).ConfigureAwait(false);
}
}

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; }
}

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/SplitPacking_UpdateJobDetailInput.cs

@ -2,16 +2,20 @@ using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
///
/// </summary>
public class SplitPacking_UpdateJobDetailInput
public class SplitPacking_UpdateJobDetailInputBase
{
/// <summary>
/// 主表number
/// </summary>
[Required(ErrorMessage = "{0}是必填项")]
public string Number { get; set; }
}
/// <summary>
///
/// </summary>
public class SplitPacking_UpdateJobDetailInput : SplitPacking_UpdateJobDetailInputBase
{
/// <summary>
/// 子表from标签
/// </summary>

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>();

48
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -445,15 +445,15 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
[HttpPost("split-packing-inspect")]
public async Task<TransferNoteDTO> SplitPacking_InspectAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput)
{
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
newInput.Number = updateJobDetailInput.Number;
newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
newInput.FromQty = updateJobDetailInput.FromQty;
newInput.ToPackingCode = updateJobDetailInput.ToPackingCode;
newInput.ToQty = updateJobDetailInput.ToQty;
newInput.FromLocationCode = transferNoteEditInput.Details[0].FromLocationCode;
newInput.ToLocationCode = transferNoteEditInput.Details[0].ToLocationCode;
var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
//SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
//newInput.Number = updateJobDetailInput.Number;
//newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
//newInput.FromQty = updateJobDetailInput.FromQty;
//newInput.ToPackingCode = updateJobDetailInput.ToPackingCode;
//newInput.ToQty = updateJobDetailInput.ToQty;
//newInput.FromLocationCode = transferNoteEditInput.Details[0].FromLocationCode;
//newInput.ToLocationCode = transferNoteEditInput.Details[0].ToLocationCode;
//var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false);
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false); //库存操作
return ret;
@ -482,9 +482,31 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
return ret;
}
/// <summary>
/// 拆箱,预计出表存在数据时不允许办理
/// </summary>
/// <param name="transferNoteEditInput"></param>
/// <param name="updateJobDetailInputBase"></param>
/// <returns></returns>
[HttpPost("split-packing-check-expect-out")]
public async Task<TransferNoteDTO> SplitPackingCheckExpectOutAsync(TransferNoteEditInput transferNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInputBase updateJobDetailInputBase)
{
var detailObj = transferNoteEditInput.Details[0];
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
newInput.Number = updateJobDetailInputBase.Number;
newInput.FromPackingCode = detailObj.FromPackingCode;
newInput.FromQty = detailObj.Qty;
newInput.ToPackingCode = detailObj.ToPackingCode;
newInput.ToQty = detailObj.Qty;
newInput.FromLocationCode = detailObj.FromLocationCode;
newInput.ToLocationCode = detailObj.ToLocationCode;
var expectOutLst = await _expectOutAppService.GetListByJobNumberAsync(newInput).ConfigureAwait(false);
if (expectOutLst.Count > 0)
{
throw new UserFriendlyException($"预计出表存在数据,不允许办理拆箱:JobNumber={newInput.Number}|PackingCode={newInput.FromPackingCode}|Qty={newInput.FromQty}|LocationCode={newInput.FromLocationCode}");
}
var ret = await SplitPackingAsync(transferNoteEditInput).ConfigureAwait(false);
return ret;
}
}

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