Browse Source

修改 三方库

dev_DY_CC
郑勃旭 11 months ago
parent
commit
33f014d4f7
  1. 112
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs
  2. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/IThirdLocationJobAppService.cs
  3. 122
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs
  4. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/IThirdLocationNoteAppService.cs
  5. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/IThirdLocationRequestAppService.cs
  6. 101
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
  7. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs
  8. 261
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ThirdLocationJobs/ThirdLocationJobAppService.cs
  9. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAppService.cs
  10. 197
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  11. 59
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
  12. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestManager.cs
  13. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
  14. 46
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ThirdLocationJobAutoMapperProfile.cs
  15. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/ThirdLocationNoteAutoMapperProfile.cs
  16. 80
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs
  17. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs
  18. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs
  19. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  20. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs
  21. 4
      build/src/docker/publish/conf/settings/appsettings.Development.json

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

@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -7,112 +8,121 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasToLocation
{
/// <summary>
/// 来源库位
/// 发出时间
/// </summary>
[Display(Name = "来源库位")]
public string FromLocationCode { get; set; }
public DateTime IssueTime { get; set; }
/// <summary>
/// 来源库区
/// 是否在在途
/// </summary>
[Display(Name = "来源库区")]
public string FromLocationArea { get; set; }
public bool IsOnTheWayLocationCode { get; set; }
#region 目标库位
/// <summary>
/// 到库位
/// 到库位
/// </summary>
[Display(Name = "到库位")]
public string ToLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
public string ToWarehouseCode { get; set; }
#endregion
#region 来源库位
/// <summary>
/// 在途库库位
/// 库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
public string FromLocationCode { get; set; }
/// <summary>
/// 收货单件码
/// 到库区
/// </summary>
[Display(Name = "收货单件码")]
public string SingleCodeJob { get; set; }
public string FromLocationArea { get; set; }
/// <summary>
/// 申请单件码
/// 到库位组
/// </summary>
[Display(Name = "申请单件码")]
public string SingleCodeRequest { get; set; }
public string FromLocationGroup { get; set; }
/// <summary>
/// 过期时间
/// 到ERP库位
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string FromLocationErpCode { get; set; }
/// <summary>
/// 工序
/// 到仓库
/// </summary>
[Display(Name = "工序")]
public string Operation { get; set; }
public string FromWarehouseCode { get; set; }
#endregion
#region 在途库位
/// <summary>
/// 配送方式
/// 在途库库位
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string OnTheWayLocationCode { get; set; }
#endregion
/// <summary>
/// 取整方式
/// 申请单件码
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public string SingleCodeRequest { get; set; }
/// <summary>
/// 取整后数量
/// 已发数量
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public decimal IssuedQty { get; set; }
/// <summary>
/// 计划拆分规则
/// 已收数量
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public decimal ReceivedQty { get; set; }
/// <summary>
/// 箱码
/// </summary>
public string PackingCode { get; set; }
/// <summary>
/// 批次
/// </summary>
public string Lot { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public DateTime ExpiredTime { get; set; }
/// <summary>
/// 计划开始时间
/// 库位状态
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public EnumInventoryStatus EnumInventoryStatus { get; set; }
/// <summary>
/// 每次配送数量
/// 请求未收
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
[NotMapped]
public decimal NotFinishQty => IssuedQty - ReceivedQty;
}

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

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@ -9,4 +9,18 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IThirdLocationJobAppService
: ISfsJobAppServiceBase<ThirdLocationJobDTO, SfsJobRequestInputBase, ThirdLocationJobCheckInput, ThirdLocationJobEditInput>
{
/// <summary>
/// 执行任务明细
/// </summary>
/// <returns></returns>
Task ExecuteDetailAsync(Guid masterId,List<ThirdLocationJobDetailDTO> detailDto);
Task<List<ThirdLocationJobDTO>> GetByRequestNumberAsync(string requestNumber);
/// <summary>
/// 完成任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task CompleteAsync(Guid id);
}

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

@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -7,136 +8,121 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLocation
{
/// <summary>
/// 来源库位
/// 发出时间
/// </summary>
[Display(Name = "来源库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string FromLocationCode { get; set; }
public DateTime IssueTime { get; set; }
/// <summary>
/// 来源库区
/// 是否在在途
/// </summary>
[Display(Name = "来源库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string FromLocationArea { get; set; }
public bool IsOnTheWayLocationCode { get; set; }
#region 目标库位
/// <summary>
/// 到库位
/// 到库位
/// </summary>
[Display(Name = "到库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToWarehouseCode { get; set; }
#endregion
#region 来源库位
/// <summary>
/// 在途库库位
/// 库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
public string FromLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
public string FromLocationArea { get; set; }
/// <summary>
/// 收货单件码
/// 到库位组
/// </summary>
[Display(Name = "收货单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SingleCodeJob { get; set; }
public string FromLocationGroup { get; set; }
/// <summary>
/// 申请单件码
/// 到ERP库位
/// </summary>
[Display(Name = "申请单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SingleCodeRequest { get; set; }
public string FromLocationErpCode { get; set; }
/// <summary>
/// 过期时间
/// 到仓库
/// </summary>
[Display(Name = "过期时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime ExpiredTime { get; set; }
public string FromWarehouseCode { get; set; }
#endregion
#region 在途库位
/// <summary>
/// 工序
/// 在途库库位
/// </summary>
[Display(Name = "工序")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Operation { get; set; }
public string OnTheWayLocationCode { get; set; }
#endregion
/// <summary>
/// 配送方式
/// 申请单件码
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string SingleCodeRequest { get; set; }
/// <summary>
/// 取整方式
/// 已发数量
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public decimal IssuedQty { get; set; }
/// <summary>
/// 取整后数量
/// 已收数量
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public decimal ReceivedQty { get; set; }
/// <summary>
/// 计划拆分规则
/// 箱码
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public string PackingCode { get; set; }
/// <summary>
/// 计划开始时间
/// 批次
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public string Lot { get; set; }
/// <summary>
/// 每次配送数量
/// 过期时间
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
public DateTime ExpiredTime { get; set; }
/// <summary>
/// 位置码
/// 库位状态
/// </summary>
public string PositionCode { get; set; }
public EnumInventoryStatus EnumInventoryStatus { get; set; }
/// <summary>
/// 推荐类型
/// 请求未收
/// </summary>
public EnumRecommendType RecommendType { get; set; }
[NotMapped]
public decimal NotFinishQty => IssuedQty - ReceivedQty;
}

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ThirdLocationNotes/IThirdLocationNoteAppService.cs

@ -3,10 +3,16 @@ using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IThirdLocationNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<ThirdLocationNoteDTO, SfsStoreRequestInputBase, ThirdLocationNoteDetailDTO, SfsStoreRequestInputBase>
{
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
Task<ThirdLocationNote> CreateByNumberAsync(ThirdLocationNoteEditInput input);
}

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

@ -9,5 +9,5 @@ public interface IThirdLocationRequestAppService
: ISfsStoreRequestMasterAppServiceBase<ThirdLocationRequestDTO, SfsStoreRequestInputBase, ThirdLocationRequestEditInput, ThirdLocationRequestDetailDTO, SfsStoreRequestInputBase>
{
Task UpdateRequestStatusAsync(string requestNumber);
}

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

@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -7,81 +8,111 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase
{
#region 目标库位
/// <summary>
/// 目标库位
/// 库位
/// </summary>
[Display(Name = "目标库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位
/// 到库区
/// </summary>
public string ToLocationArea { get; set; }
/// <summary>
/// 到库位组
/// </summary>
public string ToLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string ToLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string ToWarehouseCode { get; set; }
#endregion
#region 来源库位
/// <summary>
/// 到库位
/// </summary>
[Display(Name = "来源库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string FromLocationCode { get; set; }
/// <summary>
/// 来源库区
/// 库区
/// </summary>
[Display(Name = "来源库区")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string FromLocationArea { get; set; }
/// <summary>
/// 申请单件码
/// 到库位组
/// </summary>
[Display(Name = "申请单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SingleCodeRequest { get; set; }
public string FromLocationGroup { get; set; }
/// <summary>
/// 工作中心
/// 到ERP库位
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public string FromLocationErpCode { get; set; }
/// <summary>
/// 过期时间
/// 到仓库
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string FromWarehouseCode { get; set; }
#endregion
#region 在途库位
/// <summary>
/// 状态
/// 在途库库位
/// </summary>
[Display(Name = "状态")]
public EnumRequestStatus RequestStatus { get; set; } = EnumRequestStatus.New;
public string OnTheWayLocationCode { get; set; }
#endregion
/// <summary>
/// ERP储位
/// 申请单件码
/// </summary>
[Display(Name = "ERP储位")]
public string ToLocationErpCode { get; set; }
public string SingleCodeRequest { get; set; }
/// <summary>
/// 已发数量
/// 已发数量
/// </summary>
[Display(Name = "已发数量")]
public decimal IssuedQty { get; set; }
/// <summary>
/// 已收数量
/// 已收数量
/// </summary>
[Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; }
/// <summary>
/// 位置
///
/// </summary>
public string PositionCode { get; set; }
public string PackingCode { get; set; }
/// <summary>
/// 推荐类型
/// 批次
/// </summary>
public EnumRecommendType RecommendType { get; set; }
public string Lot { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public DateTime ExpiredTime { get; set; }
/// <summary>
/// 库位状态
/// </summary>
public EnumInventoryStatus EnumInventoryStatus { get; set; }
/// <summary>
/// 请求未收
/// </summary>
[NotMapped]
public decimal NotFinishQty => IssuedQty - ReceivedQty;
}

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs

@ -6,41 +6,15 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ThirdLocationRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
{
#region Base
/// <summary>
/// 申请单件码
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SingleCodeRequest { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
#endregion
#region Create
/// <summary>
/// 要货单号
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Number { get; set; }
/// <summary>
/// 叫料类型
/// 三方库申请类型
/// </summary>
[Display(Name = "叫料类型")]
[Display(Name = "三方库申请类型")]
public string Type { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<ThirdLocationRequestDetailInput> Details { get; set; } = new List<ThirdLocationRequestDetailInput>();
#endregion
}

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

@ -4,6 +4,8 @@ using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using IdentityServer4.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
@ -12,10 +14,13 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
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.Inventory.Domain;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -29,12 +34,264 @@ public class ThirdLocationJobAppService
IThirdLocationJobAppService
{
private readonly IThirdLocationJobManager _thirdLocationJobManager;
private readonly ITransferLogAppService _transferLogAppService;
private readonly ILocationAppService _locationAppService;
private readonly IThirdLocationNoteAppService _thirdLocationNoteAppService;
protected IThirdLocationRequestAppService ThirdLocationRequestAppService =>
LazyServiceProvider.LazyGetRequiredService<IThirdLocationRequestAppService>();
public ThirdLocationJobAppService(
IThirdLocationJobRepository repository, IThirdLocationJobManager thirdLocationJobManager
) : base(repository, thirdLocationJobManager)
IThirdLocationJobRepository repository, IThirdLocationJobManager thirdLocationJobManager,
ITransferLogAppService transferLogAppService, ILocationAppService locationAppService, IThirdLocationNoteAppService thirdLocationNoteAppService) : base(repository, thirdLocationJobManager)
{
_thirdLocationJobManager = thirdLocationJobManager;
_transferLogAppService = transferLogAppService;
_locationAppService = locationAppService;
_thirdLocationNoteAppService = thirdLocationNoteAppService;
}
[HttpPost("")]
public override async Task<ThirdLocationJobDTO> CreateAsync(ThirdLocationJobEditInput input)
{
input.JobStatus = EnumJobStatus.Open;
var result = await base.CreateAsync(input).ConfigureAwait(false);
var buildTransferLogsAsync = await BuildTransferLogsByToTransportAsync(result).ConfigureAwait(false);
await AddTransferLogsAsync(buildTransferLogsAsync).ConfigureAwait(false);
return result;
}
[HttpPost("add-many")]
public override async Task<List<ThirdLocationJobDTO>> CreateManyAsync(List<ThirdLocationJobEditInput> inputs)
{
var thirdLocationJobDtos = new List<ThirdLocationJobDTO>();
foreach (var input in inputs)
{
thirdLocationJobDtos.Add(await CreateAsync(input).ConfigureAwait(false));
}
return thirdLocationJobDtos;
}
/// <summary>
/// 执行任务明细
/// </summary>
/// <returns></returns>
[HttpPost("ExecuteDetail/{masterId}")]
public async Task ExecuteDetailAsync(Guid masterId,List<ThirdLocationJobDetailDTO> detailDtoList)
{
var thirdLocationJob=await _repository.GetAsync(masterId).ConfigureAwait(false);
thirdLocationJob.JobStatus = EnumJobStatus.Partial;
var tempDetailDto= new List<ThirdLocationJobDetailDTO>();
var entityList=ObjectMapper.Map<List<ThirdLocationJobDetail>, List<ThirdLocationJobDetailDTO>>(thirdLocationJob.Details);
foreach (var detailDto in detailDtoList)//为了不用DTO的赋值
{
var jobDetailDto=entityList.First(p => p.Id == detailDto.Id);
jobDetailDto.HandledQty = detailDto.HandledQty;
jobDetailDto.RecommendQty = detailDto.RecommendQty;
tempDetailDto.Add(jobDetailDto);
thirdLocationJob.Details.First(p => p.Id == detailDto.Id).ReceivedQty += detailDto.HandledQty;
}
var transferLogs = await BuildTransferLogsByFromTransportAsync(thirdLocationJob, tempDetailDto).ConfigureAwait(false);
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
var jobDto=await GetAsync(masterId).ConfigureAwait(false);
var tempDetailDtos = new List<ThirdLocationJobDetailDTO>();
foreach (var detailDto in detailDtoList)
{
var temp=jobDto.Details.First(p => p.Id == detailDto.Id);
temp.HandledQty=detailDto.HandledQty;
temp.RecommendQty = detailDto.RecommendQty;
tempDetailDtos.Add(temp);
}
jobDto.Details = tempDetailDtos;
var input =await BuildThirdLocationNoteAsync(jobDto).ConfigureAwait(false);
var noteDto = await _thirdLocationNoteAppService.CreateByNumberAsync(input).ConfigureAwait(false);
await UpdateJobStatusAsync(thirdLocationJob).ConfigureAwait(false);
await _repository.UpdateAsync(thirdLocationJob).ConfigureAwait(false);
}
/// <summary>
/// 完成任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("Complete/{id}")]
public async Task CompleteAsync(Guid id)
{
var kittingIssueJob = await _repository.FindAsync(id).ConfigureAwait(false);
kittingIssueJob.JobStatus = EnumJobStatus.Done;
var entity=await _repository.UpdateAsync(kittingIssueJob).ConfigureAwait(false);
var dto=ObjectMapper.Map<ThirdLocationJob, ThirdLocationJobDTO>(entity);
var transferLogEditInputs=await BuildTransferLogsByBackFromAsync(dto).ConfigureAwait(false);
await AddTransferLogsAsync(transferLogEditInputs).ConfigureAwait(false);
await ThirdLocationRequestAppService.UpdateRequestStatusAsync(kittingIssueJob.RequestNumber).ConfigureAwait(false);
}
[HttpPost("Get-By-Request-Number")]
public async Task<List<ThirdLocationJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var list=await _repository.GetListAsync(p => p.RequestNumber == requestNumber).ConfigureAwait(false);
return ObjectMapper.Map<List<ThirdLocationJob>, List<ThirdLocationJobDTO>>(list);
}
#region 私有
private async Task UpdateJobStatusAsync(ThirdLocationJob thirdLocationJob)
{
var flag = true;
foreach (var detail in thirdLocationJob.Details)
{
if (detail.IssuedQty > detail.ReceivedQty)
{
flag = false;
break;
}
}
if (flag)
{
thirdLocationJob.JobStatus = EnumJobStatus.Done;
}
await _repository.UpdateAsync(thirdLocationJob).ConfigureAwait(false);
await ThirdLocationRequestAppService.UpdateRequestStatusAsync(thirdLocationJob.RequestNumber).ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
}
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList)
{
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(inputList);
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<ThirdLocationNoteEditInput> BuildThirdLocationNoteAsync(ThirdLocationJobDTO jobDto)
{
await Task.CompletedTask.ConfigureAwait(false);
return ObjectMapper.Map<ThirdLocationJobDTO, ThirdLocationNoteEditInput>(jobDto);
}
/// <summary>
/// 创建库移 从from到在途
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
private async Task<List<TransferLogEditInput>> BuildTransferLogsByToTransportAsync(ThirdLocationJobDTO dto)
{
//获取在途库
var transportLocation =await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var transferLog = new List<TransferLogEditInput>();
foreach (var detailDto in dto.Details)
{
var transferLogEditInput = ObjectMapper.Map<ThirdLocationJobDetailDTO, TransferLogEditInput>(detailDto);
transferLogEditInput.TransType = EnumTransType.Transfer;
transferLogEditInput.DocNumber = dto.Number;
transferLogEditInput.JobNumber = dto.Number;
transferLogEditInput.Remark = $"目标库位:{detailDto.ToLocationCode.Clone()}";
transferLogEditInput.ToLocationCode = transportLocation.Code;
transferLogEditInput.ToLocationErpCode = transportLocation.ErpLocationCode;
transferLogEditInput.ToLocationArea = transportLocation.AreaCode;
transferLogEditInput.ToLocationGroup = transportLocation.LocationGroupCode;
transferLogEditInput.ToWarehouseCode = transportLocation.WarehouseCode;
transferLog.Add(transferLogEditInput);
}
await Task.CompletedTask.ConfigureAwait(false);
return transferLog;
}
/// <summary>
/// 创建库移 从在途到To
/// </summary>
/// <param name="entity"></param>
/// <param name="detailDtos"></param>
/// <returns></returns>
private async Task<List<TransferLogEditInput>> BuildTransferLogsByFromTransportAsync(ThirdLocationJob entity, List<ThirdLocationJobDetailDTO> detailDtos)
{
//获取在途库
var transportLocation =await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var transferLog = new List<TransferLogEditInput>();
foreach (var detail in entity.Details)
{
var transferLogEditInput = ObjectMapper.Map<ThirdLocationJobDetail, TransferLogEditInput>(detail);
transferLogEditInput.TransType = EnumTransType.Transfer;
transferLogEditInput.DocNumber = entity.Number;
transferLogEditInput.JobNumber = entity.Number;
transferLogEditInput.Remark = $"来源库位:{detail.FromLocationCode.Clone()}";
transferLogEditInput.FromLocationCode = transportLocation.Code;
transferLogEditInput.FromLocationErpCode = transportLocation.ErpLocationCode;
transferLogEditInput.FromLocationArea = transportLocation.AreaCode;
transferLogEditInput.FromLocationGroup = transportLocation.LocationGroupCode;
transferLogEditInput.FromWarehouseCode = transportLocation.WarehouseCode;
transferLogEditInput.Qty = detailDtos.First(p => p.Id == detail.Id).HandledQty;
transferLog.Add(transferLogEditInput);
}
await Task.CompletedTask.ConfigureAwait(false);
return transferLog;
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsByBackFromAsync(ThirdLocationJobDTO dto)
{
//获取在途库
var transportLocation = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var transferLog = new List<TransferLogEditInput>();
foreach (var detailDto in dto.Details)
{
var transferLogEditInput = ObjectMapper.Map<ThirdLocationJobDetailDTO, TransferLogEditInput>(detailDto);
transferLogEditInput.TransType = EnumTransType.Transfer;
transferLogEditInput.DocNumber = dto.Number;
transferLogEditInput.JobNumber = dto.Number;
transferLogEditInput.FromLocationCode = transportLocation.Code;
transferLogEditInput.FromLocationErpCode = transportLocation.ErpLocationCode;
transferLogEditInput.FromLocationArea = transportLocation.AreaCode;
transferLogEditInput.FromLocationGroup = transportLocation.LocationGroupCode;
transferLogEditInput.FromWarehouseCode = transportLocation.WarehouseCode;
transferLogEditInput.ToLocationCode = detailDto.FromLocationCode;
transferLogEditInput.ToLocationErpCode = detailDto.FromLocationErpCode;
transferLogEditInput.ToLocationArea = detailDto.FromLocationArea;
transferLogEditInput.ToLocationGroup = detailDto.FromLocationGroup;
transferLogEditInput.ToWarehouseCode = detailDto.ToWarehouseCode;
transferLogEditInput.Qty = detailDto.IssuedQty - detailDto.ReceivedQty;
transferLog.Add(transferLogEditInput);
}
await Task.CompletedTask.ConfigureAwait(false);
return transferLog;
}
#endregion
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ThirdLocationNotes/ThirdLocationNoteAppService.cs

@ -9,7 +9,9 @@ using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
@ -33,4 +35,25 @@ public class ThirdLocationNoteAppService :
{
_thirdLocationNoteManager = thirdLocationNoteManager;
}
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost("Create-By-Number")]
public virtual async Task<ThirdLocationNote> CreateByNumberAsync(ThirdLocationNoteEditInput input)
{
var entity=ObjectMapper.Map<ThirdLocationNoteEditInput, ThirdLocationNote>(input);
var number = string.IsNullOrEmpty(entity.Number)
? await GenerateNumberAsync(nameof(AssembleIssueRequest), entity.ActiveDate).ConfigureAwait(false)
: entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
await _repository.InsertAsync(entity, true).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsCreatedEntityEventData<ThirdLocationNote>(entity), false)
.ConfigureAwait(false);
return entity;
}
}

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

@ -5,6 +5,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main;
using DocumentFormat.OpenXml.Vml.Office;
using IdentityModel;
@ -40,49 +41,177 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
IThirdLocationRequestAppService
{
private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
private readonly IItemStoreRelationAppService _itemStoreRelationApp;
private readonly IAreaAppService _areaApp;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionIssueJobAppService _issueJobAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly IBalanceAppService _balanceAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IThirdLocationJobAppService _thirdLocationJobAppService;
private readonly IThirdLocationJobRepository _thirdLocationJobRepository;
private readonly IBalanceManager _balanceManager;
public ThirdLocationRequestAppService(
IThirdLocationRequestRepository repository,
IThirdLocationJobAppService thirdLocationJobAppService,
IThirdLocationJobRepository thirdLocationJobRepository,
IThirdLocationRequestManager thirdLocationRequestManager,
IPreparationPlanManager preparationPlanManager,
IItemStoreRelationAppService itemStoreRelationApp,
IAreaAppService areaApp,
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService,
ITransactionTypeAppService transactionTypeAppService,
IExpectOutAppService expectOutAppService,
IBalanceAppService balanceAppService,
IBalanceManager balanceManager,
IInjectionIssueJobAppService issueJobAppService)
IThirdLocationRequestRepository repository, IThirdLocationRequestManager thirdLocationRequestManager, ILocationAppService locationAppService, IBalanceAppService balanceAppService, IItemBasicAppService itemBasicAppService, IThirdLocationJobAppService thirdLocationJobAppService)
: base(repository, thirdLocationRequestManager)
{
_thirdLocationRequestManager = thirdLocationRequestManager;
_itemStoreRelationApp = itemStoreRelationApp;
_areaApp = areaApp;
_locationAppService = locationAppService;
_balanceAppService = balanceAppService;
_itemBasicAppService = itemBasicAppService;
_productionLineAppService = productionLineAppService;
_issueJobAppService = issueJobAppService;
_transactionTypeAppService = transactionTypeAppService;
_expectOutAppService= expectOutAppService;
_balanceAppService= balanceAppService;
_thirdLocationJobAppService= thirdLocationJobAppService;
_thirdLocationJobRepository= thirdLocationJobRepository;
_balanceManager= balanceManager;
_thirdLocationJobAppService = thirdLocationJobAppService;
}
[HttpPost("")]
public override async Task<ThirdLocationRequestDTO> CreateAsync(ThirdLocationRequestEditInput input)
{
foreach (var detailInput in input.Details)
{
var transportLocationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var fromLocationDto=await _locationAppService.GetByCodeAsync(detailInput.FromLocationCode).ConfigureAwait(false);
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.FromLocationCode).ConfigureAwait(false);
var itemBasicDto= await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
detailInput.OnTheWayLocationCode = transportLocationDto.Code;
if (fromLocationDto == null)
{
throw new UserFriendlyException($"库位【{detailInput.FromLocationCode}】不存在");
}
if (toLocationDto == null)
{
throw new UserFriendlyException($"库位【{detailInput.ToLocationCode}】不存在");
}
if (itemBasicDto == null)
{
throw new UserFriendlyException($"ERP料号【{detailInput.ItemCode}】不存在");
}
detailInput.FromLocationArea = fromLocationDto.AreaCode;
detailInput.FromLocationErpCode = fromLocationDto.ErpLocationCode;
detailInput.FromWarehouseCode= fromLocationDto.WarehouseCode;
detailInput.FromLocationGroup = fromLocationDto.LocationGroupCode;
detailInput.ToLocationArea = toLocationDto.AreaCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode;
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode;
detailInput.ItemName = itemBasicDto.Name;
detailInput.ItemDesc1 = itemBasicDto.Name;
detailInput.ItemDesc2= itemBasicDto.Name;
var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detailInput.PackingCode, detailInput.ItemCode, detailInput.FromLocationCode, detailInput.EnumInventoryStatus, detailInput.Lot).ConfigureAwait(false);
if (balanceDto == null || balanceDto.Qty <= 0)
{
throw new UserFriendlyException($"ERP料号【{detailInput.ItemCode}】,箱码【{detailInput.PackingCode}】,批次【{detailInput.Lot}】,库位【{detailInput.FromLocationCode}】,状态【{detailInput.EnumInventoryStatus}】的库存,可用余额为【{balanceDto.Qty}】,无法使用。");
}
detailInput.ExpiredTime = balanceDto.ExpireDate;
detailInput.StdPackQty=balanceDto.StdPackQty;
detailInput.Uom=balanceDto.Uom;
detailInput.EnumInventoryStatus = balanceDto.Status;
}
var entity = ObjectMapper.Map<ThirdLocationRequestEditInput, ThirdLocationRequest>(input);
var result =await _thirdLocationRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var requestDto = ObjectMapper.Map<ThirdLocationRequest, ThirdLocationRequestDTO>(result);
var thirdLocationJobAsync=await BuildThirdLocationJobAsync(requestDto).ConfigureAwait(false);
await _thirdLocationJobAppService.CreateManyAsync(thirdLocationJobAsync).ConfigureAwait(false);
return requestDto;
}
[HttpPost("Update-Request-Status")]
public async Task UpdateRequestStatusAsync(string requestNumber)
{
var thirdLocationRequest=await _repository.GetAsync(p=>p.Number==requestNumber).ConfigureAwait(false);
var jobDtos=await _thirdLocationJobAppService.GetByRequestNumberAsync(requestNumber).ConfigureAwait(false);
var noFinsh=jobDtos.Any(p => p.JobStatus == EnumJobStatus.Open ||
p.JobStatus == EnumJobStatus.Doing ||
p.JobStatus == EnumJobStatus.Wait ||
p.JobStatus == EnumJobStatus.Partial);
if (noFinsh==false)
{
thirdLocationRequest.RequestStatus = EnumRequestStatus.Completed;
await _repository.UpdateAsync(thirdLocationRequest).ConfigureAwait(false);
}
}
public override async Task<ThirdLocationRequestDTO> CompleteAsync(Guid id)
{
var thirdLocationRequest = await _repository.GetAsync(id).ConfigureAwait(false);
if (thirdLocationRequest.RequestStatus == EnumRequestStatus.Handling ||
thirdLocationRequest.RequestStatus == EnumRequestStatus.Partial ||
thirdLocationRequest.RequestStatus == EnumRequestStatus.New)
{
thirdLocationRequest.RequestStatus = EnumRequestStatus.Completed;
}
else
{
throw new UserFriendlyException($"【{thirdLocationRequest.RequestStatus.GetDisplayName()}】状态不允许完成");
}
var jobDtos=await _thirdLocationJobAppService.GetByRequestNumberAsync(thirdLocationRequest.Number).ConfigureAwait(false);
foreach (var job in jobDtos)
{
await _thirdLocationJobAppService.CompleteAsync(job.Id).ConfigureAwait(false);
}
var entity=await _repository.UpdateAsync(thirdLocationRequest).ConfigureAwait(false);
return ObjectMapper.Map<ThirdLocationRequest, ThirdLocationRequestDTO>(entity);
}
public override async Task<ThirdLocationRequestDTO> CancelAsync(Guid id)
{
var thirdLocationRequest = await _repository.GetAsync(id).ConfigureAwait(false);
if (thirdLocationRequest.RequestStatus == EnumRequestStatus.Handling ||
thirdLocationRequest.RequestStatus == EnumRequestStatus.Partial ||
thirdLocationRequest.RequestStatus == EnumRequestStatus.New)
{
thirdLocationRequest.RequestStatus = EnumRequestStatus.Cancelled;
}
else
{
throw new UserFriendlyException($"【{thirdLocationRequest.RequestStatus.GetDisplayName()}】状态不允许取消");
}
await _thirdLocationJobAppService.CompleteAsync(thirdLocationRequest.Id).ConfigureAwait(false);
var entity = await _repository.UpdateAsync(thirdLocationRequest).ConfigureAwait(false);
return ObjectMapper.Map<ThirdLocationRequest, ThirdLocationRequestDTO>(entity);
}
#region 私有
private async Task<List<ThirdLocationJobEditInput>> BuildThirdLocationJobAsync(ThirdLocationRequestDTO requestDto)
{
var inputsDict = new Dictionary<string, ThirdLocationJobEditInput>();
var groupBy = requestDto.Details.GroupBy(p => p.ItemCode);
var thirdLocationJobEditInputs = new List<ThirdLocationJobEditInput>();
foreach (var itemCodeGroupBy in groupBy)
{
var list = itemCodeGroupBy.ToList();//当前零件所有的集合
var mastEditInput = ObjectMapper.Map<ThirdLocationRequestDTO, ThirdLocationJobEditInput>(requestDto);
mastEditInput.Details = new List<ThirdLocationJobDetailInput>();
mastEditInput.Worker = requestDto.Worker;
mastEditInput.WarehouseCode = list.First().ToWarehouseCode;
var tempJobDetailInputs = ObjectMapper.Map<List<ThirdLocationRequestDetailDTO>, List<ThirdLocationJobDetailInput>>(list);
tempJobDetailInputs.ForEach(p =>
{
p.IssuedQty = p.RecommendQty;
p.IssueTime = DateTime.Now;
});
mastEditInput.Details = tempJobDetailInputs;
thirdLocationJobEditInputs.Add(mastEditInput);
}
await Task.CompletedTask.ConfigureAwait(false);
return thirdLocationJobEditInputs;
}
#endregion
}

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

@ -1,6 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
@ -18,10 +19,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<ThirdLocationRequestDetailInput, ThirdLocationRequestDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.IssuedQty)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ToWarehouseCode)
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
@ -64,5 +61,59 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.IgnoreAuditedObjectProperties()
.Ignore(x => x.RequestStatus)
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
CreateMap<ThirdLocationJobDetailDTO, TransferLogEditInput>()
.Ignore(x => x.DocNumber)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker)
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
.ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledQty))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.ExpiredTime))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledLot))
.ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledLot))
.ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledPackingCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledContainerCode))
;
CreateMap<ThirdLocationJobDetail, TransferLogEditInput>()
.Ignore(x => x.DocNumber)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker)
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
.ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledQty))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.ExpiredTime))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledLot))
.ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledLot))
.ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledPackingCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledContainerCode))
;
}
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/IThirdLocationRequestManager.cs

@ -7,5 +7,10 @@ using Win_in.Sfs.Shared.Domain;
public interface IThirdLocationRequestManager : ISfsStoreRequestManager<ThirdLocationRequest, ThirdLocationRequestDetail>,
IBulkImportService<ThirdLocationRequest>
{
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
Task<ThirdLocationRequest> CreateByNumberAsync(ThirdLocationRequest entity);
}

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs

@ -29,4 +29,25 @@ public class ThirdLocationRequestManager
{
throw new NotImplementedException();
}
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public virtual async Task<ThirdLocationRequest> CreateByNumberAsync(ThirdLocationRequest entity)
{
var number = string.IsNullOrEmpty(entity.Number)
? await GenerateNumberAsync(nameof(ThirdLocationRequest), entity.ActiveDate).ConfigureAwait(false)
: entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
entity.Submit();
entity.Agree();
entity.RequestStatus = EnumRequestStatus.Partial;
await _repository.InsertAsync(entity, true).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<ThirdLocationRequest>(entity), false)
.ConfigureAwait(false);
return entity;
}
}

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

@ -17,6 +17,8 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.RequestNumber))
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName))
.Ignore(x => x.IssueTime)
.Ignore(x => x.ReceiptTime)
.Ignore(x => x.Number);
CreateMap<ThirdLocationJobDetail, ThirdLocationNoteDetail>()
@ -60,9 +62,22 @@ public partial class StoreEventAutoMapperProfile : Profile
CreateMap<ThirdLocationJob, ThirdLocationNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.RequestNumber))
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.Confirmed)
.Ignore(x => x.ActiveDate)
.Ignore(x => x.Workshop)
.Ignore(x => x.RequestType)
.Ignore(x => x.UseOnTheWayLocation)
;
CreateMap<ThirdLocationJobDTO, ThirdLocationNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.RequestNumber))
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.ActiveDate)
.Ignore(x => x.Workshop)
.Ignore(x => x.RequestType)
.Ignore(x => x.UseOnTheWayLocation)
;
CreateMap<ThirdLocationJobDetail, ThirdLocationNoteDetailInput>()
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
@ -85,6 +100,35 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.SingleCodeRequest, y => y.MapFrom(d => d.SingleCodeRequest))
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.RecommendType)
.Ignore(x => x.PositionCode)
;
CreateMap<ThirdLocationJobDetailDTO, ThirdLocationNoteDetailInput>()
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.FromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.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))
.ForMember(x => x.SingleCodeRequest, y => y.MapFrom(d => d.SingleCodeRequest))
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.RecommendType)
.Ignore(x => x.PositionCode)
;
}
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/ThirdLocationNoteAutoMapperProfile.cs

@ -25,6 +25,9 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.CallBusinessType)
.Ignore(x => x.CallRequestNumber)
.Ignore(x => x.CallJobNumber)
.Ignore(x => x.UseOnTheWayLocation)
.Ignore(x => x.Confirmed)
.Ignore(x => x.ConfirmTime)
;
CreateMap<ThirdLocationNoteDetail, TransferNoteDetailDTO>()

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

@ -1,6 +1,8 @@
using System;
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
@ -35,7 +37,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ToContainerCode)
;
CreateMap<ThirdLocationRequest, ThirdLocationJobEditInput>()
CreateMap<ThirdLocationRequestDTO, ThirdLocationJobEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type))
.Ignore(x => x.SingleCodeJob)
@ -57,27 +59,21 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.Details)
.Ignore(x => x.UseOnTheWayLocation)
;
CreateMap<ThirdLocationRequestDetail, ThirdLocationJobDetailInput>()
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.SingleCodeRequest, y => y.MapFrom(d => d.SingleCodeRequest))
.Ignore(x => x.SingleCodeJob)
.ForMember(x => x.IsOnTheWayLocationCode, y => y.MapFrom(d => true))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.Ignore(x => x.RecommendFromLocationArea)
.Ignore(x => x.RecommendFromLocationGroup)
.Ignore(x => x.HandledFromLocationArea)
.Ignore(x => x.HandledFromLocationGroup)
.Ignore(x => x.RecommendFromWarehouseCode)
.Ignore(x => x.HandledFromWarehouseCode)
.Ignore(x => x.OnTheWayLocationCode)
.Ignore(x => x.DistributionType)
.Ignore(x => x.RoundedQty)
.Ignore(x => x.Operation)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.TruncType)
.Ignore(x => x.PlanBeginTime)
.Ignore(x => x.PlannedSplitRule)
.Ignore(x => x.DeliveryQty)
.Ignore(x => x.Status)
.Ignore(x => x.RecommendContainerCode)
.Ignore(x => x.RecommendPackingCode)
@ -103,6 +99,49 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.RecommendLot)
.IgnoreIHasRecommendAndHandledFrom();
CreateMap<ThirdLocationRequestDetailDTO, ThirdLocationJobDetailInput>()
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.SingleCodeRequest, y => y.MapFrom(d => d.SingleCodeRequest))
.ForMember(x => x.IsOnTheWayLocationCode, y => y.MapFrom(d => true))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.Uom, y => y.MapFrom(d => d.Uom))
.ForMember(x => x.IssuedQty, y => y.MapFrom(d => 0))
.ForMember(x => x.NotFinishQty, y => y.MapFrom(d => 0))
.ForMember(x => x.ReceivedQty, y => y.MapFrom(d => 0))
.ForMember(x => x.RecommendFromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.RecommendFromLocationGroup, y => y.MapFrom(d => d.FromLocationGroup))
.ForMember(x => x.RecommendFromLocationArea, y => y.MapFrom(d => d.FromLocationArea))
.ForMember(x => x.RecommendFromLocationErpCode, y => y.MapFrom(d => d.FromLocationErpCode))
.ForMember(x => x.RecommendFromWarehouseCode, y => y.MapFrom(d => d.FromWarehouseCode))
.ForMember(x => x.HandledFromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.HandledFromLocationGroup, y => y.MapFrom(d => d.FromLocationGroup))
.ForMember(x => x.HandledFromLocationArea, y => y.MapFrom(d => d.FromLocationArea))
.ForMember(x => x.HandledFromLocationErpCode, y => y.MapFrom(d => d.FromLocationErpCode))
.ForMember(x => x.HandledFromWarehouseCode, y => y.MapFrom(d => d.FromWarehouseCode))
.ForMember(x => x.RecommendPackingCode, y => y.MapFrom(d => d.PackingCode))
.ForMember(x => x.RecommendLot, y => y.MapFrom(d => d.Lot))
.ForMember(x => x.RecommendProduceDate, y => y.MapFrom(d => DateTime.MinValue))
.ForMember(x => x.RecommendContainerCode, y => y.MapFrom(d => string.Empty))
.ForMember(x => x.RecommendExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.RecommendSupplierBatch, y => y.MapFrom(d => string.Empty))
.ForMember(x => x.RecommendQty, y => y.MapFrom(d => d.Qty))
.ForMember(x => x.RecommendArriveDate, y => y.MapFrom(d => DateTime.MinValue))
.ForMember(x => x.HandledPackingCode, y => y.MapFrom(d => d.PackingCode))
.ForMember(x => x.HandledLot, y => y.MapFrom(d => d.Lot))
.ForMember(x => x.HandledProduceDate, y => y.MapFrom(d => DateTime.MinValue))
.ForMember(x => x.HandledContainerCode, y => y.MapFrom(d => string.Empty))
.ForMember(x => x.HandledExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.HandledSupplierBatch, y => y.MapFrom(d => string.Empty))
.ForMember(x => x.HandledQty, y => y.MapFrom(d => d.Qty))
.ForMember(x => x.HandledArriveDate, y => y.MapFrom(d => DateTime.MinValue))
.ForMember(x => x.HandledUom, y => y.MapFrom(d => d.Uom))
.ForMember(x => x.Status, y => y.MapFrom(d => d.EnumInventoryStatus))
;
CreateMap<BalanceDTO, ThirdLocationJobDetailInput>()
.ForMember(x => x.RecommendArriveDate, y => y.MapFrom(d => d.ArriveDate))
.ForMember(x => x.RecommendContainerCode, y => y.MapFrom(d => d.ContainerCode))
@ -127,7 +166,6 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.HandledFromWarehouseCode)
.Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.HandledContainerCode)
.Ignore(x => x.HandledExpireDate)
@ -141,21 +179,21 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.HandledUom)
.Ignore(x => x.Remark)
.Ignore(x => x.OnTheWayLocationCode)
.Ignore(x => x.DistributionType)
.Ignore(x => x.RoundedQty)
.Ignore(x => x.Operation)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.TruncType)
.Ignore(x => x.PlanBeginTime)
.Ignore(x => x.PlannedSplitRule)
.Ignore(x => x.DeliveryQty)
.Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode)
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.PositionCode)
.Ignore(x => x.RecommendType)
.Ignore(x => x.FromLocationArea)
.Ignore(x=>x.IssueTime)
.Ignore(x=>x.IsOnTheWayLocationCode)
.Ignore(x => x.FromLocationGroup)
.Ignore(x => x.FromLocationErpCode)
.Ignore(x => x.FromWarehouseCode)
.Ignore(x => x.IssuedQty)
.Ignore(x => x.ReceivedQty)
.Ignore(x => x.EnumInventoryStatus)
.IgnoreIHasRecommendAndHandledFrom();
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/DataExchanges/ThirdLocationNoteEventHandler.cs

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quartz.Simpl;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;

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

@ -35,18 +35,18 @@ public class ThirdLocationJobEventHandler :
_thirdLocationJobRepository = thirdLocationJobRepository;
}
public Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationJob> eventData)
public async Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationJob> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationJob> eventData)
public async Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationJob> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsClosedEntityEventData<ThirdLocationJob> eventData)
public async Task HandleEventAsync(SfsClosedEntityEventData<ThirdLocationJob> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
}

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

@ -55,33 +55,33 @@ public class ThirdLocationRequestEventHandler
_transferLogAppService = transferLogAppService;
}
public Task HandleEventAsync(SfsHandledEntityEventData<ThirdLocationRequest> eventData)
public async Task HandleEventAsync(SfsHandledEntityEventData<ThirdLocationRequest> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsAbortedEntityEventData<ThirdLocationRequest> eventData)
public async Task HandleEventAsync(SfsAbortedEntityEventData<ThirdLocationRequest> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationRequest> eventData)
public async Task HandleEventAsync(SfsCompletedEntityEventData<ThirdLocationRequest> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationRequest> eventData)
public async Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationRequest> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationRequest> eventData)
public async Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationRequest> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCreatedEntityEventData<List<ThirdLocationRequest>> eventData)
public async Task HandleEventAsync(SfsCreatedEntityEventData<List<ThirdLocationRequest>> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
}

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

@ -31,18 +31,18 @@ public class ThirdLocationNoteEventHandler
_ThirdLocationRequestRepository = ThirdLocationRequestRepository;
}
public Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationNote> eventData)
public async Task HandleEventAsync(SfsCreatedEntityEventData<ThirdLocationNote> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsCreatedEntityEventData<List<ThirdLocationNote>> eventData)
public async Task HandleEventAsync(SfsCreatedEntityEventData<List<ThirdLocationNote>> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
public Task HandleEventAsync(SfsConfirmedEntityEventData<ThirdLocationNote> eventData)
public async Task HandleEventAsync(SfsConfirmedEntityEventData<ThirdLocationNote> eventData)
{
throw new NotImplementedException();
await Task.CompletedTask.ConfigureAwait(false);
}
}

4
build/src/docker/publish/conf/settings/appsettings.Development.json

@ -133,8 +133,8 @@
//"BaseUrl": "http://localhost:59093/"
},
"BaseData": {
//"BaseUrl": "http://dev.ccwin-in.com:60084/"
"BaseUrl": "http://localhost:59094/"
"BaseUrl": "http://dev.ccwin-in.com:60084/"
//"BaseUrl": "http://localhost:59094/"
},
"Default": {
"BaseUrl": "http://dev.ccwin-in.com:60083/"

Loading…
Cancel
Save