TestController.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Components\AsyncResponse;
  4. use App\Components\ErrorPush;
  5. use App\ErrorTemp;
  6. use App\Feature;
  7. use App\Jobs\OrderCreateWaybill;
  8. use App\MaterialBox;
  9. use App\MaterialBoxModel;
  10. use App\Order;
  11. use App\Owner;
  12. use App\OwnerFeeDetail;
  13. use App\OwnerPriceOperation;
  14. use App\RejectedBill;
  15. use App\Services\ForeignHaiRoboticsService;
  16. use App\Station;
  17. use App\StationTask;
  18. use App\StationTaskMaterialBox;
  19. use App\TaskTransaction;
  20. use App\Unit;
  21. use App\Waybill;
  22. use Illuminate\Database\Eloquent\Collection;
  23. use Illuminate\Http\Request;
  24. use Illuminate\Support\Facades\Auth;
  25. use Illuminate\Support\Facades\Cache;
  26. use Illuminate\Support\Facades\Cookie;
  27. use Illuminate\Support\Facades\DB;
  28. use Illuminate\Support\Facades\Http;
  29. class TestController extends Controller
  30. {
  31. use AsyncResponse,ErrorPush;
  32. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  33. private $data = [];
  34. public function __construct()
  35. {
  36. $this->data["active_test"] = "active";
  37. }
  38. public function method(Request $request, $method)
  39. {
  40. return call_user_func([$this, $method], $request);
  41. }
  42. public function lightUp()
  43. {
  44. app("CacheShelfService")->lightUp('HAIB1-02-02','3','0');
  45. }
  46. public function lightOff()
  47. {
  48. $params = [
  49. "areaCode" => "1004",
  50. 'locCode' => "HAIB1-02-02",
  51. 'PTLAction' => 0,
  52. ];
  53. $response = Http::post(config('api.haiq.storage.light'), $params);
  54. return json_decode($response->body());
  55. }
  56. private $key = "CACHE_SHELF_AVAILABLE";
  57. public function test()
  58. {
  59. $w = Waybill::query()->first();
  60. $w->loadCount(["waybillAuditLogs"]);
  61. dd($w);
  62. }
  63. }