2024-11-05 聚水潭.sql 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. USE `yami_bbc`;
  2. ALTER TABLE `tz_order`
  3. ADD COLUMN `jst_order_id` bigint DEFAULT NULL COMMENT '聚水潭内部订单id';
  4. ALTER TABLE `tz_order_refund`
  5. ADD COLUMN `jst_refund_id` bigint DEFAULT NULL COMMENT '聚水潭内部售后id';
  6. INSERT INTO `tz_sys_config`(`param_key`, `param_value`, `remark`) VALUES
  7. ('JUSHUITAN_CONFIG', '{\"serverUrl\":\"https://openapi.jushuitan.com\",\"appKey\":\"",\"appSecret\":\"",\"openWebUrl\":\"https://openweb.jushuitan.com\",\"signature\":false,\"isOpenJST\":false}', '聚水潭配置');
  8. CREATE TABLE `tz_shop_jst_config` (
  9. `shop_id` bigint NOT NULL COMMENT '商家id',
  10. `access_token` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '访问令牌',
  11. `expires_in` bigint DEFAULT NULL COMMENT 'access_token访问过期时间【单位是秒】,还有多少秒后过期',
  12. `is_open` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启聚水潭服务(0-关闭,1-开启)',
  13. `auth_time` datetime DEFAULT NULL COMMENT '授权时间(以此为准,判断还有多久授权过期)',
  14. `shop_no` bigint DEFAULT NULL COMMENT '店铺编号(通过登录聚水潭系统获取)',
  15. PRIMARY KEY (`shop_id`)
  16. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
  17. # 补充聚水潭授权菜单及按钮权限
  18. INSERT INTO `tz_shop_menu`(`menu_id`, `parent_id`, `url`, `perms`, `type`, `icon`, `order_num`, `hidden`,`router_name`,`sys_type`) VALUES
  19. ('1400','45','','','0','','4','0','','1'),
  20. ('1401','1400','sys/jushuitan/authorization/index','','1','','0','0','','1'),
  21. ('1402','1400','','jushuitan:auth:getAuthorizationUrl','2','','0','0','','1'),
  22. ('1403','1400','','jushuitan:auth:setOpenState','2','','0','0','','1'),
  23. ('1404','11','','prod:prod:syncJstProduct','2','','0','0','','1'),
  24. ('1405','226','','supplier:supplier:syncSupplierToJst','2','','0','0','','1');
  25. INSERT INTO `tz_shop_menu_lang`(`menu_id`, `lang`, `name`) VALUES
  26. ('1400', '0', '聚水潭'),
  27. ('1400', '1', 'JuShuiTan'),
  28. ('1401', '0', '授权管理'),
  29. ('1401', '1', 'Authorization'),
  30. ('1402', '0', '获取授权的URL'),
  31. ('1402', '1', 'Obtain authorized URL'),
  32. ('1403', '0', '更新聚水潭配置信息'),
  33. ('1403', '1', 'Update config info of the jushuitan'),
  34. ('1404', '0', '批量同步商品到聚水潭'),
  35. ('1404', '1', 'Batch synchronize products to Jushuitan'),
  36. ('1405', '0', '批量同步供应商到聚水潭'),
  37. ('1405', '1', 'Batch synchronization of suppliers to Jushuitan');
  38. USE `xxl_job`;
  39. # 添加聚水潭定时任务
  40. INSERT INTO `xxl_job_info`(`job_group`, `job_desc`, `add_time`, `update_time`, `author`, `alarm_email`, `schedule_type`, `schedule_conf`, `misfire_strategy`, `executor_route_strategy`, `executor_handler`, `executor_param`, `executor_block_strategy`, `executor_timeout`, `executor_fail_retry_count`, `glue_type`, `glue_source`, `glue_remark`, `glue_updatetime`, `child_jobid`, `trigger_status`, `trigger_last_time`, `trigger_next_time`) VALUES
  41. (2, '检查商家聚水潭授权是否已经过期,过期则自动关闭', '2024-10-17 13:42:21', '2024-10-17 13:43:00', 'admin', '', 'CRON', '0 0/1 0 * * ?', 'DO_NOTHING', 'FIRST', 'checkShopJstConfigExpire', '', 'SERIAL_EXECUTION', 0, 0, 'BEAN', '', 'GLUE代码初始化', '2024-10-17 13:42:21', '', 0, 1729184340000, 1729267200000);