| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <?php
- namespace App\Http\Controllers;
- use App\Batch;
- use App\CommodityBarcode;
- use App\Components\AsyncResponse;
- use App\Components\Database;
- use App\Components\ErrorPush;
- use App\Exceptions\Exception;
- use App\Jobs\SyncOrderRejectingStatusJob;
- use App\OracleDOCWaveDetails;
- use App\Order;
- use App\OrderBin;
- use App\OrderCommodity;
- use App\OrderIssue;
- use App\Rejected;
- use App\RejectedBill;
- use App\RejectedBillItem;
- use App\Services\LogService;
- use App\Services\OracleDocAsnHerderService;
- use App\Services\OracleDOCOrderHeaderService;
- use App\Services\OrderCommodityService;
- use App\Services\OrderRejectedBillRelationService;
- use App\Services\OrderService;
- use App\Services\OwnerService;
- use App\Services\RejectedBillService;
- use App\Services\StoreItemService;
- use App\Services\StoreService;
- use App\Services\WaveService;
- use App\Services\WaybillService;
- use App\SortingStation;
- use App\Store;
- use App\User;
- use App\UserToken;
- use App\ValueStore;
- use App\Warehouse;
- use App\Waybill;
- use Carbon\Carbon;
- use Illuminate\Database\Eloquent\Collection;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Auth;
- use Illuminate\Support\Facades\DB;
- use Illuminate\Support\Facades\Hash;
- use Illuminate\Support\Facades\Http;
- use Illuminate\Support\Str;
- use Zttp\Zttp;
- class TestController extends Controller
- {
- use AsyncResponse, ErrorPush, Database;
- const ASNREFERENCE_2 = 'ASNREFERENCE2';
- public function __construct()
- {
- $this->data["active_test"] = "active";
- }
- public function method(Request $request, $method)
- {
- try {
- return call_user_func([$this, $method], $request);
- }catch (\BadMethodCallException $e){
- dd("方法不存在");
- }
- }
- public function test(Request $request)
- {
- $waybill = Waybill::query()->where("waybill_number","BSZX2209079840")->first();
- $json="
- {
- \"request\": [
- {
- \"OrderNo\": \"{$waybill['wms_bill_number']}\",
- \"DELIVERYNO\": \"{$waybill['waybill_number']}\"
- }
- ]
- }
- ";
- $sendingJson = json_decode($json,true);
- $url=url(config('api.flux.waybill.new'));
- try{
- $response = Zttp::post($url, $sendingJson);
- }catch (\Exception $exception){
- dd('CURL请求异常:'.$exception->getMessage());
- return false;
- }
- $responseJson = $response->json();
- if(!$responseJson||!isset($responseJson['Response'])||!$responseJson['Response']['return']['returnFlag']=='1'){
- dd("向WMS提交运单失败!!SO单号:{$waybill['wms_bill_number']}。提交:{$json},返回:{$response->body()}, URL:{$url}");
- return false;
- }
- Controller::logS(__METHOD__,''.__FUNCTION__,"向WMS提交运单成功,SO单号:{$waybill['wms_bill_number']}。返回:{$response->body()}",0);
- return true;
- }
- }
|