Files
ruoyi-java/sql/batch_publish.sql
2025-10-09 19:45:14 +08:00

47 lines
2.7 KiB
SQL
Raw Permalink 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 `batch_publish_task` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
`task_name` varchar(200) DEFAULT NULL COMMENT '任务名称',
`original_message` text COMMENT '原始线报消息',
`total_products` int(11) DEFAULT NULL COMMENT '解析出的商品数量',
`selected_products` int(11) DEFAULT NULL COMMENT '选中的商品数量',
`target_accounts` varchar(500) DEFAULT NULL COMMENT '目标ERP账号JSON数组',
`status` int(11) DEFAULT '0' COMMENT '任务状态0待处理 1处理中 2已完成 3失败',
`success_count` int(11) DEFAULT '0' COMMENT '成功发品数量',
`fail_count` int(11) DEFAULT '0' COMMENT '失败发品数量',
`common_params` text COMMENT '通用参数JSON',
`create_user_id` bigint(20) DEFAULT NULL COMMENT '创建人ID',
`create_user_name` varchar(100) DEFAULT NULL COMMENT '创建人姓名',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`complete_time` datetime DEFAULT NULL COMMENT '完成时间',
PRIMARY KEY (`id`),
KEY `idx_create_user` (`create_user_id`),
KEY `idx_status` (`status`),
KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批量发品任务表';
-- 批量发品明细表
CREATE TABLE IF NOT EXISTS `batch_publish_item` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '明细ID',
`task_id` bigint(20) NOT NULL COMMENT '任务ID',
`skuid` varchar(100) DEFAULT NULL COMMENT 'SKUID',
`product_name` varchar(500) DEFAULT NULL COMMENT '商品名称',
`target_account` varchar(100) DEFAULT NULL COMMENT '目标ERP账号',
`account_remark` varchar(100) DEFAULT NULL COMMENT '账号备注名',
`status` int(11) DEFAULT '0' COMMENT '发品状态0待发布 1发布中 2发布成功 3发布失败 4上架中 5已上架 6上架失败',
`product_id` bigint(20) DEFAULT NULL COMMENT 'ERP商品ID发品成功后返回',
`product_status` int(11) DEFAULT NULL COMMENT '商品状态(发品成功后返回)',
`outer_id` varchar(100) DEFAULT NULL COMMENT '商家编码(发品成功后返回)',
`publish_price` bigint(20) DEFAULT NULL COMMENT '发品价格(分)',
`error_message` varchar(1000) DEFAULT NULL COMMENT '失败原因',
`publish_time` datetime DEFAULT NULL COMMENT '上架时间',
`delay_seconds` int(11) DEFAULT '3' COMMENT '延迟上架时间(秒)',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_task_id` (`task_id`),
KEY `idx_skuid` (`skuid`),
KEY `idx_status` (`status`),
KEY `idx_product_id` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='批量发品明细表';