Browse Source

成品发运修改

dev_DY_CC
lvzb 12 months ago
parent
commit
d074e29f7f
  1. 2
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
  2. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs
  3. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs
  4. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs
  5. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs

2
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs

@ -149,7 +149,7 @@ public class AgentModule : AbpModule
public override void OnApplicationInitialization( public override void OnApplicationInitialization(
ApplicationInitializationContext context) ApplicationInitializationContext context)
{ {
//context.AddBackgroundWorkerAsync<IncomingToWmsWorker>(); context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
// context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>(); // context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
} }
} }

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/DeliverRequests/Inputs/DeliverRequestImportInput.cs

@ -7,6 +7,13 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
[Display(Name = "发货申请")] [Display(Name = "发货申请")]
public class DeliverRequestImportInput : SfsStoreImportInputBase public class DeliverRequestImportInput : SfsStoreImportInputBase
{ {
/// <summary>
/// 单据号
/// </summary>
[Display(Name = "单据号")]
[Required]
[Key]
public string Number { get; set; }
/// <summary> /// <summary>
/// 发货类型 /// 发货类型
/// </summary> /// </summary>

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAppService.cs

@ -89,6 +89,11 @@ IItemBasicAppService itemBasicAppService)
protected override async Task SaveImportAsync(Dictionary<DeliverRequest, EntityState> dict) protected override async Task SaveImportAsync(Dictionary<DeliverRequest, EntityState> dict)
{ {
var addList = dict.Where(p => p.Value == EntityState.Added).Select(p => p.Key).ToList(); var addList = dict.Where(p => p.Value == EntityState.Added).Select(p => p.Key).ToList();
foreach (var item in addList)
{
await SetRequestAutoPropertiesAsync(item).ConfigureAwait(false);
}
await _deliverRequestManager.CreateManyAsync(addList).ConfigureAwait(false); await _deliverRequestManager.CreateManyAsync(addList).ConfigureAwait(false);
} }
private static void CheckItemBasic(ItemBasicDTO itemcBasicDto, string itemCode) private static void CheckItemBasic(ItemBasicDTO itemcBasicDto, string itemCode)

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/DeliverRequests/DeliverRequestAutoMapperProfile.cs

@ -29,7 +29,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<DeliverRequestImportInput, DeliverRequest>() CreateMap<DeliverRequestImportInput, DeliverRequest>()
.ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.Normal)) // .ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.Normal))
.Ignore(x => x.CustomerAddressCode) .Ignore(x => x.CustomerAddressCode)
.Ignore(x => x.DeliverPlanNumber) .Ignore(x => x.DeliverPlanNumber)
.Ignore(x => x.ActiveDate) .Ignore(x => x.ActiveDate)
@ -62,7 +62,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark); .Ignore(x => x.Remark);
CreateMap<DeliverRequestFisImportInput, DeliverRequest>() CreateMap<DeliverRequestFisImportInput, DeliverRequest>()
.ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.FIS)) // .ForMember(x => x.DeliverRequestType, y => y.MapFrom(t => EnumDeliverRequestType.FIS))
.Ignore(x => x.CustomerAddressCode) .Ignore(x => x.CustomerAddressCode)
.Ignore(x => x.DeliverPlanNumber) .Ignore(x => x.DeliverPlanNumber)
.Ignore(x => x.ActiveDate) .Ignore(x => x.ActiveDate)

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/DeliverNoteEventHandler.cs

@ -20,6 +20,7 @@ namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class DeliverNoteEventHandler public class DeliverNoteEventHandler
: StoreInventoryEventHandlerBase : StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<DeliverNote>> , ILocalEventHandler<SfsCreatedEntityEventData<DeliverNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<DeliverNote>>>
{ {
private const EnumTransType TransType = EnumTransType.Deliver; private const EnumTransType TransType = EnumTransType.Deliver;
private readonly IDeliverRequestAppService _deliverRequestApp; private readonly IDeliverRequestAppService _deliverRequestApp;
@ -49,7 +50,24 @@ public class DeliverNoteEventHandler
await SetRequestStatusAsync(entity).ConfigureAwait(false); await SetRequestStatusAsync(entity).ConfigureAwait(false);
} }
/// <summary>
/// 创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<DeliverNote>> eventDatas)
{
var entitys = eventDatas.Entity;
var transferLogs = new List<TransferLogEditInput>();
foreach (var entity in entitys)
{
transferLogs.AddRange(BuildTransferLogs(entity));
await SetRequestStatusAsync(entity).ConfigureAwait(false);
}
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
#region 私有 #region 私有
private async Task AddTransactionsAsync(DeliverNote deliverNote) private async Task AddTransactionsAsync(DeliverNote deliverNote)

Loading…
Cancel
Save