版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

376 строки
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. }
  216. [SugarIndex("index_{table}_pid", nameof(OrderHistory.Pid), OrderByType.Asc, isUnique: false)]
  217. public class OrderHistory : BaseTable
  218. {
  219. public int Pid { get; set; }
  220. public bool Qualified { get; set; }//合格
  221. //比对
  222. public int CompareResult { get; set; }
  223. //平均值
  224. public double TensionValue { get; set; }
  225. public double HeightValue { get; set; }
  226. #region 尺寸均值
  227. public double LineWidthValue { get; set; }
  228. public double PTValue { get; set; }
  229. //X方向pt
  230. public double XPTValue { get; set; }
  231. //新增检测均值2024-2-20
  232. public double FLineWidthValue { get; set; } = 0;
  233. public double MGridIntervalValue { get; set; } = 0;
  234. public double MGridWidthValue { get; set; } = 0;
  235. public double MGridSpreadValue { get; set; } = 0;
  236. public double FGridSpreadValue { get; set; } = 0;
  237. public double BackPoleWidthValue { get; set; } = 0;
  238. public double MGridLengthValue { get; set; } = 0;
  239. public double MarkXDisValue { get; set; } = 0;
  240. public double MarkYDisValue { get; set; } = 0;
  241. public double ForkLengthValue { get; set; } = 0;
  242. public double ForkWidthValue { get; set; } = 0;
  243. public double ForkDisValue { get; set; } = 0;
  244. //2024 0307
  245. public double ChilopodLengthValue { get; set; } = 0;
  246. public double ChilopodWidthValue { get; set; } = 0;
  247. //2024 0308
  248. public double ShardingDisValue { get; set; } = 0;
  249. public double WeldingSpotDisValue { get; set; } = 0;
  250. public double WeldingSpotLengthValue { get; set; } = 0;
  251. public double WeldingSpotWidthValue { get; set; } = 0;
  252. #endregion
  253. //2024-01-11 添加单次测试尺寸数据均值
  254. /// <summary>
  255. /// 尺寸测试均值数据
  256. /// </summary>
  257. [Navigate(NavigateType.OneToMany, nameof(SizeDefectAverageInfo.Pid))]
  258. public List<SizeDefectAverageInfo> SizeDefectAverageInfoList { get; set; }
  259. //外观
  260. public int DKCount { get; set; }//堵孔数量
  261. public int ZWCount { get; set; }//脏污数量
  262. public int GSYCCount { get; set; }//钢丝异常数量
  263. public int XWSCount { get; set; }//纤维丝数量
  264. public int QKCount { get; set; }//缺口数量
  265. public int ZKCount { get; set; }//针孔数量
  266. public int PPCount { get; set; }//泡泡数量
  267. public int HSCount { get; set; }//划伤数量
  268. public int YXCount { get; set; }//压线数量
  269. public int XBCount { get; set; }//斜边数量 new
  270. public int SXCount { get; set; }//栅线数量 new
  271. }
  272. [SugarIndex("index_{table}_pid", nameof(SizeTagData.Pid), OrderByType.Asc, isUnique: false)]
  273. public class SizeTagData : BaseTable
  274. {
  275. public int Pid { get; set; }
  276. public string SizeTag { get; set; }
  277. /// <summary>
  278. /// 产生Tag工序索引
  279. /// </summary>
  280. public int CreateStepIndex { get; set; }
  281. /// <summary>
  282. /// 消费本数据工序索引和消费值索引:5-0,8-2
  283. /// </summary>
  284. public string ConsumeStepIndex { get; set; }
  285. /// <summary>
  286. /// double[]
  287. /// </summary>
  288. public string posePT { get; set; }
  289. }
  290. [SugarIndex("index_{table}_pid", nameof(DefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  291. public class DefectInfo : BaseTable
  292. {
  293. public int Pid { get; set; }
  294. /// <summary>
  295. /// 0-Defect 1-Size
  296. /// </summary>
  297. public int Type { get; set; }
  298. public string Code { get;set; }
  299. public double X { get; set; }
  300. public double Y { get; set; }
  301. public double ZXD { get; set; }
  302. public double Area { get; set; }
  303. //[SugarColumn(IsNullable = true)]
  304. //public string PicName { get; set; }
  305. public int Index { get; set; }
  306. }
  307. //2023-12-27 新表,存储单点尺寸测试数据
  308. [SugarIndex("index_{table}_pid", nameof(SizeDefectInfo.Pid), OrderByType.Asc, isUnique: false)]
  309. public class SizeDefectInfo : BaseTable
  310. {
  311. public int Pid { get; set; }
  312. //单次结果 1:ok 2:ng
  313. public int result { get; set; }
  314. //测试项代码
  315. public string PointCode { get; set; }
  316. //标记位置
  317. public double X { get; set; }
  318. public double Y { get; set; }
  319. //测试数据
  320. public double Data { get; set; }
  321. //测试步骤名称
  322. public string StepName { get; set; }
  323. }
  324. //2024-03-11 新表,存储不同步骤的均值测试数据
  325. [SugarIndex("index_{table}_pid", nameof(SizeDefectAverageInfo.Pid), OrderByType.Asc, isUnique: false)]
  326. public class SizeDefectAverageInfo : BaseTable
  327. {
  328. public int Pid { get; set; }
  329. //单次结果 1:ok 2:ng
  330. public int result { get; set; }
  331. //测试项代码
  332. public string PointCode { get; set; }
  333. //上下限
  334. public double Max { get; set; }
  335. public double Min { get; set; }
  336. //测试数据
  337. public double AverageData { get; set; }
  338. //测试步骤名称
  339. public string StepName { get; set; }
  340. }
  341. }