From e416b0653b1e69270935a5467b11a34f6345776c Mon Sep 17 00:00:00 2001 From: lvzb <35200379@qq.com> Date: Mon, 15 Apr 2024 11:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9B=98=E7=82=B9=E9=99=84?= =?UTF-8?q?=E5=B1=9E=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Jobs/CountJobs/DTOs/CountJobDTO.cs | 7 +++ .../DTOs/CountJobDependentDetailDTO.cs | 58 +++++++++++++++++++ .../Jobs/CountJobs/CountJob.cs | 5 ++ .../Jobs/CountJobs/CountJobDependentDetail.cs | 51 ++++++++++++++++ ...ountJobDbContextModelCreatingExtensions.cs | 25 ++++++++ .../StoreEntityFrameworkCoreModule.cs | 2 +- 6 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs create mode 100644 be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs index 57c8c539d..952919ea8 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDTO.cs @@ -1,6 +1,9 @@ +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win_in.Sfs.Shared.Domain; +using Win_in.Sfs.Shared.Domain.Entities; using Win_in.Sfs.Shared.Domain.Shared; +using Win_in.Sfs.Wms.Store.Domain; namespace Win_in.Sfs.Wms.Store.Application.Contracts; @@ -51,4 +54,8 @@ public class CountJobDTO : SfsJobDTOBase [Display(Name = "库位代码")] public string LocationCode { get; set; } + /// + /// 任务从表明细(记录每次扫得明细) + /// + public List DepDetails { get; set; } = new List(); } diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs new file mode 100644 index 000000000..e98bf2708 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDependentDetailDTO.cs @@ -0,0 +1,58 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Application.Contracts; + +public class CountJobDependentDetailDTO : SfsJobDetailDTOBase, IHasCountResult +{ + + /// + /// 盘点标签 + /// + [Display(Name = "盘点标签")] + [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] + public string CountLabel { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// 库存数量 + /// + [Display(Name = "库存数量")] + public decimal InventoryQty { get; set; } + + /// + /// 库存库位 + /// + [Display(Name = "库存库位")] + public string InventoryLocationCode { get; set; } + + /// + /// 盘点数量 + /// + [Display(Name = "盘点数量")] + public decimal CountQty { get; set; } + + /// + /// 盘点时间 + /// + [Display(Name = "盘点时间")] + public DateTime? CountTime { get; set; } + + /// + /// 盘点操作员 + /// + [Display(Name = "盘点操作员")] + public string CountOperator { get; set; } + + /// + /// 盘点描述 + /// + [Display(Name = "盘点描述")] + public string CountDescription { get; set; } +} diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs index 5d2834ed6..a008e92f2 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJob.cs @@ -62,6 +62,11 @@ public class CountJob : SfsJobAggregateRootBase /// [IgnoreUpdate] public override List Details { get; set; } = new List(); + /// + /// 任务从表明细(记录每次扫得明细) + /// + [IgnoreUpdate] + public List DepDetails { get; set; } = new List(); /// /// 设置任务明细的实际库位和实际数量 diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs new file mode 100644 index 000000000..1d79ddb41 --- /dev/null +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobDependentDetail.cs @@ -0,0 +1,51 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Win_in.Sfs.Shared.Domain; + +namespace Win_in.Sfs.Wms.Store.Domain; + +public class CountJobDependentDetail : SfsJobDetailEntityBase, IHasCountResult, IHasInventoryQty +{ + + /// + /// 盘点标签 + /// + public string CountLabel { get; set; } + + /// + /// 库存数量 + /// + public decimal InventoryQty { get; set; } + + /// + /// 计量单位 + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// 库存库位 + /// + public string InventoryLocationCode { get; set; } + + /// + /// 盘点数量(每次扫得数量) + /// + public decimal CountQty { get; set; } + + /// + /// 盘点时间 + /// + public DateTime? CountTime { get; set; } + + /// + /// 盘点操作员 + /// + public string CountOperator { get; set; } + + /// + /// 盘点描述 + /// + public string CountDescription { get; set; } +} + diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs index 7222a0ccc..1a6333d90 100644 --- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs +++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/CountJobs/CountJobDbContextModelCreatingExtensions.cs @@ -29,6 +29,7 @@ public static class CountJobDbContextModelCreatingExtensions b.Property(q => q.LocationCode).HasMaxLength(SfsPropertyConst.CodeLength); //Relations b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); + b.HasMany(q => q.DepDetails).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); //Indexes b.HasIndex(q => new { q.Number }).IsUnique(); }); @@ -55,5 +56,29 @@ public static class CountJobDbContextModelCreatingExtensions //Indexes //b.HasIndex(q => new { q.PackingCode }).IsUnique(); }); + + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(CountJobDependentDetail), options.Schema); + //Configure ABP properties + b.ConfigureByConvention(); + //Configure Sfs base properties + b.ConfigureSfsBase(); + //Configure Job base properties + b.ConfigureJobDetail(); + //Properties + b.Property(q => q.CountLabel).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.InventoryLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CountOperator).HasMaxLength(SfsPropertyConst.CodeLength); + b.Property(q => q.CountDescription).HasMaxLength(SfsPropertyConst.CodeLength); + + //Relations + //None + + //Indexes + //b.HasIndex(q => new { q.PackingCode }).IsUnique(); + }); } } 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 17d37a43e..3a820eef5 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 @@ -337,7 +337,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule #region Jobs options.Entity(orderOptions => - orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); + orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details).Include(o => o.DepDetails)); options.Entity(orderOptions => orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details)); options.Entity(orderOptions =>