¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | }); |
| | | } |
| | | } |