WCS_TASK.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Converters;
  3. using SqlSugar;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. namespace WCS.Data.Models
  9. {
  10. public enum TASK_COMTYPEEnum
  11. {
  12. 入库 = 1,
  13. 出库 = 2,
  14. 移库 = 3,
  15. 搬运 = 4,
  16. 移动 = 5
  17. }
  18. public class WCS_TASK
  19. {
  20. /// <summary>
  21. /// WCS任务号
  22. /// </summary>
  23. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  24. public int TASK_NO { get; set; }
  25. /// <summary>
  26. /// WMS任务号
  27. /// </summary>
  28. public string TASK_WMSNO { get; set; }
  29. public int TASK_COMTYPE { get; set; }
  30. [SugarColumn(IsIgnore = true)]
  31. public TASK_COMTYPEEnum TASK_COMTYPECh
  32. {
  33. get
  34. {
  35. return (TASK_COMTYPEEnum)TASK_COMTYPE;
  36. }
  37. }
  38. public string TASK_SYSTYPE { get; set; }
  39. public string TASK_POSIDFROM { get; set; }
  40. public string TASK_POSIDCUR { get; set; }
  41. public string TASK_POSIDNEXT { get; set; }
  42. public string TASK_POSIDTO { get; set; }
  43. public string TASK_POSIDMOVE { get; set; }
  44. public int TASK_PRIORITY { get; set; }
  45. public int TASK_WKSTATUS { get; set; }
  46. public string TASK_WHID { get; set; }
  47. public string TASK_ADDUSERNO { get; set; }
  48. public DateTime TASK_ADDDATETIME { get; set; }
  49. public string TASK_EDITUSERNO { get; set; }
  50. public DateTime TASK_EDITDATETIME { get; set; }
  51. /// <summary>
  52. /// 是否缠膜(1.缠膜;0.不缠膜)
  53. /// </summary>
  54. public string TASK_NOTES { get; set; }
  55. public string TASK_SRMNO { get; set; }
  56. /// <summary>
  57. /// rgv编号
  58. /// </summary>
  59. public string TASK_RGVNO { get; set; }
  60. public int TASK_ORDERTYPE { get; set; }
  61. /// <summary>
  62. /// 条码
  63. /// </summary>
  64. public string TASK_BOXBARCODE { get; set; }
  65. /// <summary>
  66. /// 起始巷道号
  67. /// </summary>
  68. public string TASK_FromTunnelNum { get; set; }
  69. /// <summary>
  70. /// 目标巷道号
  71. /// </summary>
  72. public string TASK_EndTunnelNum { get; set; }
  73. /// <summary>
  74. /// 熟化类型(0=不需熟化、1=熟化房熟化、2=小烘房熟化)
  75. /// </summary>
  76. public int TASK_MatureType { get; set; }
  77. /// <summary>
  78. /// 熟化时间(小时:10,16)
  79. /// </summary>
  80. public decimal TASK_MatureDate { get; set; }
  81. /// <summary>
  82. /// 重量
  83. /// </summary>
  84. public decimal TASK_WEIGHT { get; set; }
  85. /// <summary>
  86. /// 垛型
  87. /// </summary>
  88. public int TASK_STACKINGTYPE { get; set; }
  89. /// <summary>
  90. /// 熟化次数
  91. /// </summary>
  92. public int? MatureNum { get; set; }
  93. //{
  94. // get
  95. // {
  96. // if (TASK_MatureDate == 48)
  97. // {
  98. // return Convert.ToInt32(TASK_MatureDate) / 12;
  99. // }
  100. // else
  101. // {
  102. // return 1;
  103. // }
  104. // }
  105. //}
  106. /// <summary>
  107. /// 熟化温度(小数)
  108. /// </summary>
  109. public decimal TASK_MatureTemperat { get; set; }
  110. /// <summary>
  111. /// 进入熟化房时间
  112. /// </summary>
  113. public DateTime? TASK_InMatureRoomDate { get; set; }
  114. /// <summary>
  115. /// 离开熟化房时间
  116. /// </summary>
  117. public DateTime? TASK_OutMatureRoomDate { get; set; }
  118. /// <summary>
  119. /// 重量
  120. /// </summary>
  121. public decimal TASK_GrossWeight { get; set; }
  122. /// <summary>
  123. /// 是否缠膜(1.缠膜;0.不缠膜)
  124. /// </summary>
  125. public bool TASK_IsWrapFilm { get; set; }
  126. /// <summary>
  127. /// 预分配堆垛机出口输送线编号
  128. /// </summary>
  129. //public string TASK_SRMOUTCONVNO { get; set; }
  130. /// <summary>
  131. /// 机械手:子托盘的尺寸编码
  132. /// </summary>
  133. public string PalletizingSonTraySize { get; set; }
  134. /// <summary>
  135. /// 机械手:码垛的箱子尺寸编码
  136. /// </summary>
  137. public string PalletizingBoxSize { get; set; }
  138. /// <summary>
  139. /// 子托盘颜色编号(1蓝:,2:白,3:绿)
  140. /// </summary>
  141. public int? SonTrayColorNo { get; set; }
  142. /// <summary>
  143. /// 分组编号
  144. /// </summary>
  145. public string TASK_ITEM1 { get; set; }
  146. /// <summary>
  147. /// 托盘类型(1.原膜托盘 2.熟化架 3.成品托盘 4.空托盘组)
  148. /// </summary>
  149. public string TASK_ITEM2 { get; set; }
  150. /// <summary>
  151. /// 是否空盘(1.空盘 2.非空盘)
  152. /// </summary>
  153. public string TASK_ITEM3 { get; set; }
  154. /// <summary>
  155. /// RGV起点地址
  156. /// </summary>
  157. public string TASK_ITEM4 { get; set; }
  158. /// <summary>
  159. /// 原膜托盘上卷一条码(领料)
  160. /// </summary>
  161. public string TASK_ITEM5 { get; set; }
  162. /// <summary>
  163. /// 原膜托盘上卷二条码(领料)
  164. /// </summary>
  165. public string TASK_ITEM6 { get; set; }
  166. /// <summary>
  167. /// 预分配堆垛机巷道列表
  168. /// </summary>
  169. public string TASK_ITEM7 { get; set; }
  170. /// <summary>
  171. /// AGV任务Id
  172. /// </summary>
  173. public string TASK_ITEM8 { get; set; }
  174. /// <summary>
  175. /// 退料原膜卷条码一,(机械手:码垛的箱子尺寸编码)
  176. /// </summary>
  177. public string TASK_ITEM9 { get; set; }
  178. /// <summary>
  179. /// 退料原膜卷条码二,(机械手:子托盘的尺寸编码)
  180. /// </summary>
  181. public string TASK_ITEM10 { get; set; }
  182. ///// <summary>
  183. /////
  184. ///// </summary>
  185. //public string TASK_ITEM11 { get; set; }
  186. //public string TASK_ITEM12 { get; set; }
  187. //public string TASK_ITEM13 { get; set; }
  188. //public string TASK_ITEM14 { get; set; }
  189. //public string TASK_ITEM15 { get; set; }
  190. //public string TASK_ITEM16 { get; set; }
  191. [SugarColumn(IsIgnore = true)]
  192. public List<string> FromLocation
  193. {
  194. get
  195. {
  196. return TASK_POSIDFROM.Split('-').ToList();
  197. }
  198. }
  199. [SugarColumn(IsIgnore = true)]
  200. public string FromNo
  201. {
  202. get
  203. {
  204. return FromLocation[0];
  205. }
  206. }
  207. [SugarColumn(IsIgnore = true)]
  208. public int FromRow
  209. {
  210. get
  211. {
  212. try
  213. {
  214. return Convert.ToInt32(FromLocation[1]);
  215. }
  216. catch (Exception ex)
  217. {
  218. throw new Exception(string.Format("任务[{0}]起点地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDFROM));
  219. }
  220. }
  221. }
  222. [SugarColumn(IsIgnore = true)]
  223. public string TASK_POSIDTO_SHORT
  224. {
  225. get
  226. {
  227. if (TASK_POSIDTO.Length > 4)
  228. {
  229. return TASK_POSIDTO.Substring(0, 4);
  230. }
  231. else
  232. {
  233. return TASK_POSIDTO;
  234. }
  235. }
  236. }
  237. [SugarColumn(IsIgnore = true)]
  238. public int FromCol
  239. {
  240. get
  241. {
  242. try
  243. {
  244. return Convert.ToInt32(FromLocation[2]);
  245. }
  246. catch (Exception ex)
  247. {
  248. throw new Exception(string.Format("任务[{0}]起点地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDFROM));
  249. }
  250. }
  251. }
  252. [SugarColumn(IsIgnore = true)]
  253. public int FromLayer
  254. {
  255. get
  256. {
  257. try
  258. {
  259. return Convert.ToInt32(FromLocation[3]);
  260. }
  261. catch (Exception ex)
  262. {
  263. throw new Exception(string.Format("任务[{0}]起点地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDFROM));
  264. }
  265. }
  266. }
  267. [SugarColumn(IsIgnore = true)]
  268. public int FromDepth
  269. {
  270. get
  271. {
  272. try
  273. {
  274. return Convert.ToInt32(FromLocation[4]);
  275. }
  276. catch (Exception ex)
  277. {
  278. throw new Exception(string.Format("任务[{0}]起点地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDFROM));
  279. }
  280. }
  281. }
  282. [SugarColumn(IsIgnore = true)]
  283. public int FromSingleDepthRow
  284. {
  285. get
  286. {
  287. return 1;
  288. }
  289. }
  290. [SugarColumn(IsIgnore = true)]
  291. public List<string> ToLocation
  292. {
  293. get
  294. {
  295. return TASK_POSIDTO.Split('-').ToList();
  296. }
  297. }
  298. [SugarColumn(IsIgnore = true)]
  299. public string ToNo
  300. {
  301. get
  302. {
  303. return FromLocation[0];
  304. }
  305. }
  306. [SugarColumn(IsIgnore = true)]
  307. public int ToRow
  308. {
  309. get
  310. {
  311. try
  312. {
  313. return Convert.ToInt32(ToLocation[1]);
  314. }
  315. catch (Exception ex)
  316. {
  317. throw new Exception(string.Format("任务[{0}]目标地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDTO));
  318. }
  319. }
  320. }
  321. [SugarColumn(IsIgnore = true)]
  322. public int ToCol
  323. {
  324. get
  325. {
  326. try
  327. {
  328. return Convert.ToInt32(ToLocation[2]);
  329. }
  330. catch (Exception ex)
  331. {
  332. throw new Exception(string.Format("任务[{0}]目标地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDTO));
  333. }
  334. }
  335. }
  336. [SugarColumn(IsIgnore = true)]
  337. public int ToLayer
  338. {
  339. get
  340. {
  341. try
  342. {
  343. return Convert.ToInt32(ToLocation[3]);
  344. }
  345. catch (Exception ex)
  346. {
  347. throw new Exception(string.Format("任务[{0}]目标地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDTO));
  348. }
  349. }
  350. }
  351. [SugarColumn(IsIgnore = true)]
  352. public int ToDepth
  353. {
  354. get
  355. {
  356. try
  357. {
  358. return Convert.ToInt32(ToLocation[4]);
  359. }
  360. catch (Exception)
  361. {
  362. throw new Exception(string.Format("任务[{0}]目标地址[{1}]不正确,堆垛机无法执行。", TASK_NO, TASK_POSIDTO));
  363. }
  364. }
  365. }
  366. public WCS_TASK QainClone()
  367. {
  368. return MemberwiseClone() as WCS_TASK;
  369. }
  370. }
  371. public class WCS_TASK_DTL
  372. {
  373. [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
  374. public string ID { get; set; }
  375. public int PARENTID { get; set; }
  376. public int TASKNO { get; set; }
  377. public string POSIDCUR { get; set; }
  378. public string POSIDNEXT { get; set; }
  379. public string DESCRIPTION { get; set; }
  380. public string NOTES { get; set; }
  381. public DateTime EXECUTEDATE { get; set; }
  382. }
  383. public class WCS_TASK_DIS
  384. {
  385. /// <summary>
  386. /// WCS任务号
  387. /// </summary>
  388. [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
  389. public int TASK_NO { get; set; }
  390. /// <summary>
  391. /// WMS任务号
  392. /// </summary>
  393. public string TASK_WMSNO { get; set; }
  394. public int TASK_COMTYPE { get; set; }
  395. public string TASK_SYSTYPE { get; set; }
  396. public string TASK_POSIDFROM { get; set; }
  397. public string TASK_POSIDCUR { get; set; }
  398. public string TASK_POSIDNEXT { get; set; }
  399. public string TASK_POSIDTO { get; set; }
  400. public string TASK_POSIDMOVE { get; set; }
  401. public int TASK_PRIORITY { get; set; }
  402. public int TASK_WKSTATUS { get; set; }
  403. public string TASK_WHID { get; set; }
  404. public string TASK_SRMNO { get; set; }
  405. /// <summary>
  406. /// rgv工位
  407. /// </summary>
  408. public string TASK_RGVNO { get; set; }
  409. public int TASK_ORDERTYPE { get; set; }
  410. public string TASK_BOXBARCODE { get; set; }
  411. /// <summary>
  412. /// 起始巷道号
  413. /// </summary>
  414. public string TASK_FromTunnelNum { get; set; }
  415. /// <summary>
  416. /// 目标巷道号
  417. /// </summary>
  418. public string TASK_EndTunnelNum { get; set; }
  419. /// <summary>
  420. /// 熟化类型(0=不需熟化、1=熟化房熟化、2=小烘房熟化)
  421. /// </summary>
  422. public int TASK_MatureType { get; set; }
  423. /// <summary>
  424. /// 熟化时间(小时:10,16)
  425. /// </summary>
  426. public decimal TASK_MatureDate { get; set; }
  427. /// <summary>
  428. /// 熟化温度(小数)
  429. /// </summary>
  430. public decimal TASK_MatureTemperat { get; set; }
  431. /// <summary>
  432. /// 进入熟化房时间
  433. /// </summary>
  434. public DateTime? TASK_InMatureRoomDate { get; set; }
  435. /// <summary>
  436. /// 离开熟化房时间
  437. /// </summary>
  438. public DateTime? TASK_OutMatureRoomDate { get; set; }
  439. /// <summary>
  440. /// 重量
  441. /// </summary>
  442. public decimal TASK_GrossWeight { get; set; }
  443. /// <summary>
  444. /// 是否缠膜(1.缠膜;0.不缠膜)
  445. /// </summary>
  446. public bool TASK_IsWrapFilm { get; set; }
  447. public string TASK_ADDUSERNO { get; set; }
  448. public DateTime TASK_ADDDATETIME { get; set; }
  449. public string TASK_EDITUSERNO { get; set; }
  450. public DateTime TASK_EDITDATETIME { get; set; }
  451. public string TASK_DELETEUSER { get; set; }
  452. public DateTime TASK_DELETEDATE { get; set; }
  453. public string TASK_NOTES { get; set; }
  454. /// <summary>
  455. /// 机械手:子托盘的尺寸编码
  456. /// </summary>
  457. public string PalletizingSonTraySize { get; set; }
  458. /// <summary>
  459. /// 机械手:码垛的箱子尺寸编码
  460. /// </summary>
  461. public string PalletizingBoxSize { get; set; }
  462. /// <summary>
  463. /// 子托盘颜色编号(1,2,3)
  464. /// </summary>
  465. public int? SonTrayColorNo { get; set; }
  466. /// <summary>
  467. /// 预分配堆垛机出口输送线编号
  468. /// </summary>
  469. //public string TASK_SRMOUTCONVNO { get; set; }
  470. public string TASK_ITEM1 { get; set; }
  471. public string TASK_ITEM2 { get; set; }
  472. public string TASK_ITEM3 { get; set; }
  473. public string TASK_ITEM4 { get; set; }
  474. public string TASK_ITEM5 { get; set; }
  475. public string TASK_ITEM6 { get; set; }
  476. public string TASK_ITEM7 { get; set; }
  477. public string TASK_ITEM8 { get; set; }
  478. public string TASK_ITEM9 { get; set; }
  479. public string TASK_ITEM10 { get; set; }
  480. }
  481. public class WCS_TASK_DIS_DTL
  482. {
  483. [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
  484. public string ID { get; set; }
  485. public int PARENTID { get; set; }
  486. public int TASKNO { get; set; }
  487. public string POSIDCUR { get; set; }
  488. public string POSIDNEXT { get; set; }
  489. public string DESCRIPTION { get; set; }
  490. public string NOTES { get; set; }
  491. public DateTime EXECUTEDATE { get; set; }
  492. }
  493. /// <summary>
  494. /// json属性值转为日期
  495. /// </summary>
  496. public class DateConverter : IsoDateTimeConverter
  497. {
  498. /// <summary>
  499. /// 类构造
  500. /// </summary>
  501. public DateConverter()
  502. {
  503. base.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
  504. }
  505. }
  506. public class WCS_TASKTIMEPOINT
  507. {
  508. public WCS_TASKTIMEPOINT()
  509. {
  510. }
  511. /// <summary>
  512. /// Desc:站台号
  513. /// Default:
  514. /// Nullable:True
  515. /// </summary>
  516. [SugarColumn(IsPrimaryKey = true, IsIdentity = false)]
  517. public string F_NO { get; set; }
  518. /// <summary>
  519. /// Desc:是否暂停
  520. /// Default:
  521. /// Nullable:False
  522. /// </summary>
  523. public int F_ISSTOP { get; set; }
  524. /// <summary>
  525. /// Desc:是否删除
  526. /// Default:
  527. /// Nullable:False
  528. /// </summary>
  529. public int F_ISDELETE { get; set; }
  530. /// <summary>
  531. /// Desc:容器条码
  532. /// Default:
  533. /// Nullable:True
  534. /// </summary>
  535. public string F_BOXBARCODE { get; set; }
  536. /// <summary>
  537. /// Desc:去处(1:入库 2.移动至收货口 3.堆垛机码盘)
  538. /// Default:
  539. /// Nullable:True
  540. /// </summary>
  541. public int? F_POSIDTOTYPE { get; set; }
  542. /// <summary>
  543. /// Desc:超时时长S
  544. /// Default:
  545. /// Nullable:True
  546. /// </summary>
  547. public string F_OVERTIME { get; set; }
  548. /// <summary>
  549. /// Desc:创建用户编码
  550. /// Default:
  551. /// Nullable:True
  552. /// </summary>
  553. public string F_ADDUSERNO { get; set; }
  554. /// <summary>
  555. /// Desc:创建用户姓名
  556. /// Default:
  557. /// Nullable:True
  558. /// </summary>
  559. public string F_ADDUSERNAME1 { get; set; }
  560. /// <summary>
  561. /// Desc:创建日期
  562. /// Default:
  563. /// Nullable:True
  564. /// </summary>
  565. public DateTime? F_ADDDATETIME { get; set; }
  566. /// <summary>
  567. /// Desc:编辑用户
  568. /// Default:
  569. /// Nullable:True
  570. /// </summary>
  571. public string F_EDIUSERNO { get; set; }
  572. /// <summary>
  573. /// Desc:编辑用户姓名
  574. /// Default:
  575. /// Nullable:True
  576. /// </summary>
  577. public string F_EDIUSERNAME { get; set; }
  578. /// <summary>
  579. /// Desc:编辑日期
  580. /// Default:
  581. /// Nullable:True
  582. /// </summary>
  583. public DateTime? F_EDITDATETIME { get; set; }
  584. /// <summary>
  585. /// 目标地址列表(逗号分隔)
  586. /// </summary>
  587. public string F_POSIDTO { get; set; }
  588. /// <summary>
  589. /// 生产线下料位置
  590. /// </summary>
  591. public string F_PROLINEUPMATPOS { get; set; }
  592. /// <summary>
  593. /// 是否回库
  594. /// </summary>
  595. public bool F_ISBACK { get; set; }
  596. /// <summary>
  597. /// 是否钢平台拣选位置
  598. /// </summary>
  599. public string F_ITEM1 { get; set; }
  600. public string F_ITEM2 { get; set; }
  601. public string F_ITEM3 { get; set; }
  602. public string F_ITEM4 { get; set; }
  603. public string F_ITEM5 { get; set; }
  604. }
  605. }