zs
2025-06-04 5a149d626ae8bc3fa4bddbb53f8caf40f51f6da6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using CMS.Plugin.MyExtension.Domain;
using CMS.Plugin.PipeLineLems.Domain;
using CMS.Plugin.PipeLineLems.Domain.Shared.MyTestEntityNames;
using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
 
namespace CMS.Plugin.PipeLineLems.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<CallMaterialOrderRecord> IncludeDetails(this IQueryable<CallMaterialOrderRecord> queryable, bool include = true)
    {
        if (!include)
        {
            return queryable;
        }
 
        return queryable;
    }
 
    /// <summary>
    /// Configures the mytestentityname.
    /// </summary>
    /// <param name="builder">The builder.</param>
    public static void ConfigureCallMaterialOrderRecord(this ModelBuilder builder)
    {
        Check.NotNull(builder, nameof(builder));
 
        builder.Entity<CallMaterialOrderRecord>(b =>
        {
            //Configure table & schema name
            b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_CallMaterialOrderRecords").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("叫料记录表");
 
            b.ConfigureByConvention();
 
            // Configure properties
 
            b.Property(x => x.CallMaterialStatus).IsRequired().HasComment("叫料状态");
            b.Property(x => x.DataIdentifier).IsRequired().HasMaxLength(256).HasComment("原料标识");
            b.Property(x => x.MaterialMode).HasMaxLength(256).HasComment("原料型号");
            b.Property(x => x.Quantity).HasComment("叫料数量");
            b.Property(x => x.WmsRetResult).HasComment("WMS返回结果");
            b.Property(x => x.WmsTaskNo).HasComment("WMS任务号");
 
            b.ConfigureMyCmsEntityForRecord();
 
            // Configure indexes
            b.HasIndex(u => u.DataIdentifier);
 
            b.ApplyObjectExtensionMappings();
        });
    }
}