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 int ProductId { get; set; }
[Navigate(NavigateType.ManyToOne, nameof(ProductId))]
public Product ProductInfo { 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; }
public double LineWidthValue { get; set; }
public double PTValue { get; set; }
//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
#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; }
//-------IsIgnore = true 不保存
[SugarColumn(IsIgnore = true)]
//[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))]
public List SizeTagDataList { get; set; }
//2023-10-30 添加异常列
///
/// 异常情况
///
public string Abnormalities { get; set; }
///
/// 修复人员
///
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; }
public double LineWidthValue { get; set; }
public double PTValue { 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; }
}
}