using SqlSugar; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Models { [SugarIndex("index_{table}_sn", nameof(Order.SN), OrderByType.Asc, isUnique: true)] public class Order : BaseTable { public Order() { XPTValue = 0; } /// /// 产品 /// public int ProductId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(ProductId))] public Product ProductInfo { get; set; } /// /// 2024-1-5 检测料号 /// [SugarColumn(IsNullable = true)] public string DetectOrder { get; set; } [SugarColumn(IsNullable = true)] public string OrderCode { get; set; } public string SN { get; set; } public string BatchId { get; set; } /// /// 流程 /// public int StepId { get; set; } [Navigate(NavigateType.ManyToOne, nameof(StepId))] public Step StepInfo { get; set; } /// /// 时长-秒 /// public double TimeLen { get; set; } /// /// 是否合格 /// [SugarColumn(IsNullable = true)] public bool Qualified { get; set; } = true; /// /// 比对结果 0-未比对 1-通过 2-不通过 /// public int CompareResult { get; set; } = 0; //平均值 public double TensionValue { get; set; } public double HeightValue { get; set; } #region 尺寸测试均值 public double LineWidthValue { get; set; } public double PTValue { get; set; } [SugarColumn(IsNullable = true)] public double XPTValue { get; set; } = 0; //新增检测均值2024-2-20 [SugarColumn(IsNullable = true)] public double FLineWidthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MGridIntervalValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MGridWidthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MGridSpreadValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double FGridSpreadValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double BackPoleWidthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MGridLengthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MarkXDisValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double MarkYDisValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double ForkLengthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double ForkWidthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double ForkDisValue { get; set; } = 0; //2024 0307 [SugarColumn(IsNullable = true)] public double ChilopodLengthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double ChilopodWidthValue { get; set; } = 0; //2024 0308 [SugarColumn(IsNullable = true)] public double ShardingDisValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double WeldingSpotDisValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double WeldingSpotLengthValue { get; set; } = 0; [SugarColumn(IsNullable = true)] public double WeldingSpotWidthValue { get; set; } = 0; #endregion //N次 #region 张力5次 public double Tension1 { get; set; } public double Tension2 { get; set; } public double Tension3 { get; set; } public double Tension4 { get; set; } public double Tension5 { get; set; } #endregion #region 厚度5次 public double Height1 { get; set; } public double Height2 { get; set; } public double Height3 { get; set; } public double Height4 { get; set; } public double Height5 { get; set; } #endregion #region 线宽9次 public double LineWidth1 { get; set; } public double LineWidth2 { get; set; } public double LineWidth3 { get; set; } public double LineWidth4 { get; set; } public double LineWidth5 { get; set; } public double LineWidth6 { get; set; } public double LineWidth7 { get; set; } public double LineWidth8 { get; set; } public double LineWidth9 { get; set; } #endregion #region PT6次 public double PT1 { get; set; } public double PT2 { get; set; } public double PT3 { get; set; } public double PT4 { get; set; } public double PT5 { get; set; } public double PT6 { get; set; } #endregion /// /// 缺陷数 /// public int DefectCount { get; set; } #region 缺陷种类 public int DKCount { get; set; }//堵孔数量 public int ZWCount { get; set; }//脏污数量 public int GSYCCount { get; set; }//钢丝异常数量 public int XWSCount { get; set; }//纤维丝数量 public int QKCount { get; set; }//缺口数量 public int ZKCount { get; set; }//针孔数量 public int PPCount { get; set; }//泡泡数量 public int HSCount { get; set; }//划伤数量 public int YXCount { get; set; }//压线数量 public int XBCount { get; set; }//斜边数量 new public int SXCount { get; set; }//栅线数量 new public int GSDLCount { get; set; }//钢丝断裂 new public int CJDKCount { get; set; }//残胶堵孔 new #endregion /// /// mark点数据:[X1,Y1,X2,Y2,X3,Y3,X4,Y4] /// [SugarColumn(IsNullable = true)] public string MarkData { get; set; } // public bool Succeed { get; set; } /// /// 失败分类 /// public int FailType { get; set; } /// /// 失败的工序名称 /// [SugarColumn(IsNullable = true)] public string FailProcessName { get; set; } [SugarColumn(IsNullable = true, ColumnDataType = "text", Length = 2048)] public string Note { get; set; } /// /// 0-初始; 5-已检测; 10-出现异常 /// public int State { get; set; } //---------- /// /// 修改次数 /// public int HistoryCount { get; set; } = 0; /// /// 修改历史记录 /// [Navigate(NavigateType.OneToMany, nameof(OrderHistory.Pid))] public List OrderHistoryList { get; set; } /// /// Defect和Size比对失败的坐标位置 /// [Navigate(NavigateType.OneToMany, nameof(DefectInfo.Pid))] public List DefectInfoList { get; set; } //2023-10-30 添加单次测试尺寸数据列 /// /// 尺寸测试单点数据 /// [Navigate(NavigateType.OneToMany, nameof(SizeDefectInfo.Pid))] public List SizeDefectInfoList { get; set; } //2024-01-11 添加单次测试尺寸数据均值 /// /// 尺寸测试均值数据 /// [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))] public List SizeDefectAverageInfoList { get; set; } //-------IsIgnore = true 不保存 [SugarColumn(IsIgnore = true)] //[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))] public List SizeTagDataList { get; set; } //2023-10-30 添加异常列 /// /// 异常情况 /// [SugarColumn(IsNullable = true)] public string Abnormalities { get; set; } /// /// 修复人员 /// [SugarColumn(IsNullable = true)] public string RepairCode { get; set; } } [SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)] public class OrderHistory : BaseTable { public int Pid { get; set; } public bool Qualified { get; set; }//合格 //比对 public int CompareResult { get; set; } //平均值 public double TensionValue { get; set; } public double HeightValue { get; set; } #region 尺寸均值 public double LineWidthValue { get; set; } public double PTValue { get; set; } //X方向pt public double XPTValue { get; set; } //新增检测均值2024-2-20 public double FLineWidthValue { get; set; } = 0; public double MGridIntervalValue { get; set; } = 0; public double MGridWidthValue { get; set; } = 0; public double MGridSpreadValue { get; set; } = 0; public double FGridSpreadValue { get; set; } = 0; public double BackPoleWidthValue { get; set; } = 0; public double MGridLengthValue { get; set; } = 0; public double MarkXDisValue { get; set; } = 0; public double MarkYDisValue { get; set; } = 0; public double ForkLengthValue { get; set; } = 0; public double ForkWidthValue { get; set; } = 0; public double ForkDisValue { get; set; } = 0; //2024 0307 public double ChilopodLengthValue { get; set; } = 0; public double ChilopodWidthValue { get; set; } = 0; //2024 0308 public double ShardingDisValue { get; set; } = 0; public double WeldingSpotDisValue { get; set; } = 0; public double WeldingSpotLengthValue { get; set; } = 0; public double WeldingSpotWidthValue { get; set; } = 0; #endregion //2024-01-11 添加单次测试尺寸数据均值 /// /// 尺寸测试均值数据 /// [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))] public List SizeDefectAverageInfoList { get; set; } //外观 public int DKCount { get; set; }//堵孔数量 public int ZWCount { get; set; }//脏污数量 public int GSYCCount { get; set; }//钢丝异常数量 public int XWSCount { get; set; }//纤维丝数量 public int QKCount { get; set; }//缺口数量 public int ZKCount { get; set; }//针孔数量 public int PPCount { get; set; }//泡泡数量 public int HSCount { get; set; }//划伤数量 public int YXCount { get; set; }//压线数量 public int XBCount { get; set; }//斜边数量 new public int SXCount { get; set; }//栅线数量 new } [SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)] public class SizeTagData : BaseTable { public int Pid { get; set; } public string SizeTag { get; set; } /// /// 产生Tag工序索引 /// public int CreateStepIndex { get; set; } /// /// 消费本数据工序索引和消费值索引:5-0,8-2 /// public string ConsumeStepIndex { get; set; } /// /// double[] /// public string posePT { get; set; } } [SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)] public class DefectInfo : BaseTable { public int Pid { get; set; } /// /// 0-Defect 1-Size /// public int Type { get; set; } public string Code { get;set; } public double X { get; set; } public double Y { get; set; } public double ZXD { get; set; } public double Area { get; set; } //[SugarColumn(IsNullable = true)] //public string PicName { get; set; } public int Index { get; set; } } //2023-12-27 新表,存储单点尺寸测试数据 [SugarIndex("index_{table}_pid", nameof(SizeDefectInfo.Pid), OrderByType.Asc, isUnique: false)] public class SizeDefectInfo : BaseTable { public int Pid { get; set; } //单次结果 1:ok 2:ng public int result { get; set; } //测试项代码 public string PointCode { get; set; } //标记位置 public double X { get; set; } public double Y { get; set; } //测试数据 public double Data { get; set; } //测试步骤名称 public string StepName { get; set; } } //2024-03-11 新表,存储不同步骤的均值测试数据 [SugarIndex("index_{table}_pid", nameof(SizeDefectAverageInfo.Pid), OrderByType.Asc, isUnique: false)] public class SizeDefectAverageInfo : BaseTable { public int Pid { get; set; } //单次结果 1:ok 2:ng public int result { get; set; } //测试项代码 public string PointCode { get; set; } //上下限 public double Max { get; set; } public double Min { get; set; } //测试数据 public double AverageData { get; set; } //测试步骤名称 public string StepName { get; set; } } }