版博士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.

Product.cs 11 KiB

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