协程版仓库后端项目
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-08 14:59:47 +08:00
commit 0b2299c427
134 changed files with 19277 additions and 0 deletions

View File

@ -0,0 +1,47 @@
<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('column_config', function (Blueprint $table) {
$table->unsignedInteger('id', true);
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('method', 50)->default('')->comment('场景');
$table->string('prop', 50)->default('')->comment('字段');
$table->string('label', 50)->default('')->comment('名称');
$table->boolean('sortable')->default(true)->comment('是否开启排序');
$table->integer('sort')->default(0)->comment('排序值');
$table->integer('width')->default(0)->comment('宽度');
$table->boolean('hide')->default(true)->comment('是否显示');
$table->boolean('fix')->default(true)->comment('是否固定');
$table->boolean('filter')->default(true)->comment('是否筛选');
$table->boolean('is_search')->default(true)->comment('是否搜索');
$table->string('search_type', 50)->default('')->comment('搜索类型');
$table->string('condition', 50)->default('')->comment('搜索条件');
MigrateService::migrateCreateInfo($table);
$table->comment('列配置');
$table->index(['company_id', 'deleted_at'], 'company_id_deleted_at_index');
$table->index(['creator_id', 'method'], 'creator_id_method_index');
$table->unique(['prop', 'method', 'creator_id'], 'prop_method_creator_id_index');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('column_config');
}
};

View File

@ -0,0 +1,39 @@
<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('table_config', function (Blueprint $table) {
$table->unsignedInteger('id', true);
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('method', 50)->default('')->comment('场景');
$table->string('size', 50)->default('')->comment('表格大小');
// 配置项
$table->json('config')->comment('配置项');
MigrateService::migrateCreateInfo($table);
$table->comment('表格配置');
$table->index(['company_id', 'deleted_at'], 'company_id_deleted_at_index');
$table->index(['method', 'creator_id'], 'method_creator_id_index');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('table_config');
}
};

View File

@ -0,0 +1,44 @@
<?php
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('operator_logs', function (Blueprint $table) {
$table->unsignedInteger('id', true);
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->smallInteger('type')->default(0)->comment('日志类型');
$table->string('log_title', 120)->default('')->comment('日志主题');
$table->string('route', 255)->default('')->comment('路由名称');
$table->json('params')->comment('参数');
$table->integer('ip')->default(0)->comment('IP地址')->unsigned();
$table->string('location', 255)->default('')->comment('IP定位地址');
$table->tinyInteger('source')->default(0)->comment('客户端操作来源1PC端 2手机端 3对外服务SDK接口 4后台执行日志');
$table->float('timer', 8, 3)->default(0)->comment('接口请求时间');
$table->string('agent', 255)->default('')->comment('客户端浏览器内核');
$table->text('remark')->comment('日志备注');
$table->integer('creator_id')->default(0)->unsigned()->comment('创建人ID');
$table->string('creator_name', 45)->default('')->comment('创建人姓名');
$table->integer('created_at')->default(0)->unsigned()->comment('创建时间');
$table->integer('updated_at')->default(0)->unsigned()->comment('更新时间');
$table->index(['source', 'type', 'company_id', 'created_at', 'id'], 'idx_mes_logs_full');
$table->comment('日志管理表');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('operator_logs');
}
};

View File

@ -0,0 +1,55 @@
<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('purchase', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('purchase_sn', 45)->default('')->comment('采购单号');
$table->json('warehouse_ids')->comment('所属的仓库ID列表');
$table->string('contract_sn', 45)->default('')->comment('采购合同号');
$table->integer('purchase_time')->default(0)->unsigned()->comment('提单日期');
$table->tinyInteger('customer_type')->default(1)->comment('代理类型1-代理 2-非代理');
$table->tinyInteger('container_type')->default(1)->comment('装卸类型1拆箱费整箱 2上下车费散货');
$table->smallInteger('container_count')->default(0)->unsigned()->comment('箱量/车次');
$table->smallInteger('original_count')->default(0)->unsigned()->comment('码单件数');
$table->decimal('original_cube', 12, 4)->default(0)->unsigned()->comment('码单方数');
$table->smallInteger('receiving_container')->default(0)->unsigned()->comment('收到的货柜数或车次');
$table->smallInteger('receiving_count')->default(0)->unsigned()->comment('收货件数');
$table->decimal('receiving_cube', 12, 4)->default(0)->unsigned()->comment('收货方数');
$table->integer('kz_company_id')->default(0)->unsigned()->comment('开证公司id');
$table->string('kz_company_name', 45)->default('')->comment('开证公司');
$table->integer('sh_company_id')->default(0)->unsigned()->comment('收货公司id');
$table->string('sh_company_name', 45)->default('')->comment('收货公司');
$table->string('remark', 255)->default('')->comment('备注');
$table->tinyInteger('is_from_erp')->default(0)->comment('是否erp提交的数据0否1是');
$table->integer('erp_return_id')->default(0)->unsigned()->comment('对应的erp退货单id,默认0不是退货单');
$table->tinyInteger('status')->default(1)->comment('状态: 0结束 1正在执行');
MigrateService::migrateCreateInfo($table);
$table->comment('采购单表');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('purchase');
}
};

View File

@ -0,0 +1,42 @@
<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('first_company', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('domain', 100)->comment('公司域名');
$table->string('name', 60)->comment('公司简称');
$table->string('full_name', 255)->default('')->comment('公司全称');
$table->string('address', 255)->default('')->comment('公司地址');
$table->string('company_type', 20)->default('')->comment('公司类型');
$table->string('logo', 255)->default('')->comment('公司LOGO');
$table->string('org_code', 64)->default('')->comment('公司营业执照编号');
$table->string('owner', 45)->default('')->comment('公司法人');
$table->string('id_card', 18)->default('')->comment('公司法人身份证');
$table->char('mobile', 11)->default('')->comment('负责人手机');
$table->integer('activation_date')->default(0)->unsigned()->comment('启用时间');
$table->tinyInteger('active_status')->default(1)->comment('状态: 0禁用 1正常');
$table->string('remark', 255)->default('')->comment('备注信息');
MigrateService::migrateCreateInfo($table);
$table->comment('平台公司信息');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('first_company');
}
};

View File

@ -0,0 +1,37 @@
<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('company', function (Blueprint $table) {
$table->bigIncrements('id');
$table->tinyInteger('company_type')->default(1)->comment('公司类型 1开证公司 2收货公司');
$table->string('name', 128)->default('')->comment('公司全称');
$table->tinyInteger('status')->default(1)->comment('状态: 0禁用 1正常');
$table->unique(['name', 'company_type'], 'name');
MigrateService::migrateCreateInfo($table);
$table->comment('公司表');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('company');
}
};