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 = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion #endregion
#region 标签信息 #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 = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion #endregion
#region 标签信息 #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 = "单号")] [Display(Name = "单号")]
public string Number { get; set; } public string Number { get; set; }
/// <summary>
/// 单号
/// </summary>
[Display(Name = "单号")]
public string WarehouseCode { get; set; }
#region 物品基础信息 #region 物品基础信息
/// <summary> /// <summary>
@ -99,12 +105,6 @@ public class IntegrationPackingNoteDetailInput : SfsDetailInputBase
[Display(Name = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion #endregion
#region 标签信息 #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 = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion #endregion
#region 标签信息 #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 = "数量")] [Display(Name = "数量")]
public decimal Qty { get; set; } public decimal Qty { get; set; }
/// <summary>
/// 仓库代码
/// </summary>
[Display(Name = "仓库代码")]
public string WarehouseCode { get; set; }
#endregion #endregion
#region 标签信息 #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.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -6,7 +7,9 @@ using IdentityServer4.Models;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Guids; using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata; using Win_in.Sfs.Basedata;
@ -78,38 +81,47 @@ public class IntegrationPackingNoteAppService :
throw new UserFriendlyException($"此物料已经被【任务编号:{outDtos.First().JobNumber}】占用"); 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) foreach (var detailInput in input.Details)
{ {
//库存移动 //库存移动
var transferLogEditInput = var transferLogEditInput =
await BuildTransferLogsAsync(dto, detailInput) await BuildTransferLogsAsync(entity, detailInput)
.ConfigureAwait(false); .ConfigureAwait(false);
transferLogEditInputs.Add(transferLogEditInput); transferLogEditInputs.Add(transferLogEditInput);
} }
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false); await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);
var dto = entity.ToObject<IntegrationPackingNoteDTO>();
return dto; return dto;
} }
/// <summary> /// <summary>
/// 构造 库存转移日志实体 /// 构造 库存转移日志实体
/// </summary> /// </summary>
/// <param name="dto"></param> /// <param name="entity"></param>
/// <param name="detailInput"></param> /// <param name="detailInput"></param>
/// <returns></returns> /// <returns></returns>
private async Task<TransferLogEditInput> BuildTransferLogsAsync( private async Task<TransferLogEditInput> BuildTransferLogsAsync(
IntegrationPackingNoteDTO dto, IntegrationPackingNote entity,
IntegrationPackingNoteDetailInput detailInput) IntegrationPackingNoteDetailInput detailInput)
{ {
var fromLocationDto = await _locationAppService.GetByCodeAsync(detailInput.LocationCode).ConfigureAwait(false); 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 var transferLogEditInput = new TransferLogEditInput
{ {
Worker = dto.Worker, Worker = entity.Worker,
Qty = detailInput.Qty, Qty = detailInput.Qty,
ItemCode = detailInput.ItemCode, ItemCode = detailInput.ItemCode,
FromLocationCode = fromLocationDto.Code, FromLocationCode = fromLocationDto.Code,
@ -122,25 +134,25 @@ public class IntegrationPackingNoteAppService :
ToLocationArea = toLocationDto.AreaCode, ToLocationArea = toLocationDto.AreaCode,
ToLocationGroup = toLocationDto.LocationGroupCode, ToLocationGroup = toLocationDto.LocationGroupCode,
ToWarehouseCode = toLocationDto.WarehouseCode, ToWarehouseCode = toLocationDto.WarehouseCode,
ToPackingCode = dto.PackingCode, ToPackingCode = entity.PackingCode,
Remark = dto.Remark, Remark = entity.Remark,
ArriveDate = dto.ArriveDate, ArriveDate = entity.ArriveDate,
DocNumber = string.Empty, DocNumber = string.Empty,
ExpireDate = dto.ExpireDate, ExpireDate = entity.ExpireDate,
FromContainerCode = detailInput.ContainerCode, FromContainerCode = detailInput.ContainerCode,
FromLot = detailInput.Lot, FromLot = detailInput.Lot,
FromPackingCode = detailInput.PackingCode, FromPackingCode = detailInput.PackingCode,
Uom = detailInput.Uom, Uom = detailInput.Uom,
FromStatus = EnumInventoryStatus.OK, FromStatus = EnumInventoryStatus.OK,
JobNumber = string.Empty, JobNumber = string.Empty,
ItemDesc1 = dto.ItemDesc1, ItemDesc1 = entity.ItemDesc1,
StdPackQty = dto.StdPackQty, StdPackQty = entity.StdPackQty,
TransType = EnumTransType.Transfer, TransType = EnumTransType.Transfer,
ToLot = dto.Lot, ToLot = entity.Lot,
ItemDesc2 = dto.ItemDesc2, ItemDesc2 = entity.ItemDesc2,
ItemName = dto.ItemName, ItemName = entity.ItemName,
ProduceDate = dto.ProduceDate, ProduceDate = entity.ProduceDate,
SupplierBatch = dto.SupplierBatch, SupplierBatch = entity.SupplierBatch,
ToContainerCode = detailInput.ContainerCode, ToContainerCode = detailInput.ContainerCode,
ToStatus = EnumInventoryStatus.OK, ToStatus = EnumInventoryStatus.OK,
TransSubType = EnumTransSubType.Transfer_Integration, 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); transferLogEditInputs.Add(transferLogEditInput);
} }
await _repository.UpdateAsync(entity).ConfigureAwait(false); //await _repository.UpdateAsync(entity).ConfigureAwait(false);
var dto = entity.ToObject<SeparationPackingNoteDTO>(); var dto = entity.ToObject<SeparationPackingNoteDTO>();
await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false); await _transferLogAppService.AddManyAsync(transferLogEditInputs).ConfigureAwait(false);

Loading…
Cancel
Save