using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Models { [SugarIndex("index_{table}_code", nameof(Product.Code), OrderByType.Asc, isUnique: true)] public class Product : BaseTable { public string Code { get; set; } public string Name { get; set; } [SugarColumn(IsNullable = true)] public string Spec { get; set; } //类别 public int ClassesId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(ClassesId))] public Classes ClassesInfo { get; set; } //目数 public int HoleCount { get; set; } //外观检测模型文件 //不存在默认使用 .\onnx\default.onnx [SugarColumn(IsNullable = true)] public string DefectModelFile { get; set; } //Files Type0-产品图纸 [Navigate(NavigateType.OneToMany, nameof(Attachment.Pid))] public List AttachmentList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 //当前最新批次号 public string BatchId { get; set; } /// /// 目标数量 /// public int TargetCount { get; set; } /// /// 完成数量 /// public int CompleteCount { get; set; } [Navigate(NavigateType.OneToMany, nameof(BatchHistory.Pid))] public List BatchHistoryList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 /// /// 合格标准 /// [Navigate(NavigateType.OneToMany, nameof(QualifiedCriterion.Pid))] public List QualifiedCriterionList { get; set; } [SugarColumn(IsNullable = true)] public string Note { get; set; } // public double TensionBaseValue { get; set; } public double TensionUpFloatValue { get; set; } public double TensionDownFloatValue { get; set; } public double HeightBaseValue { get; set; } public double HeightUpFloatValue { get; set; } public double HeightDownFloatValue { get; set; } public double LineWidthBaseValue { get; set; } public double LineWidthUpFloatValue { get; set; } public double LineWidthDownFloatValue { get; set; } public double PTBaseValue { get; set; } public double PTUpFloatValue { get; set; } public double PTDownFloatValue { get; set; } //高度BASE值 public string HeightBaseDec { get; set; } //====生产流程绑定 [SugarColumn(IsNullable = true)] public int? StepId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(StepId))] public Step StepInfo { get; set; } //流程工序列表 [Navigate(NavigateType.OneToMany, nameof(ProductProcess.Pid))] public List ProductProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 //====校正流程绑定 [SugarColumn(IsNullable = true)] public int? ReviseStepId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(ReviseStepId))] public Step ReviseStepInfo { get; set; } //校正流程工序列表 [Navigate(NavigateType.OneToMany, nameof(ProductReviseProcess.Pid))] public List ProductReviseProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 //====修复流程绑定 [SugarColumn(IsNullable = true)] public int? AssistStepId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(AssistStepId))] public Step AssistStepInfo { get; set; } //校正流程工序列表 [Navigate(NavigateType.OneToMany, nameof(ProductAssistProcess.Pid))] public List ProductAssistProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 //生产记录(用于导航删除) [Navigate(NavigateType.OneToMany, nameof(Order.ProductId))] public List OrderList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到 //2023-11-2 加入mark使用 //mark类型 0:无mark public int MarkType { get; set; } //mark尺寸 public double MarkSize { get; set; } //抓点图像 public string MapPath { get; set; } //抓取点位 public string GetPointList { get; set; } } /// /// 结束的批次才加入 /// public class Attachment : BaseTable { /// /// 源表名,小写 /// public string TBName { get; set; } /// /// 子类 看TB主表对应类型 /// public int Type { get; set; } = 0; public int Pid { get; set; } /// /// 原始文件名还扩展名 /// public string Name { get; set; } /// /// 本地文件名 子路径+文件名(无扩展名):{TBName}\\{NameTimestamp} //NameTimestamp=id\\A /// public string NameTimestamp { get; set; } /// /// .pdf/.doc /// public string ExtendName { get; set; } } /// /// 非全量copy于StepProcess工序,只有产品修改工序参数时保存 /// public class ProductProcess : BaseTable { public int Pid { get; set; } public string ProcessCode { get; set; } /// /// json /// [SugarColumn(IsNullable = true, Length = 2048)] public string ProcessParams { get; set; } } public class ProductReviseProcess : ProductProcess { } public class ProductAssistProcess : ProductProcess { } /// /// 结束的批次才加入 /// public class BatchHistory : BaseTable { public int Pid { get; set; } public string BatchId { get; set; } /// /// 目标数量 /// public int TargetCount { get; set; } /// /// 当前数量 /// public int CompleteCount { get; set; } } /// /// 合格标准 /// public class QualifiedCriterion : BaseTable { public int Pid { get; set; } public string DefectCode { get; set; }//pp,sx,... EnumUtil.Convert2Enum /// /// 尺寸 /// public float Size { get; set; } /// /// 最大允许缺陷数量 /// public int MaxDefectCount { get; set; } } }