schangxiang@126.com
2025-05-07 cace264ad9d86a7831099810b079da1141957add
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using CMS.Plugin.PipeLineLems.Domain;
using CMS.Plugin.PipeLineLems.Domain.WorkPlan;
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<WorkPlan> IncludeDetails(this IQueryable<WorkPlan> queryable, bool include = true)
    {
        if (!include)
        {
            return queryable;
        }
 
        return queryable;
    }
 
    /// <summary>
    /// Configures the mytestentityname.
    /// </summary>
    /// <param name="builder">The builder.</param>
    public static void ConfigureWorkPlan(this ModelBuilder builder)
    {
        Check.NotNull(builder, nameof(builder));
 
        builder.Entity<WorkPlan>(b =>
        {
            //Configure table & schema name
            b.ToTable((CMSPluginDbProperties.DbTablePrefix + "_WorkPlans").ToLower(), CMSPluginDbProperties.DbSchema).HasComment("WorkPlan");
 
            b.ConfigureByConvention();
 
            //Properties
            b.Property(x => x.TaskCode).HasMaxLength(64).IsRequired().HasComment("任务编码");
            b.Property(x => x.OrgMaterialCode).HasMaxLength(64).IsRequired().HasComment("原料编号");
            b.Property(x => x.Sort).HasComment("排序");
            b.Property(x => x.IsDisabled).IsRequired(false).HasComment("是否禁用");
            b.Property(x => x.Remark).HasMaxLength(256).IsRequired(false).HasComment("备注");
 
            b.Property(x => x.OrgMaterialCode).HasMaxLength(64).HasComment("原料编号");
            b.Property(x => x.FactoryCode).HasMaxLength(64).HasComment("工厂代码");
            b.Property(x => x.ProductCode).HasMaxLength(64).HasComment("产品代码");
            b.Property(x => x.WorkstationCode).HasMaxLength(64).HasComment("工位代码");
            b.Property(x => x.EquipmentCode).HasMaxLength(64).HasComment("设备代码");
            b.Property(x => x.WorkpieceName).HasMaxLength(64).HasComment("工件名称");
            b.Property(x => x.ProcessName).HasMaxLength(64).HasComment("工序名称");
            b.Property(x => x.PipeFittingCode).HasMaxLength(64).HasComment("管件编码");
            b.Property(x => x.PreSerialNumber).HasMaxLength(64).HasComment("顺序号");
            b.Property(x => x.DataIdentifier).HasMaxLength(64).HasComment("原料标识");
            b.Property(x => x.PipeSpecCode).HasMaxLength(64).HasComment("管规格码");
            b.Property(x => x.PipeSectionName).HasMaxLength(64).HasComment("管段名称");
            b.Property(x => x.OuterDiameter).HasMaxLength(64).HasComment("外径");
            b.Property(x => x.Bevel).HasMaxLength(64).HasComment("坡口");
            b.Property(x => x.Material).HasMaxLength(64).HasComment("材质");
            b.Property(x => x.Length).HasMaxLength(64).HasComment("长度");
            b.Property(x => x.DrillingPosition).HasMaxLength(64).HasComment("打孔位");
            b.Property(x => x.Intersecting).HasMaxLength(64).HasComment("相贯");
            b.Property(x => x.InterfaceRequirement).HasMaxLength(64).HasComment("接口要求");
            b.Property(x => x.HasMainSignature).HasComment("是否有主签");
            b.Property(x => x.Quantity).HasComment("包括数量");
            b.Property(x => x.MarkingContent).HasMaxLength(64).HasComment("打码内容");
            b.Property(x => x.CuttingFile).HasMaxLength(64).HasComment("切割文件");
            b.Property(x => x.BranchOuterDiameter).HasMaxLength(64).HasComment("支外径");
            b.Property(x => x.BranchWallThickness).HasMaxLength(64).HasComment("支管壁厚");
            b.Property(x => x.BranchMaterial).HasMaxLength(64).HasComment("支管材质");
            b.Property(x => x.BranchPortRadius).HasMaxLength(64).HasComment("支管端口曲率半径");
            b.Property(x => x.BranchPortAngle).HasMaxLength(64).HasComment("支管端口角度");
            b.Property(x => x.BranchPortRequirement).HasMaxLength(64).HasComment("支管端口要求");
            b.Property(x => x.IntersectingLineType).HasMaxLength(64).HasComment("相贯线类型");
            b.Property(x => x.IntersectingLineCategory).HasMaxLength(64).HasComment("相贯线类别");
            b.Property(x => x.FinishedProductScale).HasMaxLength(64).HasComment("成品图幅");
            b.Property(x => x.FlangeThickness).HasMaxLength(64).HasComment("法兰厚度");
            b.Property(x => x.FlangeInnerDiameter).HasMaxLength(64).HasComment("法兰内径");
            b.Property(x => x.WeldingHeatInput).HasMaxLength(64).HasComment("焊接热输入");
            b.Property(x => x.PipeAllowableStress).HasMaxLength(64).HasComment("管道允许应力");
            b.Property(x => x.PipeDiameter).HasMaxLength(64).HasComment("管径");
            b.Property(x => x.PipeWallThickness).HasMaxLength(64).HasComment("管道壁厚");
            b.Property(x => x.VRData).HasMaxLength(64).HasComment("VR数据");
            b.Property(x => x.ProcessRouteNumber).HasMaxLength(64).HasComment("工艺路线编号");
            b.Property(x => x.PlannedStartTime).HasComment("计划开始时间");
            b.Property(x => x.PlannedEndTime).HasComment("计划完成时间");
            b.Property(x => x.TimeInfo).HasMaxLength(64).HasComment("时间信息");
 
            b.HasIndex(u => u.TaskCode);
 
            b.ApplyObjectExtensionMappings();
        });
    }
}