Forráskód Böngészése

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 5 éve
szülő
commit
c37579a895
1 módosított fájl, 12 hozzáadás és 0 törlés
  1. 12 0
      app/Http/Controllers/WaveController.php

+ 12 - 0
app/Http/Controllers/WaveController.php

@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
 use App\Batch;
 use App\Components\AsyncResponse;
 use App\Order;
+use App\OrderBin;
 use App\Services\WaveService;
 use Exception;
 use Illuminate\Http\Request;
@@ -112,6 +113,17 @@ class WaveController extends Controller
             Order::query()->whereIn("code",$ordernos)->update([
                 "batch_id"=>$wave->id
             ]);
+            Order::query()->with(["batch","bin"])->whereIn("code",$ordernos)->get()->each(function ($order){
+                if (!$order->bin){
+                    $bin = DB::connection("oracle")->selectOne(DB::raw("select seqno from DOC_WAVE_DETAILS where waveno = ? and orderno = ?"),[$order->batch->code,$order->code]);
+                    if ($bin){
+                        OrderBin::query()->create([
+                            'order_id' => $order->id,
+                            'number' => $bin->seqno,
+                        ]);
+                    }
+                }
+            });
         }
         $this->success($error);
     }