diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml index 36847ea03..2cc64724c 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml @@ -10,8 +10,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - bin\Release\net6.0\publish\ + D:\发布\WMS\store FileSystem <_TargetId>Folder + + net6.0 + 488eeada-cfed-4016-9884-7a1dcbe5eb9c + false \ No newline at end of file diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs index 92b149911..7b205cdaa 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs @@ -43,12 +43,7 @@ public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase /// [Display(Name = "已收数量")] public decimal ReceivedQty { get; set; } - - /// - /// 明细状态 - /// - [Display(Name = "明细状态")] - public EnumStatus Status { get; set; } + /// /// 请求未发 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs index b6294d8cd..aec149364 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs @@ -71,12 +71,7 @@ public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase /// [Display(Name = "已收数量")] public decimal ReceivedQty { get; set; } - - /// - /// 明细状态 - /// - [Display(Name = "明细状态")] - public EnumStatus Status { get; set; } + /// /// 位置码 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs index 856be3ddf..e8965b174 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs @@ -42,8 +42,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile .Ignore(x => x.Remark); CreateMap() - .IgnoreAuditedObjectProperties() - .ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open)) + .IgnoreAuditedObjectProperties() .Ignore(x => x.ToLocationErpCode) .Ignore(x => x.ToWarehouseCode) .Ignore(x => x.ToLocationArea) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs index f3f221923..dbea45ed9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs @@ -77,10 +77,7 @@ public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasT /// public decimal ReceivedQty { get; set; } - /// - /// 明细状态 - /// - public EnumStatus Status { get; set; } + /// /// 请求未发 还未发送的数量 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs index c9d45a6dc..1586bfcf3 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs @@ -73,48 +73,49 @@ public class ThirdLocationRequestManager private void SetMaterialRequestDetailStatus(ThirdLocationRequestDetail detail) { - if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数 - { - detail.Status = EnumStatus.Close; - } - else - { - detail.Status = EnumStatus.Open; - } + //if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数 + //{ + // detail.Status = EnumStatus.Close; + //} + //else + //{ + // detail.Status = EnumStatus.Open; + //} } private async Task SetMaterialRequestStatusAsync(ThirdLocationRequest materialRequest) { - if (materialRequest.Details.All(p => p.Status == EnumStatus.Close)) - { - materialRequest.RequestStatus = EnumRequestStatus.Completed; - } - else - { - var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false); - if (issueJobs.Count > 0) - { - if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled)) - { - if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty)) - { - materialRequest.RequestStatus = EnumRequestStatus.Completed; - } - else - { - materialRequest.RequestStatus = EnumRequestStatus.Partial; - } - } - else - { - materialRequest.RequestStatus = EnumRequestStatus.Partial; - } - } - else - { - materialRequest.RequestStatus = EnumRequestStatus.Partial; - } - } + //if (materialRequest.Details.All(p => p.Status == EnumStatus.Close)) + //{ + // materialRequest.RequestStatus = EnumRequestStatus.Completed; + //} + //else + //{ + // var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false); + // if (issueJobs.Count > 0) + // { + // if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled)) + // { + // if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty)) + // { + // materialRequest.RequestStatus = EnumRequestStatus.Completed; + // } + // else + // { + // materialRequest.RequestStatus = EnumRequestStatus.Partial; + // } + // } + // else + // { + // materialRequest.RequestStatus = EnumRequestStatus.Partial; + // } + // } + // else + // { + // materialRequest.RequestStatus = EnumRequestStatus.Partial; + // } + //} + } public virtual async Task CompleteAsync(string number) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs index f6a4a922f..ea0364046 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs @@ -53,8 +53,7 @@ public static class ThirdLocationRequestDbContextModelCreatingExtensions b.Property(q => q.ProdLine).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); - b.Property(q => q.Status).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + b.Property(q => q.ReceivedQty).HasPrecision(18, 6); b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs index ec4586e0c..d5d1702be 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs @@ -256,38 +256,12 @@ public class ThirdLocationRequestEventHandler jobs.Add(job); } job.Details.AddRange(jobDetails); - if (thirdLocationRequestDetail.ToBeIssuedQty < 0) - { - thirdLocationRequestDetail.Status = EnumStatus.Close; - } + } jobs = jobs.Where(p => p.Details.Any()).ToList(); - - var openRequestDetails = - thirdLocationRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList(); - - if (!openRequestDetails.Any()) - { - return jobs; - } - - - var enableMultipleCreateThirdLocationJob = await SettingManager.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false); - if (enableMultipleCreateThirdLocationJob) - { - - //thirdLocationRequest.Partial(); - } - else - { - var sb = new StringBuilder(); - foreach (var openRequestDetail in openRequestDetails) - { - sb.AppendLine($"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}"); - } - throw new UserFriendlyException($"{sb} 可用库存数量不足, 无法生成发料任务"); - } + + return jobs; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs index 2199cfc75..c46ab6697 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs @@ -22,10 +22,13 @@ public class ThirdLocationNoteEventHandler private const EnumTransType TransType = EnumTransType.TransferLib; private readonly ILocationAppService _locationAppService; + private readonly IThirdLocationRequestManager _thirdLocationRequestManager; - public ThirdLocationNoteEventHandler(ILocationAppService locationAppService) + public ThirdLocationNoteEventHandler(ILocationAppService locationAppService + , IThirdLocationRequestManager thirdLocationRequestManager) { _locationAppService = locationAppService; + _thirdLocationRequestManager = thirdLocationRequestManager; } [UnitOfWork] @@ -39,6 +42,12 @@ public class ThirdLocationNoteEventHandler await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); + + if (!string.IsNullOrEmpty(entity.RequestNumber)) + { + var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false); + await _thirdLocationRequestManager.CompleteAsync(thirdLocationRequest).ConfigureAwait(false); + } } [UnitOfWork]