#电子面单新建表
USE `tmerclub_order`;

/*Table structure for table `outlet_config` */

DROP TABLE IF EXISTS `outlet_config`;

CREATE TABLE `outlet_config` (
    `outlet_config_id` bigint NOT NULL AUTO_INCREMENT COMMENT '网点配置id',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `shop_id` bigint DEFAULT NULL COMMENT '店铺id',
    `supplier_id` bigint DEFAULT NULL COMMENT '供应商id',
    `delivery_company_type` tinyint NOT NULL COMMENT '快递公司类型',
    `shop_addr_id` bigint DEFAULT NULL COMMENT '发货地址id',
    `shipper` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货人',
    `mobile` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发货人电话',
    `partner_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '电子面单客户账户或月结账号',
    `partner_key` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '电子面单密码',
    `net` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '收件网点名称',
    `paper_size` tinyint DEFAULT '1' COMMENT '纸张规格 1.一联面单 2.二联面单',
    `is_default` tinyint NOT NULL DEFAULT '0' COMMENT '是否默认 0否1是',
    PRIMARY KEY (`outlet_config_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='网点配置';


/*Table structure for table `printer` */

DROP TABLE IF EXISTS `printer`;

CREATE TABLE `printer` (
    `printer_id` bigint NOT NULL AUTO_INCREMENT COMMENT '打印机id',
    `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    `shop_id` bigint DEFAULT NULL COMMENT '店铺id',
    `supplier_id` bigint DEFAULT NULL COMMENT '供应商id',
    `printer_name` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '打印机名称',
    `siid` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '设备码',
    `printer_remark` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '打印机备注',
    `is_default` tinyint DEFAULT '0' COMMENT '是否默认 0否1是',
    PRIMARY KEY (`printer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='打印机';

USE tmerclub_admin;
# 快递100增加secret, isPrint, printReqUrl配置
UPDATE sys_config SET param_value = REPLACE(param_value,'","key":','","secret":"","isPrint":false,"mock":false,"printReqUrl":"https://api.kuaidi100.com/label/order","key":')
WHERE param_key = 'QUICK100_CONFIG';

USE tmerclub_auth;
-- 菜单SQL
# 371为商家端系统菜单id
insert  into `menu`(`menu_id`,`create_time`,`update_time`,`parent_id`,`biz_type`,`permission`,`path`,`component`,`redirect`,`always_show`,`hidden`,`name`,`title`,`icon`,`no_cache`,`breadcrumb`,`affix`,`active_menu`,`seq`) values
(647,'2023-08-28 14:36:57','2023-08-28 14:36:57',371,1,NULL,'/system/delivery-manager','system/delivery-manager',NULL,NULL,0,'发货管理','发货管理','',NULL,NULL,NULL,NULL,4),
(648,'2023-08-28 14:37:51','2023-08-28 14:37:51',647,1,NULL,'outlet-config/index','system/delivery-manager/outlet-config/index',NULL,NULL,0,'网点管理','网点管理','',NULL,NULL,NULL,NULL,0),
(649,'2023-08-28 14:38:33','2023-08-28 14:38:33',647,1,NULL,'printer/index','system/delivery-manager/printer/index',NULL,NULL,0,'硬件设备','硬件设备','',NULL,NULL,NULL,NULL,1),
(650,'2023-08-29 15:28:06','2023-08-29 15:28:06',255,2,NULL,'addr','platform/addr',NULL,NULL,0,'发货地址','发货地址','',NULL,NULL,NULL,NULL,7),
(651,'2023-08-29 15:29:38','2023-08-29 15:29:38',166,2,NULL,'/system/delivery-manager','system/delivery-manager',NULL,NULL,0,'发货管理','发货管理','',NULL,NULL,NULL,NULL,4),
(652,'2023-08-29 15:30:10','2023-08-29 16:14:37',651,2,NULL,'outlet-config/index','system/delivery-manager/outlet-config/index',NULL,NULL,0,'网点管理','网点管理','',NULL,NULL,NULL,NULL,0),
(653,'2023-08-29 15:31:35','2023-08-29 16:16:32',651,2,NULL,'printer/index','system/delivery-manager/printer/index',NULL,NULL,0,'硬件设备','硬件设备','',NULL,NULL,NULL,NULL,1),
(654,'2023-08-29 15:33:24','2023-08-29 15:33:24',461,3,NULL,'/setting/delivery-manager','setting/delivery-manager',NULL,NULL,0,'发货管理','发货管理','',NULL,NULL,NULL,NULL,4),
(655,'2023-08-29 15:34:04','2023-08-30 17:22:24',654,3,NULL,'outlet-config/index','setting/delivery-manager/outlet-config/index',NULL,NULL,0,'网点管理','网点管理','',NULL,NULL,NULL,NULL,0),
(656,'2023-08-29 15:34:35','2023-08-30 17:22:09',654,3,NULL,'printer/index','setting/delivery-manager/printer/index',NULL,NULL,0,'硬件设备','硬件设备','',NULL,NULL,NULL,NULL,1);

update `menu` set `name` = '商家地址库', `title` = '商家地址库' where `component` = 'shop/refund-addr';

insert into `menu_permission` (`menu_permission_id`, `create_time`, `update_time`, `menu_id`, `biz_type`, `permission`, `name`, `uri`, `method`) values
(635,'2023-08-29 15:59:11','2023-08-29 15:59:11',648,1,'shop:outletConfig:save','新增','/mp/outlet_config',2),
(636,'2023-08-29 15:59:36','2023-08-29 15:59:36',648,1,'shop:outletConfig:update','编辑','/mp/outlet_config',3),
(637,'2023-08-29 15:59:53','2023-08-29 15:59:53',648,1,'shop:outletConfig:delete','删除','/mp/outlet_config',4),
(638,'2023-08-29 16:00:30','2023-08-29 16:00:30',648,1,'shop:outletConfig:paperSize','纸张规格','/mp/outlet_config',3),
(639,'2023-08-29 16:01:09','2023-08-29 16:01:09',648,1,'shop:outletConfig:setDefault','设为默认','/mp/outlet_config/set_default',3),
(640,'2023-08-29 16:01:38','2023-08-29 16:01:38',649,1,'shop:printer:save','新增','/mp/printer',2),
(641,'2023-08-29 16:01:57','2023-08-29 16:01:57',649,1,'shop:printer:update','编辑','/mp/printer',3),
(642,'2023-08-29 16:02:10','2023-08-29 16:02:10',649,1,'shop:printer:delete','删除','/mp/printer',4),
(643,'2023-08-29 16:02:39','2023-08-29 16:02:39',649,1,'shop:printer:setDefault','设为默认','/mp/printer/set_default',3),
(653,'2023-08-29 15:59:11','2023-08-29 16:06:24',652,2,'platform:outletConfig:save','新增','/mp/outlet_config',2),
(654,'2023-08-29 15:59:36','2023-08-29 16:06:26',652,2,'platform:outletConfig:update','编辑','/mp/outlet_config',3),
(655,'2023-08-29 15:59:53','2023-08-29 16:06:28',652,2,'platform:outletConfig:delete','删除','/mp/outlet_config',4),
(656,'2023-08-29 16:00:30','2023-08-29 16:06:31',652,2,'platform:outletConfig:paperSize','纸张规格','/mp/outlet_config',3),
(657,'2023-08-29 16:01:09','2023-08-29 16:06:34',652,2,'platform:outletConfig:setDefault','设为默认','/mp/outlet_config/set_default',3),
(658,'2023-08-29 16:01:38','2023-08-29 16:06:37',653,2,'platform:printer:save','新增','/mp/printer',2),
(659,'2023-08-29 16:01:57','2023-08-29 16:06:38',653,2,'platform:printer:update','编辑','/mp/printer',3),
(660,'2023-08-29 16:02:10','2023-08-29 16:06:41',653,2,'platform:printer:delete','删除','/mp/printer',4),
(661,'2023-08-29 16:02:39','2023-08-29 16:06:43',653,2,'platform:printer:setDefault','设为默认','/mp/printer/set_default',3),
(662,'2023-08-29 15:59:11','2023-08-29 16:06:50',655,3,'supplier:outletConfig:save','新增','/s/outlet_config',2),
(663,'2023-08-29 15:59:36','2023-08-29 16:06:51',655,3,'supplier:outletConfig:update','编辑','/s/outlet_config',3),
(664,'2023-08-29 15:59:53','2023-08-29 16:06:53',655,3,'supplier:outletConfig:delete','删除','/s/outlet_config',4),
(665,'2023-08-29 16:00:30','2023-08-29 16:06:55',655,3,'supplier:outletConfig:paperSize','纸张规格','/s/outlet_config',3),
(666,'2023-08-29 16:01:09','2023-08-29 16:06:57',655,3,'supplier:outletConfig:setDefault','设为默认','/s/outlet_config/set_default',3),
(667,'2023-08-29 16:01:38','2023-08-29 16:06:59',656,3,'supplier:printer:save','新增','/s/printer',2),
(668,'2023-08-29 16:01:57','2023-08-29 16:07:01',656,3,'supplier:printer:update','编辑','/s/printer',3),
(669,'2023-08-29 16:02:10','2023-08-29 16:07:02',656,3,'supplier:printer:delete','删除','/s/printer',4),
(670,'2023-08-29 16:02:39','2023-08-29 16:07:03',656,3,'supplier:printer:setDefault','设为默认','/s/printer/set_default',3),
(671,'2022-08-05 11:35:13','2022-08-05 11:35:13',650,2,'platform:shopAddr:delete','删除','/mp/shop_refund_addr',4),
(672,'2022-08-05 11:35:46','2022-08-05 11:35:46',650,2,'platform:shopAddr:update','编辑','/mp/shop_refund_addr',3),
(673,'2022-08-05 11:36:28','2022-08-05 11:36:28',650,2,'platform:shopAddr:save','新建','/mp/shop_refund_addr',2);