You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

202 lines
7.2 KiB

  1. using SqlSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Models
  8. {
  9. [SugarIndex("index_{table}_code", nameof(Product.Code), OrderByType.Asc, isUnique: true)]
  10. public class Product : BaseTable
  11. {
  12. public string Code { get; set; }
  13. public string Name { get; set; }
  14. [SugarColumn(IsNullable = true)]
  15. public string Spec { get; set; }
  16. //类别
  17. public int ClassesId { get; set; }
  18. [Navigate(NavigateType.ManyToOne, nameof(ClassesId))]
  19. public Classes ClassesInfo { get; set; }
  20. //目数
  21. public int HoleCount { get; set; }
  22. //外观检测模型文件 //不存在默认使用 .\onnx\default.onnx
  23. [SugarColumn(IsNullable = true)]
  24. public string DefectModelFile { get; set; }
  25. //Files Type0-产品图纸
  26. [Navigate(NavigateType.OneToMany, nameof(Attachment.Pid))]
  27. public List<Attachment> AttachmentList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  28. //当前最新批次号
  29. public string BatchId { get; set; }
  30. /// <summary>
  31. /// 目标数量
  32. /// </summary>
  33. public int TargetCount { get; set; }
  34. /// <summary>
  35. /// 完成数量
  36. /// </summary>
  37. public int CompleteCount { get; set; }
  38. [Navigate(NavigateType.OneToMany, nameof(BatchHistory.Pid))]
  39. public List<BatchHistory> BatchHistoryList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  40. /// <summary>
  41. /// 合格标准
  42. /// </summary>
  43. [Navigate(NavigateType.OneToMany, nameof(QualifiedCriterion.Pid))]
  44. public List<QualifiedCriterion> QualifiedCriterionList { get; set; }
  45. [SugarColumn(IsNullable = true)]
  46. public string Note { get; set; }
  47. //
  48. public double TensionBaseValue { get; set; }
  49. public double TensionUpFloatValue { get; set; }
  50. public double TensionDownFloatValue { get; set; }
  51. public double HeightBaseValue { get; set; }
  52. public double HeightUpFloatValue { get; set; }
  53. public double HeightDownFloatValue { get; set; }
  54. public double LineWidthBaseValue { get; set; }
  55. public double LineWidthUpFloatValue { get; set; }
  56. public double LineWidthDownFloatValue { get; set; }
  57. public double PTBaseValue { get; set; }
  58. public double PTUpFloatValue { get; set; }
  59. public double PTDownFloatValue { get; set; }
  60. //高度BASE值
  61. public string HeightBaseDec { get; set; }
  62. //====生产流程绑定
  63. [SugarColumn(IsNullable = true)]
  64. public int? StepId { get; set; }
  65. [Navigate(NavigateType.ManyToOne, nameof(StepId))]
  66. public Step StepInfo { get; set; }
  67. //流程工序列表
  68. [Navigate(NavigateType.OneToMany, nameof(ProductProcess.Pid))]
  69. public List<ProductProcess> ProductProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  70. //====校正流程绑定
  71. [SugarColumn(IsNullable = true)]
  72. public int? ReviseStepId { get; set; }
  73. [Navigate(NavigateType.ManyToOne, nameof(ReviseStepId))]
  74. public Step ReviseStepInfo { get; set; }
  75. //校正流程工序列表
  76. [Navigate(NavigateType.OneToMany, nameof(ProductReviseProcess.Pid))]
  77. public List<ProductReviseProcess> ProductReviseProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  78. //====修复流程绑定
  79. [SugarColumn(IsNullable = true)]
  80. public int? AssistStepId { get; set; }
  81. [Navigate(NavigateType.ManyToOne, nameof(AssistStepId))]
  82. public Step AssistStepInfo { get; set; }
  83. //校正流程工序列表
  84. [Navigate(NavigateType.OneToMany, nameof(ProductAssistProcess.Pid))]
  85. public List<ProductAssistProcess> ProductAssistProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  86. //生产记录(用于导航删除)
  87. [Navigate(NavigateType.OneToMany, nameof(Order.ProductId))]
  88. public List<Order> OrderList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  89. //2023-11-2 加入mark使用
  90. //mark类型 0:无mark
  91. public int MarkType { get; set; }
  92. //mark尺寸
  93. public double MarkSize { get; set; }
  94. //抓点图像
  95. [SugarColumn(IsNullable = true)]
  96. public string MapPath { get; set; }
  97. //抓取点位
  98. [SugarColumn(IsNullable = true)]
  99. public string GetPointList { get; set; }
  100. //2023-12-18 加入mark干扰判断,是否主栅
  101. public int MarkDisturb { get; set; }
  102. public int MainGrid { get; set; }
  103. }
  104. /// <summary>
  105. /// 结束的批次才加入
  106. /// </summary>
  107. public class Attachment : BaseTable
  108. {
  109. /// <summary>
  110. /// 源表名,小写
  111. /// </summary>
  112. public string TBName { get; set; }
  113. /// <summary>
  114. /// 子类 看TB主表对应类型
  115. /// </summary>
  116. public int Type { get; set; } = 0;
  117. public int Pid { get; set; }
  118. /// <summary>
  119. /// 原始文件名还扩展名
  120. /// </summary>
  121. public string Name { get; set; }
  122. /// <summary>
  123. /// 本地文件名 子路径+文件名(无扩展名):{TBName}\\{NameTimestamp} //NameTimestamp=id\\A
  124. /// </summary>
  125. public string NameTimestamp { get; set; }
  126. /// <summary>
  127. /// .pdf/.doc
  128. /// </summary>
  129. public string ExtendName { get; set; }
  130. }
  131. /// <summary>
  132. /// 非全量copy于StepProcess工序,只有产品修改工序参数时保存
  133. /// </summary>
  134. public class ProductProcess : BaseTable
  135. {
  136. public int Pid { get; set; }
  137. public string ProcessCode { get; set; }
  138. /// <summary>
  139. /// json
  140. /// </summary>
  141. [SugarColumn(IsNullable = true, Length = 2048)]
  142. public string ProcessParams { get; set; }
  143. }
  144. public class ProductReviseProcess : ProductProcess
  145. {
  146. }
  147. public class ProductAssistProcess : ProductProcess
  148. {
  149. }
  150. /// <summary>
  151. /// 结束的批次才加入
  152. /// </summary>
  153. public class BatchHistory : BaseTable
  154. {
  155. public int Pid { get; set; }
  156. public string BatchId { get; set; }
  157. /// <summary>
  158. /// 目标数量
  159. /// </summary>
  160. public int TargetCount { get; set; }
  161. /// <summary>
  162. /// 当前数量
  163. /// </summary>
  164. public int CompleteCount { get; set; }
  165. }
  166. /// <summary>
  167. /// 合格标准
  168. /// </summary>
  169. public class QualifiedCriterion : BaseTable
  170. {
  171. public int Pid { get; set; }
  172. public string DefectCode { get; set; }//pp,sx,... EnumUtil.Convert2Enum
  173. /// <summary>
  174. /// 尺寸
  175. /// </summary>
  176. public float Size { get; set; }
  177. /// <summary>
  178. /// 最大允许缺陷数量
  179. /// </summary>
  180. public int MaxDefectCount { get; set; }
  181. }
  182. }