Browse Source

三方库增加申请位置单间码和任务单件码保存

dev_DY_CC
周红军 11 months ago
parent
commit
78353b7825
  1. 12
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs
  2. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs
  3. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs
  4. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs
  5. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
  6. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
  7. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestImportInput.cs
  8. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs
  9. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs
  10. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  11. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
  12. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs
  13. 41
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobManager.cs
  14. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
  15. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs
  16. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
  17. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ThirdLocationJobAutoMapperProfile.cs
  18. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs
  19. 78
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs
  20. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  21. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

12
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ThirdLocationJobController.cs

@ -8,6 +8,7 @@ using Polly.Caching;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Domain.Repositories;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
@ -181,6 +182,17 @@ public class ThirdLocationJobController : AbpController
await _thirdLocationJobAppService.CancelAcceptAsync(id).ConfigureAwait(false);
}
/// <summary>
/// 关闭任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("close-job/{id}")]
public virtual async Task CloseJobAsync(Guid id)
{
await _thirdLocationJobAppService.CloseJobAsync(id).ConfigureAwait(false);
}
/// <summary>
/// 执行任务
/// </summary>

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs

@ -55,12 +55,12 @@ public class ThirdLocationJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasT
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 收货单件码
/// </summary>
[Display(Name = "生产线")]
public string ProdLine { get; set; }
[Display(Name = "收货单件码")]
public string SingleCodeJob { get; set; }
/// <summary>
/// 工作中心

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@ -16,6 +17,7 @@ public interface IThirdLocationJobAppService
bool includeDetails = false, CancellationToken cancellationToken = default);
Task<List<ThirdLocationJobDTO>> GetByRequestNumberAsync(string requestNumber);
Task CloseJobAsync(Guid id);
/// <summary>
/// 保存拆箱时涉及的明细修改

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs

@ -67,11 +67,11 @@ public class ThirdLocationJobDetailInput : SfsJobRecommendFromDetailInputBase, I
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 收货单件码
/// </summary>
[Display(Name = "生产线")]
[Display(Name = "收货单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string SingleCodeJob { get; set; }
/// <summary>
/// 工作中心

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs

@ -26,6 +26,12 @@ public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
[Display(Name = "来源库位")]
public string FromLocationCode { get; set; }
/// <summary>
/// 申请单件码
/// </summary>
[Display(Name = "申请单件码")]
public string SingleCodeRequest { get; set; }
/// <summary>
/// 来源库区
/// </summary>

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs

@ -29,11 +29,11 @@ public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase
public string FromLocationArea { get; set; }
/// <summary>
/// 生产线
/// 申请单件码
/// </summary>
[Display(Name = "生产线")]
[Display(Name = "申请单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string SingleCodeRequest { get; set; }
/// <summary>
/// 工作中心

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestImportInput.cs

@ -8,13 +8,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationRequestImportInput : SfsStoreImportInputBase
{
/// <summary>
/// 叫料类型
/// 类型
/// </summary>
[Display(Name = "叫料类型")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "叫料类型")]
[ExporterHeader(DisplayName = "叫料类型")]
[ValueMapping("人工拉动", EnumMaterialRequestType.Issue_Manual)]
[Display(Name = "类型")]
[Required(ErrorMessage = "{0}是必填项")]
public string Type { get; set; }
/// <summary>

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs

@ -52,18 +52,21 @@ public class ThirdLocationJobAppService
}
if(dto.Details.Count==0)
{
throw new UserFriendlyException($"任务错误:编号为【{job.Number} 的任务未包含明细");
throw new UserFriendlyException($"任务错误:编号为【{dto.Number} 的任务未包含明细");
}
else
{
if (dto.Details[0].HandledQty > job.Details[0].RecommendQty)
var jobDetail= job.Details.FirstOrDefault(p => p.ItemCode == dto.Details[0].ItemCode);
if (jobDetail.HandledQty + dto.Details[0].HandledQty > jobDetail.RecommendQty)
{
throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际数量【{dto.Details[0].HandledQty}】不能大于申请数量【{dto.Details[0].RecommendQty}】");
throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际数量【{jobDetail.HandledQty + dto.Details[0].HandledQty}】不能大于申请数量【{dto.Details[0].RecommendQty}】");
}
if(dto.Details[0].ToLocationCode != job.Details[0].ToLocationCode)
if (jobDetail.ToLocationCode != dto.Details[0].ToLocationCode)
{
throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际目标库位【{dto.Details[0].ToLocationCode}】与申请目标库位【{job.Details[0].ToLocationCode}】不一致");
}
throw new UserFriendlyException($"任务错误:编号为【{job.Number}】的实际目标库位【{dto.Details[0].ToLocationCode}】与申请目标库位【{jobDetail.ToLocationCode}】不一致");
}
}
@ -77,6 +80,18 @@ public class ThirdLocationJobAppService
return handleDto;
}
[HttpPost("close-job/{id}")]
public virtual async Task CloseJobAsync(Guid id)
{
var thirdLocationJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (thirdLocationJob == null)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
}
await _thirdLocationJobManager.CloseAsync(thirdLocationJob).ConfigureAwait(false);
}
/// <summary>
/// 根据物品和库位 检查是否存在发料任务
/// </summary>

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/KittingIssueRequests/KittingIssueRequestAppService.cs

@ -73,7 +73,7 @@ public class KittingIssueRequestAppService : SfsStoreRequestAppServiceBase<Kitti
kittingIssueJobDto.JobStatus == EnumJobStatus.Wait)
{
await _kittingIssueJobAppService.CancelAsync(kittingIssueJobDto.Id).ConfigureAwait(false);
}
}
}
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs

@ -187,6 +187,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
detail.StdPackQty = itemBasicDto.StdPackQty;
}
var result = await _thirdLocationRequestManager.CreateAsync(entity).ConfigureAwait(false);
@ -217,6 +218,10 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
{
await _thirdLocationJobAppService.CancelAsync(thirdLocationJobDto.Id).ConfigureAwait(false);
}
else
{
throw new UserFriendlyException($"【{thirdLocationJobDto.JobStatus.GetDisplayName()}】状态不允许取消");
}
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs

@ -48,7 +48,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2)
.Ignore(x => x.ProdLine)
.Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.WorkStation)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.IssuedQty)

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs

@ -47,9 +47,9 @@ public class ThirdLocationJobDetail : SfsJobRecommendFromDetailEntityBase, IHasT
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 收货单件码
/// </summary>
public string ProdLine { get; set; }
public string SingleCodeJob { get; set; }
/// <summary>
/// 工作中心

41
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobManager.cs

@ -20,7 +20,7 @@ public class ThirdLocationJobManager : SfsJobManagerBase<ThirdLocationJob, Third
}
/// <summary>
/// 执行任务 发料任务
/// 执行三方库任务
/// </summary>
/// <param name="id"></param>
/// <param name="input"></param>
@ -32,7 +32,7 @@ public class ThirdLocationJobManager : SfsJobManagerBase<ThirdLocationJob, Third
foreach (var detail in input.Details)
{
//发料子任务 赋值实际转移
//赋值实际收货
await entity.BuildDetail(detail.Id,
detail.HandledFromLocationCode,
detail.HandledFromLocationErpCode,
@ -47,7 +47,42 @@ public class ThirdLocationJobManager : SfsJobManagerBase<ThirdLocationJob, Third
detail.HandledPackingCode).ConfigureAwait(false);
}
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
bool isDone = false;
var jobDetail = entity.Details.FirstOrDefault(p => p.ItemCode == entity.Details[0].ItemCode);
if (jobDetail.RecommendQty == jobDetail.HandledQty + input.Details[0].HandledQty)
{
jobDetail.HandledQty += input.Details[0].HandledQty;
isDone = true;
}
else
{
jobDetail.HandledQty = input.Details[0].HandledQty;
isDone = false;
}
foreach (var item in entity.Details.FindAll(p => p.ItemCode != entity.Details[0].ItemCode))
{
if (item.RecommendQty == item.HandledQty)
{
isDone = true;
}
else
{
isDone = false;
}
}
if (isDone)
{
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
else
{
entity.JobStatus = EnumJobStatus.Partial;
await PublishCompletedAsync(input).ConfigureAwait(false);
return await Repository.UpdateAsync(entity).ConfigureAwait(false);
}
}
public override void CheckDetails(ThirdLocationJob entity, AbpValidationResult result)

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs

@ -53,9 +53,9 @@ public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasT
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 申请单件码
/// </summary>
public string ProdLine { get; set; }
public string SingleCodeRequest { get; set; }
/// <summary>
/// 工作中心

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs

@ -50,7 +50,7 @@ public static class ThirdLocationJobDbContextModelCreatingExtensions
b.Property(q => q.ToLocationGroup).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationArea).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SingleCodeJob).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs

@ -50,7 +50,7 @@ public static class ThirdLocationRequestDbContextModelCreatingExtensions
b.Property(q => q.FromLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.OnTheWayLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SingleCodeRequest).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.IssuedQty).HasPrecision(18, 6);
b.Property(q => q.ReceivedQty).HasPrecision(18, 6);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ThirdLocationJobAutoMapperProfile.cs

@ -44,6 +44,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(d => d.ToLocationCode))
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ProdLine)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ToLocationErpCode)
;
@ -87,6 +88,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.Ignore(x => x.ProdLine)
;
}
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs

@ -61,6 +61,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CreateMap<ThirdLocationRequestDetail, ThirdLocationJobDetailInput>()
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.RecommendFromLocationArea)
.Ignore(x => x.RecommendFromLocationGroup)
.Ignore(x => x.HandledFromLocationArea)
@ -126,7 +127,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.HandledFromWarehouseCode)
.Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.ProdLine)
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.WorkStation)
.Ignore(x => x.HandledContainerCode)
.Ignore(x => x.HandledExpireDate)
@ -150,7 +151,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.DeliveryQty)
.Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.ProdLine)
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.WorkStation)
.Ignore(x => x.PositionCode)
.Ignore(x => x.RecommendType)

78
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs

@ -7,6 +7,7 @@ using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -15,17 +16,21 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessJob;
public class ThirdLocationJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>>,ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationJob>>
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>>,ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationJob>>, ILocalEventHandler<SfsClosedEntityEventData<ThirdLocationJob>>
{
private const EnumTransType TransType = EnumTransType.Issue;
private readonly IThirdLocationNoteAppService _thirdLocationNoteAppService;
private readonly ILocationAppService _locationAppService;
private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
private readonly ITransferLogAppService _transferLogAppService;
public ThirdLocationJobEventHandler(IThirdLocationNoteAppService thirdLocationNoteAppService, ILocationAppService locationAppService)
public ThirdLocationJobEventHandler(IThirdLocationNoteAppService thirdLocationNoteAppService, ITransferLogAppService transferLogAppService, IThirdLocationRequestManager thirdLocationRequestManager, ILocationAppService locationAppService)
{
_thirdLocationNoteAppService = thirdLocationNoteAppService;
_locationAppService = locationAppService;
_thirdLocationRequestManager = thirdLocationRequestManager;
_transferLogAppService = transferLogAppService;
}
/// <summary>
@ -104,6 +109,75 @@ public class ThirdLocationJobEventHandler :
}
/// <summary>
/// 关闭任务后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsClosedEntityEventData<ThirdLocationJob> eventData)
{
var entity = eventData.Entity;
if (!string.IsNullOrEmpty(entity.RequestNumber))
{
var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(await BuildCancelTransferLogsAsync(thirdLocationRequest).ConfigureAwait(false));
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
thirdLocationRequest.RequestStatus = EnumRequestStatus.Abort;
await _thirdLocationRequestManager.UpdateAsync(thirdLocationRequest).ConfigureAwait(false);
}
}
private async Task<List<TransferLogEditInput>> BuildCancelTransferLogsAsync(ThirdLocationRequest thirdLocationRequest)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in thirdLocationRequest.Details.Where(detail => detail.IssuedQty-detail.ReceivedQty != 0))
{
var transferLog = ObjectMapper.Map<ThirdLocationRequestDetail, TransferLogEditInput>(detail);
LocationDTO fromLocationDTO = null;
LocationDTO toLocationDTO = null;
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
transferLog.FromLocationCode = fromLocationDTO.Code;
transferLog.FromLocationArea = fromLocationDTO.AreaCode;
transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
transferLog.FromWarehouseCode = fromLocationDTO.WarehouseCode;
transferLog.ToLocationCode = toLocationDTO.Code;
transferLog.ToLocationArea = toLocationDTO.AreaCode;
transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
transferLog.ToWarehouseCode = toLocationDTO.WarehouseCode;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(thirdLocationRequest.Type);
transferLog.TransType = TransType;
transferLog.DocNumber = thirdLocationRequest.Number;
transferLog.JobNumber = "";
transferLog.Qty = detail.IssuedQty - detail.ReceivedQty;
transferLog.FromPackingCode = "";
transferLog.FromLot = "";
transferLog.ToPackingCode = "";
transferLog.ToLot = "";
transferLog.FromStatus = EnumInventoryStatus.OK;
transferLog.ToStatus = EnumInventoryStatus.OK;
transferLogs.Add(transferLog);
}
return transferLogs;
}
/// <summary>
/// 去除箱码 托码 批次
/// </summary>

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs

@ -381,9 +381,7 @@ public class ThirdLocationRequestEventHandler
private async Task<ThirdLocationJobDetailInput> BuildThirdLocationJobDetailAsync(ThirdLocationRequestDetail thirdLocationRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance);
detail.WorkStation = thirdLocationRequestDetail.WorkStation;
@ -427,12 +425,9 @@ public class ThirdLocationRequestEventHandler
else
{
throw new UserFriendlyException($"未获取到在途库代码");
}
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.ProdLine = toLocationGroupCode;
}
await Task.CompletedTask.ConfigureAwait(false);
return detail;

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

@ -51,27 +51,39 @@ public class ThirdLocationNoteEventHandler
{
//var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
var entities = await _ThirdLocationRequestRepository.GetListAsync(p => p.Number == entity.RequestNumber, "Number", true).ConfigureAwait(false);
if(entities.Count>0)
var requestEntities = await _ThirdLocationRequestRepository.GetListAsync(p => p.Number == entity.RequestNumber, "Number", true).ConfigureAwait(false);
if(requestEntities.Count>0 && entity.Details.Count>0)
{
foreach (var item in entities[0].Details)
bool isDone = false;
var requestDetail = requestEntities[0].Details.FirstOrDefault(p => p.ItemCode == entity.Details[0].ItemCode);
if(requestDetail != null)
{
//item.IssuedQty = entity.Details[0].RecommendQty;
item.ReceivedQty = entity.Details[0].HandledQty;
}
foreach(var item in entity.Details)
requestDetail.ReceivedQty += entity.Details[0].HandledQty;
if(requestDetail.IssuedQty == requestDetail.ReceivedQty)
{
isDone = true;
}
}
foreach(var item in requestEntities[0].Details.FindAll(p=>p.ItemCode!= entity.Details[0].ItemCode))
{
if(item.Qty == item.HandledQty)
if(item.IssuedQty == item.ReceivedQty)
{
await _thirdLocationRequestManager.CompleteAsync(entities[0]).ConfigureAwait(false);
isDone = true;
}
else
{
await _thirdLocationRequestManager.UpdateAsync(entities[0]).ConfigureAwait(false);
isDone = false;
}
}
if (isDone)
{
await _thirdLocationRequestManager.CompleteAsync(requestEntities[0]).ConfigureAwait(false);
}
else
{
await _thirdLocationRequestManager.UpdateAsync(requestEntities[0]).ConfigureAwait(false);
}
}

Loading…
Cancel
Save