ajun пре 5 година
родитељ
комит
d4559b4fcc

+ 10 - 0
app/Http/Controllers/TestController.php

@@ -25,6 +25,7 @@ use App\Exceptions\ErrorException;
 use App\Events\CancelOrder;
 use App\Events\SendEmailEvent;
 use App\Exceptions\Exception;
+use App\Http\Controllers\api\thirdPart\hengli\PackageController;
 use App\Http\Requests\ForeignHaiRobotic_taskUpdateRequest;
 use App\Http\Requests\TestAaRequest;
 use App\Imports\OrderTrackingImport;
@@ -1669,4 +1670,13 @@ where (commodities.owner_id,commodity_barcodes.code) in (select commodities.owne
         dump($value);
 
     }
+
+    public function synlogs()
+    {
+        $string = "0_1";
+        $str = str_replace('_',".",$string);
+        dd($string,$str);
+        LogService::syncRedisLogs();
+    }
+
 }

+ 20 - 1
app/Http/Controllers/api/thirdPart/hengli/PackageController.php

@@ -21,6 +21,11 @@ class PackageController extends WeightBaseController
 
     public function new_(Request $request)
     {
+        Log::query()->create([
+            'method' => 'test',
+            'class' => 'test',
+            'description' => json_encode($request->all())
+        ]);
         return $this->new($request);
     }
 
@@ -39,7 +44,8 @@ class PackageController extends WeightBaseController
                     $params['code'] = $value;
                     break;
                 case '2':
-                    $params['weight'] = $value;
+                    $weight = str_replace('_','.',$value);
+                    $params['weight'] =  $weight;
                     break;
                 case '3':
                     $params['weight_at'] = $value;
@@ -48,9 +54,22 @@ class PackageController extends WeightBaseController
                     break;
             }
         }
+        Log::query()->create([
+            'class'=>'test',
+            'method'=>'test',
+            'description'=>json_encode($params),
+        ]);
         return $params;
     }
 
+    public function getWeight($params)
+    {
+        $weight =  parent::getWeight($params); // TODO: Change the autogenerated stub
+        $weight = str_replace('_','.',$weight);
+
+        return $weight;
+    }
+
     // 信息返回
 
     // 返回称重成功信息

+ 2 - 1
tests/webApi/thirdPart/hengli/PackageController.http

@@ -8,6 +8,7 @@
 GET http://bswas/api/thirdPart/hengli/weight/new
 Content-Type: application/json
 
-{"hengli001,75451307461078,12,2021\/03\/31_14:58:35":null}
+{"hengli001,75451542409790,0_12,2021\/04\/01_10:29:17":null}
 ###
 
+