版博士V2.0程序
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

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