Browse Source

修改 合箱

Agv分支2024-11-19
郑勃旭 4 months ago
parent
commit
ab70f3071b
  1. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/DTOs/IntegrationPackingNoteDTO.cs
  2. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/DTOs/IntegrationPackingNoteDetailDTO.cs
  3. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteDetailInput.cs
  4. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteEditInput.cs
  5. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteImportInput.cs
  6. 46
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs
  7. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/SeparationPackingNotes/SeparationPackingNoteAppService.cs

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/DTOs/IntegrationPackingNoteDTO.cs

@ -94,12 +94,6 @@ public class IntegrationPackingNoteDTO : SfsStoreDTOBase<IntegrationPackingNoteD
[Display(Name = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion
#region 标签信息

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/DTOs/IntegrationPackingNoteDetailDTO.cs

@ -93,12 +93,6 @@ public class IntegrationPackingNoteDetailDTO : SfsDetailDTOBase
[Display(Name = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion
#region 标签信息

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteDetailInput.cs

@ -15,6 +15,12 @@ public class IntegrationPackingNoteDetailInput : SfsDetailInputBase
[Display(Name = "单号")]
public string Number { get; set; }
/// <summary>
/// 单号
/// </summary>
[Display(Name = "单号")]
public string WarehouseCode { get; set; }
#region 物品基础信息
/// <summary>
@ -99,12 +105,6 @@ public class IntegrationPackingNoteDetailInput : SfsDetailInputBase
[Display(Name = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion
#region 标签信息

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteEditInput.cs

@ -98,12 +98,6 @@ public class IntegrationPackingNoteEditInput : SfsStoreCreateOrUpdateInputBase
[Display(Name = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion
#region 标签信息

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/OperationPacking/IntegrationPackingNotes/Inputs/IntegrationPackingNoteImportInput.cs

@ -91,12 +91,6 @@ public class IntegrationPackingNoteImportInput : SfsStoreImportInputBase
[Display(Name = "数量")]
public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion
#region 标签信息

46
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/IntegrationPackingNotes/IntegrationPackingNoteAppService.cs

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -6,7 +7,9 @@ using IdentityServer4.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata;
@ -78,38 +81,47 @@ public class IntegrationPackingNoteAppService :
throw new UserFriendlyException($"此物料已经被【任务编号:{outDtos.First().JobNumber}】占用");
}
var dto = await base.CreateAsync(input).ConfigureAwait(false);
var entity = input.ToObject<IntegrationPackingNote>();
var number = await GenerateNumberAsync(nameof(IntegrationPackingNote), Clock.Now).ConfigureAwait(false);
entity.Number = number;
entity.SetId(GuidGenerator.Create());
entity.SetIdAndNumberWithDetails(GuidGenerator, entity.Number);
entity.WarehouseCode = string.Empty;
entity.Details.ForEach(p=>p.WarehouseCode=string.Empty);
entity = await _repository.InsertAsync(entity).ConfigureAwait(false);
foreach (var detailInput in input.Details)
{
//库存移动
var transferLogEditInput =
await BuildTransferLogsAsync(dto, detailInput)
await BuildTransferLogsAsync(entity, detailInput)
.ConfigureAwait(false);
transferLogEditInputs.Add(transferLogEditInput);
}
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);
var dto = entity.ToObject<IntegrationPackingNoteDTO>();
return dto;
}
/// <summary>
/// 构造 库存转移日志实体
/// </summary>
/// <param name="dto"></param>
/// <param name="entity"></param>
/// <param name="detailInput"></param>
/// <returns></returns>
private async Task<TransferLogEditInput> BuildTransferLogsAsync(
IntegrationPackingNoteDTO dto,
IntegrationPackingNote entity,
IntegrationPackingNoteDetailInput detailInput)
{
var fromLocationDto = await _locationAppService.GetByCodeAsync(detailInput.LocationCode).ConfigureAwait(false);
var toLocationDto = await _locationAppService.GetByCodeAsync(dto.LocationCode).ConfigureAwait(false);
var toLocationDto = await _locationAppService.GetByCodeAsync(entity.LocationCode).ConfigureAwait(false);
var transferLogEditInput = new TransferLogEditInput
{
Worker = dto.Worker,
Worker = entity.Worker,
Qty = detailInput.Qty,
ItemCode = detailInput.ItemCode,
FromLocationCode = fromLocationDto.Code,
@ -122,25 +134,25 @@ public class IntegrationPackingNoteAppService :
ToLocationArea = toLocationDto.AreaCode,
ToLocationGroup = toLocationDto.LocationGroupCode,
ToWarehouseCode = toLocationDto.WarehouseCode,
ToPackingCode = dto.PackingCode,
Remark = dto.Remark,
ArriveDate = dto.ArriveDate,
ToPackingCode = entity.PackingCode,
Remark = entity.Remark,
ArriveDate = entity.ArriveDate,
DocNumber = string.Empty,
ExpireDate = dto.ExpireDate,
ExpireDate = entity.ExpireDate,
FromContainerCode = detailInput.ContainerCode,
FromLot = detailInput.Lot,
FromPackingCode = detailInput.PackingCode,
Uom = detailInput.Uom,
FromStatus = EnumInventoryStatus.OK,
JobNumber = string.Empty,
ItemDesc1 = dto.ItemDesc1,
StdPackQty = dto.StdPackQty,
ItemDesc1 = entity.ItemDesc1,
StdPackQty = entity.StdPackQty,
TransType = EnumTransType.Transfer,
ToLot = dto.Lot,
ItemDesc2 = dto.ItemDesc2,
ItemName = dto.ItemName,
ProduceDate = dto.ProduceDate,
SupplierBatch = dto.SupplierBatch,
ToLot = entity.Lot,
ItemDesc2 = entity.ItemDesc2,
ItemName = entity.ItemName,
ProduceDate = entity.ProduceDate,
SupplierBatch = entity.SupplierBatch,
ToContainerCode = detailInput.ContainerCode,
ToStatus = EnumInventoryStatus.OK,
TransSubType = EnumTransSubType.Transfer_Integration,

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/OperationPacking/SeparationPackingNotes/SeparationPackingNoteAppService.cs

@ -182,7 +182,7 @@ public class SeparationPackingNoteAppService :
transferLogEditInputs.Add(transferLogEditInput);
}
await _repository.UpdateAsync(entity).ConfigureAwait(false);
//await _repository.UpdateAsync(entity).ConfigureAwait(false);
var dto = entity.ToObject<SeparationPackingNoteDTO>();
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);

Loading…
Cancel
Save