From b8ac6c7251228832a80250fee1c984d36904caf0 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Mon, 10 Apr 2023 19:33:10 +0800 Subject: [PATCH] =?UTF-8?q?pda=20=E5=82=A8=E4=BD=8D=E8=B0=83=E6=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jobs/PurchaseReceiptJobController.cs | 4 +- .../Inputs/TransferNoteEditInput.cs | 28 +++++++ .../TransferNotes/TransferNoteAppService.cs | 2 +- .../TransferNoteMapperProfile.cs | 8 ++ .../Transactions/TransferNoteEventHandler.cs | 73 ++++++++++--------- 5 files changed, 79 insertions(+), 36 deletions(-) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs index c37c119bc..e24f784c4 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs @@ -186,7 +186,7 @@ public class PurchaseReceiptJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonWlgCodes = JsonSerializer.Serialize(wlgCodes); - var status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var requestInput = new SfsJobRequestInputBase @@ -222,7 +222,7 @@ public class PurchaseReceiptJobController : AbpController var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); var jsonCodes = JsonSerializer.Serialize(wlgCodes); - List status = new List() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; + List status = new List() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() }; var jsonStatus = JsonSerializer.Serialize(status); var request = new SfsJobRequestInputBase diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs index 398f1d2ba..b1b084185 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -23,4 +24,31 @@ public class TransferNoteEditInput : SfsStoreCreateOrUpdateInputBase [Display(Name = "确认时间")] public DateTime? ConfirmTime { get; set; } #endregion + + /// + /// 调拨申请单号 + /// + [Display(Name = "调拨申请单号")] + public string RequestNumber { get; set; } + + /// + /// 任务ID + /// + [Display(Name = "任务ID")] + public string JobNumber { get; set; } + + /// + /// 调拨类型 + /// + [Display(Name = "调拨类型")] + public string Type { get; set; } + + /// + /// 使用中间库 + /// + [Display(Name = "使用中间库")] + public bool UseOnTheWayLocation { get; set; } + + [Display(Name = "详情")] + public List Details { get; set; } = new List(); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs index 09de0cd4d..43b0d71ae 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs @@ -251,7 +251,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase { var entity = ObjectMapper.Map(input); - await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); + entity=await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs index 3509ad258..e2ba27294 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs @@ -12,6 +12,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile CreateMap() .ReverseMap(); + CreateMap() + .IgnoreAuditedObjectProperties() + ; + + CreateMap() + .IgnoreAuditedObjectProperties() + ; + CreateMap(); CreateMap(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs index c221e9cb0..4e451144d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs @@ -104,40 +104,47 @@ public class TransferNoteEventHandler { var transferLog = ObjectMapper.Map(detail); - if (note.UseOnTheWayLocation) + var fromLocation = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); + var toLocation = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); + var transferOnTheWay = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false); + + switch (route) { - var fromLocation = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); - var toLocation = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); - var transferOnTheWay = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false); - - switch (route) - { - case EnumTransferRoute.SourceToOnTheWay: - transferLog.FromLocationCode = fromLocation.Code; - transferLog.FromLocationArea = fromLocation.AreaCode; - transferLog.FromLocationErpCode = fromLocation.ErpLocationCode; - transferLog.FromLocationGroup = fromLocation.LocationGroupCode; - - transferLog.ToLocationCode = transferOnTheWay.Code; - transferLog.ToLocationArea = transferOnTheWay.AreaCode; - transferLog.ToLocationErpCode = transferOnTheWay.ErpLocationCode; - transferLog.ToLocationGroup = transferOnTheWay.LocationGroupCode; - break; - case EnumTransferRoute.OnTheWayToDestination: - transferLog.FromLocationCode = transferOnTheWay.Code; - transferLog.FromLocationArea = transferOnTheWay.AreaCode; - transferLog.FromLocationErpCode = transferOnTheWay.ErpLocationCode; - transferLog.FromLocationGroup = transferOnTheWay.LocationGroupCode; - - transferLog.ToLocationCode = toLocation.Code; - transferLog.ToLocationArea = toLocation.AreaCode; - transferLog.ToLocationErpCode = toLocation.ErpLocationCode; - transferLog.ToLocationGroup = toLocation.LocationGroupCode; - break; - case EnumTransferRoute.SourceToDestination: - default: - throw new ArgumentOutOfRangeException(nameof(route), route, null); - } + case EnumTransferRoute.SourceToOnTheWay: + transferLog.FromLocationCode = fromLocation.Code; + transferLog.FromLocationArea = fromLocation.AreaCode; + transferLog.FromLocationErpCode = fromLocation.ErpLocationCode; + transferLog.FromLocationGroup = fromLocation.LocationGroupCode; + + transferLog.ToLocationCode = transferOnTheWay.Code; + transferLog.ToLocationArea = transferOnTheWay.AreaCode; + transferLog.ToLocationErpCode = transferOnTheWay.ErpLocationCode; + transferLog.ToLocationGroup = transferOnTheWay.LocationGroupCode; + break; + case EnumTransferRoute.OnTheWayToDestination: + transferLog.FromLocationCode = transferOnTheWay.Code; + transferLog.FromLocationArea = transferOnTheWay.AreaCode; + transferLog.FromLocationErpCode = transferOnTheWay.ErpLocationCode; + transferLog.FromLocationGroup = transferOnTheWay.LocationGroupCode; + + transferLog.ToLocationCode = toLocation.Code; + transferLog.ToLocationArea = toLocation.AreaCode; + transferLog.ToLocationErpCode = toLocation.ErpLocationCode; + transferLog.ToLocationGroup = toLocation.LocationGroupCode; + break; + case EnumTransferRoute.SourceToDestination: + transferLog.FromLocationCode = fromLocation.Code; + transferLog.FromLocationArea = fromLocation.AreaCode; + transferLog.FromLocationErpCode = fromLocation.ErpLocationCode; + transferLog.FromLocationGroup = fromLocation.LocationGroupCode; + + transferLog.ToLocationCode = toLocation.Code; + transferLog.ToLocationArea = toLocation.AreaCode; + transferLog.ToLocationErpCode = toLocation.ErpLocationCode; + transferLog.ToLocationGroup = toLocation.LocationGroupCode; + break;; + default: + throw new ArgumentOutOfRangeException(nameof(route), route, null); } transferLog.TransType = TransType;