Parcourir la source

运单接口BUG

LD il y a 6 ans
Parent
commit
1ac1c145b9

+ 11 - 10
app/Http/Controllers/api/thirdPart/flux/WaybillController.php

@@ -20,10 +20,11 @@ class WaybillController extends Controller
 
     public function new_(Request $request)
     {
+        (new Controller())->log(__METHOD__,__FUNCTION__,'WMS requesting:.'.'|'.json_encode($request->all()));
         $errors=$this->validatorForNew($request->all())->errors();
         if(count($errors)>0){
             $this->log(__METHOD__, 'error_' . __FUNCTION__, json_encode($request->getContent()));
-            (new Controller())->log(__METHOD__,'error_'.__FUNCTION__,'fields wrong, see Errors report please.'.'|'.json_encode($request).'|'.json_encode($errors));
+            (new Controller())->log(__METHOD__,'error_'.__FUNCTION__,'fields wrong, see Errors report please.'.'|'.json_encode($request->all()).'|'.json_encode($errors));
             return response()->json(['response'=>['return'=>['returnFlag'=>'0','returnCode'=>'0001','returnDesc'=>'消息处理失败:Failure','resultInfo'=>'',
                 'errors'=>$errors]]])
                 ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
@@ -45,20 +46,20 @@ class WaybillController extends Controller
                         ->setEncodingOptions(JSON_UNESCAPED_UNICODE);
                 }
             }
-            $owner=Owner::where('code',$receiveInputting->CustomerID)->first();
-            if (!$owner){$owner=new Owner(['name'=>$receiveInputting->CustomerID,'code'=>$receiveInputting->CustomerID]);$owner->save();}
-            $city=City::where('name',$receiveInputting->C_City)->first();
+            $owner=Owner::where('code',$receiveInputting['CustomerID'])->first();
+            if (!$owner){$owner=new Owner(['name'=>$receiveInputting['CustomerID'],'code'=>$receiveInputting['CustomerID']]);$owner->save();}
+            $city=City::where('name',$receiveInputting['C_City'])->first();
             $zfCar=config('bszf.ZFList');
             $waybill=new Waybill([
-                'type'=>isset($zfCar[$receiveInputting->CarrierID])&&$zfCar[$receiveInputting->CarrierID]?"直发车":"专线",
+                'type'=>isset($zfCar[$receiveInputting['CarrierID']])&&$zfCar[$receiveInputting['CarrierID']]?"直发车":"专线",
                 'waybill_number'=>Uuid::uuid1(),
                 'owner_id'=>$owner->id,
-                'wms_bill_number'=>$receiveInputting->OrderNo,
+                'wms_bill_number'=>$receiveInputting['OrderNo'],
                 'origination'=>"上海市松江区泗砖路351号宝时松江仓",
-                'destination'=>$receiveInputting->C_Address1,
-                'recipient'=>$receiveInputting->ConsigneeName,
-                'recipient_mobile'=>$receiveInputting->C_Tel,
-                'destination_city_id'=>$city->id,
+                'destination'=>$receiveInputting['C_Address1'],
+                'recipient'=>$receiveInputting['ConsigneeName'],
+                'recipient_mobile'=>$receiveInputting['C_Tel'],
+                'destination_city_id'=>$city['id'],
             ]);
             $waybill->save();
             if ($waybill->type=='直发车'){

+ 0 - 4
app/Tutorial.php

@@ -19,10 +19,6 @@ class Tutorial extends Model
         'owner_name'
     ];
 
-    protected function serializeDate(\DateTimeInterface $date)
-    {
-        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
-    }
 
     public function owner(){
         return $this->belongsTo('App\Owner','owner_id','id');

+ 0 - 1
resources/views/process/create.blade.php

@@ -159,7 +159,6 @@
             },
             mounted:function(){
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
-                alert(new Date('2017-05-04T18:30:00.000Z').to)
             },
             methods:{
                 //新增库单据