schangxiang@126.com
2024-04-23 f47411fb53aeee0c7bd514cbc841f9030349f448
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
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
 
namespace Admin.NET.Core
{
    /// <summary>
    /// 转储单
    /// </summary>
    [Table("wms_dumporder")]
    [Comment("转储单")]
    public class WmsDumpOrder : DEntityBase, IEntityTypeBuilder<WmsDumpOrder>
    {
        /// <summary>
        ///  Billdate
        /// </summary>
        [Comment("单据大类")]
        [Required]
        public long OrderLargeCategory { get; set; }
 
        /// <summary>
        /// 单据小类
        /// </summary>
        [Comment("单据小类")]
        [Required]
        public long OrderSubclass { get; set; }
 
        /// <summary>
        /// 上位系统单据唯一识别码
        /// </summary>
        [Comment("上位系统单据唯一识别码")]
        public long SOID { get; set; }
 
        /// <summary>
        /// 单据编号  
        /// </summary>
        [Comment("单据编号")]
        [Required]
        [MaxLength(255)]
        public string NO { get; set; }
 
        /// <summary>
        /// 创建日期    
        /// </summary>
        [Comment("创建日期")]
        public DateTimeOffset? Billdate { get; set; }
 
        /// <summary>
        /// 创建人
        /// </summary>
        [Comment("创建人")]
        [MaxLength(255)]
        public string Creator { get; set; }
 
        /// <summary>
        /// 公司    
        /// </summary>
        [Comment("公司")]
        [MaxLength(255)]
        public string Companyname { get; set; }
 
        /// <summary>
        /// 单据状态
        /// </summary>
        [Comment("单据状态")]
        [Required]
        public OrderStatusEnum OrderStatus { get; set; } = OrderStatusEnum.WEIXIAFA;
 
        /// <summary>
        /// 单据明细
        /// </summary>
        public ICollection<WmsDumpOrderDetails> WmsDumpOrderDetails { get; set; }
 
        /// <summary>
        /// 1对多配置关系
        /// </summary>
        /// <param name="entityBuilder"></param>
        /// <param name="dbContext"></param>
        /// <param name="dbContextLocator"></param>
        public void Configure(EntityTypeBuilder<WmsDumpOrder> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            // 一对多配置
            entityBuilder.HasMany(x => x.WmsDumpOrderDetails)
                .WithOne(x => x.WmsDumpOrder)
                .HasForeignKey(x => x.OrderId);
        }
    }
}