using System.ComponentModel.DataAnnotations;
using MiniExcelLibs.Attributes;
namespace Admin.NET.Plugin.AiDOP.Dto.S0.Quality;
///
/// 成品检验规范(FQC)明细 DTO。
/// 字段集对齐 `qms_ccjygfzb` 中被检验单快照消费的列——少一个,S7 生成检验单时该列就是空的。
///
public class AdoS0QmsFinishedInspectionSpecEntryDto
{
public long? Id { get; set; }
/// 序号。空/非数字不报错,但 S7 快照的 xh 会落 NULL、排序退化为按 id。
[MaxLength(800)] public string? SeqNo { get; set; }
/// 检验项目。S7 生成检验单时**强制非空**(空值会整单拒绝生成)。
public string? InspectionItem { get; set; }
/// 录入类型:NUMERIC / NON_NUMERIC / 空(未设置)。其它值一律拒绝。
[MaxLength(20)] public string? ResultType { get; set; }
/// 数值上限。仅 NUMERIC 有意义;长度上界 255 由快照列 inspbillst.sx 决定。
[MaxLength(255)] public string? UpperLimit { get; set; }
/// 数值下限。同上。
[MaxLength(255)] public string? LowerLimit { get; set; }
public string? TechnicalRequirement { get; set; }
public string? InspectionMethod { get; set; }
public string? Instrument { get; set; }
public string? InspectionClause { get; set; }
public string? TechnicalStandard { get; set; }
[MaxLength(1000)] public string? SamplingPlan { get; set; }
public string? Record { get; set; }
[MaxLength(800)] public string? SizeSpecifications { get; set; }
[MaxLength(800)] public string? Remarks { get; set; }
}
///
/// 成品检验规范(FQC)主单 + 明细 上行 DTO。
///
/// 【为什么一个 [Required] 都没有】Create 与 Update 共用本 DTO;任何 [Required] 都会在
/// MVC 模型绑定阶段先于 触发,
/// 把 Update 直接挡成 400,破坏「历史兼容、禁止劣化」语义。必填一律由守卫承担。
///
public class AdoS0QmsFinishedInspectionSpecUpsertDto
{
[MaxLength(800)] public string? FileNumber { get; set; }
[MaxLength(800)] public string? VersionNo { get; set; }
[MaxLength(800)] public string? ProductName { get; set; }
[MaxLength(800)] public string? ProductModel { get; set; }
[MaxLength(800)] public string? EffectiveDate { get; set; }
/// 适用物料编码。桥表按分隔符切 token 后与 ItemMaster 精确匹配(禁 LIKE)。
public string? MaterialCode { get; set; }
public string? Attachment { get; set; }
public List Items { get; set; } = [];
}
/// 成品检验规范 Excel 导入行(主从同表,续行可省略除文件编号外的头字段)。
public class AdoS0QmsFinishedInspectionSpecImportRow
{
[ExcelColumnName("文件编号")] [MaxLength(800)] public string? FileNumber { get; set; }
[ExcelColumnName("版本")] [MaxLength(800)] public string? VersionNo { get; set; }
[ExcelColumnName("产品名称")] [MaxLength(800)] public string? ProductName { get; set; }
[ExcelColumnName("产品型号")] [MaxLength(800)] public string? ProductModel { get; set; }
[ExcelColumnName("生效日期")] [MaxLength(800)] public string? EffectiveDate { get; set; }
[ExcelColumnName("物料编码")] public string? MaterialCode { get; set; }
[ExcelColumnName("附件")] public string? Attachment { get; set; }
[ExcelColumnName("明细-序号")] public string? SeqNo { get; set; }
[ExcelColumnName("明细-检验项目")] public string? InspectionItem { get; set; }
[ExcelColumnName("明细-录入类型(NUMERIC/NON_NUMERIC)")] public string? ResultType { get; set; }
[ExcelColumnName("明细-上限")] [MaxLength(255)] public string? UpperLimit { get; set; }
[ExcelColumnName("明细-下限")] [MaxLength(255)] public string? LowerLimit { get; set; }
[ExcelColumnName("明细-技术要求")] public string? TechnicalRequirement { get; set; }
[ExcelColumnName("明细-检验方法")] public string? InspectionMethod { get; set; }
[ExcelColumnName("明细-检验仪器")] public string? Instrument { get; set; }
[ExcelColumnName("明细-技术标准")] public string? TechnicalStandard { get; set; }
[ExcelColumnName("明细-抽样方案")] public string? SamplingPlan { get; set; }
[ExcelColumnName("明细-尺寸规格")] public string? SizeSpecifications { get; set; }
}