From e71bc24daa8f00768787e18f5daba09128abfc62 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周二, 29 4月 2025 10:59:40 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WmsPlace.cs | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WmsPlace.cs b/HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WmsPlace.cs new file mode 100644 index 0000000..b557a95 --- /dev/null +++ b/HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WmsPlace.cs @@ -0,0 +1,74 @@ +using CMS.Plugin.HIAWms.Domain; +using CMS.Plugin.HIAWms.Domain.WmsPlaces; +using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; + +/// <summary> +/// EfCore鎵╁睍 +/// </summary> +public static partial class CMSPluginEfCoreExtensions +{ + /// <summary> + /// Includes the details. + /// </summary> + /// <param name="queryable">The queryable.</param> + /// <param name="include">if set to <c>true</c> [include].</param> + /// <returns></returns> + public static IQueryable<WmsPlace> IncludeDetails(this IQueryable<WmsPlace> queryable, bool include = true) + { + if (!include) + { + return queryable; + } + + return queryable; + } + + /// <summary> + /// Configures the wmsplace. + /// </summary> + /// <param name="builder">The builder.</param> + public static void ConfigureWmsPlace(this ModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + + builder.Entity<WmsPlace>(b => + { + // Configure table & schema name + b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WmsPlaces").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("搴撲綅琛�"); + + b.ConfigureByConvention(); + + // Properties + b.Property(x => x.PlaceNo).HasMaxLength(WmsPlaceConsts.MaxPlaceNoLength).IsRequired().HasComment("缂栧彿"); + b.Property(x => x.StorageTypeNo).HasComment("璐т綅绫诲瀷"); + b.Property(x => x.PlaceStatus).HasComment("璐т綅鐘舵��"); + b.Property(x => x.AreaCode).HasMaxLength(WmsPlaceConsts.MaxAreaCodeLength).IsRequired().HasComment("鎵�鍦ㄥ簱鍖�"); + b.Property(x => x.Aisle).HasComment("宸烽亾"); + b.Property(x => x.RowNo).HasComment("鎺�"); + b.Property(x => x.ColumnNo).HasComment("鍒�"); + b.Property(x => x.LayerNo).HasComment("灞�"); + b.Property(x => x.Islock).HasComment("鏄惁閿佸畾"); + b.Property(x => x.EmptyContainer).HasComment("鏄惁绌烘墭"); + b.Property(x => x.RedundantField1).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("鍐椾綑瀛楁1 - 棰勭暀鎵╁睍鐢ㄩ��"); + b.Property(x => x.RedundantField2).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("鍐椾綑瀛楁2 - 棰勭暀鎵╁睍鐢ㄩ��"); + b.Property(x => x.RedundantField3).HasMaxLength(WmsPlaceConsts.MaxRedundantFieldLength).IsRequired(false).HasComment("鍐椾綑瀛楁3 - 棰勭暀鎵╁睍鐢ㄩ��"); + b.Property(x => x.Sort).HasComment("鎺掑簭"); + b.Property(x => x.Remark).HasMaxLength(WmsPlaceConsts.MaxRemarkLength).IsRequired(false).HasComment("澶囨敞"); + b.Property(x => x.IsDisabled).IsRequired(false).HasComment("鏄惁绂佺敤"); + + // Indexes + b.HasIndex(u => u.PlaceNo).IsUnique(); // 缂栧彿瀛楁娣诲姞鍞竴绱㈠紩 + b.HasIndex(u => u.AreaCode); // 鎵�鍦ㄥ簱鍖哄瓧娈垫坊鍔犳櫘閫氱储寮� + b.HasIndex(u => u.StorageTypeNo); // 璐т綅绫诲瀷瀛楁娣诲姞鏅�氱储寮� + b.HasIndex(u => u.PlaceStatus); // 璐т綅绫诲瀷瀛楁娣诲姞鏅�氱储寮� + + // Apply object extension mappings + b.ApplyObjectExtensionMappings(); + }); + } +} -- Gitblit v1.9.3