LD 5 лет назад
Родитель
Сommit
d5209fef35

+ 1 - 1
app/Console/Commands/SyncBatchTask.php

@@ -138,7 +138,7 @@ class SyncBatchTask extends Command
                 }
             }
         }
-        $this->batchService->assignTasks($batches);
+//        $this->batchService->assignTasks($batches);
 
 
         ValueStore::query()->where("name","wave_last_sync_date")->update(["value"=>Carbon::now()->subSeconds(1)->toDateTimeString()]);

+ 85 - 0
app/Http/Controllers/StationTaskController.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\StationTask;
+use Illuminate\Http\Request;
+
+class StationTaskController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * Show the form for creating a new resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return \Illuminate\Http\Response
+     */
+    public function store(Request $request)
+    {
+        //
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  \App\StationTask  $stationTask
+     * @return \Illuminate\Http\Response
+     */
+    public function show(StationTask $stationTask)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\StationTask  $stationTask
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(StationTask $stationTask)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\StationTask  $stationTask
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, StationTask $stationTask)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\StationTask  $stationTask
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(StationTask $stationTask)
+    {
+        //
+    }
+}

+ 85 - 0
app/Http/Controllers/StationTaskTypeController.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\StationTaskType;
+use Illuminate\Http\Request;
+
+class StationTaskTypeController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * Show the form for creating a new resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return \Illuminate\Http\Response
+     */
+    public function store(Request $request)
+    {
+        //
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  \App\StationTaskType  $stationTaskType
+     * @return \Illuminate\Http\Response
+     */
+    public function show(StationTaskType $stationTaskType)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\StationTaskType  $stationTaskType
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(StationTaskType $stationTaskType)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\StationTaskType  $stationTaskType
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, StationTaskType $stationTaskType)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\StationTaskType  $stationTaskType
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(StationTaskType $stationTaskType)
+    {
+        //
+    }
+}

+ 2 - 0
app/Providers/AppServiceProvider.php

@@ -4,6 +4,7 @@ namespace App\Providers;
 
 use App\Http\Controllers\Controller;
 use App\Services\AuthorityService;
+use App\Services\BatchService;
 use App\Services\CacheService;
 use App\Services\CommodityService;
 use App\Services\common\BatchUpdateService;
@@ -125,6 +126,7 @@ class AppServiceProvider extends ServiceProvider
     }
 
     private function loadingService(){
+        app()->singleton('BatchService',BatchService::class);
         app()->singleton('CacheService',CacheService::class);
         app()->singleton('UserService',UserService::class);
         app()->singleton('AuthorityService',AuthorityService::class);

+ 10 - 0
app/StationTask.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class StationTask extends Model
+{
+    //
+}

+ 10 - 0
app/StationTaskType.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class StationTaskType extends Model
+{
+    //
+}

+ 12 - 0
database/factories/StationTaskFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\StationTask;
+use Faker\Generator as Faker;
+
+$factory->define(StationTask::class, function (Faker $faker) {
+    return [
+        //
+    ];
+});

+ 12 - 0
database/factories/StationTaskTypeFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\StationTaskType;
+use Faker\Generator as Faker;
+
+$factory->define(StationTaskType::class, function (Faker $faker) {
+    return [
+        //
+    ];
+});

+ 32 - 0
database/migrations/2020_12_04_160314_create_station_task_types_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateStationTaskTypesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('station_task_types', function (Blueprint $table) {
+            $table->id();
+            $table->string('name')->index();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('station_task_types');
+    }
+}

+ 34 - 0
database/migrations/2020_12_04_175932_create_station_tasks_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateStationTasksTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('station_tasks', function (Blueprint $table) {
+            $table->id();
+            $table->integer('station_id');
+            $table->integer('station_type_id');
+            $table->index('station_id','station_type_id');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('station_tasks');
+    }
+}

+ 16 - 0
database/seeds/StationTaskSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class StationTaskSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}

+ 16 - 0
database/seeds/StationTaskTypeSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class StationTaskTypeSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}