Browse Source

pda 储位调拨

集成Redis
郑勃旭 2 years ago
parent
commit
b8ac6c7251
  1. 4
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/PurchaseReceiptJobController.cs
  2. 28
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/TransferNotes/Inputs/TransferNoteEditInput.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs
  4. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs
  5. 73
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs

4
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>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
List<string> status = new List<string>() { 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<int> status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
List<string> status = new List<string>() { EnumJobStatus.Open.ToString(), EnumJobStatus.Doing.ToString() };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase

28
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
/// <summary>
/// 调拨申请单号
/// </summary>
[Display(Name = "调拨申请单号")]
public string RequestNumber { get; set; }
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 调拨类型
/// </summary>
[Display(Name = "调拨类型")]
public string Type { get; set; }
/// <summary>
/// 使用中间库
/// </summary>
[Display(Name = "使用中间库")]
public bool UseOnTheWayLocation { get; set; }
[Display(Name = "详情")]
public List<TransferNoteDetailInput> Details { get; set; } = new List<TransferNoteDetailInput>();
}

2
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<TransferNoteEditInput, TransferNote>(input);
await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
entity=await _transferNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<TransferNote, TransferNoteDTO>(entity);

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteMapperProfile.cs

@ -12,6 +12,14 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<TransferNote, TransferNoteDTO>()
.ReverseMap();
CreateMap<TransferNoteEditInput, TransferNote>()
.IgnoreAuditedObjectProperties()
;
CreateMap<TransferNoteDetailInput, TransferNoteDetail>()
.IgnoreAuditedObjectProperties()
;
CreateMap<TransferNoteDetailDTO, TransferNoteDetail>();
CreateMap<TransferNoteDetail, TransferNoteDetailDTO>();

73
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/TransferNoteEventHandler.cs

@ -104,40 +104,47 @@ public class TransferNoteEventHandler
{
var transferLog = ObjectMapper.Map<TransferNoteDetail, TransferLogEditInput>(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;

Loading…
Cancel
Save