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.

66 lines
2.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Controller\v3;
  3. use App\Controller\BaseController;
  4. use App\Service\v3\Interfaces\HorsemanServiceInterface;
  5. use Hyperf\Di\Annotation\Inject;
  6. use App\Service\v3\Interfaces\OrderOnlineServiceInterface;
  7. class HorsemanController extends BaseController
  8. {
  9. /**
  10. * @Inject
  11. * @var HorsemanServiceInterface
  12. */
  13. protected $horsemanService;
  14. /**
  15. * @Inject
  16. * @var OrderOnlineServiceInterface
  17. */
  18. protected $orderOnlineService;
  19. public function getOrderList()
  20. {
  21. $employeesId = $this->request->input('employees_id', -1);
  22. $page = $this->request->input('page',0);
  23. $pagesize = $this->request->input('pagesize',0);
  24. $orderMainList = $this->horsemanService->getOrderList($employeesId,$page, $pagesize);
  25. return $this->success($orderMainList);
  26. }
  27. public function getOrderInfo()
  28. {
  29. $globalOrderId = $this->request->input('global_order_id', -1);
  30. $orderMain = $this->orderOnlineService->getOrderInfo($globalOrderId);
  31. return $this->success(['order' => $orderMain]);
  32. }
  33. public function setHorsemanCoordinate()
  34. {
  35. $employeesId = $this->request->input('employees_id', -1);
  36. $coordinate = $this->request->input('coordinate', -1);
  37. return $this->success($this->horsemanService->setHorsemanCoordinate($employeesId,$coordinate));
  38. }
  39. public function getHorsemanCoordinate()
  40. {
  41. $employeesId = $this->request->input('employees_id', -1);
  42. $coordinate = $this->horsemanService->getHorsemanCoordinate($employeesId);
  43. return $this->success(['coordinate' => $coordinate]);
  44. }
  45. public function getOrderCoordinate()
  46. {
  47. $globalOrderId = $this->request->input('global_order_id', -1);
  48. return $this->success($this->horsemanService->getOrderCoordinate($globalOrderId));
  49. }
  50. public function orderComplete()
  51. {
  52. $globalOrderId = $this->request->input('global_order_id', -1);
  53. $res = $this->orderOnlineService->completeForHorseman($globalOrderId);
  54. return $this->success($res);
  55. }
  56. }