优化成本计算问题,加入辅料备件分摊页面
This commit is contained in:
@@ -92,3 +92,135 @@ CREATE TABLE `eqp_spare_parts_change` (
|
||||
KEY `fk_change_part` (`part_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1980201774324969474 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='备品备件变动记录表';
|
||||
|
||||
create table wms_material_coil
|
||||
(
|
||||
coil_id bigint auto_increment comment '主键ID'
|
||||
primary key,
|
||||
enter_coil_no varchar(50) not null comment '入场钢卷号(年份后两位+月份+当月第几个,如25100001、25102422)',
|
||||
current_coil_no varchar(50) not null comment '当前钢卷号(入场钢卷号和当前钢卷号可能不同)',
|
||||
supplier_coil_no varchar(50) null comment '厂家原料卷号',
|
||||
data_type tinyint(1) default 1 not null comment '数据类型(0=历史,1=现存)',
|
||||
warehouse_id bigint null comment '所在库区ID',
|
||||
next_warehouse_id bigint null comment '下一库区ID',
|
||||
actual_warehouse_id bigint null comment '所在实际库区ID(关联wms_actual_warehouse表)',
|
||||
qrcode_record_id bigint null comment '关联二维码ID(wms_generate_record.record_id)',
|
||||
team varchar(50) null comment '班组',
|
||||
has_merge_split tinyint(1) default 0 not null comment '是否合卷/分卷(0=否,1=分卷,2=合卷)',
|
||||
parent_coil_nos varchar(500) null comment '父卷号(合卷或分卷时用,逗号分隔)',
|
||||
item_id bigint not null comment '物品ID(指向原材料或产品主键)',
|
||||
item_type varchar(20) not null comment '物品类型(raw_material/product)',
|
||||
material_type varchar(20) null comment '材料类型(废品,成品,原料)',
|
||||
quality_status varchar(20) null comment '质量状态(0=正常,1=待检,2=不合格)',
|
||||
status tinyint(1) default 0 null comment '状态(0=在库,1=已出库)',
|
||||
remark varchar(255) null comment '备注',
|
||||
export_time datetime null comment '发货时间',
|
||||
del_flag tinyint(1) default 0 not null comment '删除标志(0=正常,1=已删除)',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
create_by varchar(50) null comment '创建人',
|
||||
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
update_by varchar(50) null comment '更新人',
|
||||
gross_weight decimal(10, 3) null comment '毛重',
|
||||
net_weight decimal(10, 3) null comment '毛重',
|
||||
length decimal(10, 3) null comment '钢卷长度(单位:米)',
|
||||
trimming_requirement varchar(100) null comment '切边要求',
|
||||
packing_status varchar(20) null comment '打包状态(0=未打包,1=已打包)',
|
||||
packaging_requirement varchar(255) null comment '包装要求',
|
||||
sale_id bigint null comment '销售id',
|
||||
constraint fk_coil_next_warehouse
|
||||
foreign key (next_warehouse_id) references wms_warehouse (warehouse_id),
|
||||
constraint fk_coil_qrcode
|
||||
foreign key (qrcode_record_id) references wms_generate_record (record_id)
|
||||
)
|
||||
comment '钢卷物料表';
|
||||
|
||||
create index idx_coil_current_no
|
||||
on wms_material_coil (current_coil_no);
|
||||
|
||||
create index idx_coil_type
|
||||
on wms_material_coil (data_type);
|
||||
|
||||
create index idx_coil_warehouse
|
||||
on wms_material_coil (warehouse_id);
|
||||
|
||||
create index idx_mc_coil_id
|
||||
on wms_material_coil (coil_id);
|
||||
|
||||
create index idx_mc_core
|
||||
on wms_material_coil (del_flag, data_type, status, material_type, actual_warehouse_id, item_type, item_id);
|
||||
|
||||
create index idx_mc_data_type
|
||||
on wms_material_coil (data_type);
|
||||
|
||||
create index idx_mc_del_awh
|
||||
on wms_material_coil (del_flag, actual_warehouse_id);
|
||||
|
||||
create index idx_mc_del_create
|
||||
on wms_material_coil (del_flag, create_time);
|
||||
|
||||
create index idx_mc_del_item
|
||||
on wms_material_coil (del_flag, item_type, item_id);
|
||||
|
||||
create index idx_mc_del_status_sale
|
||||
on wms_material_coil (del_flag, status, sale_id);
|
||||
|
||||
create index idx_mc_del_update
|
||||
on wms_material_coil (del_flag, update_time);
|
||||
|
||||
create index idx_mc_del_wh
|
||||
on wms_material_coil (del_flag, warehouse_id);
|
||||
|
||||
create index idx_mc_enter_coil_no
|
||||
on wms_material_coil (enter_coil_no);
|
||||
|
||||
create index idx_mc_fixed_group
|
||||
on wms_material_coil (del_flag, data_type, status, item_type, actual_warehouse_id, item_id);
|
||||
|
||||
create index idx_mc_has_merge_split
|
||||
on wms_material_coil (has_merge_split);
|
||||
|
||||
create index idx_mc_team
|
||||
on wms_material_coil (team);
|
||||
|
||||
|
||||
|
||||
|
||||
create table wms_coil_pending_action
|
||||
(
|
||||
action_id bigint auto_increment comment '主键ID'
|
||||
primary key,
|
||||
coil_id bigint not null comment '关联的钢卷ID',
|
||||
current_coil_no varchar(50) not null comment '当前钢卷号',
|
||||
action_type int not null comment '操作类型(1=分卷,2=合卷,3=更新)',
|
||||
action_status tinyint(1) default 0 not null comment '操作状态(0=待处理,1=处理中,2=已完成,3=已取消)',
|
||||
scan_time datetime null comment '扫码时间',
|
||||
scan_device varchar(100) null comment '扫码设备(移动端设备信息)',
|
||||
priority tinyint(1) default 0 null comment '优先级(0=普通,1=重要,2=紧急)',
|
||||
source_type varchar(20) default 'scan' not null comment '来源类型(scan=扫码,manual=手动创建)',
|
||||
warehouse_id bigint null comment '所在库区ID',
|
||||
operator_id bigint null comment '操作人ID',
|
||||
operator_name varchar(50) null comment '操作人姓名',
|
||||
process_time datetime null comment '处理时间',
|
||||
complete_time datetime null comment '完成时间',
|
||||
remark varchar(500) null comment '备注',
|
||||
del_flag tinyint(1) default 0 not null comment '删除标志(0=正常,1=已删除)',
|
||||
create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
|
||||
create_by varchar(50) null comment '创建人',
|
||||
update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
update_by varchar(50) null comment '更新人'
|
||||
)
|
||||
comment '钢卷待操作表';
|
||||
|
||||
create index idx_action_status
|
||||
on wms_coil_pending_action (action_status);
|
||||
|
||||
create index idx_action_type
|
||||
on wms_coil_pending_action (action_type);
|
||||
|
||||
create index idx_coil_id
|
||||
on wms_coil_pending_action (coil_id);
|
||||
|
||||
create index idx_scan_time
|
||||
on wms_coil_pending_action (scan_time);
|
||||
|
||||
create index idx_warehouse_id
|
||||
on wms_coil_pending_action (warehouse_id);
|
||||
|
||||
Reference in New Issue
Block a user