|
|
@@ -6,6 +6,9 @@ use App\Station;
|
|
|
use App\StationTypeBinMonitor;
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
use Illuminate\Http\Request;
|
|
|
+use Illuminate\Contracts\Foundation\Application;
|
|
|
+use Illuminate\Contracts\View\Factory;
|
|
|
+use Illuminate\View\View;
|
|
|
|
|
|
class StationController extends Controller
|
|
|
{
|
|
|
@@ -27,6 +30,19 @@ class StationController extends Controller
|
|
|
return view('station.monitor.index',compact('stations'));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 缓存货架
|
|
|
+ * @return Application|Factory|View
|
|
|
+ */
|
|
|
+ public function cachingShelfIndex()
|
|
|
+ {
|
|
|
+ $stations = Station::query()->with('stationType:name','parent:name')->whereHas('stationType',function($query){
|
|
|
+ /** @var Builder $query */
|
|
|
+ $query->where('name','缓存架');
|
|
|
+ })->paginate(100);
|
|
|
+ return view('station.cachingShelf.list.index',compact('stations'));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Show the form for creating a new resource.
|
|
|
*
|
|
|
@@ -107,4 +123,24 @@ class StationController extends Controller
|
|
|
{
|
|
|
//
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param Request $request
|
|
|
+ * @param $id
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function cachingShelfApi(Request $request,$id): array
|
|
|
+ {
|
|
|
+ $station = Station::query()->where('id',$id)->with([
|
|
|
+ 'stationTypeBinMonitor',
|
|
|
+ 'currentStationTask'=>function($query){
|
|
|
+ /** @var Builder $query */
|
|
|
+ $query->with(['stationTaskCommodities'=>function($query){
|
|
|
+ /** @var Builder $query */
|
|
|
+ $query->with(['commodity.barcodes','materialBox','batch','materialBox']);
|
|
|
+ }]);
|
|
|
+ }
|
|
|
+ ])->first();
|
|
|
+ return ['success' => true,'data' => $station];
|
|
|
+ }
|
|
|
}
|