From afb14500c6e9462c1c06f8cc06f03b3c7063eca4 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 6 Mar 2024 14:01:38 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=9E=9A=E4=B8=BE=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Stores/IssueNoteController.cs | 8 +-- .../PositionCode/PositionCodeAppService.cs | 9 +++ ...ionCodeDbContextModelCreatingExtensions.cs | 2 + .../IssueJobs/Inputs/IssueJobDetailInput.cs | 2 +- .../DTOs/ProductRecycleJobDTO.cs | 9 +++ .../DTOs/ProductRecycleJobDetailDTO.cs | 9 +++ .../IProductRecycleJobAppService.cs | 10 ++++ ...ons.cs => ProductRecycleJobPermissions.cs} | 2 +- .../IssueNotes/Inputs/IssueNoteDetailInput.cs | 2 +- .../StorePermissionDefinitionProvider.cs | 1 + .../Inputs/MaterialRequestDetailInput.cs | 2 +- ...Sfs.Wms.Store.Application.Contracts.csproj | 1 - .../MaterialRequestAppService.cs | 8 +-- .../Jobs/IssueJobs/IssueJobDetail.cs | 2 +- .../ProductRecycleJobManager.cs | 59 +++++++++++++++++-- .../Notes/IssueNotes/IssueNoteDetail.cs | 2 +- .../MaterialRequests/MaterialRequestDetail.cs | 2 +- ...ssueJobDbContextModelCreatingExtensions.cs | 3 +- 18 files changed, 112 insertions(+), 21 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs rename be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/{ProductRecyclePermissions.cs => ProductRecycleJobPermissions.cs} (95%) diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index f8ac25b4b..bad5c92d0 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -41,19 +41,19 @@ public class IssueNoteController : AbpController p.ToPackingCode = string.Empty; if(p.PositionCode.Contains('W')) { - p.RecommendType = EnumRecommendType.W; + p.RecommendType = "W"; } else if(p.PositionCode.Contains('Q')) { - p.RecommendType = EnumRecommendType.Q; + p.RecommendType = "Q"; } else if (p.PositionCode.Contains('K')) { - p.RecommendType = EnumRecommendType.K; + p.RecommendType = "K"; } else { - p.RecommendType = EnumRecommendType.None; + p.RecommendType = "None"; } }); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs index 48117759c..29bd0b204 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/PositionCode/PositionCodeAppService.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Caching; +using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Domain; @@ -22,6 +23,7 @@ public class PositionCodeAppService , IPositionCodeAppService { private readonly IPositionCodeManager _manager; + private new readonly IPositionCodeRepository _repository; public PositionCodeAppService(IPositionCodeRepository repository, IDistributedCache cache, IPositionCodeManager manager) : base(repository, cache) { @@ -29,6 +31,7 @@ public class PositionCodeAppService base.UpdatePolicyName = CategoryPermissions.Update; base.DeletePolicyName = CategoryPermissions.Delete; _manager = manager; + _repository = repository; } @@ -42,6 +45,12 @@ public class PositionCodeAppService throw new UserFriendlyException($"{input.Code} 已存在"); } + var itemEntity = await _repository.FirstOrDefaultAsync(p => p.PartCode == input.PartCode).ConfigureAwait(false); + if(itemEntity != null) + { + throw new UserFriendlyException($"{input.PartCode} 物品已存在"); + } + var itemBasic = await ItemBasicAppService.GetByCodeAsync(input.PartCode).ConfigureAwait(false); Check.NotNull(itemBasic, "物品代码", $"物品 {input.PartCode} 不存在"); input.PartName = itemBasic.Name; diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCode/PositionCodeDbContextModelCreatingExtensions.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCode/PositionCodeDbContextModelCreatingExtensions.cs index b679f5f79..33f7bd550 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCode/PositionCodeDbContextModelCreatingExtensions.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.EntityFrameworkCore/PositionCode/PositionCodeDbContextModelCreatingExtensions.cs @@ -33,6 +33,8 @@ public static class PositionCodeDbContextModelCreatingExtensions //Indexes b.HasIndex(q => new { q.Code,q.PartCode,q.LocationCode }).IsUnique(); + b.HasIndex(q => new { q.Code }).IsUnique(); + b.HasIndex(q => new { q.PartCode }).IsUnique(); }); } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs index b059524c9..022a32dc5 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs @@ -130,5 +130,5 @@ public class IssueJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLoc /// /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs new file mode 100644 index 000000000..c0a16a64c --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductRecycleJobDTO +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs new file mode 100644 index 000000000..7edbbb44b --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs @@ -0,0 +1,9 @@ +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductRecycleJobDetailDTO +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs new file mode 100644 index 000000000..c5f53458a --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public interface IProductRecycleJobAppService + : ISfsJobAppServiceBase + +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecycleJobPermissions.cs similarity index 95% rename from be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs rename to be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecycleJobPermissions.cs index ca438e6ff..545314ba2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecyclePermissions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/ProductRecycleJobPermissions.cs @@ -3,7 +3,7 @@ using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public static class ProductRecyclePermissions +public static class ProductRecycleJobPermissions { public const string Default = StorePermissions.GroupName + "." + nameof(ProductRecycleJob); public const string Create = Default + "." + StorePermissions.CreateStr; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs index 0d8769392..226f02145 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs @@ -48,6 +48,6 @@ public class IssueNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBa /// /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs index 92bbc9d6d..f0ef3dfc6 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs @@ -91,6 +91,7 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider storeGroup.AddDeliverJobPermission(); storeGroup.AddPurchaseReturnJobPermission(); storeGroup.AddProductReceiveJobPermission(); + storeGroup.AddProductRecycleJobPermission(); storeGroup.AddCheckJobPermission(); storeGroup.AddCountJobPermission(); storeGroup.AddJisDeliverJobPermission(); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs index 058c47f49..b58996f7a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs @@ -79,7 +79,7 @@ public class MaterialRequestDetailInput : SfsStoreDetailWithQtyInputBase /// /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj index 7430f5c7e..819319a8f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj @@ -42,7 +42,6 @@ - diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index 64d689dbc..decb16295 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -216,19 +216,19 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs index f6f8db851..f27a29a7c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ProductRecycleJobs/ProductRecycleJobManager.cs @@ -1,10 +1,61 @@ -using System; +using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; -using System.Text; +using System.Linq.Expressions; using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Users; +using Volo.Abp.Validation; +using Win_in.Sfs.Shared.Domain.Shared; -namespace Win_in.Sfs.Wms.Store.Jobs.ProductRecycleJobs; -internal class ProductRecycleJobManager +namespace Win_in.Sfs.Wms.Store.Domain; + +public class ProductRecycleJobManager : SfsJobManagerBase, IProductRecycleJobManager { + + public ProductRecycleJobManager( + IProductRecycleJobRepository repository + ) : base(repository) + { + } + + public override void CheckDetails(ProductRecycleJob entity, AbpValidationResult result) + { + var details = entity.Details; + foreach (var detail in details) + { + if (detail.HandledToLocationCode == null) + { + result.Errors.Add(new ValidationResult($"{detail.HandledToLocationCode} 不能为空")); + } + + } + } + + public override async Task> GetWorkingListByPackingAsync(string packingCode) + { + return await Repository.GetListAsync( + c => c.Details.Any(p => p.RecommendPackingCode == packingCode) + && c.JobStatus != EnumJobStatus.Closed + && c.JobStatus != EnumJobStatus.Cancelled + , true).ConfigureAwait(false); + + } + + public override async Task> GetWorkingListByContainerAsync(string containerCode) + { + return await Repository.GetListAsync( + c => c.Details.Any(p => p.RecommendContainerCode == containerCode) + && c.JobStatus != EnumJobStatus.Closed + && c.JobStatus != EnumJobStatus.Cancelled + , true).ConfigureAwait(false); + + } + + public async Task GetAsync(Expression> expression) + { + return await Repository.FindAsync(expression).ConfigureAwait(false); + } + } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs index bd3fad75b..de7699dc9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs @@ -39,5 +39,5 @@ public class IssueNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase /// /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs index 19420cba8..ce4890d59 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs @@ -99,6 +99,6 @@ public class MaterialRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLoca /// /// 推荐类型 /// - public EnumRecommendType RecommendType { get; set; } + public string RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs index f13b3c4ac..3923b6b1a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs @@ -56,7 +56,8 @@ public static class IssueJobDbContextModelCreatingExtensions b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(q => q.PlannedSplitRule).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); - b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); + b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false); + b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false); //Relations //None From 250d748ed2376140e04b5ebe3654d02b421b4af8 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Wed, 6 Mar 2024 15:13:31 +0800 Subject: [PATCH 2/6] =?UTF-8?q?3=E4=B8=AA=E6=8B=86=E7=AE=B1=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=88=E6=9B=B4=E6=96=B0=E4=BB=BB=E5=8A=A1=E6=98=8E?= =?UTF-8?q?=E7=BB=86=EF=BC=89=E6=B5=8B=E8=AF=95=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jobs/InspectJobs/InspectJobAppService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs index 677079a54..e363915bd 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs @@ -170,7 +170,7 @@ public class InspectJobAppService public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input) { InspectJob job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); - InspectJobDetail detail = job.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode && p.InspectQty == input.FromQty); + InspectJobDetail detail = job.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode && p.ReceiveQty == input.FromQty); if (detail == null) { throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取InspectDetail表为空!"); From 1cc4eb4c758358c5cc12cb98fdb45ced9b54dbca Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 6 Mar 2024 15:27:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=A0=81=E5=AF=BC=E5=85=A5=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Properties/PublishProfiles/FolderProfile.pubxml | 2 +- .../Properties/PublishProfiles/FolderProfile.pubxml | 4 ++-- .../Controllers/Stores/IssueNoteController.cs | 8 ++++---- .../PositionCode/Inputs/PositionCodeImportInput.cs | 2 ++ .../Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs | 2 +- .../Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs | 2 +- .../MaterialRequests/Inputs/MaterialRequestDetailInput.cs | 2 +- .../MaterialRequests/MaterialRequestAppService.cs | 8 ++++---- .../Jobs/IssueJobs/IssueJobDetail.cs | 2 +- .../Notes/IssueNotes/IssueNoteDetail.cs | 2 +- .../Requests/MaterialRequests/MaterialRequestDetail.cs | 2 +- .../IssueJobs/IssueJobDbContextModelCreatingExtensions.cs | 2 +- 12 files changed, 20 insertions(+), 18 deletions(-) diff --git a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml index ef3bc86af..39db2b9e4 100644 --- a/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Basedata.Host/Win_in.Sfs.Basedata.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -10,7 +10,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - C:\发布\WMS + D:\发布\WMS\base FileSystem net6.0 diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml index 83d3b93a7..893ee79a0 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -10,11 +10,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU FileSystem - .\..\..\..\OutPut\StoreHost\ + D:\发布\WMS\store FileSystem net6.0 488eeada-cfed-4016-9884-7a1dcbe5eb9c false - + \ No newline at end of file diff --git a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs index bad5c92d0..f8ac25b4b 100644 --- a/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs +++ b/be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/IssueNoteController.cs @@ -41,19 +41,19 @@ public class IssueNoteController : AbpController p.ToPackingCode = string.Empty; if(p.PositionCode.Contains('W')) { - p.RecommendType = "W"; + p.RecommendType = EnumRecommendType.W; } else if(p.PositionCode.Contains('Q')) { - p.RecommendType = "Q"; + p.RecommendType = EnumRecommendType.Q; } else if (p.PositionCode.Contains('K')) { - p.RecommendType = "K"; + p.RecommendType = EnumRecommendType.K; } else { - p.RecommendType = "None"; + p.RecommendType = EnumRecommendType.None; } }); diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PositionCode/Inputs/PositionCodeImportInput.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PositionCode/Inputs/PositionCodeImportInput.cs index 9136deffe..53432b077 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PositionCode/Inputs/PositionCodeImportInput.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application.Contracts/PositionCode/Inputs/PositionCodeImportInput.cs @@ -13,6 +13,7 @@ public class PositionCodeImportInput : SfsBaseDataImportInputBase [Key] [Display(Name = "代码")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + [Required(ErrorMessage = "{0}是必填项")] public string Code { get; set; } /// /// 物料号 @@ -60,6 +61,7 @@ public class PositionCodeImportInput : SfsBaseDataImportInputBase /// 类型 /// [Display(Name = "类型")] + [Required(ErrorMessage = "{0}是必填项")] public EnumRecommendType Type { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs index 022a32dc5..b059524c9 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/Inputs/IssueJobDetailInput.cs @@ -130,5 +130,5 @@ public class IssueJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLoc /// /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs index 226f02145..0d8769392 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/Inputs/IssueNoteDetailInput.cs @@ -48,6 +48,6 @@ public class IssueNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBa /// /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs index b58996f7a..058c47f49 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/Inputs/MaterialRequestDetailInput.cs @@ -79,7 +79,7 @@ public class MaterialRequestDetailInput : SfsStoreDetailWithQtyInputBase /// /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs index decb16295..64d689dbc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/MaterialRequestAppService.cs @@ -216,19 +216,19 @@ public class MaterialRequestAppService : SfsStoreRequestAppServiceBase /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } public void SetId(Guid id) { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs index de7699dc9..bd3fad75b 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/IssueNoteDetail.cs @@ -39,5 +39,5 @@ public class IssueNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase /// /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs index ce4890d59..19420cba8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/MaterialRequestDetail.cs @@ -99,6 +99,6 @@ public class MaterialRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLoca /// /// 推荐类型 /// - public string RecommendType { get; set; } + public EnumRecommendType RecommendType { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs index 3923b6b1a..2a6c87990 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/IssueJobDbContextModelCreatingExtensions.cs @@ -57,7 +57,7 @@ public static class IssueJobDbContextModelCreatingExtensions b.Property(q => q.PlannedSplitRule).HasMaxLength(SfsPropertyConst.NameLength).HasConversion(); b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false); - b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false); + b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).HasConversion(); //Relations //None From 7549674323ed34fef43937aeca1764e805b11c49 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 6 Mar 2024 17:13:28 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=80=80=E6=8B=86=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DTOs/ProductRecycleJobDTO.cs | 18 +++- .../DTOs/ProductRecycleJobDetailDTO.cs | 83 ++++++++++++++++- .../IProductRecycleJobAppService.cs | 2 +- .../Inputs/ProductRecycleJobCheckInput.cs | 6 ++ .../Inputs/ProductRecycleJobDetailInput.cs | 90 +++++++++++++++++++ .../ProductRecycleJobDetailSaveInput.cs | 43 +++++++++ .../Inputs/ProductRecycleJobEditInput.cs | 48 ++++++++++ ...Sfs.Wms.Store.Application.Contracts.csproj | 1 - .../ProductRecycleJobAppService.cs | 28 ++++++ .../ProductRecycleJobAutoMapperProfile.cs | 31 +++++++ ...ycleJobDbContextModelCreatingExtensions.cs | 52 +++++++++++ .../ProductRecycleJobEfCoreRepository.cs | 11 +++ .../Jobs/ProductionRecycleJobEventHandler.cs | 75 ++++++++++++++++ 13 files changed, 483 insertions(+), 5 deletions(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobCheckInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailSaveInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobEditInput.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAutoMapperProfile.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobEfCoreRepository.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionRecycleJobEventHandler.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs index c0a16a64c..12e3f745f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDTO.cs @@ -3,7 +3,21 @@ using Win_in.Sfs.Shared.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class ProductRecycleJobDTO -{ +[Display(Name = "客户退拆任务")] +public class ProductRecycleJobDTO : SfsJobDTOBase +{ + /// + /// 车间 + /// + [Display(Name = "车间")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Workshop { get; set; } + + /// + /// 班次 + /// + [Display(Name = "班次")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string Shift { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs index 7edbbb44b..32f7be931 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/DTOs/ProductRecycleJobDetailDTO.cs @@ -1,9 +1,90 @@ using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Data; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; namespace Win_in.Sfs.Wms.Store.Application.Contracts; -public class ProductRecycleJobDetailDTO +public class ProductRecycleJobDetailDTO : SfsJobRecommendToDetailDTOBase { + /// + /// Bom版本 + /// + public string BomVersion { get; set; } + + /// + /// 库位代码 + /// + public string LocationCode { get; set; } + + /// + /// 库区 + /// + public string LocationArea { get; set; } + + /// + /// 库位组 + /// + public string LocationGroup { get; set; } + + /// + /// ERP库位代码 + /// + public string LocationErpCode { get; set; } + + /// + /// 原料库位代码 + /// + public string RawLocationCode { get; set; } + + /// + /// 原料库区 + /// + public string RawLocationArea { get; set; } + + /// + /// 原料库位组 + /// + public string RawLocationGroup { get; set; } + + /// + /// 原料ERP库位 + /// + public string RawLocationErpCode { get; set; } + + /// + /// 原料仓库 + /// + public string RawWarehouseCode { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + [MaxLength(SfsPropertyConst.CodeLength)] + public string Uom { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [Column(TypeName = "decimal(18,6)")] + public decimal Qty { get; set; } + + /// + /// 扩展属性 + /// + public ExtraPropertyDictionary ExtraProperties { get; } = new ExtraPropertyDictionary(); + + /// + /// 库存状态 + /// + public EnumInventoryStatus Status { get; set; } + + /// + /// 仓库代码 + /// + public string WarehouseCode { get; set; } } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs index c5f53458a..c68fa097a 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/IProductRecycleJobAppService.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; namespace Win_in.Sfs.Wms.Store.Application.Contracts; public interface IProductRecycleJobAppService - : ISfsJobAppServiceBase + : ISfsJobAppServiceBase { diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobCheckInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobCheckInput.cs new file mode 100644 index 000000000..4dc7816e5 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobCheckInput.cs @@ -0,0 +1,6 @@ +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductRecycleJobCheckInput : SfsJobCheckInputBase +{ + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailInput.cs new file mode 100644 index 000000000..696e2b713 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailInput.cs @@ -0,0 +1,90 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using Volo.Abp.Data; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductRecycleJobDetailInput : SfsJobRecommendToDetailInputBase +{ + /// + /// Bom版本 + /// + public string BomVersion { get; set; } + + /// + /// 库位代码 + /// + public string LocationCode { get; set; } + + /// + /// 库区 + /// + public string LocationArea { get; set; } + + /// + /// 库位组 + /// + public string LocationGroup { get; set; } + + /// + /// ERP库位代码 + /// + public string LocationErpCode { get; set; } + + /// + /// 原料库位代码 + /// + public string RawLocationCode { get; set; } + + /// + /// 原料库区 + /// + public string RawLocationArea { get; set; } + + /// + /// 原料库位组 + /// + public string RawLocationGroup { get; set; } + + /// + /// 原料ERP库位 + /// + public string RawLocationErpCode { get; set; } + + /// + /// 原料仓库 + /// + public string RawWarehouseCode { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + [MaxLength(SfsPropertyConst.CodeLength)] + public string Uom { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [Column(TypeName = "decimal(18,6)")] + public decimal Qty { get; set; } + + /// + /// 扩展属性 + /// + public ExtraPropertyDictionary ExtraProperties { get; } = new ExtraPropertyDictionary(); + + /// + /// 库存状态 + /// + public EnumInventoryStatus Status { get; set; } + + /// + /// 仓库代码 + /// + public string WarehouseCode { get; set; } + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailSaveInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailSaveInput.cs new file mode 100644 index 000000000..fa5580803 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobDetailSaveInput.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.FileStorage.Application.Contracts; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +/// +/// 客户退拆 保存模型 +/// +public class ProductRecycleJobDetailSaveInput +{ + /// + /// Id + /// + [Display(Name = "Id")] + public Guid Id { get; set; } + /// + /// 详情ID + /// + [Display(Name = "详情ID")] + public Guid DetailId { get; set; } + + /// + /// 不合格原因 + /// + [Display(Name = "不合格原因")] + public string FailedReason { get; set; } + + /// + /// 质量缺陷 + /// + [Display(Name = "质量缺陷")] + public string MassDefect { get; set; } + + + /// + /// 图片字节流 + /// + [Display(Name = "图片字节流")] + public List FilesList { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobEditInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobEditInput.cs new file mode 100644 index 000000000..3fc12e68e --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ProductRecycleJobs/Inputs/ProductRecycleJobEditInput.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class ProductRecycleJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput +{ + #region Create + + /// + /// 上游任务编号 + /// + [Display(Name = "上游任务编号")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string UpStreamJobNumber { get; set; } + + /// + /// 任务类型 + /// + [Display(Name = "任务类型")] + [Required(ErrorMessage = "{0}是必填项")] + public EnumJobType JobType { get; set; } + + /// + /// 是否自动完成 + /// + [Display(Name = "是否自动完成")] + [Required(ErrorMessage = "{0}是必填项")] + public bool IsAutoComplete { get; set; } + + /// + /// 过期时间 + /// + [Display(Name = "过期时间")] + [Required(ErrorMessage = "{0}是必填项")] + public DateTime ExpiredTime { get; set; } + + /// + /// 任务明细 + /// + [Display(Name = "任务明细")] + [Required(ErrorMessage = "{0}是必填项")] + public List Details { get; set; } + #endregion +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj index 819319a8f..a14d0abb2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Win_in.Sfs.Wms.Store.Application.Contracts.csproj @@ -42,7 +42,6 @@ - diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs new file mode 100644 index 000000000..a7842a0b5 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAppService.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; +using Win_in.Sfs.Wms.Store.Domain.Shared; + +namespace Win_in.Sfs.Wms.Store.Application; + +[Authorize] +[Route($"{StoreConsts.RootPath}production-recycle-job")] + +public class ProductRecycleJobAppService + : SfsJobAppServiceBase + , IProductRecycleJobAppService +{ + private readonly IProductRecycleJobManager _productRecycleJobManager; + + public ProductRecycleJobAppService( + IProductRecycleJobRepository repository, IProductRecycleJobManager productRecycleJobManager) + : base(repository, productRecycleJobManager) + { + _productRecycleJobManager = productRecycleJobManager; + } + + + +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAutoMapperProfile.cs new file mode 100644 index 000000000..87069a2b4 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ProductRecycleJobs/ProductRecycleJobAutoMapperProfile.cs @@ -0,0 +1,31 @@ +using AutoMapper; +using Volo.Abp.AutoMapper; +using Win_in.Sfs.Wms.Store.Application.Contracts; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.Application; + +public partial class StoreApplicationAutoMapperProfile : Profile +{ + private void ProductRecycleJobAutoMapperProfile() + { + CreateMap() + .ReverseMap(); + + CreateMap() + ; + + CreateMap(); + + CreateMap() + .IgnoreAuditedObjectProperties() + .Ignore(x => x.MasterID) + .Ignore(x => x.TenantId) + .Ignore(x => x.Number) + .Ignore(x => x.Id); + + CreateMap() + ; + + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs new file mode 100644 index 000000000..84ac2f4e3 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs @@ -0,0 +1,52 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Modeling; +using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Shared.EntityFrameworkCore; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public static class ProductRecycleJobDbContextModelCreatingExtensions +{ + public static void ConfigureProductRecycleJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ProductReceiveJob), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsBase(); + //Configure Job base properties + b.ConfigureJob(); + //Properties + b.Property(q => q.Workshop).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.Shift).HasMaxLength(SfsPropertyConst.CodeLength); + //Relations + b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + //Indexes + b.HasIndex(q => new { q.Number }).IsUnique(); + }); + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ProductRecycleJobDetail), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsBase(); + //Configure Job base properties + b.ConfigureJobRecommendToDetail(); + //Properties + + + //Relations + //None + + //Indexes + //b.HasIndex(q => new { q.PackingCode }).IsUnique(); + }); + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobEfCoreRepository.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobEfCoreRepository.cs new file mode 100644 index 000000000..7e7a9b688 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobEfCoreRepository.cs @@ -0,0 +1,11 @@ +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Wms.Store.Domain; + +namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; + +public class ProductRecycleJobEfCoreRepository : SfsJobEfCoreRepositoryBase, IProductRecycleJobRepository +{ + public ProductRecycleJobEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionRecycleJobEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionRecycleJobEventHandler.cs new file mode 100644 index 000000000..8e6c7fc5b --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ProductionRecycleJobEventHandler.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.EventBus; +using Volo.Abp.Uow; +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; + +namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; + + +public class ProductionRecycleJobEventHandler : + StoreEventHandlerBase +, ILocalEventHandler> +, ILocalEventHandler> +{ + private readonly IProductRecycleNoteAppService _productRecycleNoteAppService; + + public ProductionRecycleJobEventHandler( + IProductRecycleNoteAppService productRecycleNoteAppService + ) + { + _productRecycleNoteAppService = productRecycleNoteAppService; + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCreatedEntityEventData eventData) + { + var entity = eventData.Entity; + + if (entity.IsAutoComplete) + { + entity.CompleteTime = Clock.Now; + entity.JobStatus = EnumJobStatus.Done; + + foreach (var detail in eventData.Entity.Details) + { + detail.SetHandledFromRecommend(); + } + + var note = BuildProductionReturnNote(entity); + await _productRecycleNoteAppService.CreateAsync(note).ConfigureAwait(false); + } + } + + [UnitOfWork] + public virtual async Task HandleEventAsync(SfsCompletedEntityEventData eventData) + { + var entity = eventData.Entity; + + var productRecycleNote = BuildProductionReturnNote(entity); + await _productRecycleNoteAppService.CreateAsync(productRecycleNote).ConfigureAwait(false); + + } + + private ProductRecycleNoteEditInput BuildProductionReturnNote(ProductRecycleJob entity) + { + var input = ObjectMapper.Map(entity); + + + input.Details = new List(); + + foreach (var detail in entity.Details.Where(detail => detail.HandledQty != 0)) + { + var inputDetail = ObjectMapper.Map(detail); + + input.Details.Add(inputDetail); + } + + return input; + } +} From d9f4124ba0b08cbb9583807189e0e3bc7712dc26 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Thu, 7 Mar 2024 10:46:33 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=80=80=E6=8B=86EF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IStoreDbContext.cs | 1 + .../ProductRecycleJobDbContextModelCreatingExtensions.cs | 2 +- .../Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs | 1 + .../StoreDbContextModelCreatingExtensions.cs | 1 + .../StoreEntityFrameworkCoreModule.cs | 3 +++ 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs index dc0a7a333..a171f29dc 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs @@ -96,6 +96,7 @@ public interface IStoreDbContext : IEfCoreDbContext public DbSet JisDeliverJobs { get; } public DbSet PurchaseReturnJobs { get; } public DbSet ProductReceiveJobs { get; } + public DbSet ProductRecycleJobs { get; } public DbSet CheckJobs { get; } public DbSet CountJobs { get; } public DbSet UnplannedIssueJobs { get; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs index 84ac2f4e3..de07c7b69 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ProductRecycleJobs/ProductRecycleJobDbContextModelCreatingExtensions.cs @@ -13,7 +13,7 @@ public static class ProductRecycleJobDbContextModelCreatingExtensions builder.Entity(b => { //Configure table & schema name - b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ProductReceiveJob), options.Schema); + b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ProductRecycleJob), options.Schema); //Configure ABP properties b.ConfigureByConvention(); //Configure Sfs base properties diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs index 12527670d..f9ed7239c 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs @@ -96,6 +96,7 @@ public class StoreDbContext : AbpDbContext, IStoreDbContext public DbSet JisDeliverJobs { get; set; } public DbSet PurchaseReturnJobs { get; set; } public DbSet ProductReceiveJobs { get; set; } + public DbSet ProductRecycleJobs { get; set; } public DbSet CheckJobs { get; set; } public DbSet CountJobs { get; set; } public DbSet UnplannedIssueJobs { get; set; } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs index 67eb52523..62d3e058d 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs @@ -115,6 +115,7 @@ public static class StoreDbContextModelCreatingExtensions builder.ConfigureJisDeliverJob(options); builder.ConfigurePurchaseReturnJob(options); builder.ConfigureProductReceiveJob(options); + builder.ConfigureProductRecycleJob(options); builder.ConfigureCheckJob(options); builder.ConfigureCountJob(options); builder.ConfigureUnplannedIssueJob(options); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs index 2b05879e9..504232437 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs @@ -116,6 +116,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); + context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); @@ -279,6 +280,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); + options.Entity(orderOptions => + orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions => From 3aa63da321eb7e5f1cc2cb1c8775099501c853b5 Mon Sep 17 00:00:00 2001 From: liuyunfeng Date: Fri, 8 Mar 2024 09:35:56 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=86=E7=AE=B1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublishProfiles/FolderProfile.pubxml | 12 ++++-------- .../PublishProfiles/FolderProfile1.pubxml | 16 ---------------- .../Jobs/InspectJobs/InspectJobAppService.cs | 2 +- .../Jobs/IssueJobs/IssueJobAppService.cs | 11 ++++++----- .../PurchaseReceiptJobAppService.cs | 12 +++++++----- .../PurchaseReceiptRequestAppService.cs | 5 +++-- 6 files changed, 21 insertions(+), 37 deletions(-) delete mode 100644 be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml index 893ee79a0..c238ca481 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile.pubxml @@ -4,17 +4,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - true - false - true + False + False + True Release Any CPU FileSystem - D:\发布\WMS\store + D:\~all-publish\WMS2.0_东阳\Win_in.Sfs.Wms.Store.HttpApi.Host FileSystem - - net6.0 - 488eeada-cfed-4016-9884-7a1dcbe5eb9c - false \ No newline at end of file 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 deleted file mode 100644 index c238ca481..000000000 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - False - False - True - Release - Any CPU - FileSystem - D:\~all-publish\WMS2.0_东阳\Win_in.Sfs.Wms.Store.HttpApi.Host - FileSystem - - \ No newline at end of file diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs index e363915bd..9ecba3c87 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InspectJobs/InspectJobAppService.cs @@ -170,7 +170,7 @@ public class InspectJobAppService public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input) { InspectJob job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); - InspectJobDetail detail = job.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode && p.ReceiveQty == input.FromQty); + InspectJobDetail detail = job.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode); /* && p.ReceiveQty == input.FromQty*/ if (detail == null) { throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取InspectDetail表为空!"); diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs index 6439fc1e8..f1e5d8d17 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/IssueJobAppService.cs @@ -168,23 +168,24 @@ public class IssueJobAppService public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input) { var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); - IssueJobDetail detail = job.Details.FirstOrDefault(p => p.HandledPackingCode == input.FromPackingCode && p.HandledQty == input.FromQty); + IssueJobDetail detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode ); /*&& p.HandledQty == input.FromQty*/ if (detail == null) { - throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取IssueJobDetail表为空!"); + //throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取IssueJobDetail表为空!"); + throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取IssueJobDetail表为空!"); } //插入目标箱 var newDetail = CommonHelper.CloneObj(detail); newDetail.SetId(GuidGenerator.Create()); newDetail.RecommendPackingCode = input.ToPackingCode; newDetail.RecommendQty = input.ToQty; - newDetail.HandledPackingCode = input.ToPackingCode; - newDetail.HandledQty = input.ToQty; + newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值 + newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0; //newDetail.CreationTime = CommonHelper.CurTime; job.Details.Add(newDetail); //修改源箱 detail.RecommendQty = input.FromQty - input.ToQty; - detail.HandledQty = input.FromQty - input.ToQty; + detail.HandledQty = detail.HandledQty > 0 ? input.FromQty - input.ToQty : 0; var entity = await _repository.UpdateAsync(job).ConfigureAwait(false); var ret = ObjectMapper.Map(entity); return ret; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs index 75d502fb6..ec046020f 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/PurchaseReceiptJobs/PurchaseReceiptJobAppService.cs @@ -237,23 +237,25 @@ public class PurchaseReceiptJobAppService : public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input) { var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false); - PurchaseReceiptJobDetail detail = job.Details.FirstOrDefault(p => p.HandledPackingCode == input.FromPackingCode && p.HandledQty == input.FromQty); + PurchaseReceiptJobDetail detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode); /* && p.RecommendQty == input.FromQty*/ if (detail == null) { - throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取ReceiptRequestDetail表为空!"); + //throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取ReceiptRequestDetail表为空!"); + throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取PurchaseReceiptJobDetail表为空!"); + } //插入目标箱 var newDetail = CommonHelper.CloneObj(detail); newDetail.SetId(GuidGenerator.Create()); newDetail.RecommendPackingCode = input.ToPackingCode; newDetail.RecommendQty = input.ToQty; - newDetail.HandledPackingCode = input.ToPackingCode; - newDetail.HandledQty = input.ToQty; + newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值 + newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0; //newDetail.CreationTime = CommonHelper.CurTime; job.Details.Add(newDetail); //修改源箱 detail.RecommendQty = input.FromQty - input.ToQty; - detail.HandledQty = input.FromQty - input.ToQty; + detail.HandledQty = detail.HandledQty > 0 ? input.FromQty - input.ToQty : 0; var entity = await _repository.UpdateAsync(job).ConfigureAwait(false); var ret = ObjectMapper.Map(entity); return ret; diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs index 2c0039268..f146614c1 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/PurchaseReceiptRequests/PurchaseReceiptRequestAppService.cs @@ -168,10 +168,11 @@ public class PurchaseReceiptRequestAppService : public virtual async Task SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input, string packingCode) { var request = await _repository.FindAsync(p => p.Number == packingCode).ConfigureAwait(false); - PurchaseReceiptRequestDetail detail = request.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode && p.Qty == input.FromQty); + PurchaseReceiptRequestDetail detail = request.Details.FirstOrDefault(p => p.PackingCode == input.FromPackingCode); /* && p.Qty == input.FromQty*/ if (detail == null) { - throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取ReceiptRequestDetail表为空!"); + //throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取ReceiptRequestDetail表为空!"); + throw new UserFriendlyException($"根据PackingCode={input.FromPackingCode}取PurchaseReceiptRequestDetail表为空!"); } //插入目标箱 var newDetail = CommonHelper.CloneObj(detail);