schangxiang@126.com
2024-06-11 2954a2dd4529679ff30c1fd08870895c29d507f2
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using iWare.Wms.Core.Enum;
 
namespace iWare.Wms.Core
{
    /// <summary>
    /// 托盘信息
    /// </summary>
    [Table("wms_container")]
    [Comment("托盘信息")]
    public class WmsContainer:DEntityBase, IEntityTypeBuilder<WmsContainer>
    {
 
        /// <summary>
        /// 编号
        /// </summary>
        [Comment("编号")]
        [Required]
 
        [MaxLength(50)]
        public string ContainerCode { get; set; }
 
        /// <summary>
        /// 类型;数据字典
        /// </summary>
        [Comment("类型")]
        [Required]
 
        public ContainerType ContainerType { get; set; }
 
        /// <summary>
        /// 托盘状态;数据字典
        /// </summary>
        [Comment("托盘状态")]
        [Required]
 
        public ContainerStatus ContainerStatus { get; set; }
 
        /// <summary>
        /// 长度
        /// </summary>
        [Comment("长度")]
 
        public decimal SpecLength { get; set; }
 
        /// <summary>
        /// 宽度
        /// </summary>
        [Comment("宽度")]
 
        public decimal SpecWidth { get; set; }
 
        /// <summary>
        /// 高度
        /// </summary>
        [Comment("高度")]
 
        public decimal SpecHeight { get; set; }
 
        /// <summary>
        /// 限长
        /// </summary>
        [Comment("限长")]
 
        public decimal LimitLength { get; set; }
 
        /// <summary>
        /// 限宽
        /// </summary>
        [Comment("限宽")]
 
        public decimal LimitWidth { get; set; }
 
        /// <summary>
        /// 限高
        /// </summary>
        [Comment("限高")]
 
        public decimal LimitHeight { get; set; }
 
        /// <summary>
        /// 载重上限
        /// </summary>
        [Comment("载重上限")]
 
        public decimal MaxWeight { get; set; }
 
        /// <summary>
        /// 父托盘ID
        /// </summary>
        [Comment("父托盘ID")]
 
        public long ParentContainerId { get; set; }
 
 
        public ICollection<WmsMaterialContainer> WmsMaterialContainers { get; set; }
 
 
        /// <summary>
        /// 构建一对多的关系
        /// </summary>
        /// <param name="entityBuilder"></param>
        /// <param name="dbContext"></param>
        /// <param name="dbContextLocator"></param>
        public void Configure(EntityTypeBuilder<WmsContainer> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.HasMany(x => x.WmsMaterialContainers)
                .WithOne(x => x.WmsContainer)
                .HasForeignKey(x => x.ContainerId);
        }
    }
}