You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

11 KiB

drop table if exists rcs_task_biz;
create table rcs_task_biz
(
  biz_task_id           bigint      not null,
  env_id                bigint      not null comment '环境ID',
  biz_type              varchar(10) not null comment '任务类型' default 'carry',
  lpn                   varchar(50) not null comment '托盘ID',
  priority              integer     not null comment '任务优先级',
  task_from             varchar(50) not null comment '任务起始点',
  task_to               varchar(50) not null comment '任务目标点',
  allocated_executor_id varchar(50)                             default 'N/A' comment '系统分配的执行器ID',
  biz_task_payload      varchar(3000) comment '任务负载信息',
  biz_task_error_info   varchar(500)                            default 'N/A' comment '异常提示信息',
  biz_task_description  varchar(500)                            default 'N/A' comment '任务描述',
  biz_task_status       varchar(20)                             default 'pending' comment '任务状态',
  create_at             timestamp   not null comment '创建时间',
  create_by             varchar(50) not null comment '创建人',
  update_at             timestamp   null comment '更新时间',
  update_by             varchar(50) null comment '更新人',
  primary key (env_id, biz_task_id)
);

drop table if exists rcs_task_plan;
create table rcs_task_plan
(
  plan_task_id          bigint        not null comment '规划ID',
  biz_task_id           bigint        not null comment '业务任务ID',
  env_id                bigint        not null comment '环境ID',
  plan_type             varchar(10)   not null comment '规划类型',
  executor_id           varchar(50)   not null comment '执行器ID',
  seq                   integer       not null comment '规划序号',
  target_id             varchar(50)   null comment '目标点ID',
  target_bay            integer       null comment '目标点货架列',
  target_level          integer       null comment '目标点货架层',
  target_cell           integer       null comment '目标点货架格',
  target_rotation       FLOAT(7, 3)   null comment '目标点货架旋转角度',
  load_lpn              varchar(3000) null comment '背负托盘ID',
  plan_task_payload     varchar(3000) not null default 'N/A' comment '任务负载信息',
  plan_task_status      varchar(20)   not null default 'N/A' comment '规划执行状态',
  plan_task_error_info  varchar(500)  not null default 'N/A' comment '异常提示信息',
  plan_task_description varchar(500)  not null default 'N/A' comment '任务描述',
  create_at             timestamp     not null comment '创建时间',
  create_by             varchar(50)   not null comment '创建人',
  update_at             timestamp     null comment '更新时间',
  update_by             varchar(50)   null comment '更新人',
  primary key (env_id, plan_task_id)
);
create index idx_task_plan_biz_task_id on rcs_task_plan (biz_task_id);
create index idx_task_plan_executor_id on rcs_task_plan (executor_id);

drop table if exists rcs_task_device;
create table rcs_task_device
(
  device_task_id          bigint        not null comment '设备任务ID',
  plan_task_id            bigint        not null comment '规划ID',
  biz_task_id             bigint        not null comment '业务任务ID',
  env_id                  bigint        not null comment '环境ID',
  device_type             varchar(50)   not null comment '设备类型',
  device_item_id          varchar(50)   not null comment '执行器ID',
  seq                     integer       not null comment '执行序号',
  packet_type             varchar(10)   not null comment '报文类型',
  packet_end_point        varchar(50)   not null comment '报文目标点',
  packet_payload          varchar(50)   not null comment '报文内容',
  device_task_payload     varchar(3000) not null default 'N/A' comment '任务负载信息',
  device_task_status      varchar(20)   not null default 'N/A' comment '执行状态',
  device_task_error_info  varchar(500)  not null default 'N/A' comment '异常提示信息',
  device_task_description varchar(500)  not null default 'N/A' comment '任务描述',
  create_at               timestamp     not null comment '创建时间',
  create_by               varchar(50)   not null comment '创建人',
  update_at               timestamp     null comment '更新时间',
  update_by               varchar(50)   null comment '更新人',
  primary key (env_id, device_task_id)
);
create index idx_rcs_task_device1 on rcs_task_device (biz_task_id);
create index idx_rcs_task_device2 on rcs_task_device (plan_task_id);


drop table if exists lcc_env_info;
create table lcc_env_info
(
  env_id      bigint        not null comment '环境ID',
  env_name    varchar(50)   not null comment '环境名称',
  world_id    varchar(50)   not null comment '世界地图ID',
  is_virtual  boolean       not null default false comment '是否虚拟环境',
  env_payload varchar(3000) not null default 'N/A' comment '环境负载信息',
  auto_start  boolean       not null default false comment '是否自动启动',
  create_at   timestamp     not null comment '创建时间',
  create_by   varchar(50)   not null comment '创建人',
  update_at   timestamp     null comment '更新时间',
  update_by   varchar(50)   null comment '更新人',
  primary key (env_id)
);
create index idx_lcc_env_info_1 on lcc_env_info (world_id);

insert into lcc_env_info (env_id, world_id, env_name, is_virtual, env_payload, auto_start, create_at, create_by, update_at, update_by)
values (1, 'example1', '台湾展会生产', false, 'N/A', true, now(), 'system', now(), 'system'),
       (2, 'example1', '虚拟仿真', true, 'N/A', false, now(), 'system', now(), 'system');


drop table if exists lcc_bas_container;
create table lcc_bas_container
(
  env_id         bigint      not null comment '环境ID',
  lpn            varchar(50) not null comment '容器条码',
  container_type varchar(20) not null comment '容器类型',
  is_active      boolean     not null default true comment '是否激活',
  create_at      timestamp   not null comment '创建时间',
  create_by      varchar(50) not null comment '创建人',
  update_at      timestamp   null comment '更新时间',
  update_by      varchar(50) null comment '更新人',
  primary key (env_id, lpn)
) comment '容器信息';

drop table if exists lcc_bas_executor;
create table lcc_bas_executor
(
  env_id                   bigint        not null comment '环境ID',
  executor_id              varchar(50)   not null comment '执行器ID',
  virtual_floor_code       varchar(50)   not null comment '仿真车所在楼层',
  virtual_location_at      varchar(50)   not null comment '仿真车所在XYZ',
  virtual_executor_payload varchar(3000) not null default 'N/A' comment '仿真车配置详情',
  is_active                boolean       not null default true comment '是否激活',
  create_at                timestamp     not null comment '创建时间',
  create_by                varchar(50)   not null comment '创建人',
  update_at                timestamp     null comment '更新时间',
  update_by                varchar(50)   null comment '更新人',
  primary key (env_id, executor_id)
) comment '执行器信息';

drop table if exists lcc_bas_location;
create table lcc_bas_location
(
  env_id        bigint      not null comment '环境ID',
  loc_code      varchar(50) not null comment '位置编码',
  loc_type      varchar(20) not null comment '位置类型_gstore_rack_executor',
  way_point     varchar(50) not null comment '路径点编码',
  loc_direction varchar(10) not null comment '货位相对于路径方向',
  rack          varchar(50) not null comment '位置编码',
  bay           integer     not null default '0' comment '货架列',
  level         integer     not null default '0' comment '货架层',
  cell          integer     not null default '0' comment '货架格',
  is_lock       tinyint     not null default '0' comment '是否锁定',
  is_frozen     tinyint     not null default '0' comment '是否冻结',
  create_at     timestamp   not null comment '创建时间',
  create_by     varchar(50) not null comment '创建人',
  update_at     timestamp   null comment '更新时间',
  update_by     varchar(50) null comment '更新人',
  primary key (env_id, loc_code)
) comment '库存位置';

drop table if exists lcc_inv_lpn;
create table lcc_inv_lpn
(
  env_id      bigint      not null comment '环境ID',
  lpn         varchar(50) not null comment '托盘条码',
  loc_code    varchar(50) not null comment '库存位置',
  layer_index integer     not null comment '堆叠层号从0开始',
  qty         integer     not null comment '库存数量',
  qty_in      integer     not null comment '入库占用数量',
  qty_out     integer     not null comment '出库占用数量',
  create_at   timestamp   not null comment '创建时间',
  create_by   varchar(50) not null comment '创建人',
  update_at   timestamp   null comment '更新时间',
  update_by   varchar(50) null comment '更新人',
  primary key (env_id, lpn, loc_code)
) comment '库存';

drop table if exists lcc_inv_ledger;
create table lcc_inv_ledger
(
  env_id             bigint       not null comment '环境ID',
  biz_task_id        bigint       not null comment '业务单据ID',
  ledger_id          bigint       not null comment '账页号',
  ledger_type        varchar(20)  not null comment '账页类型',
  ledger_remark      varchar(200) not null comment '账页原因',
  lpn                varchar(50)  not null comment '托盘条码',
  loc_code_before    varchar(50)  not null comment '改变前库存位置',
  layer_index_before integer      not null comment '改变前堆叠层号从0开始',
  qty_before         integer      not null comment '改变前库存数量',
  qty_in_before      integer      not null comment '改变前入库占用数量',
  qty_out_before     integer      not null comment '改变前出库占用数量',
  layer_index        integer      not null comment '改变后堆叠层号从0开始',
  loc_code           varchar(50)  not null comment '改变前库存位置',
  qty                integer      not null comment '改变后库存数量',
  qty_in             integer      not null comment '改变后入库占用数量',
  qty_out            integer      not null comment '改变后出库占用数量',
  create_at          timestamp    not null comment '创建时间',
  create_by          varchar(50)  not null comment '创建人',
  update_at          timestamp    null comment '更新时间',
  update_by          varchar(50)  null comment '更新人',
  primary key (env_id, ledger_id)
) comment '库存账页';