| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace App\Http\Controllers;
- use App\Commodity;
- use App\CommodityMaterialBoxModel;
- use App\Components\AsyncResponse;
- use App\Components\ErrorPush;
- use App\ErrorTemp;
- use App\Feature;
- use App\Jobs\CacheShelfTaskJob;
- use App\Jobs\OrderCreateWaybill;
- use App\Jobs\TestJob;
- use App\MaterialBox;
- use App\MaterialBoxModel;
- use App\Order;
- use App\Owner;
- use App\OwnerAreaReport;
- use App\OwnerFeeDetail;
- use App\OwnerFeeOperation;
- use App\OwnerFeeOperationDetail;
- use App\OwnerFeeStorage;
- use App\OwnerPriceOperation;
- use App\OrderPackageCountingRecord;
- use App\RejectedBill;
- use App\Services\ForeignHaiRoboticsService;
- use App\Services\OwnerPriceOperationService;
- use App\Services\StationService;
- use App\Services\StorageService;
- use App\Services\TestService;
- use App\Station;
- use App\StationTask;
- use App\StationTaskMaterialBox;
- use App\Store;
- use App\TaskTransaction;
- use App\Unit;
- use App\Waybill;
- use Carbon\Carbon;
- use Carbon\CarbonPeriod;
- use Illuminate\Database\Eloquent\Collection;
- 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;
- class TestController extends Controller
- {
- use AsyncResponse,ErrorPush;
- const ASNREFERENCE_2 = 'ASNREFERENCE2';
- private $data = [];
- public function __construct()
- {
- $this->data["active_test"] = "active";
- }
- public function method(Request $request, $method)
- {
- return call_user_func([$this, $method], $request);
- }
- public function lightUp()
- {
- app("CacheShelfService")->lightUp('HAIB1-02-02','3','0');
- }
- public function lightOff()
- {
- }
- public function test()
- {
- ini_set('max_execution_time',2500);
- $stores = Store::query()->where("status","已入库")->limit(1)->get();
- foreach ($stores as $store){
- /** @var OwnerPriceOperationService $service */
- $service = app("OwnerPriceOperationService");
- $GLOBALS["FEE_INFO"] = [];
- list($id,$money,$taxFee) = $service->matching($store, Feature::MAPPING["store"], $store->owner_id, "入库");
- $defaultInfo = [
- "worked_at" => $store->updated_at,
- "owner_id" => $store->owner_id,
- "model_id" => $id,
- "source_number"=> null,
- "doc_number" => $store->asn_code,
- "commodity_id" => 0,
- "total_fee" =>0,
- "tax_rate" =>0,
- "fee_description"=>'',
- ];
- foreach ($GLOBALS["FEE_INFO"] as $info){
- $operation = $defaultInfo;
- foreach ($operation as $key=>$val)if (isset($info[$key]))$operation[$key] = $info[$key];
- dump($operation);
- }
- }
- }
- }
|