版博士V2.0程序
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

373 Zeilen
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. #endregion
  148. /// <summary>
  149. /// mark点数据:[X1,Y1,X2,Y2,X3,Y3,X4,Y4]
  150. /// </summary>
  151. [SugarColumn(IsNullable = true)]
  152. public string MarkData { get; set; }
  153. //
  154. public bool Succeed { get; set; }
  155. /// <summary>
  156. /// 失败分类
  157. /// </summary>
  158. public int FailType { get; set; }
  159. /// <summary>
  160. /// 失败的工序名称
  161. /// </summary>
  162. [SugarColumn(IsNullable = true)]
  163. public string FailProcessName { get; set; }
  164. [SugarColumn(IsNullable = true, ColumnDataType = "text", Length = 2048)]
  165. public string Note { get; set; }
  166. /// <summary>
  167. /// 0-初始; 5-已检测; 10-出现异常
  168. /// </summary>
  169. public int State { get; set; }
  170. //----------
  171. /// <summary>
  172. /// 修改次数
  173. /// </summary>
  174. public int HistoryCount { get; set; } = 0;
  175. /// <summary>
  176. /// 修改历史记录
  177. /// </summary>
  178. [Navigate(NavigateType.OneToMany, nameof(OrderHistory.Pid))]
  179. public List<OrderHistory> OrderHistoryList { get; set; }
  180. /// <summary>
  181. /// Defect和Size比对失败的坐标位置
  182. /// </summary>
  183. [Navigate(NavigateType.OneToMany, nameof(DefectInfo.Pid))]
  184. public List<DefectInfo> DefectInfoList { get; set; }
  185. //2023-10-30 添加单次测试尺寸数据列
  186. /// <summary>
  187. /// 尺寸测试单点数据
  188. /// </summary>
  189. [Navigate(NavigateType.OneToMany, nameof(SizeDefectInfo.Pid))]
  190. public List<SizeDefectInfo> SizeDefectInfoList { get; set; }
  191. //2024-01-11 添加单次测试尺寸数据均值
  192. /// <summary>
  193. /// 尺寸测试均值数据
  194. /// </summary>
  195. [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))]
  196. public List<SizeDefectAverageInfo> SizeDefectAverageInfoList { get; set; }
  197. //-------IsIgnore = true 不保存
  198. [SugarColumn(IsIgnore = true)]
  199. //[Navigate(NavigateType.OneToMany, nameof(SizeTagData.Pid))]
  200. public List<SizeTagData> SizeTagDataList { get; set; }
  201. //2023-10-30 添加异常列
  202. /// <summary>
  203. /// 异常情况
  204. /// </summary>
  205. [SugarColumn(IsNullable = true)]
  206. public string Abnormalities { get; set; }
  207. /// <summary>
  208. /// 修复人员
  209. /// </summary>
  210. [SugarColumn(IsNullable = true)]
  211. public string RepairCode { get; set; }
  212. }
  213. [SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)]
  214. public class OrderHistory : BaseTable
  215. {
  216. public int Pid { get; set; }
  217. public bool Qualified { get; set; }//合格
  218. //比对
  219. public int CompareResult { get; set; }
  220. //平均值
  221. public double TensionValue { get; set; }
  222. public double HeightValue { get; set; }
  223. #region 尺寸均值
  224. public double LineWidthValue { get; set; }
  225. public double PTValue { get; set; }
  226. //X方向pt
  227. public double XPTValue { get; set; }
  228. //新增检测均值2024-2-20
  229. public double FLineWidthValue { get; set; } = 0;
  230. public double MGridIntervalValue { get; set; } = 0;
  231. public double MGridWidthValue { get; set; } = 0;
  232. public double MGridSpreadValue { get; set; } = 0;
  233. public double FGridSpreadValue { get; set; } = 0;
  234. public double BackPoleWidthValue { get; set; } = 0;
  235. public double MGridLengthValue { get; set; } = 0;
  236. public double MarkXDisValue { get; set; } = 0;
  237. public double MarkYDisValue { get; set; } = 0;
  238. public double ForkLengthValue { get; set; } = 0;
  239. public double ForkWidthValue { get; set; } = 0;
  240. public double ForkDisValue { get; set; } = 0;
  241. //2024 0307
  242. public double ChilopodLengthValue { get; set; } = 0;
  243. public double ChilopodWidthValue { get; set; } = 0;
  244. //2024 0308
  245. public double ShardingDisValue { get; set; } = 0;
  246. public double WeldingSpotDisValue { get; set; } = 0;
  247. public double WeldingSpotLengthValue { get; set; } = 0;
  248. public double WeldingSpotWidthValue { get; set; } = 0;
  249. #endregion
  250. //2024-01-11 添加单次测试尺寸数据均值
  251. /// <summary>
  252. /// 尺寸测试均值数据
  253. /// </summary>
  254. [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))]
  255. public List<SizeDefectAverageInfo> SizeDefectAverageInfoList { get; set; }
  256. //外观
  257. public int DKCount { get; set; }//堵孔数量
  258. public int ZWCount { get; set; }//脏污数量
  259. public int GSYCCount { get; set; }//钢丝异常数量
  260. public int XWSCount { get; set; }//纤维丝数量
  261. public int QKCount { get; set; }//缺口数量
  262. public int ZKCount { get; set; }//针孔数量
  263. public int PPCount { get; set; }//泡泡数量
  264. public int HSCount { get; set; }//划伤数量
  265. public int YXCount { get; set; }//压线数量
  266. public int XBCount { get; set; }//斜边数量 new
  267. public int SXCount { get; set; }//栅线数量 new
  268. }
  269. [SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)]
  270. public class SizeTagData : BaseTable
  271. {
  272. public int Pid { get; set; }
  273. public string SizeTag { get; set; }
  274. /// <summary>
  275. /// 产生Tag工序索引
  276. /// </summary>
  277. public int CreateStepIndex { get; set; }
  278. /// <summary>
  279. /// 消费本数据工序索引和消费值索引:5-0,8-2
  280. /// </summary>
  281. public string ConsumeStepIndex { get; set; }
  282. /// <summary>
  283. /// double[]
  284. /// </summary>
  285. public string posePT { get; set; }
  286. }
  287. [SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  288. public class DefectInfo : BaseTable
  289. {
  290. public int Pid { get; set; }
  291. /// <summary>
  292. /// 0-Defect 1-Size
  293. /// </summary>
  294. public int Type { get; set; }
  295. public string Code { get;set; }
  296. public double X { get; set; }
  297. public double Y { get; set; }
  298. public double ZXD { get; set; }
  299. public double Area { get; set; }
  300. //[SugarColumn(IsNullable = true)]
  301. //public string PicName { get; set; }
  302. public int Index { get; set; }
  303. }
  304. //2023-12-27 新表,存储单点尺寸测试数据
  305. [SugarIndex("index_{table}_pid", nameof(SizeDefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  306. public class SizeDefectInfo : BaseTable
  307. {
  308. public int Pid { get; set; }
  309. //单次结果 1:ok 2:ng
  310. public int result { get; set; }
  311. //测试项代码
  312. public string PointCode { get; set; }
  313. //标记位置
  314. public double X { get; set; }
  315. public double Y { get; set; }
  316. //测试数据
  317. public double Data { get; set; }
  318. //测试步骤名称
  319. public string StepName { get; set; }
  320. }
  321. //2024-03-11 新表,存储不同步骤的均值测试数据
  322. [SugarIndex("index_{table}_pid", nameof(SizeDefectAverageInfo.Pid), OrderByType.Asc, isUnique: false)]
  323. public class SizeDefectAverageInfo : BaseTable
  324. {
  325. public int Pid { get; set; }
  326. //单次结果 1:ok 2:ng
  327. public int result { get; set; }
  328. //测试项代码
  329. public string PointCode { get; set; }
  330. //上下限
  331. public double Max { get; set; }
  332. public double Min { get; set; }
  333. //测试数据
  334. public double AverageData { get; set; }
  335. //测试步骤名称
  336. public string StepName { get; set; }
  337. }
  338. }