Files
huachuang/sql/mysql/wms_empty_box.sql

48 lines
3.0 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 空木箱类型、实例状态和仓位锁初始化
CREATE TABLE IF NOT EXISTS `wms_box_type` (
`id` bigint NOT NULL COMMENT '木箱类型id',
`box_type` varchar(20) NOT NULL COMMENT '木箱类型',
`box_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '木箱描述',
`lash_num` char(1) DEFAULT NULL COMMENT '捆扎模版',
`lash_num_one` int DEFAULT NULL COMMENT '一次捆扎次数',
`lash_num_two` int DEFAULT NULL COMMENT '二次捆扎次数',
`need_lash_one` tinyint(1) DEFAULT NULL COMMENT '是否一次捆扎',
`need_lash_two` tinyint(1) DEFAULT NULL COMMENT '是否二次捆扎',
`expend_width` decimal(20,0) DEFAULT NULL COMMENT '叉车取货宽度',
`box_structure` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '木箱结构',
`desiccant_num` int NOT NULL DEFAULT '6' COMMENT '干燥剂数量',
`box_length` int DEFAULT NULL COMMENT '木箱长度',
`box_width` int DEFAULT NULL COMMENT '木箱宽度',
`box_high` int DEFAULT NULL COMMENT '木箱高度',
`max_num` int NOT NULL DEFAULT '1' COMMENT '最大子卷数',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `index_unq_box_type` (`box_type`) USING BTREE COMMENT '木箱编码唯一索引'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='木箱类型表';
ALTER TABLE wmw_boxinfo
ADD COLUMN status VARCHAR(1) NOT NULL DEFAULT '1' COMMENT '状态:0待入库、1在库、2已出库',
ADD COLUMN out_time VARCHAR(25) NULL COMMENT '出库时间',
ADD INDEX idx_wmw_boxinfo_fifo (material_code, status, insert_time);
INSERT INTO system_dict_data
(id, sort, label, value, dict_type, status, color_type, css_class, remark, creator, create_time, updater, update_time, deleted)
SELECT 2080566516439883785, 8, '木箱入库锁', '8', 'wms_lock_type', 0, 'success', '', '', '1', NOW(), '1', NOW(), b'0'
WHERE NOT EXISTS (SELECT 1 FROM system_dict_data WHERE dict_type = 'wms_lock_type' AND value = '8' AND deleted = b'0');
INSERT INTO system_dict_data
(id, sort, label, value, dict_type, status, color_type, css_class, remark, creator, create_time, updater, update_time, deleted)
SELECT 2080566516439883786, 9, '木箱出库锁', '9', 'wms_lock_type', 0, 'warning', '', '', '1', NOW(), '1', NOW(), b'0'
WHERE NOT EXISTS (SELECT 1 FROM system_dict_data WHERE dict_type = 'wms_lock_type' AND value = '9' AND deleted = b'0');
INSERT INTO base_code_rule
(rule_name, rule_code, segment_config, code_separator, letter_case, total_length,
seq_strategy, status, remark, creator, updater, deleted)
SELECT '木箱编码', 'BOX_CODE',
JSON_ARRAY(
JSON_OBJECT('type', 'PREFIX', 'value', 'BOX'),
JSON_OBJECT('type', 'DATE', 'format', 'yyyyMMdd'),
JSON_OBJECT('type', 'SEQUENCE', 'resetBy', 'DAY', 'startAt', 1,
'maxValue', 9999, 'paddingLen', 4, 'paddingChar', '0')
), '-', 1, 0, 'segment', 0, '空木箱编码', '1', '1', 0
WHERE NOT EXISTS (SELECT 1 FROM base_code_rule WHERE rule_code = 'BOX_CODE' AND deleted = 0);