yirongjin
2025-07-23 c2da0b81321e66e3c3706d6833ad4c92c62d0935
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 iWare.Wms.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
 
namespace Furion.Extras.iWare.Wms.Entity
{
    /// <summary>
    /// 低代码模块管理
    /// </summary>
    [Table("sys_low_code_module")]
    [Comment("低代码模块管理")]
    public class SysLowCode : DEntityBase
    {
        /// <summary>
        /// 作者姓名
        /// </summary>
        [Comment("作者姓名")]
        [MaxLength(20)]
        public string AuthorName { get; set; }
 
        /// <summary>
        /// 生成方式
        /// </summary>
        [Comment("生成方式")]
        [MaxLength(20)]
        public string GenerateType { get; set; }
 
        /// <summary>
        /// 数据库名
        /// </summary>
        [Comment("数据库名")]
        [MaxLength(100)]
        public string DatabaseName { get; set; }
 
        /// <summary>
        /// 命名空间
        /// </summary>
        [Comment("命名空间")]
        [MaxLength(100)]
        public string NameSpace { get; set; }
 
        /// <summary>
        /// 程序集
        /// </summary>
        [NotMapped]
        public string ProName
        {
            get { return NameSpace.TrimEnd(new char[] { '.', 'A', 'p', 'p', 'l', 'i', 'c', 'a', 't', 'i', 'o', 'n' }); }
        }
 
        /// <summary>
        /// 关联表信息
        /// </summary>
        [NotMapped]
        public dynamic Tables
        {
            get
            {
                if (Databases == null || !Databases.Any()) return null;
                else return Databases.Select(x => new { x.TableName, x.ClassName, x.TableDesc }).Distinct().ToList();
            }
        }
 
        /// <summary>
        /// 业务名
        /// </summary>
        [Comment("业务名")]
        [MaxLength(100)]
        public string BusName { get; set; }
 
        /// <summary>
        /// 菜单应用分类(应用编码)
        /// </summary>
        [Comment("菜单应用分类")]
        [MaxLength(50)]
        public string MenuApplication { get; set; }
 
        /// <summary>
        /// 菜单编码
        /// </summary>
        [Comment("菜单编码")]
        public long MenuPid { get; set; }
 
        /// <summary>
        /// 动态表单类型
        /// </summary>
        [Comment("动态表单类型")]
        [Column(TypeName = "int")]
        public FormDesignType FormDesignType { get; set; } = FormDesignType.VueFormDesign;
 
        /// <summary>
        /// 动态表单
        /// </summary>
        [Comment("动态表单")]
        [Column(TypeName = "text")]
        public string FormDesign { get; set; }
 
        public ICollection<SysLowCodeDataBase> Databases { get; set; }
 
        /// <summary>
        /// 配置多对多关系
        /// </summary>
        /// <param name="entityBuilder"></param>
        /// <param name="dbContext"></param>
        /// <param name="dbContextLocator"></param>
        public void Configure(EntityTypeBuilder<SysLowCode> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.HasMany(p => p.Databases)
                .WithOne(p => p.SysLowCode)
                .HasForeignKey(p => p.SysLowCodeId)
                .HasPrincipalKey(p => p.Id);
        }
    }
}