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.

67 lines
2.3 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
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. use App\Request\v3\EmployeesRequest;
  8. use App\Request\v3\HorsemanOrderRequest;
  9. class HorsemanController extends BaseController
  10. {
  11. /**
  12. * @Inject
  13. * @var HorsemanServiceInterface
  14. */
  15. protected $horsemanService;
  16. /**
  17. * @Inject
  18. * @var OrderOnlineServiceInterface
  19. */
  20. protected $orderOnlineService;
  21. public function getOrderList(EmployeesRequest $request)
  22. {
  23. $employeesId = $this->request->input('employees_id', -1);
  24. $page = $this->request->input('page',0);
  25. $pagesize = $this->request->input('pagesize',0);
  26. $orderMainList = $this->horsemanService->getOrderList($employeesId,$page, $pagesize);
  27. return $this->success($orderMainList);
  28. }
  29. public function getOrderInfo(HorsemanOrderRequest $request)
  30. {
  31. $globalOrderId = $this->request->input('global_order_id', -1);
  32. $orderMain = $this->orderOnlineService->getOrderInfo($globalOrderId);
  33. return $this->success(['order' => $orderMain]);
  34. }
  35. public function setHorsemanCoordinate(EmployeesRequest $request)
  36. {
  37. $employeesId = $this->request->input('employees_id', -1);
  38. $coordinate = $this->request->input('coordinate', -1);
  39. return $this->success($this->horsemanService->setHorsemanCoordinate($employeesId,$coordinate));
  40. }
  41. public function getHorsemanCoordinate(EmployeesRequest $request)
  42. {
  43. $employeesId = $this->request->input('employees_id', -1);
  44. $coordinate = $this->horsemanService->getHorsemanCoordinate($employeesId);
  45. return $this->success(['coordinate' => $coordinate]);
  46. }
  47. public function getOrderCoordinate()
  48. {
  49. $globalOrderId = $this->request->input('global_order_id', -1);
  50. return $this->success($this->horsemanService->getOrderCoordinate($globalOrderId));
  51. }
  52. public function orderComplete(HorsemanOrderRequest $request)
  53. {
  54. $globalOrderId = $this->request->input('global_order_id', -1);
  55. $res = $this->orderOnlineService->completeForHorseman($globalOrderId);
  56. return $this->success($res);
  57. }
  58. }