WCS_TASK.cs 20 KB

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