Browse Source

海柔任务相关表结构修改

LD 5 years ago
parent
commit
f0cc74238d

+ 0 - 1
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -5,7 +5,6 @@ namespace App\Http\Controllers\api\thirdPart\haiq;
 
 
 use App\Services\ForeignHaiRoboticsService;
-use App\Services\LogService;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Http;
 

+ 12 - 1
app/Services/StationService.php

@@ -16,7 +16,7 @@ class StationService
      * @return Station
      * @throws Exception
      */
-    public function getDefaultStation(string $typeName):Station{
+    function getDefaultStation(string $typeName):Station{
         $station= Cache::remember('StationType_default_name_'.$typeName,config('rarelyChange'), function ()use($typeName) {
             $stationType= StationType::query()->where('name',$typeName)->orderBy('id')->get('id')->first();
             if(!$stationType) throw new Exception('指定站类型获取不到');
@@ -25,4 +25,15 @@ class StationService
         if(!$station)throw new Exception('默认站获取不到');
         return $station;
     }
+
+    function broadcast($station_id, $json_data){
+        //...
+        //event(new BroadcastToStation($station_id,$json_data))
+    }
+
+    function broadcastBinMonitor($station_id, ){
+        //...
+        //$this->broadcast($station_id, $json_data)
+    }
+
 }

+ 1 - 1
app/StationTask.php

@@ -6,5 +6,5 @@ use Illuminate\Database\Eloquent\Model;
 
 class StationTask extends Model
 {
-    //
+    protected $fillable = ['station_id', 'station_type_id'];
 }

+ 1 - 1
database/migrations/2020_11_30_174327_create_station_task_commodities_table.php

@@ -20,7 +20,7 @@ class CreateStationTaskCommoditiesTable extends Migration
             $table->integer('commodity_id')->index();
             $table->integer('amount')->default(0);
             $table->integer('order_id')->index();
-            $table->enum('status',['待处理','挂起','处理中','完成','异常','取消'])->index();  //联合索引
+            $table->enum('status',['待处理','挂起','处理中','完成','异常','取消'])->index();  //联合索引
             $table->index(['station_id','material_box_id','status'],'station_task_commodities_s_m_s_index');
             $table->timestamps();
         });

+ 3 - 2
database/migrations/2020_12_04_175932_create_station_tasks_table.php

@@ -16,8 +16,9 @@ class CreateStationTasksTable extends Migration
         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->integer('station_type_id')->nullable()->index();
+            $table->enum('status',['待处理','挂起','处理中','完成','异常','取消'])->index();
+            $table->index('station_id','station_type_id','status');
             $table->timestamps();
         });
     }

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

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddColumnHandledAmountOfStationTaskCommodities extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('station_task_commodities', function (Blueprint $table) {
+            $table->integer('handled_amount')->default(0);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('station_task_commodities', function (Blueprint $table) {
+            $table->dropColumn('handled_amount');
+        });
+    }
+}

+ 1 - 1
resources/views/station/monitor/show.blade.php

@@ -15,7 +15,7 @@
         <div class="card">
             <div class="card-body">
                 <div class="row border" style="opacity: 0.75">
-                    <div class="col-4 text-center  h3 py-2 font-weight-bold">宝时云仓</div>
+                    <div class="col-4 text-center h3 py-2 font-weight-bold text-info">宝时云仓</div>
                     <div class="col text-center  h3 py-2 text-muted">智能分拣</div>
                 </div>
                 <div class="row pt-3">