TestController.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Authority;
  4. use App\Commodity;
  5. use App\CommodityMaterialBoxModel;
  6. use App\Components\AsyncResponse;
  7. use App\Components\ErrorPush;
  8. use App\ErrorTemp;
  9. use App\Feature;
  10. use App\Http\ApiControllers\LoginController;
  11. use App\Http\Requests\OrderDelivering;
  12. use App\Jobs\CacheShelfTaskJob;
  13. use App\Jobs\OrderCreateInstantBill;
  14. use App\Jobs\OrderCreateWaybill;
  15. use App\Jobs\SettlementBillReportTask;
  16. use App\Jobs\StoreCreateInstantBill;
  17. use App\Jobs\WeightUpdateInstantBill;
  18. use App\MaterialBox;
  19. use App\MaterialBoxModel;
  20. use App\Order;
  21. use App\OrderPackage;
  22. use App\Owner;
  23. use App\OwnerFeeDetail;
  24. use App\OwnerFeeDetailLogistic;
  25. use App\OwnerFeeExpress;
  26. use App\OwnerFeeLogistic;
  27. use App\OwnerFeeOperation;
  28. use App\OwnerFeeOperationDetail;
  29. use App\OwnerFeeStorage;
  30. use App\OwnerPriceOperation;
  31. use App\OrderPackageCountingRecord;
  32. use App\RejectedBill;
  33. use App\Services\CacheShelfService;
  34. use App\Services\ForeignHaiRoboticsService;
  35. use App\Services\OrderService;
  36. use App\Services\OwnerFeeTotalService;
  37. use App\Services\OwnerLogisticFeeReportService;
  38. use App\Services\OwnerPriceOperationService;
  39. use App\Services\OwnerStoreFeeReportService;
  40. use App\Services\OwnerStoreOutFeeReportService;
  41. use App\Services\StationService;
  42. use App\Services\StorageService;
  43. use App\Station;
  44. use App\StationTask;
  45. use App\StationTaskMaterialBox;
  46. use App\Store;
  47. use App\TaskTransaction;
  48. use App\Unit;
  49. use App\User;
  50. use App\UserDetail;
  51. use App\UserDutyCheck;
  52. use App\ValueStore;
  53. use App\Waybill;
  54. use Carbon\Carbon;
  55. use Carbon\CarbonPeriod;
  56. use Firebase\JWT\JWT;
  57. use Illuminate\Database\Eloquent\Collection;
  58. use Illuminate\Foundation\Http\FormRequest;
  59. use Illuminate\Http\Request;
  60. use Illuminate\Support\Facades\Cache;
  61. use Illuminate\Support\Facades\Auth;
  62. use Illuminate\Support\Facades\Cookie;
  63. use Illuminate\Support\Facades\DB;
  64. use Illuminate\Support\Facades\Http;
  65. use Illuminate\Support\Facades\URL;
  66. use PhpOffice\PhpSpreadsheet\Calculation\Web\Service;
  67. class TestController extends Controller
  68. {
  69. use AsyncResponse,ErrorPush;
  70. const ASNREFERENCE_2 = 'ASNREFERENCE2';
  71. public function __construct()
  72. {
  73. $this->data["active_test"] = "active";
  74. }
  75. public function method(Request $request, $method)
  76. {
  77. return call_user_func([$this, $method], $request);
  78. }
  79. public function test4()
  80. {
  81. dd(Waybill::query()->where("waybill_number","BSZX2108243260")->first()->toArray());
  82. $payload = [
  83. 'data' => ['field1' => 1, 'field2' => 'string data'],
  84. "iss" => "http://example.org",
  85. "aud" => "http://example.com",
  86. "iat" => time(),
  87. "eat" => time()+7200,
  88. ];
  89. $token = JWT::encode($payload, $a, 'RS256');
  90. echo "Token:\n" . print_r($token, true) . "\n";
  91. $decoded = JWT::decode($token, $b, ['RS256']);
  92. $decoded_array = (array) $decoded;
  93. echo "Decoded:\n" . print_r($decoded_array, true) . "\n";
  94. }
  95. public function OwnerStoreFeeReportService_recordReport()
  96. {
  97. /** @var OwnerStoreFeeReportService $service */
  98. $service = app('OwnerStoreFeeReportService');
  99. $service->recordReport('2021-08-01');
  100. }
  101. public function OwnerStoreOutFeeReportService_recordReport()
  102. {
  103. /** @var OwnerStoreOutFeeReportService $service */
  104. $service = app('OwnerStoreOutFeeReportService');
  105. $service->recordReport('2021-08-01');
  106. }
  107. public function OwnerFeeTotalService_record()
  108. {
  109. /** @var OwnerFeeTotalService $service */
  110. $service = app('OwnerFeeTotalService');
  111. $service->record('2021-08-01');
  112. }
  113. //快递
  114. public function OwnerLogisticFeeReportService_record()
  115. {
  116. ini_set('max_execution_time',-1);
  117. /** @var OwnerLogisticFeeReportService $service */
  118. $service = app('OwnerLogisticFeeReportService');
  119. $service->recordReport('2021-08-01');
  120. }
  121. public function order_packages_sync_routes_flag_init()
  122. {
  123. OrderPackage::query()->whereNotNull('transfer_status')->update(['sync_routes_flag'=>true]);
  124. }
  125. public function SettlementBillReportTask()
  126. {
  127. SettlementBillReportTask::dispatchNow('2021-08-01');
  128. }
  129. }