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

373 regels
14 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. //以前只支持Y方向PT
  58. public double PTBaseValue { get; set; }
  59. public double PTUpFloatValue { get; set; }
  60. public double PTDownFloatValue { get; set; }
  61. //新增X方向PT
  62. public double PTXBaseValue { get; set; }
  63. public double PTXUpFloatValue { get; set; }
  64. public double PTXDownFloatValue { get; set; }
  65. //新增检测项2024-2-20
  66. //反面检测
  67. public double FLineWidthBaseValue { get; set; }
  68. public double FLineWidthUpFloatValue { get; set; }
  69. public double FLineWidthDownFloatValue { get; set; }
  70. //主栅连接线检测
  71. public double MGridIntervalBaseValue { get; set; }
  72. public double MGridIntervalUpFloatValue { get; set; }
  73. public double MGridIntervalDownFloatValue { get; set; }
  74. //主栅宽度
  75. public double MGridWidthBaseValue { get; set; }
  76. public double MGridWidthUpFloatValue { get; set; }
  77. public double MGridWidthDownFloatValue { get; set; }
  78. //主栅间距
  79. public double MGridSpreadBaseValue { get; set; }
  80. public double MGridSpreadUpFloatValue { get; set; }
  81. public double MGridSpreadDownFloatValue { get; set; }
  82. //细栅间距检测
  83. public double FGridSpreadBaseValue { get; set; }
  84. public double FGridSpreadUpFloatValue { get; set; }
  85. public double FGridSpreadDownFloatValue { get; set; }
  86. //背极宽度
  87. public double BackPoleWidthBaseValue { get; set; }
  88. public double BackPoleWidthUpFloatValue { get; set; }
  89. public double BackPoleWidthDownFloatValue { get; set; }
  90. //主栅长度检测
  91. public double MGridLengthBaseValue { get; set; }
  92. public double MGridLengthUpFloatValue { get; set; }
  93. public double MGridLengthDownFloatValue { get; set; }
  94. //Mark点横向间距
  95. public double MarkXDisBaseValue { get; set; }
  96. public double MarkXDisUpFloatValue { get; set; }
  97. public double MarkXDisDownFloatValue { get; set; }
  98. //Mark点竖向间距
  99. public double MarkYDisBaseValue { get; set; }
  100. public double MarkYDisUpFloatValue { get; set; }
  101. public double MarkYDisDownFloatValue { get; set; }
  102. //鱼叉口长
  103. public double ForkLengthBaseValue { get; set; }
  104. public double ForkLengthUpFloatValue { get; set; }
  105. public double ForkLengthDownFloatValue { get; set; }
  106. //鱼叉口宽
  107. public double ForkWidthBaseValue { get; set; }
  108. public double ForkWidthUpFloatValue { get; set; }
  109. public double ForkWidthDownFloatValue { get; set; }
  110. //鱼叉口间距
  111. public double ForkDisBaseValue { get; set; }
  112. public double ForkDisUpFloatValue { get; set; }
  113. public double ForkDisDownFloatValue { get; set; }
  114. //蜈蚣角长
  115. public double ChilopodLengthBaseValue { get; set; }
  116. public double ChilopodLengthUpFloatValue { get; set; }
  117. public double ChilopodLengthDownFloatValue { get; set; }
  118. //蜈蚣角宽
  119. public double ChilopodWidthBaseValue { get; set; }
  120. public double ChilopodWidthUpFloatValue { get; set; }
  121. public double ChilopodWidthDownFloatValue { get; set; }
  122. //分片间隔
  123. public double ShardingDisBaseValue { get; set; }
  124. public double ShardingDisUpFloatValue { get; set; }
  125. public double ShardingDisDownFloatValue { get; set; }
  126. //焊点间距
  127. public double WeldingSpotDisBaseValue { get; set; }
  128. public double WeldingSpotDisUpFloatValue { get; set; }
  129. public double WeldingSpotDisDownFloatValue { get; set; }
  130. //焊点长
  131. public double WeldingSpotLengthBaseValue { get; set; }
  132. public double WeldingSpotLengthUpFloatValue { get; set; }
  133. public double WeldingSpotLengthDownFloatValue { get; set; }
  134. //焊点宽
  135. public double WeldingSpotWidthBaseValue { get; set; }
  136. public double WeldingSpotWidthUpFloatValue { get; set; }
  137. public double WeldingSpotWidthDownFloatValue { get; set; }
  138. //高度BASE值
  139. public string HeightBaseDec { get; set; }
  140. //====生产流程绑定
  141. [SugarColumn(IsNullable = true)]
  142. public int? StepId { get; set; }
  143. [Navigate(NavigateType.ManyToOne, nameof(StepId))]
  144. public Step StepInfo { get; set; }
  145. //流程工序列表
  146. [Navigate(NavigateType.OneToMany, nameof(ProductProcess.Pid))]
  147. public List<ProductProcess> ProductProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  148. //====校正流程绑定
  149. [SugarColumn(IsNullable = true)]
  150. public int? ReviseStepId { get; set; }
  151. [Navigate(NavigateType.ManyToOne, nameof(ReviseStepId))]
  152. public Step ReviseStepInfo { get; set; }
  153. //校正流程工序列表
  154. [Navigate(NavigateType.OneToMany, nameof(ProductReviseProcess.Pid))]
  155. public List<ProductReviseProcess> ProductReviseProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  156. //====修复流程绑定
  157. [SugarColumn(IsNullable = true)]
  158. public int? AssistStepId { get; set; }
  159. [Navigate(NavigateType.ManyToOne, nameof(AssistStepId))]
  160. public Step AssistStepInfo { get; set; }
  161. //校正流程工序列表
  162. [Navigate(NavigateType.OneToMany, nameof(ProductAssistProcess.Pid))]
  163. public List<ProductAssistProcess> ProductAssistProcessList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  164. //生产记录(用于导航删除)
  165. [Navigate(NavigateType.OneToMany, nameof(Order.ProductId))]
  166. public List<Order> OrderList { get; set; }//注意禁止给books手动赋值,也不能new初始化,否则导航查询不到
  167. //2023-11-2 加入mark使用
  168. //mark类型 0:无mark
  169. public int MarkType { get; set; }
  170. //mark尺寸
  171. public double MarkSize { get; set; }
  172. //抓点图像
  173. [SugarColumn(IsNullable = true)]
  174. public string MapPath { get; set; }
  175. //抓取点位
  176. [SugarColumn(IsNullable = true, Length = 2048)]
  177. public string GetPointList { get; set; }
  178. //2023-12-18 加入mark干扰判断,是否主栅
  179. public int MarkDisturb { get; set; }
  180. public int MainGrid { get; set; }
  181. //2023-12-19 新流程方案参数
  182. //工单
  183. [SugarColumn(IsNullable = true)]
  184. public string WorkOrderCode { get; set; }
  185. //灵活测试点位
  186. [Navigate(NavigateType.OneToMany, nameof(TestDefectPoints.Pid))]
  187. public List<TestDefectPoints> TestDefectPointsList { get; set; }
  188. //2024-1-24 加入是否存在pad点
  189. [SugarColumn(IsNullable = true)]
  190. public int HavePad { get; set; }
  191. //2024 03-12 加入打印内容绑定产品
  192. #region 打印
  193. [SugarColumn(IsNullable = true)]
  194. /// <summary>
  195. /// 开启标签打印
  196. /// </summary>
  197. public bool EnableLabelPrint { get; set; }
  198. [SugarColumn(IsNullable = true)]
  199. /// <summary>
  200. /// 打印模板路径
  201. /// </summary>
  202. public string LabelTempPath { get; set; }
  203. [SugarColumn(IsNullable = true)]
  204. /// <summary>
  205. /// 开启Excel打印
  206. /// </summary>
  207. public bool EnableExcelPrint { get; set; }
  208. [SugarColumn(IsNullable = true)]
  209. /// <summary>
  210. /// 打印模板路径
  211. /// </summary>
  212. public string ExcelTempPath { get; set; }
  213. [SugarColumn(IsNullable = true)]
  214. //打印信息
  215. [Navigate(NavigateType.OneToMany, nameof(PrintInfo.Pid))]
  216. public List<PrintInfo> PrintInfoList { get; set; }
  217. #endregion
  218. }
  219. /// <summary>
  220. /// 结束的批次才加入
  221. /// </summary>
  222. public class Attachment : BaseTable
  223. {
  224. /// <summary>
  225. /// 源表名,小写
  226. /// </summary>
  227. public string TBName { get; set; }
  228. /// <summary>
  229. /// 子类 看TB主表对应类型
  230. /// </summary>
  231. public int Type { get; set; } = 0;
  232. public int Pid { get; set; }
  233. /// <summary>
  234. /// 原始文件名还扩展名
  235. /// </summary>
  236. public string Name { get; set; }
  237. /// <summary>
  238. /// 本地文件名 子路径+文件名(无扩展名):{TBName}\\{NameTimestamp} //NameTimestamp=id\\A
  239. /// </summary>
  240. public string NameTimestamp { get; set; }
  241. /// <summary>
  242. /// .pdf/.doc
  243. /// </summary>
  244. public string ExtendName { get; set; }
  245. }
  246. /// <summary>
  247. /// 非全量copy于StepProcess工序,只有产品修改工序参数时保存
  248. /// </summary>
  249. public class ProductProcess : BaseTable
  250. {
  251. public int Pid { get; set; }
  252. public string ProcessCode { get; set; }
  253. /// <summary>
  254. /// json
  255. /// </summary>
  256. [SugarColumn(IsNullable = true, Length = 2048)]
  257. public string ProcessParams { get; set; }
  258. }
  259. public class ProductReviseProcess : ProductProcess
  260. {
  261. }
  262. public class ProductAssistProcess : ProductProcess
  263. {
  264. }
  265. /// <summary>
  266. /// 结束的批次才加入
  267. /// </summary>
  268. public class BatchHistory : BaseTable
  269. {
  270. public int Pid { get; set; }
  271. public string BatchId { get; set; }
  272. /// <summary>
  273. /// 目标数量
  274. /// </summary>
  275. public int TargetCount { get; set; }
  276. /// <summary>
  277. /// 当前数量
  278. /// </summary>
  279. public int CompleteCount { get; set; }
  280. }
  281. /// <summary>
  282. /// 合格标准
  283. /// </summary>
  284. public class QualifiedCriterion : BaseTable
  285. {
  286. public int Pid { get; set; }
  287. public string DefectCode { get; set; }//pp,sx,... EnumUtil.Convert2Enum
  288. /// <summary>
  289. /// 尺寸
  290. /// </summary>
  291. public float Size { get; set; }
  292. /// <summary>
  293. /// 最大允许缺陷数量
  294. /// </summary>
  295. public int MaxDefectCount { get; set; }
  296. }
  297. /// <summary>
  298. /// 2023-12-25 单点测试点位
  299. /// </summary>
  300. public class TestDefectPoints : BaseTable
  301. {
  302. public int Pid { get; set; }
  303. /// <summary>
  304. /// 点位代码
  305. /// </summary>
  306. public string PointCode { get; set; }
  307. /// <summary>
  308. /// 点位X
  309. /// </summary>
  310. public double X { get; set; }
  311. /// <summary>
  312. /// 点位Y
  313. /// </summary>
  314. public double Y { get; set; }
  315. }
  316. /// <summary>
  317. /// 2024-03-12 打印信息
  318. /// </summary>
  319. public class PrintInfo : BaseTable
  320. {
  321. public int Pid { get; set; }
  322. /// <summary>
  323. /// 是否为数字
  324. /// </summary>
  325. public bool IsValue { get; set; }
  326. /// <summary>
  327. /// 是否为标签
  328. /// </summary>
  329. public bool IsLabel { get; set; }
  330. /// <summary>
  331. /// 打印位置
  332. /// </summary>
  333. public string PrintKey { get; set; }
  334. /// <summary>
  335. /// 打印代码或数据
  336. /// </summary>
  337. public string PrintCode { get; set; }
  338. }
  339. }