终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

70 lines
1.8 KiB

  1. using BPASmartClient.AGV.Feedback;
  2. using Microsoft.AspNetCore.Mvc;
  3. using Microsoft.AspNetCore.SignalR;
  4. using Newtonsoft.Json;
  5. namespace BPASmartClient.AgvApi.Controllers
  6. {
  7. [ApiController]
  8. [Route("apicallback/quicktron/[Controller]")]
  9. public class robotjobController : ControllerBase
  10. {
  11. /// <summary>
  12. /// 搬运任务状态上报
  13. /// </summary>
  14. /// <param name="sign"></param>
  15. /// <returns></returns>
  16. [HttpPost("report")]
  17. public string report(string sign)
  18. {
  19. if (sign != null)
  20. {
  21. try
  22. {
  23. var res = JsonConvert.DeserializeObject<AGVToUpSystem>(sign);
  24. if (res != null)
  25. {
  26. Factory.GetInstance.SendReport(res);
  27. return "SUCCESS";
  28. }
  29. }
  30. catch (Exception ex)
  31. {
  32. return ex.ToString();
  33. }
  34. }
  35. return "Error";
  36. }
  37. /// <summary>
  38. /// AGV上下料交互请求接口
  39. /// </summary>
  40. /// <param name="sign"></param>
  41. /// <returns></returns>
  42. [HttpPost("upstreamrequest")]
  43. public string upstreamrequest(string sign)
  44. {
  45. if (sign != null)
  46. {
  47. try
  48. {
  49. var res = JsonConvert.DeserializeObject<Upstreamrequest>(sign);
  50. if (res != null)
  51. {
  52. Factory.GetInstance.SendUpstreamrequest(sign);
  53. return "SUCCESS";
  54. }
  55. }
  56. catch (Exception ex)
  57. {
  58. return ex.ToString();
  59. }
  60. }
  61. return "Error";
  62. }
  63. }
  64. }