AdoS0LineSkillDetail.cs 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S0.Manufacturing;
  2. /// <summary>
  3. /// 产线岗位技能明细(子表)。源平台子表结构待确认;当前以“岗位→人员技能主数据引用”占位实现。
  4. /// </summary>
  5. [SugarTable("LineSkillDetail", "产线岗位技能明细")]
  6. public class AdoS0LineSkillDetail : ITenantIdFilter
  7. {
  8. [SugarColumn(ColumnName = "RecID", ColumnDescription = "明细主键", IsPrimaryKey = true, IsIdentity = true, ColumnDataType = "bigint")]
  9. public long Id { get; set; }
  10. [SugarColumn(ColumnName = "LineSkillRecID", ColumnDescription = "产线岗位主表ID", ColumnDataType = "bigint")]
  11. public long LineSkillMasterId { get; set; }
  12. [SugarColumn(ColumnName = "PersonSkillId", ColumnDescription = "人员技能主数据ID", ColumnDataType = "bigint")]
  13. public long PersonSkillId { get; set; }
  14. // ---- 旧系统遗留业务键列 ----
  15. // 这些列与 IX_LineSkillDetail 唯一索引同源,历史数据(含 1.0.412 种子)全部有值。
  16. // 此前实体未映射它们,导致 Update 的「删除+重插」把整行的 Domain/ProdLine/JOBNo/SkillNo
  17. // 写成 NULL —— 明细因此丢失业务键。这里补映射,由服务端从主表与已解析的技能主数据回填。
  18. //
  19. // ⚠️ SkillNo 与 PersonSkillId 语义不同,不得互相顶替:
  20. // SkillNo = 技能【业务编码】快照(字符串,来自 PersonSkill.Code)
  21. // PersonSkillId = 指向 PersonSkill 主数据的【内部主键】(bigint FK)
  22. // 当前数据里两者恰好都出现 "102",纯属编码巧合,不是同一个字段。
  23. [SugarColumn(ColumnName = "Domain", ColumnDescription = "工厂域(旧系统遗留)", Length = 50, IsNullable = true)]
  24. public string? Domain { get; set; }
  25. [SugarColumn(ColumnName = "Site", ColumnDescription = "站点/工作组(旧系统遗留,当前全库为 NULL)", Length = 12, IsNullable = true)]
  26. public string? Site { get; set; }
  27. [SugarColumn(ColumnName = "ProdLine", ColumnDescription = "生产线编码(旧系统遗留)", Length = 100, IsNullable = true)]
  28. public string? ProdLine { get; set; }
  29. [SugarColumn(ColumnName = "JOBNo", ColumnDescription = "岗位编码(旧系统遗留)", Length = 100, IsNullable = true)]
  30. public string? JOBNo { get; set; }
  31. [SugarColumn(ColumnName = "SkillNo", ColumnDescription = "技能业务编码快照(旧系统遗留,= PersonSkill.Code)", Length = 100, IsNullable = true)]
  32. public string? SkillNo { get; set; }
  33. [SugarColumn(ColumnName = "required_level", ColumnDescription = "要求等级", Length = 50, IsNullable = true)]
  34. public string? RequiredLevel { get; set; }
  35. [SugarColumn(ColumnName = "StartDate", ColumnDescription = "生效日期", IsNullable = true)]
  36. public DateTime? EffectiveDate { get; set; }
  37. [SugarColumn(ColumnName = "remark", ColumnDescription = "备注", Length = 500, IsNullable = true)]
  38. public string? Remark { get; set; }
  39. [SugarColumn(ColumnName = "is_enabled", ColumnDescription = "启用", ColumnDataType = "boolean")]
  40. public bool IsEnabled { get; set; } = true;
  41. [SugarColumn(ColumnName = "CreateTime", ColumnDescription = "创建时间")]
  42. public DateTime CreateTime { get; set; } = DateTime.Now;
  43. /// <summary>
  44. /// 人员技能【业务编码】(PersonSkill.Code),不落库、仅用于展示与提交。
  45. /// PersonSkillId 是内部自增主键,绝不作为前端 select 的业务值;
  46. /// UI 一律用 Code,保存时由服务端 tenant-safe 解析成 Id。
  47. /// 注意:与本表的 legacy 列 SkillNo 语义不同 —— SkillNo 是旧系统自带的技能编码快照,
  48. /// PersonSkillCode 是当前 PersonSkill 主数据的编码,二者可能不同源,不得互相顶替。
  49. /// </summary>
  50. [SugarColumn(IsIgnore = true)]
  51. public string? PersonSkillCode { get; set; }
  52. /// <summary>人员技能名称(PersonSkill.Name),不落库、仅展示。</summary>
  53. [SugarColumn(IsIgnore = true)]
  54. public string? PersonSkillName { get; set; }
  55. [SugarColumn(ColumnName = "tenant_id", IsNullable = true)]
  56. public long? TenantId { get; set; }
  57. }