版博士V2.0程序
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.
 
 
 
 

332 lines
11 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 03-12 加入打印内容绑定产品
  121. #region 打印
  122. [SugarColumn(IsNullable = true)]
  123. /// <summary>
  124. /// 开启检测单打印
  125. /// </summary>
  126. public bool EnableOrderPrint { get; set; }
  127. [SugarColumn(IsNullable = true)]
  128. /// <summary>
  129. /// 打印模板路径
  130. /// </summary>
  131. public string OrderTempPath { get; set; }
  132. [SugarColumn(IsNullable = true)]
  133. /// <summary>
  134. /// 开启标签打印
  135. /// </summary>
  136. public bool EnableLabelPrint { get; set; }
  137. [SugarColumn(IsNullable = true)]
  138. /// <summary>
  139. /// 打印模板路径
  140. /// </summary>
  141. public string LabelTempPath { get; set; }
  142. [SugarColumn(IsNullable = true)]
  143. /// <summary>
  144. /// 开启Excel打印
  145. /// </summary>
  146. public bool EnableExcelPrint { get; set; }
  147. [SugarColumn(IsNullable = true)]
  148. /// <summary>
  149. /// 打印模板路径
  150. /// </summary>
  151. public string ExcelTempPath { get; set; }
  152. [SugarColumn(IsNullable = true)]
  153. //打印信息
  154. [Navigate(NavigateType.OneToMany, nameof(PrintInfo.Pid))]
  155. public List<PrintInfo> PrintInfoList { get; set; }
  156. //保存excel
  157. [SugarColumn(IsNullable = true)]
  158. /// <summary>
  159. /// 开启Excel保存
  160. /// </summary>
  161. public bool EnableOrderSave { get; set; }
  162. [SugarColumn(IsNullable = true)]
  163. /// <summary>
  164. /// 保存路径
  165. /// </summary>
  166. public string OrderSavePath { get; set; }
  167. #endregion
  168. }
  169. /// <summary>
  170. /// 结束的批次才加入
  171. /// </summary>
  172. public class Attachment : BaseTable
  173. {
  174. /// <summary>
  175. /// 源表名,小写
  176. /// </summary>
  177. public string TBName { get; set; }
  178. /// <summary>
  179. /// 子类 看TB主表对应类型
  180. /// </summary>
  181. public int Type { get; set; } = 0;
  182. public int Pid { get; set; }
  183. /// <summary>
  184. /// 原始文件名还扩展名
  185. /// </summary>
  186. public string Name { get; set; }
  187. /// <summary>
  188. /// 本地文件名 子路径+文件名(无扩展名):{TBName}\\{NameTimestamp} //NameTimestamp=id\\A
  189. /// </summary>
  190. public string NameTimestamp { get; set; }
  191. /// <summary>
  192. /// .pdf/.doc
  193. /// </summary>
  194. public string ExtendName { get; set; }
  195. }
  196. /// <summary>
  197. /// 非全量copy于StepProcess工序,只有产品修改工序参数时保存
  198. /// </summary>
  199. public class ProductProcess : BaseTable
  200. {
  201. public int Pid { get; set; }
  202. public string ProcessCode { get; set; }
  203. /// <summary>
  204. /// json
  205. /// </summary>
  206. [SugarColumn(IsNullable = true, Length = 2048)]
  207. public string ProcessParams { get; set; }
  208. }
  209. public class ProductReviseProcess : ProductProcess
  210. {
  211. }
  212. public class ProductAssistProcess : ProductProcess
  213. {
  214. }
  215. /// <summary>
  216. /// 结束的批次才加入
  217. /// </summary>
  218. public class BatchHistory : BaseTable
  219. {
  220. public int Pid { get; set; }
  221. public string BatchId { get; set; }
  222. /// <summary>
  223. /// 目标数量
  224. /// </summary>
  225. public int TargetCount { get; set; }
  226. /// <summary>
  227. /// 当前数量
  228. /// </summary>
  229. public int CompleteCount { get; set; }
  230. }
  231. /// <summary>
  232. /// 合格标准
  233. /// </summary>
  234. public class QualifiedCriterion : BaseTable
  235. {
  236. public int Pid { get; set; }
  237. public string DefectCode { get; set; }//pp,sx,... EnumUtil.Convert2Enum
  238. /// <summary>
  239. /// 阈值 20240409
  240. /// </summary>
  241. public double Threshold { get; set; }
  242. /// <summary>
  243. /// 尺寸
  244. /// </summary>
  245. public float Size { get; set; }
  246. /// <summary>
  247. /// 最大允许缺陷数量
  248. /// </summary>
  249. public int MaxDefectCount { get; set; }
  250. }
  251. /// <summary>
  252. /// 2023-12-25 单点测试点位
  253. /// </summary>
  254. public class TestDefectPoints : BaseTable
  255. {
  256. public int Pid { get; set; }
  257. /// <summary>
  258. /// 点位代码
  259. /// </summary>
  260. public string PointCode { get; set; }
  261. /// <summary>
  262. /// 点位X
  263. /// </summary>
  264. public double X { get; set; }
  265. /// <summary>
  266. /// 点位Y
  267. /// </summary>
  268. public double Y { get; set; }
  269. }
  270. /// <summary>
  271. /// 2024-03-12 打印信息
  272. /// </summary>
  273. public class PrintInfo : BaseTable
  274. {
  275. public int Pid { get; set; }
  276. /// <summary>
  277. /// 是否为数字
  278. /// </summary>
  279. public bool IsValue { get; set; }
  280. /// <summary>
  281. /// 打印类型0:excel,1:标签,2:工单
  282. /// </summary>
  283. public int Type { get; set; }
  284. /// <summary>
  285. /// 打印位置
  286. /// </summary>
  287. public string PrintKey { get; set; }
  288. /// <summary>
  289. /// 打印代码或数据
  290. /// </summary>
  291. public string PrintCode { get; set; }
  292. /// <summary>
  293. /// 备注名称
  294. /// </summary>
  295. public string PrintName { get; set; }
  296. }
  297. }