ソースを参照

称重锁异常 临时记录

ajun 4 年 前
コミット
e2d53183eb
1 ファイル変更9 行追加1 行削除
  1. 9 1
      app/Services/weight/WeightService.php

+ 9 - 1
app/Services/weight/WeightService.php

@@ -15,6 +15,8 @@ use App\Waybill;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Carbon;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
 
 class WeightService
 {
@@ -77,7 +79,13 @@ class WeightService
 
 
         // 5、更新包裹信息
-        $bool = $this->updateOrderPackage($orderPackage, $params, $measuringMachine);
+        try {
+            $bool = $this->updateOrderPackage($orderPackage, $params, $measuringMachine);
+        } catch (\Exception $e) {
+            $result = DB::select('select * from information_schema.innodb_trx');
+            Log::warning("包裹称重",["message"=>json_encode($result),"param"=>json_encode($result)]);
+            return $this->getWeightMessage($orderPackage, $e->getMessage());
+        }
         // 6、称重时间
         if ($bool) $this->afterApply($orderPackage);
         else {