WmsApi.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using ServiceCenter.WebApi;
  2. using WCS.WorkEngineering.WebApi.Models.WMS.Request;
  3. using WCS.WorkEngineering.WebApi.Models.WMS.Response;
  4. using WCS.WorkEngineering.Worlds.Logs;
  5. namespace WCS.WorkEngineering.WebApi.Controllers
  6. {
  7. /// <summary>
  8. /// AGV相关接口控制器
  9. /// </summary>
  10. public static class WmsApi
  11. {
  12. private static string Url = "http://192.168.249.150:8026";
  13. private static string wareHouseId = "opphouse";
  14. /// <summary>
  15. /// 分配货位
  16. /// </summary>
  17. /// <param name="wcsTaskNum">WMS任务ID</param>
  18. /// <param name="tunnel">巷道</param>
  19. /// <param name="device">设备号</param>
  20. /// <returns></returns>
  21. /// <exception cref="Exception"></exception>
  22. public static I_WCS_GetWareCellResponse GetLocalIn(int wcsTaskNum, string tunnel, string device)
  23. {
  24. var res = APICaller.CallApi2<I_WCS_GetWareCellResponse>(Url + "/api/Task/I_WCS_GetWareCell", new I_WCS_GetWareCellRequest
  25. {
  26. PickUpEquipmentNo = device,
  27. TunnelNum = tunnel.Last().ToString(),
  28. WCSTaskNum = wcsTaskNum.ToString(),
  29. });
  30. if (!res.ResType)
  31. {
  32. throw new KnownException(res.ResMessage, LogLevelEnum.High);
  33. }
  34. return res;
  35. }
  36. }
  37. }