DROP TABLE IF EXISTS `kx_store_after_sales`;
CREATE TABLE `kx_store_after_sales`  (
                                         `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                         `order_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '订单号',
                                         `refund_amount` decimal(32, 8) NULL DEFAULT NULL COMMENT '退款金额',
                                         `service_type` tinyint(1) NULL DEFAULT NULL COMMENT '服务类型0仅退款1退货退款',
                                         `reasons` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '申请原因',
                                         `explains` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '说明',
                                         `explain_img` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '说明图片->多个用逗号分割',
                                         `shipper_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '物流公司编码',
                                         `delivery_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '物流单号',
                                         `delivery_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '物流名称',
                                         `state` tinyint(1) NULL DEFAULT NULL COMMENT '状态 0已提交等待平台审核 1平台已审核 等待用户发货/退款 2 用户已发货 3退款成功',
                                         `sales_state` tinyint(1) NULL DEFAULT NULL COMMENT '售后状态-0正常1用户取消2商家拒绝',
                                         `user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
                                         `consignee` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商家收货人',
                                         `phone_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商家手机号',
                                         `address` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '商家地址',
                                         `create_time` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
                                         `update_time` datetime(0) NULL DEFAULT NULL,
                                         `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
                                         `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                         `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                         PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1863135720517001218 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '售后记录表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for kx_store_after_sales_item
-- ----------------------------
DROP TABLE IF EXISTS `kx_store_after_sales_item`;
CREATE TABLE `kx_store_after_sales_item`  (
                                              `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
                                              `store_after_sales_id` bigint(20) NULL DEFAULT NULL COMMENT '售后id',
                                              `product_id` bigint(20) NULL DEFAULT NULL COMMENT '商品id',
                                              `cart_info` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '退货东西的详情信息',
                                              `create_time` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
                                              `update_time` datetime(0) NULL DEFAULT NULL,
                                              `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
                                              `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                              `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                              PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1863135720579915778 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '售后子表' ROW_FORMAT = Dynamic;


-- ----------------------------
-- Table structure for kx_store_after_sales_status
-- ----------------------------
DROP TABLE IF EXISTS `kx_store_after_sales_status`;
CREATE TABLE `kx_store_after_sales_status`  (
                                                `id` bigint(20) NOT NULL AUTO_INCREMENT,
                                                `store_after_sales_id` bigint(20) NULL DEFAULT NULL COMMENT '售后id',
                                                `change_type` tinyint(1) NULL DEFAULT NULL COMMENT '操作类型',
                                                `change_message` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '操作备注',
                                                `change_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
                                                `operator` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '操作人',
                                                `create_time` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
                                                `update_time` datetime(0) NULL DEFAULT NULL,
                                                `is_del` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '删除状态',
                                                `create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                                `update_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
                                                PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1863227831392157698 CHARACTER SET = utf8 COLLATE = utf8_bin COMMENT = '售后订单操作详情表' ROW_FORMAT = Dynamic;



INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1860301981751496705, '售后订单', 1680423431037419522, 4, 'storeAfterSales', 'order/storeAfterSales/index', NULL, 1, 0, 'C', '0', '0', 'order:storeAfterSales:list', '#', 'admin', '2024-11-23 20:44:06', 'admin', '2024-11-23 21:01:15', '售后订单菜单');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1860301981751496706, '售后订单查询', 1860301981751496705, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:storeAfterSales:query', '#', 'admin', '2024-11-23 20:44:06', '', NULL, '');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1860301981751496707, '售后订单新增', 1860301981751496705, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:storeAfterSales:add', '#', 'admin', '2024-11-23 20:44:06', '', NULL, '');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1860301981751496708, '售后订单修改', 1860301981751496705, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:storeAfterSales:edit', '#', 'admin', '2024-11-23 20:44:06', '', NULL, '');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1860301981751496709, '售后订单删除', 1860301981751496705, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'system:storeAfterSales:remove', '#', 'admin', '2024-11-23 20:44:06', '', NULL, '');

INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1865307197588652034, '用户足迹', 1680420024205606914, 10, 'userFootprint', 'user/userFootprint/index', NULL, 1, 0, 'C', '0', '0', 'user:userFootprint:list', '#', 'admin', '2024-12-07 08:08:09', 'admin', '2024-12-07 16:09:49', '足迹菜单');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1865307197588652035, '足迹查询', 1865307197588652034, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'user:userFootprint:query', '#', 'admin', '2024-12-07 08:08:09', '', NULL, '');
INSERT INTO `sys_menu`(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1865307197588652036, '足迹新增', 1865307197588652034, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'user:userFootprint:add', '#', 'admin', '2024-12-07 08:08:09', '', NULL, '');



CREATE TABLE `sys_oss_content` (
                                   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',
                                   `config_key` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置编号',
                                   `path` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '文件路径',
                                   `content` mediumblob NOT NULL COMMENT '文件内容',
                                   `create_by` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
                                   `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                   `update_by` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
                                   `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                                   `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
                                   PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1865419414938148866 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='文件表';