| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <?php
- namespace App\Http\Controllers;
- use App\Authority;
- use App\Commodity;
- use App\CommodityMaterialBoxModel;
- use App\Components\AsyncResponse;
- use App\Components\ErrorPush;
- use App\ErrorTemp;
- use App\Feature;
- use App\Http\ApiControllers\LoginController;
- use App\Http\Requests\OrderDelivering;
- use App\Jobs\CacheShelfTaskJob;
- use App\Jobs\OrderCreateInstantBill;
- use App\Jobs\OrderCreateWaybill;
- use App\Jobs\SettlementBillReportTask;
- use App\Jobs\StoreCreateInstantBill;
- use App\Jobs\WeightUpdateInstantBill;
- use App\MaterialBox;
- use App\MaterialBoxModel;
- use App\Order;
- use App\OrderPackage;
- use App\Owner;
- use App\OwnerFeeDetail;
- use App\OwnerFeeDetailLogistic;
- use App\OwnerFeeExpress;
- use App\OwnerFeeLogistic;
- use App\OwnerFeeOperation;
- use App\OwnerFeeOperationDetail;
- use App\OwnerFeeStorage;
- use App\OwnerPriceOperation;
- use App\OrderPackageCountingRecord;
- use App\RejectedBill;
- use App\Services\CacheShelfService;
- use App\Services\ForeignHaiRoboticsService;
- use App\Services\HandInStorageService;
- use App\Services\OrderService;
- use App\Services\OwnerFeeTotalService;
- use App\Services\OwnerLogisticFeeReportService;
- use App\Services\OwnerPriceOperationService;
- use App\Services\OwnerStoreFeeReportService;
- use App\Services\OwnerStoreOutFeeReportService;
- use App\Services\StationService;
- use App\Services\StorageService;
- use App\Station;
- use App\StationTask;
- use App\StationTaskMaterialBox;
- use App\Store;
- use App\TaskTransaction;
- use App\Unit;
- use App\User;
- use App\UserDetail;
- use App\UserDutyCheck;
- use App\ValueStore;
- use App\Waybill;
- use Carbon\Carbon;
- use Carbon\CarbonPeriod;
- use Firebase\JWT\JWT;
- use Illuminate\Database\Eloquent\Collection;
- use Illuminate\Foundation\Http\FormRequest;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Cache;
- use Illuminate\Support\Facades\Auth;
- use Illuminate\Support\Facades\Cookie;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Http;
- use Illuminate\Support\Facades\URL;
- use PhpOffice\PhpSpreadsheet\Calculation\Web\Service;
- class TestController extends Controller
- {
- use AsyncResponse,ErrorPush;
- const ASNREFERENCE_2 = 'ASNREFERENCE2';
- public function __construct()
- {
- $this->data["active_test"] = "active";
- }
- public function method(Request $request, $method)
- {
- return call_user_func([$this, $method], $request);
- }
- public function test4()
- {
- $user = User::query()->first();
- $b = file_get_contents(base_path().'/public.pem');
- $decoded = JWT::decode("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJkYXRhIjp7ImZpZWxkMSI6MSwiZmllbGQyIjoic3RyaW5nIGRhdGEifSwiaXNzIjoiaHR0cDpcL1wvZXhhbXBsZS5vcmciLCJhdWQiOiJodHRwOlwvXC9leGFtcGxlLmNvbSIsImlhdCI6MTYyOTc3NDUxMywiZWF0IjoxNjI5NzgxNzEzfQ.Twl3_KPMLP4Pi4zaGZig8SKhE9M6nZlCI8bVifWjuYIWuqZtlujp35Zvv1oY0GnPIkUmq-PGJZLU96mmT-RTRDL-83sPF2l7PPTeriYMoiKP1r2rsI421BtrgLs0qP7QCPxH5BmHWXAVbwTtnwv8JagKzcZxkZJRH3Lj8blRapumnCk-tMfHz4xiXHIATfMS1I23vhJJLomC-KW4Ou3pjTu6X3HiiUGe9ZBGTu5mHfiKm25dxXO5Fm3JMg2-anLf_Gy6D6D7IQJ5pM5HFEN-HdD7FibeEMraMxbk5B_82L15OjhaoCV7b7ioXNSs2QAdlRfuRgx0XIE_toFwb_152a", $b, ['RS256']);
- $payload = [
- 'data' => ['field1' => 1, 'field2' => 'string data'],
- "iss" => "http://example.org",
- "aud" => "http://example.com",
- "iat" => time(),
- "eat" => time()+7200,
- ];
- try {
- $token = JWT::encode($payload, $a, 'RS256');
- }catch (\Exception $e){
- $this->error("HTTP:409,资源异常,无法反馈");
- }
- try {
- $a = file_get_contents("test");
- }catch (\Exception $e){
- if (strpos($e->getMessage(),"No such file or directory")!==false)$this->error("HTTP:410,服务器异常,资源丢失");
- else $this->error("HTTP:403,访问某些资源失败");
- }
- $payload = [
- 'data' => ['field1' => 1, 'field2' => 'string data'],
- "iss" => "http://example.org",
- "aud" => "http://example.com",
- "iat" => time(),
- "eat" => time()+7200,
- ];
- $token = JWT::encode($payload, $a, 'RS256');
- echo "Token:\n" . print_r($token, true) . "\n";
- $decoded = JWT::decode($token, $b, ['RS256']);
- $decoded_array = (array) $decoded;
- echo "Decoded:\n" . print_r($decoded_array, true) . "\n";
- }
- public function OwnerStoreFeeReportService_recordReport()
- {
- /** @var OwnerStoreFeeReportService $service */
- $service = app('OwnerStoreFeeReportService');
- $service->recordReport('2021-08-01');
- }
- public function OwnerStoreOutFeeReportService_recordReport()
- {
- /** @var OwnerStoreOutFeeReportService $service */
- $service = app('OwnerStoreOutFeeReportService');
- $service->recordReport('2021-08-01');
- }
- public function OwnerFeeTotalService_record()
- {
- /** @var OwnerFeeTotalService $service */
- $service = app('OwnerFeeTotalService');
- $service->record('2021-08-01');
- }
- //快递
- public function OwnerLogisticFeeReportService_record()
- {
- ini_set('max_execution_time',-1);
- /** @var OwnerLogisticFeeReportService $service */
- $service = app('OwnerLogisticFeeReportService');
- $service->recordReport('2021-08-01');
- }
- public function order_packages_sync_routes_flag_init()
- {
- OrderPackage::query()->whereNotNull('transfer_status')->update(['sync_routes_flag'=>true]);
- }
- public function SettlementBillReportTask()
- {
- SettlementBillReportTask::dispatchNow('2021-08-01');
- }
- }
|