WMS.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using NPOI.SS.Formula.Functions;
  2. using ServiceCenter.WebApi;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace WCS.WorkEngineering
  9. {
  10. public class WMS
  11. {
  12. static string Url = "http://10.30.44.3:8011/";
  13. public static Response<TaskAndFloor> 帘线扫码(string dev, string barcode)
  14. {
  15. var res = APICaller.CallApi2<Response<TaskAndFloor>>(Url + "api/Sx/ApplyFloor", new { EquNo = dev, Code = barcode });
  16. if (!res.Success)
  17. {
  18. //throw new Exception(res.ResMsg);
  19. }
  20. return res;
  21. }
  22. public static Response<string> 分配巷道(string floor, string barcode)
  23. {
  24. var res = APICaller.CallApi2<Response<string>>(Url + "api/Sx/GetTunnelPriorityList", new { Floor = floor, Code = barcode });
  25. if (!res.Success)
  26. {
  27. throw new Exception(res.ResMsg);
  28. }
  29. return res;
  30. }
  31. public static Response<List<LocationInfo>> 入库分配(int[] tasks,int tunnel,int floor)
  32. {
  33. var res = APICaller.CallApi2<Response<List<LocationInfo>>>(Url + "api/Sx/ApplyStockInLoc", new { TaskNum = tasks, TunnelNum = tunnel,Floor=floor });
  34. if (!res.Success)
  35. {
  36. throw new Exception(res.ResMsg);
  37. }
  38. return res;
  39. }
  40. public static Response 堆垛机完成(int task)
  41. {
  42. var res = APICaller.CallApi2<Response>(Url + "api/Sx/SrmCompleted", new { TaskNum = task, OperationType = 1, WCSUpdateName = "WCS" });
  43. if (!res.Success)
  44. {
  45. throw new Exception(res.ResMsg);
  46. }
  47. return res;
  48. }
  49. public static Response 补料(int task,string devCode)
  50. {
  51. var res = APICaller.CallApi2<Response>(Url + "api/Sx/PalletizingPatchWheel", new { TaskNum = task, Equip=devCode });
  52. if (!res.Success)
  53. {
  54. throw new Exception(res.ResMsg);
  55. }
  56. return res;
  57. }
  58. public static Response 抓取完成(int[] tasks, string devCode)
  59. {
  60. var res = APICaller.CallApi2<Response>(Url + "api/Sx/Palletizinginfobinde", new { TaskNum = tasks, Equip = devCode });
  61. if (!res.Success)
  62. {
  63. throw new Exception(res.ResMsg);
  64. }
  65. return res;
  66. }
  67. public static Response 码垛完成(string devCode)
  68. {
  69. var res = APICaller.CallApi2<Response>(Url + "api/Sx/CompletePalletizingTask", new { Equip = devCode });
  70. if (!res.Success)
  71. {
  72. //throw new Exception(res.ResMsg);
  73. }
  74. return res;
  75. }
  76. public static Response<int> 检测回库分配楼层(int qty)
  77. {
  78. var res = APICaller.CallApi2<Response<int>>(Url + "api/Sx/TorsChkFloor", new { Count = qty });
  79. if (!res.Success)
  80. {
  81. throw new Exception(res.ResMsg);
  82. }
  83. return res;
  84. }
  85. }
  86. }