|
|
@@ -67,32 +67,7 @@ class TestController extends Controller
|
|
|
}
|
|
|
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;
|
|
|
+ $this->success(json_encode($request->input()));
|
|
|
}
|
|
|
|
|
|
}
|