Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

339 wiersze
12 KiB

  1. using SqlSugar;
  2. using System.Collections.Generic;
  3. namespace Models
  4. {
  5. [SugarIndex("index_{table}_code", nameof(Product.Code), OrderByType.Asc, isUnique: true)]
  6. public class Product : BaseTable
  7. {
  8. public string Code { get; set; }
  9. public string Name { get; set; }
  10. [SugarColumn(IsNullable = true)]
  11. public string Spec { get; set; }
  12. //类别
  13. public int ClassesId { get; set; }
  14. [Navigate(NavigateType.ManyToOne, nameof(ClassesId))]
  15. public Classes ClassesInfo { get; set; }
  16. //目数
  17. public int HoleCount { get; set; }
  18. //外观检测模型文件 //不存在默认使用 .\onnx\default.onnx
  19. [SugarColumn(IsNullable = true)]
  20. public string DefectModelFile { get; set; }
  21. //Files Type0-产品图纸
  22. [Navigate(NavigateType.OneToMany, nameof(Attachment.Pid))]
  23. public List<Attachment> AttachmentList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  24. //当前最新批次号
  25. public string BatchId { get; set; }
  26. /// <summary>
  27. /// 目标数量
  28. /// </summary>
  29. public int TargetCount { get; set; }
  30. /// <summary>
  31. /// 完成数量
  32. /// </summary>
  33. public int CompleteCount { get; set; }
  34. [Navigate(NavigateType.OneToMany, nameof(BatchHistory.Pid))]
  35. public List<BatchHistory> BatchHistoryList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  36. /// <summary>
  37. /// 合格标准
  38. /// </summary>
  39. [Navigate(NavigateType.OneToMany, nameof(QualifiedCriterion.Pid))]
  40. public List<QualifiedCriterion> QualifiedCriterionList { get; set; }
  41. [SugarColumn(IsNullable = true)]
  42. public string Note { get; set; }
  43. //判断上下限
  44. public double TensionBaseValue { get; set; }
  45. public double TensionUpFloatValue { get; set; }
  46. public double TensionDownFloatValue { get; set; }
  47. public double HeightBaseValue { get; set; }
  48. public double HeightUpFloatValue { get; set; }
  49. public double HeightDownFloatValue { get; set; }
  50. public double LineWidthBaseValue { get; set; }
  51. public double LineWidthUpFloatValue { get; set; }
  52. public double LineWidthDownFloatValue { get; set; }
  53. //以前只支持Y方向PT
  54. public double PTBaseValue { get; set; }
  55. public double PTUpFloatValue { get; set; }
  56. public double PTDownFloatValue { get; set; }
  57. //新增X方向PT
  58. public double PTXBaseValue { get; set; }
  59. public double PTXUpFloatValue { get; set; }
  60. public double PTXDownFloatValue { get; set; }
  61. //高度BASE值
  62. public string HeightBaseDec { get; set; }
  63. //====生产流程绑定
  64. [SugarColumn(IsNullable = true)]
  65. public int? StepId { get; set; }
  66. [Navigate(NavigateType.ManyToOne, nameof(StepId))]
  67. public Step StepInfo { get; set; }
  68. //流程工序列表
  69. [Navigate(NavigateType.OneToMany, nameof(ProductProcess.Pid))]
  70. public List<ProductProcess> ProductProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  71. //====校正流程绑定
  72. [SugarColumn(IsNullable = true)]
  73. public int? ReviseStepId { get; set; }
  74. [Navigate(NavigateType.ManyToOne, nameof(ReviseStepId))]
  75. public Step ReviseStepInfo { get; set; }
  76. //校正流程工序列表
  77. [Navigate(NavigateType.OneToMany, nameof(ProductReviseProcess.Pid))]
  78. public List<ProductReviseProcess> ProductReviseProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  79. //====修复流程绑定
  80. [SugarColumn(IsNullable = true)]
  81. public int? AssistStepId { get; set; }
  82. [Navigate(NavigateType.ManyToOne, nameof(AssistStepId))]
  83. public Step AssistStepInfo { get; set; }
  84. //校正流程工序列表
  85. [Navigate(NavigateType.OneToMany, nameof(ProductAssistProcess.Pid))]
  86. public List<ProductAssistProcess> ProductAssistProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  87. //生产记录(用于导航删除)
  88. [Navigate(NavigateType.OneToMany, nameof(Order.ProductId))]
  89. public List<Order> OrderList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  90. //2023-11-2 加入mark使用
  91. //mark类型 0:无mark
  92. public int MarkType { get; set; }
  93. //mark尺寸
  94. public double MarkSize { get; set; }
  95. //抓点图像
  96. [SugarColumn(IsNullable = true)]
  97. public string MapPath { get; set; }
  98. //抓取点位
  99. [SugarColumn(IsNullable = true, Length = 2048)]
  100. public string GetPointList { get; set; }
  101. //2023-12-18 加入mark干扰判断,是否主栅
  102. public int MarkDisturb { get; set; }
  103. public int MainGrid { get; set; }
  104. //2023-12-19 新流程方案参数
  105. //工单
  106. [SugarColumn(IsNullable = true)]
  107. public string WorkOrderCode { get; set; }
  108. //灵活测试点位
  109. [Navigate(NavigateType.OneToMany, nameof(TestDefectPoints.Pid))]
  110. public List<TestDefectPoints> TestDefectPointsList { get; set; }
  111. //2024-1-24 加入是否存在pad点
  112. [SugarColumn(IsNullable = true)]
  113. public int HavePad { get; set; }
  114. //2024-5-10 加入是否存在网节
  115. [SugarColumn(IsNullable = true)]
  116. public int HaveWJ { get; set; }
  117. //2024-9-7 加入网版规格
  118. [SugarColumn(IsNullable = true)]
  119. public int WBType { get; set; }
  120. //2024-12-5 加入网版规格晶澳
  121. [SugarColumn(IsNullable = true)]
  122. public int WBSpec { get; set; }
  123. //2024-9-12 设置比对精度
  124. [SugarColumn(IsNullable = true)]
  125. public double WangMuThresh { get; set; }
  126. //2024 03-12 加入打印内容绑定产品
  127. #region 打印
  128. [SugarColumn(IsNullable = true)]
  129. /// <summary>
  130. /// 开启检测单打印
  131. /// </summary>
  132. public bool EnableOrderPrint { get; set; }
  133. [SugarColumn(IsNullable = true)]
  134. /// <summary>
  135. /// 打印模板路径
  136. /// </summary>
  137. public string OrderTempPath { get; set; }
  138. [SugarColumn(IsNullable = true)]
  139. /// <summary>
  140. /// 开启标签打印
  141. /// </summary>
  142. public bool EnableLabelPrint { get; set; }
  143. [SugarColumn(IsNullable = true)]
  144. /// <summary>
  145. /// 打印模板路径
  146. /// </summary>
  147. public string LabelTempPath { get; set; }
  148. [SugarColumn(IsNullable = true)]
  149. /// <summary>
  150. /// 开启Excel打印
  151. /// </summary>
  152. public bool EnableExcelPrint { get; set; }
  153. [SugarColumn(IsNullable = true)]
  154. /// <summary>
  155. /// 打印模板路径
  156. /// </summary>
  157. public string ExcelTempPath { get; set; }
  158. [SugarColumn(IsNullable = true)]
  159. //打印信息
  160. [Navigate(NavigateType.OneToMany, nameof(PrintInfo.Pid))]
  161. public List<PrintInfo> PrintInfoList { get; set; }
  162. //保存excel
  163. [SugarColumn(IsNullable = true)]
  164. /// <summary>
  165. /// 开启Excel保存
  166. /// </summary>
  167. public bool EnableOrderSave { get; set; }
  168. [SugarColumn(IsNullable = true)]
  169. /// <summary>
  170. /// 保存路径
  171. /// </summary>
  172. public string OrderSavePath { get; set; }
  173. #endregion
  174. }
  175. /// <summary>
  176. /// 结束的批次才加入
  177. /// </summary>
  178. public class Attachment : BaseTable
  179. {
  180. /// <summary>
  181. /// 源表名,小写
  182. /// </summary>
  183. public string TBName { get; set; }
  184. /// <summary>
  185. /// 子类 看TB主表对应类型
  186. /// </summary>
  187. public int Type { get; set; } = 0;
  188. public int Pid { get; set; }
  189. /// <summary>
  190. /// 原始文件名还扩展名
  191. /// </summary>
  192. public string Name { get; set; }
  193. /// <summary>
  194. /// 本地文件名 子路径+文件名(无扩展名):{TBName}\\{NameTimestamp} //NameTimestamp=id\\A
  195. /// </summary>
  196. public string NameTimestamp { get; set; }
  197. /// <summary>
  198. /// .pdf/.doc
  199. /// </summary>
  200. public string ExtendName { get; set; }
  201. }
  202. /// <summary>
  203. /// 非全量copy于StepProcess工序,只有产品修改工序参数时保存
  204. /// </summary>
  205. public class ProductProcess : BaseTable
  206. {
  207. public int Pid { get; set; }
  208. public string ProcessCode { get; set; }
  209. /// <summary>
  210. /// json
  211. /// </summary>
  212. [SugarColumn(IsNullable = true, Length = 2048)]
  213. public string ProcessParams { get; set; }
  214. }
  215. public class ProductReviseProcess : ProductProcess
  216. {
  217. }
  218. public class ProductAssistProcess : ProductProcess
  219. {
  220. }
  221. /// <summary>
  222. /// 结束的批次才加入
  223. /// </summary>
  224. public class BatchHistory : BaseTable
  225. {
  226. public int Pid { get; set; }
  227. public string BatchId { get; set; }
  228. /// <summary>
  229. /// 目标数量
  230. /// </summary>
  231. public int TargetCount { get; set; }
  232. /// <summary>
  233. /// 当前数量
  234. /// </summary>
  235. public int CompleteCount { get; set; }
  236. }
  237. /// <summary>
  238. /// 合格标准
  239. /// </summary>
  240. public class QualifiedCriterion : BaseTable
  241. {
  242. public int Pid { get; set; }
  243. public string DefectCode { get; set; }//pp,sx,... EnumUtil.Convert2Enum
  244. /// <summary>
  245. /// 阈值 20240409
  246. /// </summary>
  247. public double Threshold { get; set; }
  248. /// <summary>
  249. /// 尺寸
  250. /// </summary>
  251. public float Size { get; set; }
  252. /// <summary>
  253. /// 最大允许缺陷数量
  254. /// </summary>
  255. public int MaxDefectCount { get; set; }
  256. }
  257. /// <summary>
  258. /// 2023-12-25 单点测试点位
  259. /// </summary>
  260. public class TestDefectPoints : BaseTable
  261. {
  262. public int Pid { get; set; }
  263. /// <summary>
  264. /// 点位代码
  265. /// </summary>
  266. public string PointCode { get; set; }
  267. /// <summary>
  268. /// 点位X
  269. /// </summary>
  270. public double X { get; set; }
  271. /// <summary>
  272. /// 点位Y
  273. /// </summary>
  274. public double Y { get; set; }
  275. }
  276. /// <summary>
  277. /// 2024-03-12 打印信息
  278. /// </summary>
  279. public class PrintInfo : BaseTable
  280. {
  281. public int Pid { get; set; }
  282. /// <summary>
  283. /// 是否为数字
  284. /// </summary>
  285. public bool IsValue { get; set; }
  286. /// <summary>
  287. /// 打印类型0:excel,1:标签,2:工单
  288. /// </summary>
  289. public int Type { get; set; }
  290. /// <summary>
  291. /// 打印位置
  292. /// </summary>
  293. public string PrintKey { get; set; }
  294. /// <summary>
  295. /// 打印代码或数据
  296. /// </summary>
  297. public string PrintCode { get; set; }
  298. /// <summary>
  299. /// 备注名称
  300. /// </summary>
  301. public string PrintName { get; set; }
  302. }
  303. }