版博士V2.0程序
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

375 satır
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}_sn", nameof(Order.SN), OrderByType.Asc, isUnique: true)]
  10. public class Order : BaseTable
  11. {
  12. public Order() {
  13. XPTValue = 0;
  14. }
  15. /// <summary>
  16. /// 产品
  17. /// </summary>
  18. public int ProductId { get; set; }
  19. [Navigate(NavigateType.ManyToOne, nameof(ProductId))]
  20. public Product ProductInfo { get; set; }
  21. /// <summary>
  22. /// 2024-1-5 检测料号
  23. /// </summary>
  24. [SugarColumn(IsNullable = true)]
  25. public string DetectOrder { get; set; }
  26. [SugarColumn(IsNullable = true)]
  27. public string OrderCode { get; set; }
  28. public string SN { get; set; }
  29. public string BatchId { get; set; }
  30. /// <summary>
  31. /// 流程
  32. /// </summary>
  33. public int StepId { get; set; }
  34. [Navigate(NavigateType.ManyToOne, nameof(StepId))]
  35. public Step StepInfo { get; set; }
  36. /// <summary>
  37. /// 时长-秒
  38. /// </summary>
  39. public double TimeLen { get; set; }
  40. /// <summary>
  41. /// 是否合格
  42. /// </summary>
  43. [SugarColumn(IsNullable = true)]
  44. public bool Qualified { get; set; } = true;
  45. /// <summary>
  46. /// 比对结果 0-未比对 1-通过 2-不通过
  47. /// </summary>
  48. public int CompareResult { get; set; } = 0;
  49. //平均值
  50. public double TensionValue { get; set; }
  51. public double HeightValue { get; set; }
  52. #region 尺寸测试均值
  53. public double LineWidthValue { get; set; }
  54. public double PTValue { get; set; }
  55. [SugarColumn(IsNullable = true)]
  56. public double XPTValue { get; set; } = 0;
  57. //新增检测均值2024-2-20
  58. [SugarColumn(IsNullable = true)]
  59. public double FLineWidthValue { get; set; } = 0;
  60. [SugarColumn(IsNullable = true)]
  61. public double MGridIntervalValue { get; set; } = 0;
  62. [SugarColumn(IsNullable = true)]
  63. public double MGridWidthValue { get; set; } = 0;
  64. [SugarColumn(IsNullable = true)]
  65. public double MGridSpreadValue { get; set; } = 0;
  66. [SugarColumn(IsNullable = true)]
  67. public double FGridSpreadValue { get; set; } = 0;
  68. [SugarColumn(IsNullable = true)]
  69. public double BackPoleWidthValue { get; set; } = 0;
  70. [SugarColumn(IsNullable = true)]
  71. public double MGridLengthValue { get; set; } = 0;
  72. [SugarColumn(IsNullable = true)]
  73. public double MarkXDisValue { get; set; } = 0;
  74. [SugarColumn(IsNullable = true)]
  75. public double MarkYDisValue { get; set; } = 0;
  76. [SugarColumn(IsNullable = true)]
  77. public double ForkLengthValue { get; set; } = 0;
  78. [SugarColumn(IsNullable = true)]
  79. public double ForkWidthValue { get; set; } = 0;
  80. [SugarColumn(IsNullable = true)]
  81. public double ForkDisValue { get; set; } = 0;
  82. //2024 0307
  83. [SugarColumn(IsNullable = true)]
  84. public double ChilopodLengthValue { get; set; } = 0;
  85. [SugarColumn(IsNullable = true)]
  86. public double ChilopodWidthValue { get; set; } = 0;
  87. //2024 0308
  88. [SugarColumn(IsNullable = true)]
  89. public double ShardingDisValue { get; set; } = 0;
  90. [SugarColumn(IsNullable = true)]
  91. public double WeldingSpotDisValue { get; set; } = 0;
  92. [SugarColumn(IsNullable = true)]
  93. public double WeldingSpotLengthValue { get; set; } = 0;
  94. [SugarColumn(IsNullable = true)]
  95. public double WeldingSpotWidthValue { get; set; } = 0;
  96. #endregion
  97. //N次
  98. #region 张力5次
  99. public double Tension1 { get; set; }
  100. public double Tension2 { get; set; }
  101. public double Tension3 { get; set; }
  102. public double Tension4 { get; set; }
  103. public double Tension5 { get; set; }
  104. #endregion
  105. #region 厚度5次
  106. public double Height1 { get; set; }
  107. public double Height2 { get; set; }
  108. public double Height3 { get; set; }
  109. public double Height4 { get; set; }
  110. public double Height5 { get; set; }
  111. #endregion
  112. #region 线宽9次
  113. public double LineWidth1 { get; set; }
  114. public double LineWidth2 { get; set; }
  115. public double LineWidth3 { get; set; }
  116. public double LineWidth4 { get; set; }
  117. public double LineWidth5 { get; set; }
  118. public double LineWidth6 { get; set; }
  119. public double LineWidth7 { get; set; }
  120. public double LineWidth8 { get; set; }
  121. public double LineWidth9 { get; set; }
  122. #endregion
  123. #region PT6次
  124. public double PT1 { get; set; }
  125. public double PT2 { get; set; }
  126. public double PT3 { get; set; }
  127. public double PT4 { get; set; }
  128. public double PT5 { get; set; }
  129. public double PT6 { get; set; }
  130. #endregion
  131. /// <summary>
  132. /// 缺陷数
  133. /// </summary>
  134. public int DefectCount { get; set; }
  135. #region 缺陷种类
  136. public int DKCount { get; set; }//堵孔数量
  137. public int ZWCount { get; set; }//脏污数量
  138. public int GSYCCount { get; set; }//钢丝异常数量
  139. public int XWSCount { get; set; }//纤维丝数量
  140. public int QKCount { get; set; }//缺口数量
  141. public int ZKCount { get; set; }//针孔数量
  142. public int PPCount { get; set; }//泡泡数量
  143. public int HSCount { get; set; }//划伤数量
  144. public int YXCount { get; set; }//压线数量
  145. public int XBCount { get; set; }//斜边数量 new
  146. public int SXCount { get; set; }//栅线数量 new
  147. public int GSDLCount { get; set; }//钢丝断裂 new
  148. public int CJDKCount { get; set; }//残胶堵孔 new
  149. #endregion
  150. /// <summary>
  151. /// mark点数据:[X1,Y1,X2,Y2,X3,Y3,X4,Y4]
  152. /// </summary>
  153. [SugarColumn(IsNullable = true)]
  154. public string MarkData { get; set; }
  155. //
  156. public bool Succeed { get; set; }
  157. /// <summary>
  158. /// 失败分类
  159. /// </summary>
  160. public int FailType { get; set; }
  161. /// <summary>
  162. /// 失败的工序名称
  163. /// </summary>
  164. [SugarColumn(IsNullable = true)]
  165. public string FailProcessName { get; set; }
  166. [SugarColumn(IsNullable = true, ColumnDataType = "text", Length = 2048)]
  167. public string Note { get; set; }
  168. /// <summary>
  169. /// 0-初始; 5-已检测; 10-出现异常
  170. /// </summary>
  171. public int State { get; set; }
  172. //----------
  173. /// <summary>
  174. /// 修改次数
  175. /// </summary>
  176. public int HistoryCount { get; set; } = 0;
  177. /// <summary>
  178. /// 修改历史记录
  179. /// </summary>
  180. [Navigate(NavigateType.OneToMany, nameof(OrderHistory.Pid))]
  181. public List<OrderHistory> OrderHistoryList { get; set; }
  182. /// <summary>
  183. /// Defect和Size比对失败的坐标位置
  184. /// </summary>
  185. [Navigate(NavigateType.OneToMany, nameof(DefectInfo.Pid))]
  186. public List<DefectInfo> DefectInfoList { get; set; }
  187. //2023-10-30 添加单次测试尺寸数据列
  188. /// <summary>
  189. /// 尺寸测试单点数据
  190. /// </summary>
  191. [Navigate(NavigateType.OneToMany, nameof(SizeDefectInfo.Pid))]
  192. public List<SizeDefectInfo> SizeDefectInfoList { get; set; }
  193. //2024-01-11 添加单次测试尺寸数据均值
  194. /// <summary>
  195. /// 尺寸测试均值数据
  196. /// </summary>
  197. [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))]
  198. public List<SizeDefectAverageInfo> SizeDefectAverageInfoList { get; set; }
  199. //-------IsIgnore = true 不保存
  200. [SugarColumn(IsIgnore = true)]
  201. //[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))]
  202. public List<SizeTagData> SizeTagDataList { get; set; }
  203. //2023-10-30 添加异常列
  204. /// <summary>
  205. /// 异常情况
  206. /// </summary>
  207. [SugarColumn(IsNullable = true)]
  208. public string Abnormalities { get; set; }
  209. /// <summary>
  210. /// 修复人员
  211. /// </summary>
  212. [SugarColumn(IsNullable = true)]
  213. public string RepairCode { get; set; }
  214. }
  215. [SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)]
  216. public class OrderHistory : BaseTable
  217. {
  218. public int Pid { get; set; }
  219. public bool Qualified { get; set; }//合格
  220. //比对
  221. public int CompareResult { get; set; }
  222. //平均值
  223. public double TensionValue { get; set; }
  224. public double HeightValue { get; set; }
  225. #region 尺寸均值
  226. public double LineWidthValue { get; set; }
  227. public double PTValue { get; set; }
  228. //X方向pt
  229. public double XPTValue { get; set; }
  230. //新增检测均值2024-2-20
  231. public double FLineWidthValue { get; set; } = 0;
  232. public double MGridIntervalValue { get; set; } = 0;
  233. public double MGridWidthValue { get; set; } = 0;
  234. public double MGridSpreadValue { get; set; } = 0;
  235. public double FGridSpreadValue { get; set; } = 0;
  236. public double BackPoleWidthValue { get; set; } = 0;
  237. public double MGridLengthValue { get; set; } = 0;
  238. public double MarkXDisValue { get; set; } = 0;
  239. public double MarkYDisValue { get; set; } = 0;
  240. public double ForkLengthValue { get; set; } = 0;
  241. public double ForkWidthValue { get; set; } = 0;
  242. public double ForkDisValue { get; set; } = 0;
  243. //2024 0307
  244. public double ChilopodLengthValue { get; set; } = 0;
  245. public double ChilopodWidthValue { get; set; } = 0;
  246. //2024 0308
  247. public double ShardingDisValue { get; set; } = 0;
  248. public double WeldingSpotDisValue { get; set; } = 0;
  249. public double WeldingSpotLengthValue { get; set; } = 0;
  250. public double WeldingSpotWidthValue { get; set; } = 0;
  251. #endregion
  252. //2024-01-11 添加单次测试尺寸数据均值
  253. /// <summary>
  254. /// 尺寸测试均值数据
  255. /// </summary>
  256. [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))]
  257. public List<SizeDefectAverageInfo> SizeDefectAverageInfoList { get; set; }
  258. //外观
  259. public int DKCount { get; set; }//堵孔数量
  260. public int ZWCount { get; set; }//脏污数量
  261. public int GSYCCount { get; set; }//钢丝异常数量
  262. public int XWSCount { get; set; }//纤维丝数量
  263. public int QKCount { get; set; }//缺口数量
  264. public int ZKCount { get; set; }//针孔数量
  265. public int PPCount { get; set; }//泡泡数量
  266. public int HSCount { get; set; }//划伤数量
  267. public int YXCount { get; set; }//压线数量
  268. public int XBCount { get; set; }//斜边数量 new
  269. public int SXCount { get; set; }//栅线数量 new
  270. }
  271. [SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)]
  272. public class SizeTagData : BaseTable
  273. {
  274. public int Pid { get; set; }
  275. public string SizeTag { get; set; }
  276. /// <summary>
  277. /// 产生Tag工序索引
  278. /// </summary>
  279. public int CreateStepIndex { get; set; }
  280. /// <summary>
  281. /// 消费本数据工序索引和消费值索引:5-0,8-2
  282. /// </summary>
  283. public string ConsumeStepIndex { get; set; }
  284. /// <summary>
  285. /// double[]
  286. /// </summary>
  287. public string posePT { get; set; }
  288. }
  289. [SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  290. public class DefectInfo : BaseTable
  291. {
  292. public int Pid { get; set; }
  293. /// <summary>
  294. /// 0-Defect 1-Size
  295. /// </summary>
  296. public int Type { get; set; }
  297. public string Code { get;set; }
  298. public double X { get; set; }
  299. public double Y { get; set; }
  300. public double ZXD { get; set; }
  301. public double Area { get; set; }
  302. //[SugarColumn(IsNullable = true)]
  303. //public string PicName { get; set; }
  304. public int Index { get; set; }
  305. }
  306. //2023-12-27 新表,存储单点尺寸测试数据
  307. [SugarIndex("index_{table}_pid", nameof(SizeDefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  308. public class SizeDefectInfo : BaseTable
  309. {
  310. public int Pid { get; set; }
  311. //单次结果 1:ok 2:ng
  312. public int result { get; set; }
  313. //测试项代码
  314. public string PointCode { get; set; }
  315. //标记位置
  316. public double X { get; set; }
  317. public double Y { get; set; }
  318. //测试数据
  319. public double Data { get; set; }
  320. //测试步骤名称
  321. public string StepName { get; set; }
  322. }
  323. //2024-03-11 新表,存储不同步骤的均值测试数据
  324. [SugarIndex("index_{table}_pid", nameof(SizeDefectAverageInfo.Pid), OrderByType.Asc, isUnique: false)]
  325. public class SizeDefectAverageInfo : BaseTable
  326. {
  327. public int Pid { get; set; }
  328. //单次结果 1:ok 2:ng
  329. public int result { get; set; }
  330. //测试项代码
  331. public string PointCode { get; set; }
  332. //上下限
  333. public double Max { get; set; }
  334. public double Min { get; set; }
  335. //测试数据
  336. public double AverageData { get; set; }
  337. //测试步骤名称
  338. public string StepName { get; set; }
  339. }
  340. }