AdoS0NbrControl.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S0.Warehouse;
  2. /// <summary>
  3. /// 单号规则主数据(复刻 NbrControl)
  4. /// </summary>
  5. [SugarTable("NbrControl", "单号规则主数据(复刻 NbrControl)")]
  6. // P1 租户化:唯一约束改为租户内唯一(tenant_id, domain_code, NbrType),使不同租户可复用相同单号规则码。
  7. // 索引名/列须与 UpdateScripts 版本 SQL 完全一致,CodeFirst 重启方能幂等、不再复活旧全局唯一索引。
  8. [SugarIndex("uk_NbrControl_tenant_domain_nbrtype", nameof(TenantId), OrderByType.Asc, nameof(DomainCode), OrderByType.Asc, nameof(NbrType), OrderByType.Asc, IsUnique = true)]
  9. public class AdoS0NbrControl : ITenantIdFilter
  10. {
  11. [SugarColumn(ColumnName = "RecID", ColumnDescription = "主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "int")]
  12. public int Id { get; set; }
  13. [SugarColumn(ColumnName = "NbrType", ColumnDescription = "单号类型编码", Length = 50, IsNullable = true)]
  14. public string? NbrType { get; set; }
  15. [SugarColumn(ColumnName = "Description", ColumnDescription = "描述", Length = 50, IsNullable = true)]
  16. public string? Description { get; set; }
  17. [SugarColumn(ColumnName = "NbrPre1", ColumnDescription = "前缀1", Length = 50, IsNullable = true)]
  18. public string? NbrPre1 { get; set; }
  19. [SugarColumn(ColumnName = "NbrPre2", ColumnDescription = "前缀2", Length = 50, IsNullable = true)]
  20. public string? NbrPre2 { get; set; }
  21. [SugarColumn(ColumnName = "NbrPre3", ColumnDescription = "前缀3", Length = 50, IsNullable = true)]
  22. public string? NbrPre3 { get; set; }
  23. [SugarColumn(ColumnName = "NextValue", ColumnDescription = "下一值", IsNullable = true)]
  24. public int? NextValue { get; set; }
  25. [SugarColumn(ColumnName = "company_ref_id", ColumnDescription = "关联公司 ID", ColumnDataType = "bigint")]
  26. public long CompanyRefId { get; set; }
  27. [SugarColumn(ColumnName = "factory_ref_id", ColumnDescription = "关联工厂 ID", ColumnDataType = "bigint")]
  28. public long FactoryRefId { get; set; }
  29. [SugarColumn(ColumnName = "domain_code", ColumnDescription = "工厂域编码", Length = 50)]
  30. public string DomainCode { get; set; } = string.Empty;
  31. [SugarColumn(ColumnName = "IniValue", ColumnDescription = "初始值", IsNullable = true)]
  32. public int? IniValue { get; set; }
  33. [SugarColumn(ColumnName = "MinValue", ColumnDescription = "最小值", IsNullable = true)]
  34. public int? MinValue { get; set; }
  35. [SugarColumn(ColumnName = "MaxValue", ColumnDescription = "最大值", IsNullable = true)]
  36. public int? MaxValue { get; set; }
  37. [SugarColumn(ColumnName = "ResetValue", ColumnDescription = "重置值", IsNullable = true)]
  38. public int? ResetValue { get; set; }
  39. [SugarColumn(ColumnName = "AllowReset", ColumnDescription = "允许重置", ColumnDataType = "bit(1)", IsNullable = true)]
  40. public bool? AllowReset { get; set; }
  41. [SugarColumn(ColumnName = "AllowSkip", ColumnDescription = "允许跳号", ColumnDataType = "bit(1)", IsNullable = true)]
  42. public bool? AllowSkip { get; set; }
  43. [SugarColumn(ColumnName = "AllowManual", ColumnDescription = "允许手动", ColumnDataType = "bit(1)", IsNullable = true)]
  44. public bool? AllowManual { get; set; }
  45. [SugarColumn(ColumnName = "DateType", ColumnDescription = "日期类型", Length = 50, IsNullable = true)]
  46. public string? DateType { get; set; }
  47. [SugarColumn(ColumnName = "EffectiveDate", ColumnDescription = "生效日期", IsNullable = true)]
  48. public DateTime? EffectiveDate { get; set; }
  49. [SugarColumn(ColumnName = "ExpireDate", ColumnDescription = "失效日期", IsNullable = true)]
  50. public DateTime? ExpireDate { get; set; }
  51. [SugarColumn(ColumnName = "ResetByDate", ColumnDescription = "是否按日期重置", ColumnDataType = "boolean", IsNullable = true)]
  52. public bool? ResetByDate { get; set; }
  53. [SugarColumn(ColumnName = "ArrayMethod", ColumnDescription = "排序方式", Length = 50, IsNullable = true)]
  54. public string? ArrayMethod { get; set; }
  55. [SugarColumn(ColumnName = "IsDateType", ColumnDescription = "是否含日期", ColumnDataType = "bit(1)", IsNullable = true)]
  56. public bool? IsDateType { get; set; }
  57. [SugarColumn(ColumnName = "BusinessID", ColumnDescription = "业务ID", IsNullable = true)]
  58. public long? BusinessId { get; set; }
  59. [SugarColumn(ColumnName = "IsActive", ColumnDescription = "是否启用", ColumnDataType = "boolean", IsNullable = true)]
  60. public bool? IsActive { get; set; }
  61. [SugarColumn(ColumnName = "IsConfirm", ColumnDescription = "是否确认", ColumnDataType = "boolean", IsNullable = true)]
  62. public bool? IsConfirm { get; set; }
  63. [SugarColumn(ColumnName = "Domain", ColumnDescription = "域", Length = 50, IsNullable = true)]
  64. public string? Domain { get; set; }
  65. [SugarColumn(ColumnName = "AddDate", ColumnDescription = "新增日期", IsNullable = true)]
  66. public DateTime? AddDate { get; set; }
  67. [SugarColumn(ColumnName = "IniDate", ColumnDescription = "初始日期", IsNullable = true)]
  68. public DateTime? IniDate { get; set; }
  69. [SugarColumn(ColumnName = "IniNextValue", ColumnDescription = "初始下一值", IsNullable = true)]
  70. public int? IniNextValue { get; set; }
  71. [SugarColumn(ColumnName = "IsStart", ColumnDescription = "是否起始", ColumnDataType = "boolean", IsNullable = true)]
  72. public bool? IsStart { get; set; }
  73. [SugarColumn(ColumnName = "IsChanged", ColumnDescription = "是否已变更", ColumnDataType = "boolean", IsNullable = true)]
  74. public bool? IsChanged { get; set; }
  75. // 与现网表一致:PascalCase 审计列(CreateTime 等)。EnableUnderLine 时由 SqlSugarSetup 对本类型跳过列名下划线转换,避免误加 create_time。
  76. [SugarColumn(ColumnName = "CreateUser", ColumnDescription = "创建人", Length = 24, IsNullable = true)]
  77. public string? CreateUser { get; set; }
  78. [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间", IsNullable = true)]
  79. public DateTime? CreateTime { get; set; }
  80. [SugarColumn(ColumnName = "UpdateUser", ColumnDescription = "更新人", Length = 24, IsNullable = true)]
  81. public string? UpdateUser { get; set; }
  82. [SugarColumn(ColumnName = "UpdateTime", ColumnDescription = "更新时间", IsNullable = true)]
  83. public DateTime? UpdateTime { get; set; }
  84. [SugarColumn(ColumnName = "EffectiveTime", ColumnDescription = "生效时间", IsNullable = true)]
  85. public DateTime? EffectiveTime { get; set; }
  86. [SugarColumn(ColumnName = "tenant_id", IsNullable = true)]
  87. public long? TenantId { get; set; }
  88. }