AdoS0QmsFinishedSpecEntities.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. namespace Admin.NET.Plugin.AiDOP.Entity.S0.Quality;
  2. /// <summary>
  3. /// 成品检验规范(FQC)主表 —— S7 FQC 运行链路的唯一事实源。
  4. ///
  5. /// 【为什么不是 qms_fqcjygf】S0 侧原 `qms_fqcjygf` 无任何下游消费者;S7 报检 → 生成检验单
  6. /// 实际读的是 `qms_ccjygf` / `qms_ccjygfzb`(`FqcApplyService` 经桥表 `ado_s7_fqc_spec_material_map`
  7. /// 精确解析)。本实体把 S0 维护入口直接落到运行链路的表上,见 `S7:D-002`。
  8. ///
  9. /// 【物理事实(2026-09-02 实测,勿假设)】
  10. /// · 本表**无 PRIMARY KEY、无任何索引、无唯一约束**;Id 由 SqlSugar `DataExecuting` AOP
  11. /// 在 `IsPrimaryKey=true && long==0` 时赋雪花值,不依赖 DB 自增;
  12. /// · 无 status / org / 审计列,字段就是下面这 9 个,不要凭空引用不存在的列;
  13. /// · 列名大小写混杂(`qms_ccjygfzb.UpperToleranceLimit` 为 PascalCase),
  14. /// 在 `EnableUnderLine=false` 下必须逐列显式 `ColumnName`,否则映射错列。
  15. ///
  16. /// 【租户】本实体**不实现 `ITenantIdFilter`**,全局租户过滤器对它不生效;
  17. /// 租户隔离 100% 依赖调用方显式谓词(见 `AdoS0QmsFqcInspectionSpecsController`)。
  18. /// </summary>
  19. [SugarTable("qms_ccjygf", "成品检验规范")]
  20. public class AdoS0QmsFinishedInspectionSpec
  21. {
  22. [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true, ColumnDataType = "bigint")]
  23. public long Id { get; set; }
  24. [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户Id", IsNullable = false, ColumnDataType = "bigint")]
  25. public long TenantId { get; set; }
  26. [SugarColumn(ColumnName = "wjbh", ColumnDescription = "文件编号", IsNullable = true, Length = 800)]
  27. public string? FileNumber { get; set; }
  28. [SugarColumn(ColumnName = "bb", ColumnDescription = "版本", IsNullable = true, Length = 800)]
  29. public string? VersionNo { get; set; }
  30. [SugarColumn(ColumnName = "cpmc", ColumnDescription = "产品名称", IsNullable = true, Length = 800)]
  31. public string? ProductName { get; set; }
  32. [SugarColumn(ColumnName = "cpxh", ColumnDescription = "产品型号", IsNullable = true, Length = 800)]
  33. public string? ProductModel { get; set; }
  34. /// <summary>生效日期。源列是 varchar(800) 自由文本(历史含 `2023..07.18`、`见受控章` 等脏值),
  35. /// 故保持 string,不改列类型;桥表侧由 NormalizeDate 归一为 datetime。</summary>
  36. [SugarColumn(ColumnName = "sxrq", ColumnDescription = "生效日期", IsNullable = true, Length = 800)]
  37. public string? EffectiveDate { get; set; }
  38. /// <summary>适用物料编码。历史为多物料脏串(分隔符不统一),新建议单码或分号分隔。</summary>
  39. [SugarColumn(ColumnName = "wlbm", ColumnDescription = "物料编码", IsNullable = true, ColumnDataType = "text")]
  40. public string? MaterialCode { get; set; }
  41. [SugarColumn(ColumnName = "fj", ColumnDescription = "附件", IsNullable = true, ColumnDataType = "text")]
  42. public string? Attachment { get; set; }
  43. }
  44. /// <summary>
  45. /// 成品检验规范-检验明细。列集合直接对齐 `FqcApplyService` 生成检验单时的快照读取集
  46. /// (`xh / jyxm / UpperToleranceLimit / LowerToleranceLimit / lrlx / jsyq / jyyqsbgj /
  47. /// jyff / jytk / jsbz / cyfa / jl / SizeSpecifications`),未被快照消费的历史列
  48. /// (`bztk` / `isPeel` / `isDisplay`)不纳入实体,避免 CodeFirst 误改结构。
  49. /// </summary>
  50. [SugarTable("qms_ccjygfzb", "成品检验规范-检验明细")]
  51. public class AdoS0QmsFinishedInspectionSpecEntry
  52. {
  53. [SugarColumn(ColumnName = "id", ColumnDescription = "主键", IsPrimaryKey = true, ColumnDataType = "bigint")]
  54. public long Id { get; set; }
  55. [SugarColumn(ColumnName = "tenant_id", ColumnDescription = "租户Id", IsNullable = false, ColumnDataType = "bigint")]
  56. public long TenantId { get; set; }
  57. [SugarColumn(ColumnName = "glid", ColumnDescription = "主表ID", IsNullable = true, ColumnDataType = "bigint")]
  58. public long? MasterId { get; set; }
  59. /// <summary>序号。源列为 varchar(800);`FqcApplyService.ParseXh` 会尝试解析为 int,
  60. /// 解析失败落 NULL(不报错),故此处保持 string。</summary>
  61. [SugarColumn(ColumnName = "xh", ColumnDescription = "序号", IsNullable = true, Length = 800)]
  62. public string? SeqNo { get; set; }
  63. [SugarColumn(ColumnName = "jyxm", ColumnDescription = "检验项目", IsNullable = true, ColumnDataType = "text")]
  64. public string? InspectionItem { get; set; }
  65. /// <summary>录入类型:NUMERIC / NON_NUMERIC / NULL(未设置)。判定开关——
  66. /// NUMERIC 走上下限自动判定,NON_NUMERIC 由检验员人工确认。</summary>
  67. [SugarColumn(ColumnName = "lrlx", ColumnDescription = "录入类型", IsNullable = true, Length = 20)]
  68. public string? ResultType { get; set; }
  69. [SugarColumn(ColumnName = "UpperToleranceLimit", ColumnDescription = "上限", IsNullable = true, Length = 800)]
  70. public string? UpperLimit { get; set; }
  71. [SugarColumn(ColumnName = "LowerToleranceLimit", ColumnDescription = "下限", IsNullable = true, Length = 800)]
  72. public string? LowerLimit { get; set; }
  73. [SugarColumn(ColumnName = "jsyq", ColumnDescription = "技术要求", IsNullable = true, ColumnDataType = "text")]
  74. public string? TechnicalRequirement { get; set; }
  75. [SugarColumn(ColumnName = "jyff", ColumnDescription = "检验方法", IsNullable = true, ColumnDataType = "text")]
  76. public string? InspectionMethod { get; set; }
  77. [SugarColumn(ColumnName = "jyyqsbgj", ColumnDescription = "检验仪器设备工具", IsNullable = true, ColumnDataType = "text")]
  78. public string? Instrument { get; set; }
  79. [SugarColumn(ColumnName = "jytk", ColumnDescription = "检验条款", IsNullable = true, ColumnDataType = "text")]
  80. public string? InspectionClause { get; set; }
  81. [SugarColumn(ColumnName = "jsbz", ColumnDescription = "技术标准", IsNullable = true, ColumnDataType = "text")]
  82. public string? TechnicalStandard { get; set; }
  83. [SugarColumn(ColumnName = "cyfa", ColumnDescription = "抽样方案", IsNullable = true, Length = 1000)]
  84. public string? SamplingPlan { get; set; }
  85. [SugarColumn(ColumnName = "jl", ColumnDescription = "记录", IsNullable = true, ColumnDataType = "text")]
  86. public string? Record { get; set; }
  87. [SugarColumn(ColumnName = "SizeSpecifications", ColumnDescription = "尺寸规格", IsNullable = true, Length = 800)]
  88. public string? SizeSpecifications { get; set; }
  89. [SugarColumn(ColumnName = "Remarks", ColumnDescription = "备注", IsNullable = true, Length = 800)]
  90. public string? Remarks { get; set; }
  91. }