소스 검색

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

LD 4 년 전
부모
커밋
bbe935d43c
2개의 변경된 파일44개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      app/Imports/StoreCheckingReceiveImport.php
  2. 41 0
      database/migrations/2021_06_03_094123_create_task_transactions_table.php

+ 3 - 1
app/Imports/StoreCheckingReceiveImport.php

@@ -5,6 +5,8 @@ namespace App\Imports;
 use App\Http\Controllers\CommodityController;
 use App\Services\CommodityBarcodeService;
 use App\Services\CommodityService;
+use App\StoreCheckingReceiveItem;
+use App\StoreItem;
 use Carbon\Carbon;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
@@ -258,7 +260,7 @@ class StoreCheckingReceiveImport implements ToCollection,WithHeadingRow
         foreach ($items as &$it){
             $it["store_checking_receive_id"] = $storeCheckingReceive->id;
         }
-        app('StoreCheckingReceiveItemService')->insert($items);
+        StoreCheckingReceiveItem::query()->insert($items);
         app('LogService')->log(__METHOD__,"导入盘收任务-批量录入盘收记录",json_encode($items,JSON_UNESCAPED_UNICODE));
 
         Cache::put("storeCheckingReceive",["success"=>true,"data"=>$storeCheckingReceive,"errors"=>$errors],86400);

+ 41 - 0
database/migrations/2021_06_03_094123_create_task_transactions_table.php

@@ -0,0 +1,41 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateTaskTransactionsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('task_transactions', function (Blueprint $table) {
+            $table->id();
+            $table->string("source_table")->nullable()->comment("来源表");
+            $table->bigInteger("rel_id")->nullable()->index()->comment("关联ID");
+            $table->string("fm_box")->nullable()->comment("来源箱");
+            $table->string("to_box")->nullable()->comment("目标箱");
+            $table->bigInteger("task_id")->nullable()->index()->comment("任务ID");
+            $table->bigInteger("commodity_id")->nullable()->comment("商品ID");
+            $table->enum("type",["出库","入库","移库"])->comment("操作类型");
+            $table->integer("amount")->default(0)->comment("数量");
+            $table->tinyInteger("status")->default(0)->comment("事务状态");
+            $table->bigInteger("user_id")->nullable()->comment("操作人");
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('task_transactions');
+    }
+}