diff --git a/sql/mysql/ruoyi-vue-pro.sql b/sql/mysql/ruoyi-vue-pro.sql index b05c14de6..22fd35018 100644 --- a/sql/mysql/ruoyi-vue-pro.sql +++ b/sql/mysql/ruoyi-vue-pro.sql @@ -11,7 +11,7 @@ Target Server Version : 80026 File Encoding : 65001 - Date: 13/04/2023 23:37:01 + Date: 09/07/2023 20:25:37 */ SET NAMES utf8mb4; @@ -415,7 +415,7 @@ CREATE TABLE `bpm_task_assign_rule` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; +) ENGINE = InnoDB AUTO_INCREMENT = 276 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; -- ---------------------------- -- Records of bpm_task_assign_rule @@ -546,7 +546,7 @@ CREATE TABLE `infra_api_error_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1110 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; +) ENGINE = InnoDB AUTO_INCREMENT = 1291 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; -- ---------------------------- -- Records of infra_api_error_log @@ -584,7 +584,7 @@ CREATE TABLE `infra_codegen_column` ( `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 = 1688 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; +) ENGINE = InnoDB AUTO_INCREMENT = 1698 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; -- ---------------------------- -- Records of infra_codegen_column @@ -644,7 +644,7 @@ CREATE TABLE `infra_config` ( `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 = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '参数配置表'; +) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '参数配置表'; -- ---------------------------- -- Records of infra_config @@ -655,6 +655,7 @@ INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `val INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (8, 'url', 2, 'SkyWalking 监控的地址', 'url.skywalking', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:57:03', b'0'); INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (9, 'url', 2, 'Spring Boot Admin 监控的地址', 'url.spring-boot-admin', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:52:07', b'0'); INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (10, 'url', 2, 'Swagger 接口文档的地址', 'url.swagger', '', b'1', '', '1', '2023-04-07 13:41:16', '1', '2023-04-07 14:59:00', b'0'); +INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `value`, `visible`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (11, 'ui', 2, '腾讯地图 key', 'tencent.lbs.key', 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E', b'1', '腾讯地图 key', '1', '2023-06-03 19:16:27', '1', '2023-06-03 19:16:27', b'0'); COMMIT; -- ---------------------------- @@ -699,7 +700,7 @@ CREATE TABLE `infra_file` ( `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 = 912 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; +) ENGINE = InnoDB AUTO_INCREMENT = 953 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; -- ---------------------------- -- Records of infra_file @@ -753,7 +754,7 @@ CREATE TABLE `infra_file_content` ( `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 = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; +) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; -- ---------------------------- -- Records of infra_file_content @@ -812,7 +813,7 @@ CREATE TABLE `infra_job_log` ( `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 = 168767 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '定时任务日志表'; +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '定时任务日志表'; -- ---------------------------- -- Records of infra_job_log @@ -867,7 +868,7 @@ CREATE TABLE `member_user` ( `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `uk_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号' -) ENGINE = InnoDB AUTO_INCREMENT = 247 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户'; +) ENGINE = InnoDB AUTO_INCREMENT = 248 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户'; -- ---------------------------- -- Records of member_user @@ -935,7 +936,7 @@ CREATE TABLE `system_dict_data` ( `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 = 1234 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; +) ENGINE = InnoDB AUTO_INCREMENT = 1341 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; -- ---------------------------- -- Records of system_dict_data @@ -1147,6 +1148,24 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1232, 20, 'Vue3 Element Plus 标准模版', '20', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-04-13 00:04:08', '1', '2023-04-13 00:04:08', 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`) VALUES (1233, 21, 'Vue3 Element Plus Schema 模版', '21', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-04-13 00:04:26', '1', '2023-04-13 00:04:26', 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`) VALUES (1234, 30, 'Vue3 vben 模版', '30', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-04-13 00:04:26', '1', '2023-04-13 00:04:26', 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`) VALUES (1235, 1, '个', '1', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1236, 1, '件', '2', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1237, 1, '盒', '3', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1238, 1, '袋', '4', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1239, 1, '箱', '5', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1240, 1, '套', '6', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1241, 1, '包', '7', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1242, 1, '双', '8', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1243, 1, '卷', '9', 'product_unit', 0, '', '', '', '1', '2023-05-23 14:38:38', '1', '2023-05-23 14:38:38', 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`) VALUES (1244, 0, '按件', '1', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:40', '1', '2023-05-21 22:46:40', 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`) VALUES (1245, 1, '按重量', '2', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:58', '1', '2023-05-21 22:46:58', 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`) VALUES (1246, 2, '按体积', '3', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:47:18', '1', '2023-05-21 22:47:18', 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`) VALUES (1335, 1, '购物', '1', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-06-28 13:48:28', 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`) VALUES (1336, 2, '签到', '2', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-06-28 13:48:31', 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`) VALUES (1337, 1, '订单创建', '1', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:42', '1', '2023-06-28 13:48:34', 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`) VALUES (1338, 2, '冻结期', '2', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:58', '1', '2023-06-28 13:48:36', 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`) VALUES (1339, 3, '完成', '3', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:07', '1', '2023-06-28 13:48:38', 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`) VALUES (1340, 4, '失效(订单退款)', '4', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:21', '1', '2023-06-28 13:48:42', b'0'); COMMIT; -- ---------------------------- @@ -1167,7 +1186,7 @@ CREATE TABLE `system_dict_type` ( `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) USING BTREE, UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 169 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; +) ENGINE = InnoDB AUTO_INCREMENT = 173 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; -- ---------------------------- -- Records of system_dict_type @@ -1233,6 +1252,10 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (166, '邮件发送状态', 'system_mail_send_status', 0, '邮件发送状态', '1', '2023-01-26 09:53:13', '1', '2023-01-26 09:53:13', b'0', '1970-01-01 00:00:00'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (167, '站内信模版的类型', 'system_notify_template_type', 0, '站内信模版的类型', '1', '2023-01-28 10:35:10', '1', '2023-01-28 10:35:10', b'0', '1970-01-01 00:00:00'); INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (168, '代码生成的前端类型', 'infra_codegen_front_type', 0, '', '1', '2023-04-12 23:57:52', '1', '2023-04-12 23:57:52', b'0', '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (169, '商品的单位', 'product_unit', 0, '商品的单位', '1', '2023-05-24 21:23:59', '1', '2023-05-24 21:23:59', b'0', '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (170, '快递计费方式', 'trade_delivery_express_charge_mode', 0, '用于商城交易模块配送管理', '1', '2023-05-21 22:45:03', '1', '2023-05-21 22:45:03', b'0', '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (171, '积分业务类型', 'member_point_biz_type', 0, '', '1', '2023-06-10 12:15:00', '1', '2023-06-28 13:48:20', b'0', '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (172, '积分订单状态', 'member_point_status', 0, '', '1', '2023-06-10 12:16:27', '1', '2023-06-28 13:48:17', b'0', '1970-01-01 00:00:00'); COMMIT; -- ---------------------------- @@ -1252,7 +1275,7 @@ CREATE TABLE `system_error_code` ( `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 = 5832 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表'; +) ENGINE = InnoDB AUTO_INCREMENT = 5833 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表'; -- ---------------------------- -- Records of system_error_code @@ -1281,7 +1304,7 @@ CREATE TABLE `system_login_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 2163 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; +) ENGINE = InnoDB AUTO_INCREMENT = 2223 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; -- ---------------------------- -- Records of system_login_log @@ -1411,7 +1434,7 @@ CREATE TABLE `system_menu` ( `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 = 2162 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; +) ENGINE = InnoDB AUTO_INCREMENT = 2301 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; -- ---------------------------- -- Records of system_menu @@ -1550,7 +1573,6 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1128, '支付应用信息创建', 'pay:app:create', 3, 2, 1126, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1129, '支付应用信息更新', 'pay:app:update', 3, 3, 1126, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1130, '支付应用信息删除', 'pay:app:delete', 3, 4, 1126, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1131, '支付应用信息导出', 'pay:app:export', 3, 5, 1126, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:31', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1132, '秘钥解析', 'pay:channel:parsing', 3, 6, 1129, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2021-11-08 15:15:47', '1', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1133, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1132, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1134, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1132, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-11-10 01:13:41', '', '2022-04-20 17:03:10', b'0'); @@ -1576,12 +1598,6 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1176, '支付订单更新', 'pay:order:update', 3, 3, 1173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1177, '支付订单删除', 'pay:order:delete', 3, 4, 1173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1178, '支付订单导出', 'pay:order:export', 3, 5, 1173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 08:49:43', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1179, '商户信息', '', 2, 0, 1117, 'merchant', 'merchant', 'pay/merchant/index', 'PayApp', 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '1', '2023-04-08 10:42:32', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1180, '支付商户信息查询', 'pay:merchant:query', 3, 1, 1179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1181, '支付商户信息创建', 'pay:merchant:create', 3, 2, 1179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1182, '支付商户信息更新', 'pay:merchant:update', 3, 3, 1179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1183, '支付商户信息删除', '', 3, 4, 1179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1184, '支付商户信息导出', 'pay:merchant:export', 3, 5, 1179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2021-12-25 09:01:44', '', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1185, '工作流程', '', 1, 50, 0, '/bpm', 'tool', NULL, NULL, 0, b'1', b'1', b'1', '1', '2021-12-30 20:26:36', '103', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1186, '流程管理', '', 1, 10, 1185, 'manager', 'nested', NULL, NULL, 0, b'1', b'1', b'1', '1', '2021-12-30 20:28:30', '1', '2022-04-20 17:03:10', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1187, '流程表单', '', 2, 0, 1186, 'form', 'form', 'bpm/form/index', 'BpmForm', 0, b'1', b'1', b'1', '', '2021-12-30 12:38:22', '1', '2023-04-08 10:50:37', b'0'); @@ -1692,118 +1708,26 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2046, '满减送活动关闭', 'promotion:reward-activity:close', 3, 5, 2041, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2022-11-05 10:42:53', '1', '2022-11-05 10:42:53', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2047, '限时折扣活动', '', 2, 7, 2030, 'discount-activity', 'time', 'mall/promotion/discountActivity/index', 'PromotionDiscountActivity', 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '1', '2023-04-08 11:45:44', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2048, '限时折扣活动查询', 'promotion:discount-activity:query', 3, 1, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1', - b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1', - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', NULL, 0, b'1', b'1', - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', NULL, 0, b'1', b'1', - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range', - 'mall/promotion/seckill/seckillActivity/index', 'PromotionSeckillActivity', 0, b'1', b'1', b'1', '', - '2022-11-06 22:24:49', '1', '2023-04-08 11:46:02', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/SeckillConfig/index', - 'PromotionSeckillConfig', 0, b'0', b'1', b'1', '', '2022-11-15 19:46:50', '1', '2023-04-08 11:46:17', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-11-19 18:57:19', - '1', '2022-12-10 16:32:57', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index', - 'TradeAfterSale', 0, b'1', b'1', b'1', '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', NULL, 0, b'1', b'1', b'1', '', - '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '1', - '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, - `updater`, `update_time`, `deleted`) -VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, b'1', b'1', - b'1', '1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2077, '物流公司管理管理', '', 2, 0, 2072, 'express-company', '', 'mall/trade/expressCompany/index', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '1', '2022-12-20 23:36:20', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2078, '物流公司管理查询', 'trade:express-company:query', 3, 1, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2079, '物流公司管理创建', 'trade:express-company:create', 3, 2, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2080, '物流公司管理更新', 'trade:express-company:update', 3, 3, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2081, '物流公司管理删除', 'trade:express-company:delete', 3, 4, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2082, '物流公司管理导出', 'trade:express-company:export', 3, 5, 2077, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2059, '秒杀商品', '', 2, 2, 2209, 'activity', 'ep:basketball', 'mall/promotion/seckill/activity/index', 'PromotionSeckillActivity', 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '1', '2023-06-24 18:57:25', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2066, '秒杀时段', '', 2, 1, 2209, 'config', 'ep:baseball', 'mall/promotion/seckill/config/index', 'PromotionSeckillConfig', 0, b'1', b'1', b'1', '', '2022-11-15 19:46:50', '1', '2023-06-24 18:57:14', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2067, '秒杀时段查询', 'promotion:seckill-config:query', 3, 1, 2066, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '1', '2023-06-24 17:50:25', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2068, '秒杀时段创建', 'promotion:seckill-config:create', 3, 2, 2066, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '1', '2023-06-24 17:48:39', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2069, '秒杀时段更新', 'promotion:seckill-config:update', 3, 3, 2066, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '1', '2023-06-24 17:50:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2070, '秒杀时段删除', 'promotion:seckill-config:delete', 3, 4, 2066, '', '', '', '', 0, b'1', b'1', b'1', '', '2022-11-15 19:46:51', '1', '2023-06-24 17:50:32', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-11-19 18:57:19', '1', '2022-12-10 16:32:57', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index', 'TradeAfterSale', 0, b'1', b'1', b'1', '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '1', '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, b'1', b'1', b'1', '1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2083, '地区管理', '', 2, 14, 1, 'area', 'row', 'system/area/index', 'SystemArea', 0, b'1', b'1', b'1', '1', '2022-12-23 17:35:05', '1', '2023-04-08 09:01:37', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2084, '公众号管理', '', 1, 100, 0, '/mp', 'wechat', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-01-01 20:11:04', '1', '2023-01-15 11:28:57', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2085, '账号管理', '', 2, 1, 2084, 'account', 'phone', 'mp/account/index', 'MpAccount', 0, b'1', b'1', b'1', '1', '2023-01-01 20:13:31', '1', '2023-02-09 23:56:39', b'0'); @@ -1883,6 +1807,45 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2159, 'Boot 开发文档', '', 1, 1, 0, 'https://doc.iocoder.cn/', 'education', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:46:28', '1', '2023-02-10 22:46:28', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2160, 'Cloud 开发文档', '', 1, 2, 0, 'https://cloud.iocoder.cn', 'documentation', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-02-10 22:47:07', '1', '2023-02-10 22:47:07', b'0'); INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2161, '接入示例', '', 2, 99, 1117, 'demo-order', 'drag', 'pay/demo/index', NULL, 0, b'1', b'1', b'1', '', '2023-02-11 14:21:42', '1', '2023-02-11 22:26:35', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2162, '商品导出', 'product:spu:export', 3, 5, 2014, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2164, '配送管理', '', 1, 2, 2072, 'delivery', '', '', '', 0, b'1', b'1', b'1', '1', '2023-05-18 09:18:02', '1', '2023-05-24 23:24:13', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2165, '快递发货', '', 1, 0, 2164, 'express', '', '', '', 0, b'1', b'1', b'1', '1', '2023-05-18 09:22:06', '1', '2023-05-18 09:22:06', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2166, '门店自提', '', 1, 1, 2164, 'pick-up-store', '', '', '', 0, b'1', b'1', b'1', '1', '2023-05-18 09:23:14', '1', '2023-05-18 09:23:14', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2167, '快递公司', '', 2, 0, 2165, 'express', '', 'mall/trade/delivery/express/index', 'Express', 0, b'1', b'1', b'1', '1', '2023-05-18 09:27:21', '1', '2023-05-18 22:11:14', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2168, '快递公司查询', 'trade:delivery:express:query', 3, 1, 2167, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-18 09:37:53', '', '2023-05-18 09:37:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2169, '快递公司创建', 'trade:delivery:express:create', 3, 2, 2167, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-18 09:37:53', '', '2023-05-18 09:37:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2170, '快递公司更新', 'trade:delivery:express:update', 3, 3, 2167, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-18 09:37:53', '', '2023-05-18 09:37:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2171, '快递公司删除', 'trade:delivery:express:delete', 3, 4, 2167, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-18 09:37:53', '', '2023-05-18 09:37:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2172, '快递公司导出', 'trade:delivery:express:export', 3, 5, 2167, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-18 09:37:53', '', '2023-05-18 09:37:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2173, '运费模版', 'trade:delivery:express-template:query', 2, 1, 2165, 'express-template', '', 'mall/trade/delivery/expressTemplate/index', 'ExpressTemplate', 0, b'1', b'1', b'1', '1', '2023-05-20 06:48:10', '1', '2023-05-20 06:48:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2174, '快递运费模板查询', 'trade:delivery:express-template:query', 3, 1, 2173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-20 06:49:53', '', '2023-05-20 06:49:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2175, '快递运费模板创建', 'trade:delivery:express-template:create', 3, 2, 2173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-20 06:49:53', '', '2023-05-20 06:49:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2176, '快递运费模板更新', 'trade:delivery:express-template:update', 3, 3, 2173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-20 06:49:53', '', '2023-05-20 06:49:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2177, '快递运费模板删除', 'trade:delivery:express-template:delete', 3, 4, 2173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-20 06:49:53', '', '2023-05-20 06:49:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2178, '快递运费模板导出', 'trade:delivery:express-template:export', 3, 5, 2173, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-20 06:49:53', '', '2023-05-20 06:49:53', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2179, '门店管理', '', 2, 1, 2166, 'pick-up-store', '', 'mall/trade/delivery/pickUpStore/index', 'PickUpStore', 0, b'1', b'1', b'1', '1', '2023-05-25 10:50:00', '1', '2023-05-25 10:50:00', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2180, '自提门店查询', 'trade:delivery:pick-up-store:query', 3, 1, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2181, '自提门店创建', 'trade:delivery:pick-up-store:create', 3, 2, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2182, '自提门店更新', 'trade:delivery:pick-up-store:update', 3, 3, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2183, '自提门店删除', 'trade:delivery:pick-up-store:delete', 3, 4, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2184, '自提门店导出', 'trade:delivery:pick-up-store:export', 3, 5, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2209, '秒杀活动', '', 2, 3, 2030, 'seckill', 'ep:place', '', '', 0, b'1', b'1', b'1', '1', '2023-06-24 17:39:13', '1', '2023-06-24 18:55:15', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2262, '会员中心', '', 1, 55, 0, '/member', 'date-range', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-06-10 00:42:03', '1', '2023-06-28 22:52:34', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2275, '积分配置', '', 2, 0, 2299, 'config', '', 'member/point/config/index', 'PointConfig', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 22:50:59', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2276, '积分设置查询', 'point:config:query', 3, 1, 2275, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '', '2023-06-10 02:07:44', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2277, '积分设置创建', 'point:config:save', 3, 2, 2275, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 20:32:31', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2281, '签到配置', '', 2, 2, 2300, 'sign-in-config', '', 'member/signin/config/index', 'SignInConfig', 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '1', '2023-07-02 15:04:15', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2282, '积分签到规则查询', 'point:sign-in-config:query', 3, 1, 2281, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2283, '积分签到规则创建', 'point:sign-in-config:create', 3, 2, 2281, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2284, '积分签到规则更新', 'point:sign-in-config:update', 3, 3, 2281, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2285, '积分签到规则删除', 'point:sign-in-config:delete', 3, 4, 2281, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2287, '积分记录', '', 2, 1, 2299, 'record', '', 'member/point/record/index', 'PointRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '1', '2023-06-27 22:51:07', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2288, '用户积分记录查询', 'point:record:query', 3, 1, 2287, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '', '2023-06-10 04:18:50', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2293, '签到记录', '', 2, 3, 2300, 'sign-in-record', '', 'member/signin/record/index', 'SignInRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '1', '2023-07-02 15:04:10', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2294, '用户签到积分查询', 'point:sign-in-record:query', 3, 1, 2293, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48:22', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2297, '用户签到积分删除', 'point:sign-in-record:delete', 3, 4, 2293, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48:22', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2299, '会员积分', '', 1, 1, 2262, 'point', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:48:51', '1', '2023-06-27 22:48:51', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2300, '会员签到', '', 1, 2, 2262, 'signin', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:49:53', '1', '2023-06-27 22:49:53', b'0'); COMMIT; -- ---------------------------- @@ -1999,7 +1962,7 @@ CREATE TABLE `system_oauth2_access_token` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 1785 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; +) ENGINE = InnoDB AUTO_INCREMENT = 2007 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; -- ---------------------------- -- Records of system_oauth2_access_token @@ -2121,7 +2084,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 738 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; +) ENGINE = InnoDB AUTO_INCREMENT = 785 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; -- ---------------------------- -- Records of system_oauth2_refresh_token @@ -2161,7 +2124,7 @@ CREATE TABLE `system_operate_log` ( `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB AUTO_INCREMENT = 6440 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; +) ENGINE = InnoDB AUTO_INCREMENT = 6601 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; -- ---------------------------- -- Records of system_operate_log @@ -2743,7 +2706,6 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2062, 2, 1128, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2063, 2, 1129, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2064, 2, 1130, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2065, 2, 1131, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2066, 2, 1132, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2067, 2, 1133, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2068, 2, 1134, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); @@ -2771,12 +2733,6 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2090, 2, 1176, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2091, 2, 1177, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2092, 2, 1178, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2093, 2, 1179, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2094, 2, 1180, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2095, 2, 1181, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2096, 2, 1182, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2097, 2, 1183, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); -INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2098, 2, 1184, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2099, 2, 1226, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2100, 2, 1227, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2101, 2, 1228, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); @@ -3321,7 +3277,7 @@ CREATE TABLE `system_tenant` ( BEGIN; INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '芋道源码', NULL, '芋艿', '17321315478', 0, 'https://www.iocoder.cn', 0, '2099-02-19 17:14:16', 9999, '1', '2021-01-05 17:03:47', '1', '2022-02-23 12:15:11', b'0'); INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (121, '小租户', 110, '小王2', '15601691300', 0, 'http://www.iocoder.cn', 111, '2024-03-11 00:00:00', 20, '1', '2022-02-22 00:56:14', '1', '2022-05-17 10:03:59', b'0'); -INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2022-03-07 21:37:58', b'0'); +INSERT INTO `system_tenant` (`id`, `name`, `contact_user_id`, `contact_name`, `contact_mobile`, `status`, `domain`, `package_id`, `expire_time`, `account_count`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (122, '测试租户', 113, '芋道', '15601691300', 0, 'https://www.iocoder.cn', 111, '2022-04-30 00:00:00', 50, '1', '2022-03-07 21:37:58', '1', '2023-04-15 09:17:54', b'0'); COMMIT; -- ---------------------------- @@ -3459,7 +3415,7 @@ CREATE TABLE `system_users` ( -- Records of system_users -- ---------------------------- BEGIN; -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '0:0:0:0:0:0:0:1', '2023-04-13 23:09:16', 'admin', '2021-01-05 17:03:47', NULL, '2023-04-13 23:09:16', b'0', 1); +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '127.0.0.1', '2023-07-09 12:19:37', 'admin', '2021-01-05 17:03:47', NULL, '2023-07-09 12:19:37', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '127.0.0.1', '2022-07-09 23:03:33', '', '2021-01-07 09:07:17', NULL, '2022-07-09 23:03:33', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, 'yuanma', '$2a$10$YMpimV4T6BtDhIaA8jSW.u8UTGBeGhc/qwXP4oxoMr4mOw9.qttt6', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '127.0.0.1', '2022-07-08 01:26:27', '', '2021-01-13 23:50:35', NULL, '2022-07-08 01:26:27', b'0', 1); INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$10$GP8zvqHB//TekuzYZSBYAuBQJiNq1.fxQVDYJ.uBCOnWCtDVKE4H6', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, '', 0, '127.0.0.1', '2022-05-28 15:43:17', '', '2021-01-21 02:13:53', NULL, '2022-07-09 09:00:33', b'0', 1); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientConfig.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientConfig.java index bf709e497..5a3843034 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientConfig.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.framework.pay.core.client; +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import com.fasterxml.jackson.annotation.JsonTypeInfo; import javax.validation.ConstraintViolation; @@ -19,24 +20,11 @@ import java.util.Set; // 2. 反序列化到内存对象时,通过 @class 属性,可以创建出正确的类型 public interface PayClientConfig { - /** - * 配置验证参数是 - * - * @param validator 校验对象 - * @return 配置好的验证参数 - */ - Set> verifyParam(Validator validator); - - // TODO @aquan:貌似抽象一个 validation group 就好了! /** * 参数校验 * * @param validator 校验对象 */ - default void validate(Validator validator) { - Set> violations = verifyParam(validator); - if (!violations.isEmpty()) { - throw new ConstraintViolationException(violations); - } - } + void validate(Validator validator); + } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/order/PayOrderUnifiedRespDTO.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/order/PayOrderUnifiedRespDTO.java index 815f63ec3..441b4ece1 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/order/PayOrderUnifiedRespDTO.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/order/PayOrderUnifiedRespDTO.java @@ -1,7 +1,7 @@ package cn.iocoder.yudao.framework.pay.core.client.dto.order; +import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO; import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; -import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum; import lombok.Data; /** @@ -24,19 +24,15 @@ public class PayOrderUnifiedRespDTO { private String displayContent; /** - * 支付状态 + * 同步的通知信息 * - * 枚举 {@link PayOrderStatusRespEnum} 类 + * 目前只有 bar 条码支付才会出现,它是支付发起时,直接返回是否支付成功的,而其它支付还是异步通知 */ - private Integer status; + private PayOrderNotifyRespDTO notify; public PayOrderUnifiedRespDTO(String displayMode, String displayContent) { - this(displayMode, displayContent, PayOrderStatusRespEnum.WAITING.getStatus()); - } - - public PayOrderUnifiedRespDTO(String displayMode, String displayContent, Integer status) { this.displayMode = displayMode; this.displayContent = displayContent; - this.status = status; } + } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java index 471161c7f..066ff0122 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; import lombok.Data; @@ -18,15 +19,6 @@ import java.util.Set; @Data public class AlipayPayClientConfig implements PayClientConfig { - /** - * 网关地址 - 线上 - */ - public static final String SERVER_URL_PROD = "https://openapi.alipay.com/gateway.do"; - /** - * 网关地址 - 沙箱 - */ - public static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do"; - /** * 公钥类型 - 公钥模式 */ @@ -43,8 +35,9 @@ public class AlipayPayClientConfig implements PayClientConfig { /** * 网关地址 - * 1. {@link #SERVER_URL_PROD} - * 2. {@link #SERVER_URL_SANDBOX} + * + * 1. 生产环境 + * 2. 沙箱环境 */ @NotBlank(message = "网关地址不能为空", groups = {ModePublicKey.class, ModeCertificate.class}) private String serverUrl; @@ -108,9 +101,8 @@ public class AlipayPayClientConfig implements PayClientConfig { } @Override - public Set> verifyParam(Validator validator) { - // TODO 芋艿:参数校验 - return validator.validate(this, + public void validate(Validator validator) { + ValidationUtils.validate(validator, this, MODE_PUBLIC_KEY.equals(this.getMode()) ? ModePublicKey.class : ModeCertificate.class); } diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxBarPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxBarPayClient.java index 47df5625c..4dab16bfb 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxBarPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxBarPayClient.java @@ -5,13 +5,13 @@ import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; +import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO; import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO; import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO; import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedRespDTO; import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum; -import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum; import com.github.binarywang.wxpay.bean.request.WxPayMicropayRequest; import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult; import com.github.binarywang.wxpay.constant.WxPayConstants; @@ -70,9 +70,15 @@ public class WxBarPayClient extends AbstractWxPayClient { try { WxPayMicropayResult response = client.micropay(request); // 支付成功(例如说,用户输入了密码) + PayOrderNotifyRespDTO notify = PayOrderNotifyRespDTO.builder() + .orderExtensionNo(response.getOutTradeNo()) + .channelOrderNo(response.getTransactionId()) + .channelUserId(response.getOpenid()) + .successTime(parseDateV2(response.getTimeEnd())) + .build(); return new PayOrderUnifiedRespDTO(PayOrderDisplayModeEnum.BAR_CODE.getMode(), - JsonUtils.toJsonString(response), - PayOrderStatusRespEnum.SUCCESS.getStatus()); + JsonUtils.toJsonString(response)) + .setNotify(notify); } catch (WxPayException ex) { // 如果不满足这 3 种任一的,则直接抛出 WxPayException 异常,不仅需处理 // 1. SYSTEMERROR:接口返回错误:请立即调用被扫订单结果查询API,查询当前订单状态,并根据订单的状态决定下一步的操作。 diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxPayClientConfig.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxPayClientConfig.java index e109a6cf7..d5740bf76 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxPayClientConfig.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxPayClientConfig.java @@ -1,15 +1,14 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.weixin; import cn.hutool.core.io.IoUtil; +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; import lombok.Data; -import javax.validation.ConstraintViolation; import javax.validation.Validator; import javax.validation.constraints.NotBlank; import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.util.Set; /** * 微信支付的 PayClientConfig 实现类 @@ -100,8 +99,9 @@ public class WxPayClientConfig implements PayClientConfig { } @Override - public Set> verifyParam(Validator validator) { - return validator.validate(this, this.getApiVersion().equals(API_VERSION_V2) ? V2.class : V3.class); + public void validate(Validator validator) { + ValidationUtils.validate(validator, this, + API_VERSION_V2.equals(this.getApiVersion()) ? V2.class : V3.class); } public static void main(String[] args) throws FileNotFoundException { diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImplIntegrationTest.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImplIntegrationTest.java index fee70b4c4..093e772e3 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImplIntegrationTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/PayClientFactoryImplIntegrationTest.java @@ -24,6 +24,8 @@ import java.io.FileNotFoundException; @Disabled public class PayClientFactoryImplIntegrationTest { + private static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do"; + private final PayClientFactoryImpl payClientFactory = new PayClientFactoryImpl(); /** @@ -79,7 +81,7 @@ public class PayClientFactoryImplIntegrationTest { // 创建配置 AlipayPayClientConfig config = new AlipayPayClientConfig(); config.setAppId("2021000118634035"); - config.setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX); + config.setServerUrl(SERVER_URL_SANDBOX); config.setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT); config.setPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJv890x84qbppUtRIfhaKSwSVN0thCcsDCaAsGR5MZslDkO8NCT9V4r2SVXjyY7eJUZlZd1M0C8T01Tg4UOx5LUbic0O3A1uJMy6V1n9IyYwbAW3AEZhBd5bSbPgrqvmv3NeWSTQT6Anxnllf+2iDH6zyA2fPl7cYyQtbZoDJQFGqr4F+cGh2R6akzRKNoBkAeMYwoY6es2lX8sJxCVPWUmxNUoL3tScwlSpd7Bxw0q9c/X01jMwuQ0+Va358zgFiGERTE6yD01eu40OBDXOYO3z++y+TAYHlQQ2toMO63trepo88X3xV3R44/1DH+k2pAm2IF5ixiLrAgMBAAECggEAPx3SoXcseaD7rmcGcE0p4SMfbsUDdkUSmBBbtfF0GzwnqNLkWa+mgE0rWt9SmXngTQH97vByAYmLPl1s3G82ht1V7Sk7yQMe74lhFllr8eEyTjeVx3dTK1EEM4TwN+936DTXdFsr4TELJEcJJdD0KaxcCcfBLRDs2wnitEFZ9N+GoZybVmY8w0e0MI7PLObUZ2l0X4RurQnfG9ZxjXjC7PkeMVv7cGGylpNFi3BbvkRhdhLPDC2E6wqnr9e7zk+hiENivAezXrtxtwKovzCtnWJ1r0IO14Rh47H509Ic0wFnj+o5YyUL4LdmpL7yaaH6fM7zcSLFjNZPHvZCKPwYcQKBgQDQFho98QvnL8ex4v6cry4VitGpjSXm1qP3vmMQk4rTsn8iPWtcxPjqGEqOQJjdi4Mi0VZKQOLFwlH0kl95wNrD/isJ4O1yeYfX7YAXApzHqYNINzM79HemO3Yx1qLMW3okRFJ9pPRzbQ9qkTpsaegsmyX316zOBhzGRYjKbutTYwKBgQCm7phr9XdFW5Vh+XR90mVs483nrLmMiDKg7YKxSLJ8amiDjzPejCn7i95Hah08P+2MIZLIPbh2VLacczR6ltRRzN5bg5etFuqSgfkuHyxpoDmpjbe08+Q2h8JBYqcC5Nhv1AKU4iOUhVLHo/FBAQliMcGc/J3eiYTFC7EsNx382QKBgClb20doe7cttgFTXswBvaUmfFm45kmla924B7SpvrQpDD/f+VDtDZRp05fGmxuduSjYdtA3aVtpLiTwWu22OUUvZZqHDGruYOO4Hvdz23mL5b4ayqImCwoNU4bAZIc9v18p/UNf3/55NNE3oGcf/bev9rH2OjCQ4nM+Ktwhg8CFAoGACSgvbkShzUkv0ZcIf9ppu+ZnJh1AdGgINvGwaJ8vQ0nm/8h8NOoFZ4oNoGc+wU5Ubops7dUM6FjPR5e+OjdJ4E7Xp7d5O4J1TaIZlCEbo5OpdhaTDDcQvrkFu+Z4eN0qzj+YAKjDAOOrXc4tbr5q0FsgXscwtcNfaBuzFVTUrUkCgYEAwzPnMNhWG3zOWLUs2QFA2GP4Y+J8cpUYfj6pbKKzeLwyG9qBwF1NJpN8m+q9q7V9P2LY+9Lp9e1mGsGeqt5HMEA3P6vIpcqLJLqE/4PBLLRzfccTcmqb1m71+erxTRhHBRkGS+I7dZEb3olQfnS1Y1tpMBxiwYwR3LW4oXuJwj8="); config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); @@ -103,7 +105,7 @@ public class PayClientFactoryImplIntegrationTest { // 创建配置 AlipayPayClientConfig config = new AlipayPayClientConfig(); config.setAppId("2021000118634035"); - config.setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX); + config.setServerUrl(SERVER_URL_SANDBOX); config.setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT); config.setPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJv890x84qbppUtRIfhaKSwSVN0thCcsDCaAsGR5MZslDkO8NCT9V4r2SVXjyY7eJUZlZd1M0C8T01Tg4UOx5LUbic0O3A1uJMy6V1n9IyYwbAW3AEZhBd5bSbPgrqvmv3NeWSTQT6Anxnllf+2iDH6zyA2fPl7cYyQtbZoDJQFGqr4F+cGh2R6akzRKNoBkAeMYwoY6es2lX8sJxCVPWUmxNUoL3tScwlSpd7Bxw0q9c/X01jMwuQ0+Va358zgFiGERTE6yD01eu40OBDXOYO3z++y+TAYHlQQ2toMO63trepo88X3xV3R44/1DH+k2pAm2IF5ixiLrAgMBAAECggEAPx3SoXcseaD7rmcGcE0p4SMfbsUDdkUSmBBbtfF0GzwnqNLkWa+mgE0rWt9SmXngTQH97vByAYmLPl1s3G82ht1V7Sk7yQMe74lhFllr8eEyTjeVx3dTK1EEM4TwN+936DTXdFsr4TELJEcJJdD0KaxcCcfBLRDs2wnitEFZ9N+GoZybVmY8w0e0MI7PLObUZ2l0X4RurQnfG9ZxjXjC7PkeMVv7cGGylpNFi3BbvkRhdhLPDC2E6wqnr9e7zk+hiENivAezXrtxtwKovzCtnWJ1r0IO14Rh47H509Ic0wFnj+o5YyUL4LdmpL7yaaH6fM7zcSLFjNZPHvZCKPwYcQKBgQDQFho98QvnL8ex4v6cry4VitGpjSXm1qP3vmMQk4rTsn8iPWtcxPjqGEqOQJjdi4Mi0VZKQOLFwlH0kl95wNrD/isJ4O1yeYfX7YAXApzHqYNINzM79HemO3Yx1qLMW3okRFJ9pPRzbQ9qkTpsaegsmyX316zOBhzGRYjKbutTYwKBgQCm7phr9XdFW5Vh+XR90mVs483nrLmMiDKg7YKxSLJ8amiDjzPejCn7i95Hah08P+2MIZLIPbh2VLacczR6ltRRzN5bg5etFuqSgfkuHyxpoDmpjbe08+Q2h8JBYqcC5Nhv1AKU4iOUhVLHo/FBAQliMcGc/J3eiYTFC7EsNx382QKBgClb20doe7cttgFTXswBvaUmfFm45kmla924B7SpvrQpDD/f+VDtDZRp05fGmxuduSjYdtA3aVtpLiTwWu22OUUvZZqHDGruYOO4Hvdz23mL5b4ayqImCwoNU4bAZIc9v18p/UNf3/55NNE3oGcf/bev9rH2OjCQ4nM+Ktwhg8CFAoGACSgvbkShzUkv0ZcIf9ppu+ZnJh1AdGgINvGwaJ8vQ0nm/8h8NOoFZ4oNoGc+wU5Ubops7dUM6FjPR5e+OjdJ4E7Xp7d5O4J1TaIZlCEbo5OpdhaTDDcQvrkFu+Z4eN0qzj+YAKjDAOOrXc4tbr5q0FsgXscwtcNfaBuzFVTUrUkCgYEAwzPnMNhWG3zOWLUs2QFA2GP4Y+J8cpUYfj6pbKKzeLwyG9qBwF1NJpN8m+q9q7V9P2LY+9Lp9e1mGsGeqt5HMEA3P6vIpcqLJLqE/4PBLLRzfccTcmqb1m71+erxTRhHBRkGS+I7dZEb3olQfnS1Y1tpMBxiwYwR3LW4oXuJwj8="); config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB"); diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayQrPayClientTest.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayQrPayClientTest.java index 78939aa83..45cabc7fd 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayQrPayClientTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/test/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayQrPayClientTest.java @@ -22,9 +22,11 @@ import static org.mockito.Mockito.when; public class AlipayQrPayClientTest extends BaseMockitoUnitTest { + private static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do"; + private final AlipayPayClientConfig config = new AlipayPayClientConfig() .setAppId("2021000118634035") - .setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX) + .setServerUrl(SERVER_URL_SANDBOX) .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT) // TODO @tina:key 可以随机就好,简洁一点哈。 .setPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJ" + diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java index cec28f868..7ec9c69e3 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/util/TenantUtils.java @@ -82,9 +82,9 @@ public class TenantUtils { * 将多租户编号,添加到 header 中 * * @param headers HTTP 请求 headers + * @param tenantId 租户编号 */ - public static void addTenantHeader(Map headers) { - Long tenantId = TenantContextHolder.getTenantId(); + public static void addTenantHeader(Map headers, Long tenantId) { if (tenantId != null) { headers.put(HEADER_TENANT_ID, tenantId.toString()); } diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java index 7f114e5b1..779803059 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java @@ -102,6 +102,10 @@ public class RandomUtils { return randomString() + "@qq.com"; } + public static String randomURL() { + return "https://www.iocoder.cn/" + randomString(); + } + @SafeVarargs public static T randomPojo(Class clazz, Consumer... consumers) { T pojo = PODAM_FACTORY.manufacturePojo(clazz); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java index c3016514a..ce139f286 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/aftersale/TradeAfterSaleConvert.java @@ -38,7 +38,7 @@ public interface TradeAfterSaleConvert { @Mappings({ @Mapping(source = "afterSale.applyReason", target = "reason"), - @Mapping(source = "afterSale.refundPrice", target = "amount") + @Mapping(source = "afterSale.refundPrice", target = "price") }) PayRefundCreateReqDTO convert(String userIp, TradeAfterSaleDO afterSale, TradeOrderProperties orderProperties); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 30a01cdab..052a3d7d7 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -106,7 +106,7 @@ public interface TradeOrderConvert { createReqDTO.setSubject(subject); createReqDTO.setBody(subject); // TODO 芋艿:临时写死 // 订单相关字段 - createReqDTO.setAmount(order.getPayPrice()).setExpireTime(addTime(orderProperties.getExpireTime())); + createReqDTO.setPrice(order.getPayPrice()).setExpireTime(addTime(orderProperties.getExpireTime())); return createReqDTO; } @@ -238,7 +238,7 @@ public interface TradeOrderConvert { AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems); orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime())); if (StrUtil.isNotEmpty(order.getPayChannelCode())) { - orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode())); + orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE, order.getPayChannelCode())); } // 处理商品属性 Map propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java index 0dc2b6e5c..8ef76ac43 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java @@ -320,7 +320,7 @@ public class TradeOrderServiceImpl implements TradeOrderService { throw exception(ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS); } // 校验支付金额一致 - if (ObjectUtil.notEqual(payOrder.getAmount(), order.getPayPrice())) { + if (ObjectUtil.notEqual(payOrder.getPrice(), order.getPayPrice())) { log.error("[validateOrderPaid][order({}) payOrder({}) 支付金额不匹配,请进行处理!order 数据是:{},payOrder 数据是:{}]", id, payOrderId, JsonUtils.toJsonString(order), JsonUtils.toJsonString(payOrder)); throw exception(ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java index 9401f4caf..5507f4307 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java @@ -144,7 +144,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { assertNotNull(createReqDTO.getMerchantOrderId()); // 由于 tradeOrderId 后生成,只能校验非空 assertEquals(createReqDTO.getSubject(), "商品 1 等多件"); assertNull(createReqDTO.getBody()); - assertEquals(createReqDTO.getAmount(), 80); + assertEquals(createReqDTO.getPrice(), 80); assertNotNull(createReqDTO.getExpireTime()); return true; }))).thenReturn(1000L); @@ -257,7 +257,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { // mock 方法(支付单) when(payOrderApi.getOrder(eq(10L))).thenReturn(randomPojo(PayOrderRespDTO.class, o -> o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()).setChannelCode("wx_pub") - .setMerchantOrderId("1")).setAmount(100)); + .setMerchantOrderId("1")).setPrice(100)); // 调用 tradeOrderService.updateOrderPaid(id, payOrderId); diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java index eb95ed657..821548323 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderCreateReqDTO.java @@ -42,7 +42,6 @@ public class PayOrderCreateReqDTO implements Serializable { /** * 商品描述 */ -// @NotEmpty(message = "商品描述信息不能为空") @Length(max = 128, message = "商品描述信息长度不能超过128") private String body; @@ -53,7 +52,7 @@ public class PayOrderCreateReqDTO implements Serializable { */ @NotNull(message = "支付金额不能为空") @DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零") - private Integer amount; + private Integer price; /** * 支付过期时间 diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderRespDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderRespDTO.java index 1a053f68e..dbc62a643 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderRespDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/order/dto/PayOrderRespDTO.java @@ -35,7 +35,7 @@ public class PayOrderRespDTO { /** * 支付金额,单位:分 */ - private Integer amount; + private Integer price; /** * 支付状态 * diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundCreateReqDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundCreateReqDTO.java index 0b7747f28..b8c8c9c20 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundCreateReqDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundCreateReqDTO.java @@ -48,5 +48,5 @@ public class PayRefundCreateReqDTO { */ @NotNull(message = "退款金额不能为空") @Min(value = 1, message = "退款金额必须大于零") - private Integer amount; + private Integer price; } diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundRespDTO.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundRespDTO.java index 1c521d380..c98eaa4f6 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundRespDTO.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/api/refund/dto/PayRefundRespDTO.java @@ -30,7 +30,7 @@ public class PayRefundRespDTO { /** * 退款金额,单位:分 */ - private Integer refundAmount; + private Integer refundPrice; // ========== 商户相关字段 ========== /** diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java index 717ce09eb..cfe92bbac 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java @@ -7,7 +7,7 @@ package cn.iocoder.yudao.module.pay.enums; */ public interface DictTypeConstants { - String CHANNEL_CODE_TYPE = "pay_channel_code_type"; // 支付-渠道名 + String CHANNEL_CODE = "pay_channel_code"; // 支付-渠道名 String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态 String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态 diff --git a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java index a53b82a8e..0353afff5 100644 --- a/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java +++ b/yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java @@ -12,7 +12,8 @@ public interface ErrorCodeConstants { // ========== APP 模块 1007000000 ========== ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1007000000, "App 不存在"); ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1007000002, "App 已经被禁用"); - ErrorCode PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE = new ErrorCode(1007000003, "支付应用存在交易中的订单,无法删除"); + ErrorCode PAY_APP_EXIST_ORDER_CANT_DELETE = new ErrorCode(1007000003, "支付应用存在支付订单,无法删除"); + ErrorCode PAY_APP_EXIST_REFUND_CANT_DELETE = new ErrorCode(1007000004, "支付应用存在退款订单,无法删除"); // ========== CHANNEL 模块 1007001000 ========== ErrorCode PAY_CHANNEL_NOT_FOUND = new ErrorCode(1007001000, "支付渠道的配置不存在"); @@ -25,22 +26,19 @@ public interface ErrorCodeConstants { ErrorCode PAY_ORDER_NOT_FOUND = new ErrorCode(1007002000, "支付订单不存在"); ErrorCode PAY_ORDER_STATUS_IS_NOT_WAITING = new ErrorCode(1007002001, "支付订单不处于待支付"); ErrorCode PAY_ORDER_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007002002, "支付订单不处于已支付"); + ErrorCode PAY_ORDER_IS_EXPIRED = new ErrorCode(1007002003, "支付订单已经过期"); // ========== ORDER 模块(拓展单) 1007003000 ========== ErrorCode PAY_ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1007003000, "支付交易拓展单不存在"); ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(1007003001, "支付交易拓展单不处于待支付"); // ========== 支付模块(退款) 1007006000 ========== - ErrorCode PAY_REFUND_AMOUNT_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额"); + ErrorCode PAY_PRICE_PRICE_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额"); ErrorCode PAY_REFUND_ALL_REFUNDED = new ErrorCode(1007006001, "订单已经全额退款"); ErrorCode PAY_REFUND_CHN_ORDER_NO_IS_NULL = new ErrorCode(1007006002, "该订单的渠道订单为空"); ErrorCode PAY_REFUND_SUCCEED = new ErrorCode(1007006003, "已经退款成功"); ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(1007006004, "支付退款单不存在"); - // ========== 支付商户信息 1007004000 ========== - ErrorCode PAY_MERCHANT_NOT_EXISTS = new ErrorCode(1007004000, "支付商户信息不存在"); - ErrorCode PAY_MERCHANT_EXIST_APP_CANT_DELETE = new ErrorCode(1007004001, "支付商户存在支付应用,无法删除"); - // ========== 示例订单 1007900000 ========== ErrorCode PAY_DEMO_ORDER_NOT_FOUND = new ErrorCode(1007900000, "示例订单不存在"); ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007900001, "示例订单更新支付状态失败,订单不是【未支付】状态"); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/PayAppController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/PayAppController.java index dda11bc96..562b2e4d4 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/PayAppController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/PayAppController.java @@ -24,6 +24,7 @@ import javax.validation.Valid; import java.util.*; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; @Slf4j @Tag(name = "管理后台 - 支付应用信息") @@ -78,15 +79,6 @@ public class PayAppController { return success(PayAppConvert.INSTANCE.convert(app)); } - @GetMapping("/list") - @Operation(summary = "获得支付应用信息列表") - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") - @PreAuthorize("@ss.hasPermission('pay:app:query')") - public CommonResult> getAppList(@RequestParam("ids") Collection ids) { - List list = appService.getAppList(ids); - return success(PayAppConvert.INSTANCE.convertList(list)); - } - @GetMapping("/page") @Operation(summary = "获得支付应用信息分页") @PreAuthorize("@ss.hasPermission('pay:app:query')") @@ -94,34 +86,15 @@ public class PayAppController { // 得到应用分页列表 PageResult pageResult = appService.getAppPage(pageVO); if (CollUtil.isEmpty(pageResult.getList())) { - return success(new PageResult<>(pageResult.getTotal())); + return success(PageResult.empty()); } // 得到所有的应用编号,查出所有的渠道 - Collection payAppIds = CollectionUtils.convertList(pageResult.getList(), PayAppDO::getId); - List channels = channelService.getChannelListByAppIds(payAppIds); - // TODO @aquan:可以基于 appId 简历一个 multiMap。这样下面,直接 get 到之后,CollUtil buildSet 即可 - Iterator iterator = channels.iterator(); + Collection appIds = convertList(pageResult.getList(), PayAppDO::getId); + List channels = channelService.getChannelListByAppIds(appIds); - // 利用反射将渠道数据复制到返回的数据结构中去 - List appList = new ArrayList<>(pageResult.getList().size()); - pageResult.getList().forEach(app -> { - // 写入应用信息的数据 - PayAppPageItemRespVO respVO = PayAppConvert.INSTANCE.pageConvert(app); - // 写入支付渠道信息的数据 - Set channelCodes = new HashSet<>(PayChannelEnum.values().length); - while (iterator.hasNext()) { - PayChannelDO channelDO = iterator.next(); - if (channelDO.getAppId().equals(app.getId())) { - channelCodes.add(channelDO.getCode()); - iterator.remove(); - } - } - respVO.setChannelCodes(channelCodes); - appList.add(respVO); - }); - - return success(new PageResult<>(appList, pageResult.getTotal())); + // 拼接后返回 + return success(PayAppConvert.INSTANCE.convertPage(pageResult, channels)); } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java index c6a4570b3..bf366119c 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java @@ -1,6 +1,10 @@ package cn.iocoder.yudao.module.pay.controller.admin.app.vo; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import org.hibernate.validator.constraints.URL; + import javax.validation.constraints.*; /** @@ -10,23 +14,26 @@ import javax.validation.constraints.*; @Data public class PayAppBaseVO { - @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "小豆") @NotNull(message = "应用名不能为空") private String name; - @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") @NotNull(message = "开启状态不能为空") + @InEnum(CommonStatusEnum.class) private Integer status; - @Schema(description = "备注") + @Schema(description = "备注", example = "我是一个测试应用") private String remark; - @Schema(description = "支付结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "支付结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/pay-callback") @NotNull(message = "支付结果的回调地址不能为空") + @URL(message = "支付结果的回调地址必须为 URL 格式") private String payNotifyUrl; - @Schema(description = "退款结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "退款结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/refund-callback") @NotNull(message = "退款结果的回调地址不能为空") + @URL(message = "退款结果的回调地址必须为 URL 格式") private String refundNotifyUrl; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageItemRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageItemRespVO.java index 0610d63fb..76b62003c 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageItemRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageItemRespVO.java @@ -14,13 +14,13 @@ import java.util.Set; @ToString(callSuper = true) public class PayAppPageItemRespVO extends PayAppBaseVO { - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long id; @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; - @Schema(description = "渠道编码集合", requiredMode = Schema.RequiredMode.REQUIRED, example = "[alipay_pc, alipay_wap]") + @Schema(description = "已配置的支付渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "[alipay_pc, alipay_wap]") private Set channelCodes; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageReqVO.java index 5a4cd1ce8..94ade7ce6 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppPageReqVO.java @@ -17,21 +17,12 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class PayAppPageReqVO extends PageParam { - @Schema(description = "应用名") + @Schema(description = "应用名", example = "小豆") private String name; - @Schema(description = "开启状态") + @Schema(description = "开启状态", example = "0") private Integer status; - @Schema(description = "备注") - private String remark; - - @Schema(description = "支付结果的回调地址") - private String payNotifyUrl; - - @Schema(description = "退款结果的回调地址") - private String refundNotifyUrl; - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @Schema(description = "创建时间") private LocalDateTime[] createTime; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppRespVO.java index 87dadcbc7..9471a2f01 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppRespVO.java @@ -10,7 +10,7 @@ import java.time.LocalDateTime; @ToString(callSuper = true) public class PayAppRespVO extends PayAppBaseVO { - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long id; @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateReqVO.java index 2cc363b6e..5edf2290a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateReqVO.java @@ -9,7 +9,7 @@ import javax.validation.constraints.*; @ToString(callSuper = true) public class PayAppUpdateReqVO extends PayAppBaseVO { - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "应用编号不能为空") private Long id; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateStatusReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateStatusReqVO.java index 64b7ea444..9b8dad6e1 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateStatusReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppUpdateStatusReqVO.java @@ -9,11 +9,11 @@ import javax.validation.constraints.NotNull; @Data public class PayAppUpdateStatusReqVO { - @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") - @NotNull(message = "商户编号不能为空") + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @NotNull(message = "应用编号不能为空") private Long id; - @Schema(description = "状态,见 SysCommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @Schema(description = "状态,见 SysCommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "状态不能为空") private Integer status; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/PayChannelController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/PayChannelController.java index cec33bf1a..37927a799 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/PayChannelController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/PayChannelController.java @@ -1,9 +1,7 @@ package cn.iocoder.yudao.module.pay.controller.admin.channel; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelRespVO; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO; import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert; @@ -11,7 +9,6 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import cn.iocoder.yudao.module.pay.service.channel.PayChannelService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; @@ -59,39 +56,19 @@ public class PayChannelController { } @GetMapping("/get") - @Operation(summary = "获得支付渠道 ") + @Operation(summary = "获得支付渠道") @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('pay:channel:query')") - public CommonResult getChannel(@RequestParam("id") Long id) { - PayChannelDO channel = channelService.getChannel(id); - return success(PayChannelConvert.INSTANCE.convert(channel)); - } - - @GetMapping("/page") - @Operation(summary = "获得支付渠道分页") - @PreAuthorize("@ss.hasPermission('pay:channel:query')") - public CommonResult> getChannelPage(@Valid PayChannelPageReqVO pageVO) { - PageResult pageResult = channelService.getChannelPage(pageVO); - return success(PayChannelConvert.INSTANCE.convertPage(pageResult)); - } - - // TODO 芋艿:需要 review 下实现 - @GetMapping("/get-channel") - @Operation(summary = "根据条件查询微信支付渠道") - @Parameters({ - @Parameter(name = "appId", description = "应用编号", required = true, example = "1"), - @Parameter(name = "code", description = "支付渠道编码", required = true, example = "wx_pub") - }) - @PreAuthorize("@ss.hasPermission('pay:channel:query')") - public CommonResult getChannel(@RequestParam Long appId, @RequestParam String code) { - // 獲取渠道 - PayChannelDO channel = channelService.getChannelByConditions(appId, code); - if (channel == null) { - return success(new PayChannelRespVO()); + public CommonResult getChannel(@RequestParam(value = "id", required = false) Long id, + @RequestParam(value = "appId", required = false) Long appId, + @RequestParam(value = "code", required = false) String code) { + PayChannelDO channel = null; + if (id != null) { + channel = channelService.getChannel(id); + } else if (appId != null && code != null) { + channel = channelService.getChannelByAppIdAndCode(appId, code); } - // 拼凑数据 - PayChannelRespVO respVo = PayChannelConvert.INSTANCE.convert(channel); - return success(respVo); + return success(PayChannelConvert.INSTANCE.convert(channel)); } @GetMapping("/get-enable-code-list") diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelBaseVO.java index 48e98a3be..1416c9790 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelBaseVO.java @@ -1,4 +1,6 @@ package cn.iocoder.yudao.module.pay.controller.admin.channel.vo; +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.validation.InEnum; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; import javax.validation.constraints.*; @@ -10,22 +12,19 @@ import javax.validation.constraints.*; @Data public class PayChannelBaseVO { - @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "渠道编码不能为空") - private String code; - - @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "开启状态不能为空") + @InEnum(CommonStatusEnum.class) private Integer status; - @Schema(description = "备注") + @Schema(description = "备注", example = "我是小备注") private String remark; - @Schema(description = "渠道费率,单位:百分比", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "渠道费率,单位:百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") @NotNull(message = "渠道费率,单位:百分比不能为空") private Double feeRate; - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "应用编号不能为空") private Long appId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelCreateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelCreateReqVO.java index d43ebbd3c..08073827a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelCreateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelCreateReqVO.java @@ -6,6 +6,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; @Schema(description = "管理后台 - 支付渠道 创建 Request VO") @Data @@ -13,6 +14,10 @@ import javax.validation.constraints.NotBlank; @ToString(callSuper = true) public class PayChannelCreateReqVO extends PayChannelBaseVO { + @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "alipay_pc") + @NotNull(message = "渠道编码不能为空") + private String code; + @Schema(description = "渠道配置的 json 字符串") @NotBlank(message = "渠道配置不能为空") private String config; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelPageReqVO.java deleted file mode 100644 index 675730128..000000000 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelPageReqVO.java +++ /dev/null @@ -1,42 +0,0 @@ -package cn.iocoder.yudao.module.pay.controller.admin.channel.vo; - -import cn.iocoder.yudao.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; -import org.springframework.format.annotation.DateTimeFormat; - -import java.time.LocalDateTime; - -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - 支付渠道 分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class PayChannelPageReqVO extends PageParam { - - @Schema(description = "渠道编码") - private String code; - - @Schema(description = "开启状态") - private Integer status; - - @Schema(description = "备注") - private String remark; - - @Schema(description = "渠道费率,单位:百分比") - private Double feeRate; - - @Schema(description = "应用编号") - private Long appId; - - @Schema(description = "支付渠道配置") - private String config; - - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - @Schema(description = "创建时间") - private LocalDateTime[] createTime; - -} diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelRespVO.java index 0d63aa25f..dafd29ec9 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelRespVO.java @@ -10,12 +10,16 @@ import java.time.LocalDateTime; @ToString(callSuper = true) public class PayChannelRespVO extends PayChannelBaseVO { - @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Long id; - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private LocalDateTime createTime; + @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "alipay_pc") + private String code; + @Schema(description = "配置", requiredMode = Schema.RequiredMode.REQUIRED) private String config; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelUpdateReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelUpdateReqVO.java index 357151ea2..39bf83eb0 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelUpdateReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelUpdateReqVO.java @@ -16,4 +16,5 @@ public class PayChannelUpdateReqVO extends PayChannelBaseVO { @Schema(description = "渠道配置的json字符串") @NotBlank(message = "渠道配置不能为空") private String config; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/demo/vo/PayDemoOrderRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/demo/vo/PayDemoOrderRespVO.java index d825cd18a..3404844dc 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/demo/vo/PayDemoOrderRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/demo/vo/PayDemoOrderRespVO.java @@ -28,7 +28,7 @@ public class PayDemoOrderRespVO { private Integer price; @Schema(description = "是否已支付", requiredMode = Schema.RequiredMode.REQUIRED) - private Boolean payed; + private Boolean payStatus; @Schema(description = "支付订单编号", example = "16863") private Long payOrderId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java index 97db64a17..ebbc32bbf 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderBaseVO.java @@ -49,17 +49,13 @@ public class PayOrderBaseVO { @Schema(description = "支付金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "支付金额,单位:分不能为空") - private Long amount; - - @Schema(description = "支付金额,单位:分", required = true) - @NotNull(message = "支付金额,单位:分不能为空") private Long price; @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; @Schema(description = "渠道手续金额,单位:分") - private Long channelFeeAmount; + private Long channelFeePrice; @Schema(description = "支付状态", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "支付状态不能为空") @@ -95,7 +91,7 @@ public class PayOrderBaseVO { @Schema(description = "退款总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "退款总金额,单位:分不能为空") - private Long refundAmount; + private Long refundPrice; @Schema(description = "渠道用户编号") private String channelUserId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExcelVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExcelVO.java index 540e6beec..fc861a0df 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExcelVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExcelVO.java @@ -35,10 +35,10 @@ public class PayOrderExcelVO { private String no; @ExcelProperty("支付金额,单位:元") - private String amount; + private String price; @ExcelProperty("渠道手续金额,单位:元") - private String channelFeeAmount; + private String channelFeePrice; @ExcelProperty("渠道手续费,单位:百分比") private String channelFeeRate; @@ -80,7 +80,7 @@ public class PayOrderExcelVO { private Integer refundTimes; @ExcelProperty("退款总金额,单位:元") - private String refundAmount; + private String refundPrice; @ExcelProperty("商品描述") private String body; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java index b96f455ad..e589d588c 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderExportReqVO.java @@ -37,13 +37,13 @@ public class PayOrderExportReqVO { private Integer notifyStatus; @Schema(description = "支付金额,单位:分") - private Long amount; + private Long price; @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; @Schema(description = "渠道手续金额,单位:分") - private Long channelFeeAmount; + private Long channelFeePrice; @Schema(description = "支付状态") private Integer status; @@ -73,7 +73,7 @@ public class PayOrderExportReqVO { private Integer refundTimes; @Schema(description = "退款总金额,单位:分") - private Long refundAmount; + private Long refundPrice; @Schema(description = "渠道用户编号") private String channelUserId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java index 4705feaf9..290feaf20 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderPageReqVO.java @@ -42,13 +42,13 @@ public class PayOrderPageReqVO extends PageParam { private Integer notifyStatus; @Schema(description = "支付金额,单位:分") - private Long amount; + private Long price; @Schema(description = "渠道手续费,单位:百分比") private Double channelFeeRate; @Schema(description = "渠道手续金额,单位:分") - private Long channelFeeAmount; + private Long channelFeePrice; @Schema(description = "支付状态") private Integer status; @@ -78,7 +78,7 @@ public class PayOrderPageReqVO extends PageParam { private Integer refundTimes; @Schema(description = "退款总金额,单位:分") - private Long refundAmount; + private Long refundPrice; @Schema(description = "渠道用户编号") private String channelUserId; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitRespVO.java index 8122b9667..8dcd9df2f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitRespVO.java @@ -1,19 +1,17 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; @Schema(description = "管理后台 - 支付订单提交 Response VO") @Data public class PayOrderSubmitRespVO { + @Schema(description = "支付状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") // 参见 PayOrderStatusEnum 枚举 + private Integer status; + @Schema(description = "展示模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "url") // 参见 PayDisplayModeEnum 枚举 private String displayMode; - @Schema(description = "展示内容", requiredMode = Schema.RequiredMode.REQUIRED) private String displayContent; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExcelVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExcelVO.java index 5e412147b..67fef0393 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExcelVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExcelVO.java @@ -53,10 +53,10 @@ public class PayRefundExcelVO { private Integer type; @ExcelProperty("支付金额,单位:元") - private String payAmount; + private String payPrice; @ExcelProperty("退款金额,单位:元") - private String refundAmount; + private String refundPrice; @ExcelProperty("退款原因") private String reason; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java index 02ef801b2..215b51fab 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundExportReqVO.java @@ -46,10 +46,10 @@ public class PayRefundExportReqVO { private Integer type; @Schema(description = "支付金额,单位分") - private Long payAmount; + private Long payPrice; @Schema(description = "退款金额,单位分") - private Long refundAmount; + private Long refundPrice; @Schema(description = "退款原因") private String reason; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java index a7acc4db7..795786439 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/refund/vo/PayRefundPageReqVO.java @@ -51,10 +51,10 @@ public class PayRefundPageReqVO extends PageParam { private Integer type; @Schema(description = "支付金额,单位分") - private Long payAmount; + private Long payPrice; @Schema(description = "退款金额,单位分") - private Long refundAmount; + private Long refundPrice; @Schema(description = "退款原因") private String reason; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http index 8b4008455..14ce54ef9 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http @@ -19,7 +19,7 @@ tenant-id: {{appTenentId}} "id": 202, "channelCode": "wx_bar", "channelExtras": { - "authCode": "132990241553789274" + "authCode": "134042110834344848" } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/app/PayAppConvert.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/app/PayAppConvert.java index ef0be7e3d..4853d07f7 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/app/PayAppConvert.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/app/PayAppConvert.java @@ -1,15 +1,20 @@ package cn.iocoder.yudao.module.pay.convert.app; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppCreateReqVO; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageItemRespVO; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppRespVO; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppUpdateReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; +import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; /** * 支付应用信息 Convert @@ -31,6 +36,14 @@ public interface PayAppConvert { List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); + + default PageResult convertPage(PageResult pageResult, List channels) { + PageResult voPageResult = convertPage(pageResult); + // 处理 channel 关系 + Map> appIdChannelMap = CollectionUtils.convertMultiMap2(channels, PayChannelDO::getAppId, PayChannelDO::getCode); + voPageResult.getList().forEach(app -> app.setChannelCodes(appIdChannelMap.get(app.getId()))); + return voPageResult; + } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/order/PayOrderConvert.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/order/PayOrderConvert.java index 29d050c19..ad45cd905 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/order/PayOrderConvert.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/order/PayOrderConvert.java @@ -27,7 +27,6 @@ public interface PayOrderConvert { PayOrderConvert INSTANCE = Mappers.getMapper(PayOrderConvert.class); - @Mapping(source = "amount", target = "price") PayOrderRespVO convert(PayOrderDO bean); PayOrderRespDTO convert2(PayOrderDO order); @@ -40,8 +39,6 @@ public interface PayOrderConvert { PageResult convertPage(PageResult page); - List convertList02(List list); - /** * 订单 DO 转自定义分页对象 * @@ -76,14 +73,14 @@ public interface PayOrderConvert { BigDecimal multiple = new BigDecimal(100); - payOrderExcelVO.setAmount(BigDecimal.valueOf(bean.getAmount()) + payOrderExcelVO.setPrice(BigDecimal.valueOf(bean.getPrice()) .divide(multiple, 2, RoundingMode.HALF_UP).toString()); - payOrderExcelVO.setChannelFeeAmount(BigDecimal.valueOf(bean.getChannelFeeAmount()) + payOrderExcelVO.setChannelFeePrice(BigDecimal.valueOf(bean.getChannelFeePrice()) .divide(multiple, 2, RoundingMode.HALF_UP).toString()); payOrderExcelVO.setChannelFeeRate(java.math.BigDecimal.valueOf(bean.getChannelFeeRate()) .multiply(multiple).toString()); - payOrderExcelVO.setRefundAmount(BigDecimal.valueOf(bean.getRefundAmount()) + payOrderExcelVO.setRefundPrice(BigDecimal.valueOf(bean.getRefundPrice()) .divide(multiple, 2, RoundingMode.HALF_UP).toString()); return payOrderExcelVO; @@ -96,7 +93,7 @@ public interface PayOrderConvert { PayOrderUnifiedReqDTO convert2(PayOrderSubmitReqVO reqVO, String userIp); - PayOrderSubmitRespVO convert(PayOrderUnifiedRespDTO bean); + PayOrderSubmitRespVO convert(PayOrderDO order, PayOrderUnifiedRespDTO unifiedRespDTO); AppPayOrderSubmitRespVO convert3(PayOrderSubmitRespVO bean); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/refund/PayRefundConvert.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/refund/PayRefundConvert.java index f270d3282..738c177cd 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/refund/PayRefundConvert.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/refund/PayRefundConvert.java @@ -77,9 +77,9 @@ public interface PayRefundConvert { payRefundExcelVO.setCreateTime(bean.getCreateTime()); BigDecimal multiple = new BigDecimal(100); - payRefundExcelVO.setPayAmount(BigDecimal.valueOf(bean.getPayAmount()) + payRefundExcelVO.setPayPrice(BigDecimal.valueOf(bean.getPayPrice()) .divide(multiple, 2, RoundingMode.HALF_UP).toString()); - payRefundExcelVO.setRefundAmount(BigDecimal.valueOf(bean.getRefundAmount()) + payRefundExcelVO.setRefundPrice(BigDecimal.valueOf(bean.getRefundPrice()) .divide(multiple, 2, RoundingMode.HALF_UP).toString()); return payRefundExcelVO; @@ -87,7 +87,7 @@ public interface PayRefundConvert { //TODO 太多需要处理了, 暂时不用 @Mappings(value = { - @Mapping(source = "amount", target = "payAmount"), + @Mapping(source = "price", target = "payPrice"), @Mapping(source = "id", target = "orderId"), @Mapping(target = "status",ignore = true) }) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/demo/PayDemoOrderDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/demo/PayDemoOrderDO.java index 578223319..a22f7c1b8 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/demo/PayDemoOrderDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/demo/PayDemoOrderDO.java @@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; import java.time.LocalDateTime; -import java.util.Date; /** * 示例订单 @@ -53,7 +52,7 @@ public class PayDemoOrderDO extends BaseDO { /** * 是否支付 */ - private Boolean payed; + private Boolean payStatus; /** * 支付订单编号 * diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletTransactionDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletTransactionDO.java index 456ced9f0..82ede2915 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletTransactionDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletTransactionDO.java @@ -67,7 +67,7 @@ public class MemberWalletTransactionDO extends BaseDO { /** * 交易金额, 单位分 */ - private Integer amount; + private Integer price; /** * 余额, 单位分 @@ -83,4 +83,4 @@ public class MemberWalletTransactionDO extends BaseDO { * 交易时间 */ private LocalDateTime transactionTime; -} \ No newline at end of file +} diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/notify/PayNotifyTaskDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/notify/PayNotifyTaskDO.java index d3d79c5f5..6bc60dc3a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/notify/PayNotifyTaskDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/notify/PayNotifyTaskDO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.pay.dal.dataobject.notify; -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; @@ -25,7 +25,7 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) -public class PayNotifyTaskDO extends BaseDO { +public class PayNotifyTaskDO extends TenantBaseDO { /** * 通知频率,单位为秒。 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java index e44062f99..c0be2b401 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/order/PayOrderDO.java @@ -76,17 +76,13 @@ public class PayOrderDO extends BaseDO { * 枚举 {@link PayOrderNotifyStatusEnum} */ private Integer notifyStatus; -// /** -// * 商户拓展参数 -// */ -// private Map merchantExtras; // ========== 订单相关字段 ========== /** * 支付金额,单位:分 */ - private Integer amount; + private Integer price; /** * 渠道手续费,单位:百分比 * @@ -96,7 +92,7 @@ public class PayOrderDO extends BaseDO { /** * 渠道手续金额,单位:分 */ - private Long channelFeeAmount; + private Long channelFeePrice; /** * 支付状态 * @@ -140,7 +136,7 @@ public class PayOrderDO extends BaseDO { /** * 退款总金额,单位:分 */ - private Long refundAmount; + private Long refundPrice; // ========== 渠道相关字段 ========== /** diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/refund/PayRefundDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/refund/PayRefundDO.java index 098778cd8..8330f0075 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/refund/PayRefundDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/refund/PayRefundDO.java @@ -124,11 +124,11 @@ public class PayRefundDO extends BaseDO { /** * 支付金额,单位:分 */ - private Integer payAmount; + private Integer payPrice; /** * 退款金额,单位:分 */ - private Integer refundAmount; + private Integer refundPrice; /** * 退款原因 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/app/PayAppMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/app/PayAppMapper.java index 6ac163a9e..c31dba551 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/app/PayAppMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/app/PayAppMapper.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.pay.dal.mysql.app; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; @@ -11,14 +12,11 @@ import org.apache.ibatis.annotations.Mapper; public interface PayAppMapper extends BaseMapperX { default PageResult selectPage(PayAppPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .likeIfPresent("name", reqVO.getName()) - .eqIfPresent("status", reqVO.getStatus()) - .eqIfPresent("remark", reqVO.getRemark()) - .eqIfPresent("pay_notify_url", reqVO.getPayNotifyUrl()) - .eqIfPresent("refund_notify_url", reqVO.getRefundNotifyUrl()) - .betweenIfPresent("create_time", reqVO.getCreateTime()) - .orderByDesc("id")); + return selectPage(reqVO, new LambdaQueryWrapperX() + .likeIfPresent(PayAppDO::getName, reqVO.getName()) + .eqIfPresent(PayAppDO::getStatus, reqVO.getStatus()) + .betweenIfPresent(PayAppDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(PayAppDO::getId)); } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/channel/PayChannelMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/channel/PayChannelMapper.java index 2f7fd86fd..acc28eeb6 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/channel/PayChannelMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/channel/PayChannelMapper.java @@ -1,14 +1,13 @@ package cn.iocoder.yudao.module.pay.dal.mysql.channel; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; +import java.time.LocalDateTime; import java.util.Collection; import java.util.List; @@ -19,41 +18,8 @@ public interface PayChannelMapper extends BaseMapperX { return selectOne(PayChannelDO::getAppId, appId, PayChannelDO::getCode, code); } - default PageResult selectPage(PayChannelPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() - .eqIfPresent("code", reqVO.getCode()) - .eqIfPresent("status", reqVO.getStatus()) - .eqIfPresent("remark", reqVO.getRemark()) - .eqIfPresent("fee_rate", reqVO.getFeeRate()) - .eqIfPresent("app_id", reqVO.getAppId()) - .betweenIfPresent("create_time", reqVO.getCreateTime()) - .orderByDesc("id")); - } - - /** - * 根据条件获取渠道 - * - * @param appId 应用编号 - * @param code 渠道编码 - * @return 数量 - */ - default PayChannelDO selectOne(Long appId, String code) { - return this.selectOne((new QueryWrapper().lambda() - .eq(PayChannelDO::getAppId, appId) - .eq(PayChannelDO::getCode, code) - )); - } - - // TODO @aquan:select 命名 - /** - * 根据支付应用ID集合获得支付渠道列表 - * - * @param appIds 应用编号集合 - * @return 支付渠道列表 - */ - default List getChannelListByAppIds(Collection appIds){ - return this.selectList(new QueryWrapper().lambda() - .in(PayChannelDO::getAppId, appIds)); + default List selectListByAppIds(Collection appIds){ + return selectList(PayChannelDO::getAppId, appIds); } default List selectListByAppId(Long appId, Integer status) { @@ -62,4 +28,7 @@ public interface PayChannelMapper extends BaseMapperX { .eq(PayChannelDO::getStatus, status)); } + @Select("SELECT COUNT(*) FROM pay_channel WHERE update_time > #{maxUpdateTime}") + Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime); + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/demo/PayDemoOrderMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/demo/PayDemoOrderMapper.java index bfc355029..0a92c6b76 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/demo/PayDemoOrderMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/demo/PayDemoOrderMapper.java @@ -22,7 +22,7 @@ public interface PayDemoOrderMapper extends BaseMapperX { default int updateByIdAndPayed(Long id, boolean wherePayed, PayDemoOrderDO updateObj) { return update(updateObj, new LambdaQueryWrapperX() - .eq(PayDemoOrderDO::getId, id).eq(PayDemoOrderDO::getPayed, wherePayed)); + .eq(PayDemoOrderDO::getId, id).eq(PayDemoOrderDO::getPayStatus, wherePayed)); } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java index 5d90f41f9..49c7d2fbf 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/order/PayOrderMapper.java @@ -50,17 +50,8 @@ public interface PayOrderMapper extends BaseMapperX { .in(PayOrderDO::getId, idList)); } - /** - * 查询符合的订单数量 - * - * @param appId 应用编号 - * @param status 订单状态 - * @return 条数 - */ - default Long selectCount(Long appId, Integer status) { - return selectCount(new LambdaQueryWrapper() - .eq(PayOrderDO::getAppId, appId) - .in(PayOrderDO::getStatus, status)); + default Long selectCountByAppId(Long appId) { + return selectCount(PayOrderDO::getAppId, appId); } default PayOrderDO selectByAppIdAndMerchantOrderId(Long appId, String merchantOrderId) { diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/refund/PayRefundMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/refund/PayRefundMapper.java index 7614c8f8e..35a6bd5a7 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/refund/PayRefundMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/refund/PayRefundMapper.java @@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -38,11 +37,8 @@ public interface PayRefundMapper extends BaseMapperX { .orderByDesc("id")); } - default Long selectCount(Long appId, Integer status) { - - return selectCount(new LambdaQueryWrapper() - .eq(PayRefundDO::getAppId, appId) - .eq(PayRefundDO::getStatus, status)); + default Long selectCountByApp(Long appId) { + return selectCount(PayRefundDO::getAppId, appId); } default PayRefundDO selectByReqNo(String reqNo) { @@ -52,4 +48,5 @@ public interface PayRefundMapper extends BaseMapperX { default PayRefundDO selectByTradeNoAndMerchantRefundNo(String tradeNo, String merchantRefundNo){ return selectOne("trade_no", tradeNo, "merchant_refund_no", merchantRefundNo); } + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/job/package-info.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/job/package-info.java index c45bf497f..845a73547 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/job/package-info.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/job/package-info.java @@ -1 +1,4 @@ +/** + * 占位,无特殊含义 + */ package cn.iocoder.yudao.module.pay.job; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppService.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppService.java index 14dce0a18..7105b78a8 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppService.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppService.java @@ -35,6 +35,14 @@ public interface PayAppService { */ void updateApp(@Valid PayAppUpdateReqVO updateReqVO); + /** + * 修改应用信息状态 + * + * @param id 应用编号 + * @param status 状态 + */ + void updateAppStatus(Long id, Integer status); + /** * 删除支付应用信息 * @@ -66,14 +74,6 @@ public interface PayAppService { */ PageResult getAppPage(PayAppPageReqVO pageReqVO); - /** - * 修改应用信息状态 - * - * @param id 应用编号 - * @param status 状态{@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum} - */ - void updateAppStatus(Long id, Integer status); - /** * 获得指定编号的商户 Map * @@ -85,7 +85,6 @@ public interface PayAppService { return CollectionUtils.convertMap(list, PayAppDO::getId); } - /** * 支付应用的合法性 * diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceImpl.java index 5f70fb5fe..48e9c3c97 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceImpl.java @@ -9,12 +9,13 @@ import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppUpdateReqVO; import cn.iocoder.yudao.module.pay.convert.app.PayAppConvert; import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; import cn.iocoder.yudao.module.pay.dal.mysql.app.PayAppMapper; -import cn.iocoder.yudao.module.pay.dal.mysql.order.PayOrderMapper; import cn.iocoder.yudao.module.pay.dal.mysql.refund.PayRefundMapper; import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; -import com.google.common.annotations.VisibleForTesting; +import cn.iocoder.yudao.module.pay.service.order.PayOrderService; +import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -23,11 +24,10 @@ import java.util.Collection; import java.util.List; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE; -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_NOT_FOUND; +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.*; /** - * 支付应用信息 Service 实现类 + * 支付应用 Service 实现类 * * @author aquan */ @@ -37,11 +37,13 @@ public class PayAppServiceImpl implements PayAppService { @Resource private PayAppMapper appMapper; - // TODO 芋艿:不能调用对方的 mapper + @Resource - private PayOrderMapper orderMapper; + @Lazy // 延迟加载,避免循环依赖报错 + private PayOrderService orderService; @Resource - private PayRefundMapper refundMapper; + @Lazy // 延迟加载,避免循环依赖报错 + private PayRefundService refundService; @Override public Long createApp(PayAppCreateReqVO createReqVO) { @@ -55,17 +57,31 @@ public class PayAppServiceImpl implements PayAppService { @Override public void updateApp(PayAppUpdateReqVO updateReqVO) { // 校验存在 - this.validateAppExists(updateReqVO.getId()); + validateAppExists(updateReqVO.getId()); // 更新 PayAppDO updateObj = PayAppConvert.INSTANCE.convert(updateReqVO); appMapper.updateById(updateObj); } + @Override + public void updateAppStatus(Long id, Integer status) { + // 校验商户存在 + validateAppExists(id); + // 更新状态 + appMapper.updateById(new PayAppDO().setId(id).setStatus(status)); + } + @Override public void deleteApp(Long id) { // 校验存在 - this.validateAppExists(id); - this.validateOrderTransactionExist(id); + validateAppExists(id); + // 校验关联数据是否存在 + if (orderService.getOrderCountByAppId(id) > 0) { + throw exception(PAY_APP_EXIST_ORDER_CANT_DELETE); + } + if (refundService.getRefundCountByAppId(id) > 0) { + throw exception(PAY_APP_EXIST_REFUND_CANT_DELETE); + } // 删除 appMapper.deleteById(id); @@ -92,59 +108,16 @@ public class PayAppServiceImpl implements PayAppService { return appMapper.selectPage(pageReqVO); } - @Override - public void updateAppStatus(Long id, Integer status) { - // 校验商户存在 - this.checkAppExists(id); - // 更新状态 - PayAppDO app = new PayAppDO(); - app.setId(id); - app.setStatus(status); - appMapper.updateById(app); - } - - /** - * 检查商户是否存在 - * - * @param id 商户编号 - */ - @VisibleForTesting - public void checkAppExists(Long id) { - if (id == null) { - return; - } - PayAppDO payApp = appMapper.selectById(id); - if (payApp == null) { - throw exception(PAY_APP_NOT_FOUND); - } - } - - /** - * 验证是否存在交易中或者退款中等处理中状态的订单 - * - * @param appId 应用 ID - */ - private void validateOrderTransactionExist(Long appId) { - // 查看交易订单 - if (orderMapper.selectCount(appId, PayOrderStatusEnum.WAITING.getStatus()) > 0) { - throw exception(PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE); - } - // 查看退款订单 - if (refundMapper.selectCount(appId, PayRefundStatusEnum.CREATE.getStatus()) > 0) { - throw exception(PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE); - } - } - @Override public PayAppDO validPayApp(Long id) { PayAppDO app = appMapper.selectById(id); // 校验是否存在 if (app == null) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_APP_NOT_FOUND); + throw exception(ErrorCodeConstants.PAY_APP_NOT_FOUND); } // 校验是否禁用 if (CommonStatusEnum.DISABLE.getStatus().equals(app.getStatus())) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_APP_IS_DISABLE); + throw exception(ErrorCodeConstants.PAY_APP_IS_DISABLE); } return app; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelService.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelService.java index 3c634b8a9..1ec50e989 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelService.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelService.java @@ -1,9 +1,7 @@ package cn.iocoder.yudao.module.pay.service.channel; import cn.iocoder.yudao.framework.common.exception.ServiceException; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; @@ -18,11 +16,6 @@ import java.util.List; */ public interface PayChannelService { - /** - * 初始化支付客户端 - */ - void initLocalCache(); - /** * 创建支付渠道 * @@ -54,15 +47,7 @@ public interface PayChannelService { PayChannelDO getChannel(Long id); /** - * 获得支付渠道分页 - * - * @param pageReqVO 分页查询 - * @return 支付渠道分页 - */ - PageResult getChannelPage(PayChannelPageReqVO pageReqVO); - - /** - * 根据支付应用ID集合获得支付渠道列表 + * 根据支付应用 ID 集合,获得支付渠道列表 * * @param appIds 应用编号集合 * @return 支付渠道列表 @@ -72,11 +57,11 @@ public interface PayChannelService { /** * 根据条件获取渠道 * - * @param appid 应用编号 + * @param appId 应用编号 * @param code 渠道编码 * @return 数量 */ - PayChannelDO getChannelByConditions(Long appid, String code); + PayChannelDO getChannelByAppIdAndCode(Long appId, String code); /** * 支付渠道的合法性 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java index de3d51ba7..69adddc4d 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java @@ -1,30 +1,35 @@ package cn.iocoder.yudao.module.pay.service.channel; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; -import cn.hutool.json.JSONUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO; import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert; import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper; import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants; +import lombok.Getter; +import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.PostConstruct; import javax.annotation.Resource; import javax.validation.Validator; +import java.time.LocalDateTime; import java.util.Collection; import java.util.List; +import java.util.concurrent.TimeUnit; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_EXIST_SAME_CHANNEL_ERROR; @@ -40,6 +45,10 @@ import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_NOT_E @Validated public class PayChannelServiceImpl implements PayChannelService { + @Getter // 为了方便测试,这里提供 getter 方法 + @Setter + private volatile List channelCache; + @Resource private PayClientFactory payClientFactory; @@ -52,7 +61,6 @@ public class PayChannelServiceImpl implements PayChannelService { /** * 初始化 {@link #payClientFactory} 缓存 */ - @Override @PostConstruct public void initLocalCache() { // 注意:忽略自动多租户,因为要全局初始化缓存 @@ -64,49 +72,101 @@ public class PayChannelServiceImpl implements PayChannelService { // 第二步:构建缓存:创建或更新支付 Client channels.forEach(payChannel -> payClientFactory.createOrUpdatePayClient(payChannel.getId(), payChannel.getCode(), payChannel.getConfig())); + this.channelCache = channels; }); } + /** + * 通过定时任务轮询,刷新缓存 + * + * 目的:多节点部署时,通过轮询”通知“所有节点,进行刷新 + */ + @Scheduled(initialDelay = 60, fixedRate = 60, timeUnit = TimeUnit.SECONDS) + public void refreshLocalCache() { + // 情况一:如果缓存里没有数据,则直接刷新缓存 + if (CollUtil.isEmpty(channelCache)) { + initLocalCache(); + return; + } + + // 情况二,如果缓存里数据,则通过 updateTime 判断是否有数据变更,有变更则刷新缓存 + LocalDateTime maxTime = CollectionUtils.getMaxValue(channelCache, PayChannelDO::getUpdateTime); + if (channelMapper.selectCountByUpdateTimeGt(maxTime) > 0) { + initLocalCache(); + } + } + @Override public Long createChannel(PayChannelCreateReqVO reqVO) { // 断言是否有重复的 - PayChannelDO channelDO = this.getChannelByConditions(reqVO.getAppId(), reqVO.getCode()); - if (ObjectUtil.isNotNull(channelDO)) { + PayChannelDO dbChannel = getChannelByAppIdAndCode(reqVO.getAppId(), reqVO.getCode()); + if (dbChannel != null) { throw exception(CHANNEL_EXIST_SAME_CHANNEL_ERROR); } // 新增渠道 - PayChannelDO channel = PayChannelConvert.INSTANCE.convert(reqVO); - settingConfigAndCheckParam(channel, reqVO.getConfig()); + PayChannelDO channel = PayChannelConvert.INSTANCE.convert(reqVO) + .setConfig(parseConfig(reqVO.getCode(), reqVO.getConfig())); channelMapper.insert(channel); - // TODO 芋艿:缺少刷新本地缓存的机制 + + // 刷新缓存 + refreshLocalCache(); return channel.getId(); } @Override public void updateChannel(PayChannelUpdateReqVO updateReqVO) { // 校验存在 - this.validateChannelExists(updateReqVO.getId()); + PayChannelDO dbChannel = validateChannelExists(updateReqVO.getId()); + // 更新 - PayChannelDO channel = PayChannelConvert.INSTANCE.convert(updateReqVO); - settingConfigAndCheckParam(channel, updateReqVO.getConfig()); + PayChannelDO channel = PayChannelConvert.INSTANCE.convert(updateReqVO) + .setConfig(parseConfig(dbChannel.getCode(), updateReqVO.getConfig())); channelMapper.updateById(channel); - // TODO 芋艿:缺少刷新本地缓存的机制 + + // 刷新缓存 + refreshLocalCache(); + } + + /** + * 解析并校验配置 + * + * @param code 渠道编码 + * @param configStr 配置 + * @return 支付配置 + */ + private PayClientConfig parseConfig(String code, String configStr) { + // 解析配置 + Class payClass = PayChannelEnum.getByCode(code).getConfigClass(); + if (ObjectUtil.isNull(payClass)) { + throw exception(CHANNEL_NOT_EXISTS); + } + PayClientConfig config = JsonUtils.parseObject2(configStr, payClass); + Assert.notNull(config); + + // 验证参数 + config.validate(validator); + return config; } @Override public void deleteChannel(Long id) { // 校验存在 - this.validateChannelExists(id); + validateChannelExists(id); + // 删除 channelMapper.deleteById(id); - // TODO 芋艿:缺少刷新本地缓存的机制 + + // 刷新缓存 + refreshLocalCache(); } - private void validateChannelExists(Long id) { - if (channelMapper.selectById(id) == null) { + private PayChannelDO validateChannelExists(Long id) { + PayChannelDO channel = channelMapper.selectById(id); + if (channel == null) { throw exception(CHANNEL_NOT_EXISTS); } + return channel; } @Override @@ -114,45 +174,20 @@ public class PayChannelServiceImpl implements PayChannelService { return channelMapper.selectById(id); } - @Override - public PageResult getChannelPage(PayChannelPageReqVO pageReqVO) { - return channelMapper.selectPage(pageReqVO); - } - @Override public List getChannelListByAppIds(Collection appIds) { - return channelMapper.getChannelListByAppIds(appIds); + return channelMapper.selectListByAppIds(appIds); } @Override - public PayChannelDO getChannelByConditions(Long appid, String code) { - return this.channelMapper.selectOne(appid, code); - } - - /** - * 设置渠道配置以及参数校验 - * - * @param channel 渠道 - * @param configStr 配置 - */ - private void settingConfigAndCheckParam(PayChannelDO channel, String configStr) { - // 得到这个渠道是微信的还是支付宝的 - Class payClass = PayChannelEnum.getByCode(channel.getCode()).getConfigClass(); - if (ObjectUtil.isNull(payClass)) { - throw exception(CHANNEL_NOT_EXISTS); - } - // TODO @芋艿:不要使用 hutool 的 json 工具,用项目的 - PayClientConfig config = JSONUtil.toBean(configStr, payClass); - - // 验证参数 - config.validate(validator); - channel.setConfig(config); + public PayChannelDO getChannelByAppIdAndCode(Long appId, String code) { + return channelMapper.selectByAppIdAndCode(appId, code); } @Override public PayChannelDO validPayChannel(Long id) { PayChannelDO channel = channelMapper.selectById(id); - this.validPayChannel(channel); + validPayChannel(channel); return channel; } @@ -163,18 +198,18 @@ public class PayChannelServiceImpl implements PayChannelService { return channel; } + private void validPayChannel(PayChannelDO channel) { + if (channel == null) { + throw exception(ErrorCodeConstants.PAY_CHANNEL_NOT_FOUND); + } + if (CommonStatusEnum.DISABLE.getStatus().equals(channel.getStatus())) { + throw exception(ErrorCodeConstants.PAY_CHANNEL_IS_DISABLE); + } + } + @Override public List getEnableChannelList(Long appId) { return channelMapper.selectListByAppId(appId, CommonStatusEnum.ENABLE.getStatus()); } - private void validPayChannel(PayChannelDO channel) { - if (channel == null) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_CHANNEL_NOT_FOUND); - } - if (CommonStatusEnum.DISABLE.getStatus().equals(channel.getStatus())) { - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_CHANNEL_IS_DISABLE); - } - } - } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java index 17bfbf002..71968f19b 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java @@ -1,10 +1,8 @@ package cn.iocoder.yudao.module.pay.service.demo; import cn.hutool.core.lang.Assert; -import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.pay.api.order.PayOrderApi; import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderRespDTO; @@ -85,14 +83,14 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { // 1.2 插入 demo 订单 PayDemoOrderDO demoOrder = new PayDemoOrderDO().setUserId(userId) .setSpuId(createReqVO.getSpuId()).setSpuName(spuName) - .setPrice(price).setPayed(false).setRefundPrice(0); + .setPrice(price).setPayStatus(false).setRefundPrice(0); payDemoOrderMapper.insert(demoOrder); // 2.1 创建支付单 Long payOrderId = payOrderApi.createOrder(new PayOrderCreateReqDTO() .setAppId(PAY_APP_ID).setUserIp(getClientIP()) // 支付应用 .setMerchantOrderId(demoOrder.getId().toString()) // 业务的订单编号 - .setSubject(spuName).setBody("").setAmount(price) // 价格信息 + .setSubject(spuName).setBody("").setPrice(price) // 价格信息 .setExpireTime(addTime(Duration.ofHours(2L)))); // 支付的过期时间 // 2.2 更新支付单到 demo 订单 payDemoOrderMapper.updateById(new PayDemoOrderDO().setId(demoOrder.getId()) @@ -101,12 +99,6 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { return demoOrder.getId(); } -// private void validateDemoOrderExists(Long id) { -// if (demoOrderMapper.selectById(id) == null) { -// throw exception(DEMO_ORDER_NOT_EXISTS); -// } -// } - @Override public PayDemoOrderDO getDemoOrder(Long id) { return payDemoOrderMapper.selectById(id); @@ -124,7 +116,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { // 更新 PayDemoOrderDO 状态为已支付 int updateCount = payDemoOrderMapper.updateByIdAndPayed(id, false, - new PayDemoOrderDO().setPayed(true).setPayTime(LocalDateTime.now()) + new PayDemoOrderDO().setPayStatus(true).setPayTime(LocalDateTime.now()) .setPayChannelCode(payOrder.getChannelCode())); if (updateCount == 0) { throw exception(PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID); @@ -148,7 +140,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { throw exception(PAY_DEMO_ORDER_NOT_FOUND); } // 1.2 校验订单未支付 - if (order.getPayed()) { + if (order.getPayStatus()) { log.error("[validateDemoOrderCanPaid][order({}) 不处于待支付状态,请进行处理!order 数据是:{}]", id, toJsonString(order)); throw exception(PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID); @@ -173,7 +165,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { throw exception(PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS); } // 2.3 校验支付金额一致 - if (notEqual(payOrder.getAmount(), order.getPrice())) { + if (notEqual(payOrder.getPrice(), order.getPrice())) { log.error("[validateDemoOrderCanPaid][order({}) payOrder({}) 支付金额不匹配,请进行处理!order 数据是:{},payOrder 数据是:{}]", id, payOrderId, toJsonString(order), toJsonString(payOrder)); throw exception(PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH); @@ -196,7 +188,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { Long payRefundId = payRefundApi.createPayRefund(new PayRefundCreateReqDTO() .setAppId(PAY_APP_ID).setUserIp(getClientIP()) // 支付应用 .setPayOrderId(order.getPayOrderId()) // 支付单号 - .setReason("想退钱").setAmount(order.getPrice()));// 价格信息 + .setReason("想退钱").setPrice(order.getPrice()));// 价格信息 // 2.2 更新退款单到 demo 订单 payDemoOrderMapper.updateById(new PayDemoOrderDO().setId(id) .setPayRefundId(payRefundId).setRefundPrice(order.getPrice())); @@ -209,7 +201,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { throw exception(PAY_DEMO_ORDER_NOT_FOUND); } // 校验订单是否支付 - if (!order.getPayed()) { + if (!order.getPayStatus()) { throw exception(PAY_DEMO_ORDER_REFUND_FAIL_NOT_PAID); } // 校验订单是否已退款 @@ -251,7 +243,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService { throw exception(PAY_DEMO_ORDER_REFUND_FAIL_REFUND_NOT_SUCCESS); } // 2.3 校验退款金额一致 - if (notEqual(payRefund.getRefundAmount(), order.getPrice())) { + if (notEqual(payRefund.getRefundPrice(), order.getPrice())) { log.error("[validateDemoOrderCanRefunded][order({}) payRefund({}) 退款金额不匹配,请进行处理!order 数据是:{},payRefund 数据是:{}]", id, payRefundId, toJsonString(order), toJsonString(payRefund)); throw exception(PAY_DEMO_ORDER_REFUND_FAIL_REFUND_PRICE_NOT_MATCH); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java index 43179b716..f38c3c0d7 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/notify/PayNotifyServiceImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.pay.service.notify; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.exceptions.ExceptionUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -24,10 +25,11 @@ import cn.iocoder.yudao.module.pay.service.order.PayOrderService; import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; -import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.transaction.support.TransactionSynchronization; +import org.springframework.transaction.support.TransactionSynchronizationManager; import javax.annotation.Resource; import javax.validation.Valid; @@ -41,7 +43,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.addTime; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.afterNow; import static cn.iocoder.yudao.module.pay.framework.job.config.PayJobConfiguration.NOTIFY_THREAD_POOL_TASK_EXECUTOR; /** @@ -86,6 +87,7 @@ public class PayNotifyServiceImpl implements PayNotifyService { private PayNotifyServiceImpl self; @Override + @Transactional(rollbackFor = Exception.class) public void createPayNotifyTask(PayNotifyTaskCreateReqDTO reqDTO) { PayNotifyTaskDO task = new PayNotifyTaskDO(); task.setType(reqDTO.getType()).setDataId(reqDTO.getDataId()); @@ -105,8 +107,13 @@ public class PayNotifyServiceImpl implements PayNotifyService { // 执行插入 payNotifyTaskMapper.insert(task); - // 异步直接发起任务。虽然会有定时任务扫描,但是会导致延迟 - self.executeNotifyAsync(task); + // 必须在事务提交后,在发起任务,否则 PayNotifyTaskDO 还没入库,就提前回调接入的业务 + TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { + @Override + public void afterCommit() { + executeNotify(task); + } + }); } @Override @@ -121,7 +128,7 @@ public class PayNotifyServiceImpl implements PayNotifyService { CountDownLatch latch = new CountDownLatch(tasks.size()); tasks.forEach(task -> threadPoolTaskExecutor.execute(() -> { try { - executeNotifySync(task); + executeNotify(task); } finally { latch.countDown(); } @@ -150,40 +157,31 @@ public class PayNotifyServiceImpl implements PayNotifyService { log.error("[awaitExecuteNotify][任务未处理完,总任务数({}) 剩余任务数({})]", size, latch.getCount()); } - /** - * 异步执行单个支付通知 - * - * @param task 通知任务 - */ - @Async - public void executeNotifyAsync(PayNotifyTaskDO task) { - self.executeNotifySync(task); // 使用 self,避免事务不发起 - } - /** * 同步执行单个支付通知 * * @param task 通知任务 */ - public void executeNotifySync(PayNotifyTaskDO task) { + public void executeNotify(PayNotifyTaskDO task) { // 分布式锁,避免并发问题 payNotifyLockCoreRedisDAO.lock(task.getId(), NOTIFY_TIMEOUT_MILLIS, () -> { // 校验,当前任务是否已经被通知过 // 虽然已经通过分布式加锁,但是可能同时满足通知的条件,然后都去获得锁。此时,第一个执行完后,第二个还是能拿到锁,然后会再执行一次。 + // 因此,此处我们通过第 notifyTimes 通知次数是否匹配来判断 PayNotifyTaskDO dbTask = payNotifyTaskMapper.selectById(task.getId()); - if (afterNow(dbTask.getNextNotifyTime())) { - log.info("[executeNotifySync][dbTask({}) 任务被忽略,原因是未到达下次通知时间,可能是因为并发执行了]", - JsonUtils.toJsonString(dbTask)); + if (ObjectUtil.notEqual(task.getNotifyTimes(), dbTask.getNotifyTimes())) { + log.warn("[executeNotifySync][task({}) 任务被忽略,原因是它的通知不是第 ({}) 次,可能是因为并发执行了]", + JsonUtils.toJsonString(task), dbTask.getNotifyTimes()); return; } // 执行通知 - self.executeNotify(dbTask); + self.executeNotify0(dbTask); }); } @Transactional - public void executeNotify(PayNotifyTaskDO task) { + public void executeNotify0(PayNotifyTaskDO task) { // 发起回调 CommonResult invokeResult = null; Throwable invokeException = null; @@ -223,7 +221,7 @@ public class PayNotifyServiceImpl implements PayNotifyService { } // 拼接 header 参数 Map headers = new HashMap<>(); - TenantUtils.addTenantHeader(headers); + TenantUtils.addTenantHeader(headers, task.getTenantId()); // 发起请求 try (HttpResponse response = HttpUtil.createPost(task.getNotifyUrl()) diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java index d6ba9b7ad..890bacd62 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java @@ -32,6 +32,14 @@ public interface PayOrderService { */ PayOrderDO getOrder(Long id); + /** + * 获得指定应用的订单数量 + * + * @param appId 应用编号 + * @return 订单数量 + */ + Long getOrderCountByAppId(Long appId); + /** * 获得支付订单 * 分页 diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java index ff3313ff0..d27c52212 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.pay.service.order; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Pair; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.framework.pay.config.PayProperties; import cn.iocoder.yudao.framework.pay.core.client.PayClient; import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; @@ -28,6 +30,7 @@ import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.pay.enums.notify.PayNotifyTypeEnum; import cn.iocoder.yudao.module.pay.enums.order.PayOrderNotifyStatusEnum; import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; +import cn.iocoder.yudao.module.pay.enums.refund.PayRefundTypeEnum; import cn.iocoder.yudao.module.pay.service.app.PayAppService; import cn.iocoder.yudao.module.pay.service.channel.PayChannelService; import cn.iocoder.yudao.module.pay.service.notify.PayNotifyService; @@ -41,6 +44,7 @@ import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.Collection; import java.util.List; +import java.util.Objects; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; @@ -78,6 +82,11 @@ public class PayOrderServiceImpl implements PayOrderService { return orderMapper.selectById(id); } + @Override + public Long getOrderCountByAppId(Long appId) { + return orderMapper.selectCountByAppId(appId); + } + @Override public PageResult getOrderPage(PayOrderPageReqVO pageReqVO) { return orderMapper.selectPage(pageReqVO); @@ -109,22 +118,19 @@ public class PayOrderServiceImpl implements PayOrderService { } // 创建支付交易单 - order = PayOrderConvert.INSTANCE.convert(reqDTO).setAppId(app.getId()); - // 商户相关字段 - order.setNotifyUrl(app.getPayNotifyUrl()) - .setNotifyStatus(PayOrderNotifyStatusEnum.NO.getStatus()); - // 订单相关字段 - order.setStatus(PayOrderStatusEnum.WAITING.getStatus()); - // 退款相关字段 - // todo @芋艿 创建支付的订单的退款状态枚举是不是有问题,应该是 PayRefundTypeEnum 吧 您这填写的是 PayOrderNotifyStatusEnum 回调状态枚举 - order.setRefundStatus(PayOrderNotifyStatusEnum.NO.getStatus()) - .setRefundTimes(0).setRefundAmount(0L); + order = PayOrderConvert.INSTANCE.convert(reqDTO).setAppId(app.getId()) + // 商户相关字段 + .setNotifyUrl(app.getPayNotifyUrl()).setNotifyStatus(PayOrderNotifyStatusEnum.NO.getStatus()) + // 订单相关字段 + .setStatus(PayOrderStatusEnum.WAITING.getStatus()) + // 退款相关字段 + .setRefundStatus(PayRefundTypeEnum.NO.getStatus()).setRefundTimes(0).setRefundPrice(0L); orderMapper.insert(order); - // 最终返回 return order.getId(); } @Override + @Transactional(rollbackFor = Exception.class) public PayOrderSubmitRespVO submitPayOrder(PayOrderSubmitReqVO reqVO, String userIp) { // 1. 获得 PayOrderDO ,并校验其是否存在 PayOrderDO order = validatePayOrderCanSubmit(reqVO.getId()); @@ -147,12 +153,18 @@ public class PayOrderServiceImpl implements PayOrderService { .setNotifyUrl(genChannelPayNotifyUrl(channel)) .setReturnUrl(reqVO.getReturnUrl()) // 订单相关字段 - .setAmount(order.getAmount()).setExpireTime(order.getExpireTime()); + .setAmount(order.getPrice()).setExpireTime(order.getExpireTime()); PayOrderUnifiedRespDTO unifiedOrderRespDTO = client.unifiedOrder(unifiedOrderReqDTO); - // TODO 轮询三方接口,是否已经支付的任务 + // 4. 如果调用直接支付成功,则直接更新支付单状态为成功。例如说:付款码支付,免密支付时,就直接验证支付成功 + if (unifiedOrderRespDTO.getNotify() != null) { + notifyPayOrderSuccess(channel, unifiedOrderRespDTO.getNotify(), null); + // 此处需要读取最新的状态 + order = orderMapper.selectById(order.getId()); + } + // 返回成功 - return PayOrderConvert.INSTANCE.convert(unifiedOrderRespDTO); + return PayOrderConvert.INSTANCE.convert(order, unifiedOrderRespDTO); } private PayOrderDO validatePayOrderCanSubmit(Long id) { @@ -163,6 +175,9 @@ public class PayOrderServiceImpl implements PayOrderService { if (!PayOrderStatusEnum.WAITING.getStatus().equals(order.getStatus())) { // 校验状态,必须是待支付 throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING); } + if (LocalDateTimeUtils.beforeNow(order.getExpireTime())) { // 校验是否过期 + throw exception(ErrorCodeConstants.PAY_ORDER_IS_EXPIRED); + } return order; } @@ -214,17 +229,22 @@ public class PayOrderServiceImpl implements PayOrderService { public void notifyPayOrder(Long channelId, PayOrderNotifyRespDTO notify, PayNotifyReqDTO rawNotify) { // 校验支付渠道是否有效 PayChannelDO channel = channelService.validPayChannel(channelId); - TenantUtils.execute(channel.getTenantId(), () -> { - // 1. 更新 PayOrderExtensionDO 支付成功 - PayOrderExtensionDO orderExtension = updatePayOrderExtensionSuccess(notify.getOrderExtensionNo(), - rawNotify); - // 2. 更新 PayOrderDO 支付成功 - PayOrderDO order = updatePayOrderSuccess(channel, orderExtension, notify); + // 更新支付订单为已支付 + TenantUtils.execute(channel.getTenantId(), () -> notifyPayOrderSuccess(channel, notify, rawNotify)); + } - // 3. 插入支付通知记录 - notifyService.createPayNotifyTask(PayNotifyTaskCreateReqDTO.builder() - .type(PayNotifyTypeEnum.ORDER.getType()).dataId(order.getId()).build()); - }); + private void notifyPayOrderSuccess(PayChannelDO channel, PayOrderNotifyRespDTO notify, PayNotifyReqDTO rawNotify) { + // 1. 更新 PayOrderExtensionDO 支付成功 + PayOrderExtensionDO orderExtension = updatePayOrderExtensionSuccess(notify.getOrderExtensionNo(), rawNotify); + // 2. 更新 PayOrderDO 支付成功 + Pair order = updatePayOrderSuccess(channel, orderExtension, notify); + if (order.getKey()) { // 如果之前已经成功回调,则直接返回,不用重复记录支付通知记录;例如说:支付平台重复回调 + return; + } + + // 3. 插入支付通知记录 + notifyService.createPayNotifyTask(PayNotifyTaskCreateReqDTO.builder() + .type(PayNotifyTypeEnum.ORDER.getType()).dataId(order.getValue().getId()).build()); } /** @@ -235,15 +255,20 @@ public class PayOrderServiceImpl implements PayOrderService { * @return PayOrderExtensionDO 对象 */ private PayOrderExtensionDO updatePayOrderExtensionSuccess(String no, PayNotifyReqDTO rawNotify) { - // 1.1 查询 PayOrderExtensionDO + // 1. 查询 PayOrderExtensionDO PayOrderExtensionDO orderExtension = orderExtensionMapper.selectByNo(no); if (orderExtension == null) { throw exception(ErrorCodeConstants.PAY_ORDER_EXTENSION_NOT_FOUND); } + if (PayOrderStatusEnum.isSuccess(orderExtension.getStatus())) { // 如果已经是成功,直接返回,不用重复更新 + log.info("[updatePayOrderSuccess][支付拓展单({}) 已经是已支付,无需更新为已支付]", orderExtension.getId()); + return orderExtension; + } if (ObjectUtil.notEqual(orderExtension.getStatus(), PayOrderStatusEnum.WAITING.getStatus())) { // 校验状态,必须是待支付 throw exception(ErrorCodeConstants.PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING); } - // 1.2 更新 PayOrderExtensionDO + + // 2. 更新 PayOrderExtensionDO int updateCounts = orderExtensionMapper.updateByIdAndStatus(orderExtension.getId(), PayOrderStatusEnum.WAITING.getStatus(), PayOrderExtensionDO.builder().id(orderExtension.getId()) .status(PayOrderStatusEnum.SUCCESS.getStatus()) @@ -261,19 +286,26 @@ public class PayOrderServiceImpl implements PayOrderService { * @param channel 支付渠道 * @param orderExtension 支付拓展单 * @param notify 通知回调 - * @return PayOrderDO 对象 + * @return key:是否之前已经成功回调 + * value:PayOrderDO 对象 */ - private PayOrderDO updatePayOrderSuccess(PayChannelDO channel, PayOrderExtensionDO orderExtension, - PayOrderNotifyRespDTO notify) { - // 2.1 判断 PayOrderDO 是否处于待支付 + private Pair updatePayOrderSuccess(PayChannelDO channel, PayOrderExtensionDO orderExtension, + PayOrderNotifyRespDTO notify) { + // 1. 判断 PayOrderDO 是否处于待支付 PayOrderDO order = orderMapper.selectById(orderExtension.getOrderId()); if (order == null) { throw exception(ErrorCodeConstants.PAY_ORDER_NOT_FOUND); } + if (PayOrderStatusEnum.isSuccess(order.getStatus()) // 如果已经是成功,直接返回,不用重复更新 + && Objects.equals(order.getSuccessExtensionId(), orderExtension.getId())) { + log.info("[updatePayOrderSuccess][支付订单({}) 已经是已支付,无需更新为已支付]", order.getId()); + return Pair.of(true, order); + } if (!PayOrderStatusEnum.WAITING.getStatus().equals(order.getStatus())) { // 校验状态,必须是待支付 throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING); } - // 2.2 更新 PayOrderDO + + // 2. 更新 PayOrderDO int updateCounts = orderMapper.updateByIdAndStatus(order.getId(), PayOrderStatusEnum.WAITING.getStatus(), PayOrderDO.builder().status(PayOrderStatusEnum.SUCCESS.getStatus()) .channelId(channel.getId()).channelCode(channel.getCode()) @@ -284,7 +316,7 @@ public class PayOrderServiceImpl implements PayOrderService { throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING); } log.info("[updatePayOrderSuccess][支付订单({}) 更新为已支付]", order.getId()); - return order; + return Pair.of(false, order); } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundService.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundService.java index 9f1c9bfd9..14f525582 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundService.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundService.java @@ -25,6 +25,14 @@ public interface PayRefundService { */ PayRefundDO getRefund(Long id); + /** + * 获得指定应用的退款数量 + * + * @param appId 应用编号 + * @return 退款数量 + */ + Long getRefundCountByAppId(Long appId); + /** * 获得退款订单分页 * diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java index 9d113b84d..a5f815bdd 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java @@ -80,6 +80,11 @@ public class PayRefundServiceImpl implements PayRefundService { return refundMapper.selectById(id); } + @Override + public Long getRefundCountByAppId(Long appId) { + return refundMapper.selectCountByApp(appId); + } + @Override public PageResult getRefundPage(PayRefundPageReqVO pageReqVO) { return refundMapper.selectPage(pageReqVO); @@ -117,7 +122,7 @@ public class PayRefundServiceImpl implements PayRefundService { validatePayRefund(reqDTO, order); // 退款类型 PayRefundTypeEnum refundType = PayRefundTypeEnum.SOME; - if (Objects.equals(reqDTO.getAmount(), order.getAmount())) { + if (Objects.equals(reqDTO.getPrice(), order.getPrice())) { refundType = PayRefundTypeEnum.ALL; } PayOrderExtensionDO orderExtensionDO = orderExtensionService.getOrderExtension(order.getSuccessExtensionId()); @@ -144,8 +149,8 @@ public class PayRefundServiceImpl implements PayRefundService { .orderId(order.getId()) .merchantRefundNo(merchantRefundId) // TODO 芋艿:需要优化 .notifyUrl(app.getRefundNotifyUrl()) - .payAmount(order.getAmount()) - .refundAmount(reqDTO.getAmount()) + .payPrice(order.getPrice()) + .refundPrice(reqDTO.getPrice()) .userIp(reqDTO.getUserIp()) .merchantOrderId(order.getMerchantOrderId()) .tradeNo(orderExtensionDO.getNo()) @@ -159,7 +164,7 @@ public class PayRefundServiceImpl implements PayRefundService { // TODO @jason:搞到 convert 里。一些额外的自动,手动 set 下; PayRefundUnifiedReqDTO unifiedReqDTO = new PayRefundUnifiedReqDTO(); unifiedReqDTO.setUserIp(reqDTO.getUserIp()) - .setAmount(reqDTO.getAmount()) + .setAmount(reqDTO.getPrice()) .setChannelOrderNo(order.getChannelOrderNo()) .setPayTradeNo(orderExtensionDO.getNo()) .setMerchantRefundId(merchantRefundId) // TODO 芋艿:需要优化 @@ -209,17 +214,17 @@ public class PayRefundServiceImpl implements PayRefundService { // 得到已退金额 PayOrderDO payOrderDO = orderService.getOrder(refundDO.getOrderId()); - Long refundedAmount = payOrderDO.getRefundAmount(); + Long refundedAmount = payOrderDO.getRefundPrice(); PayOrderStatusEnum orderStatus = PayOrderStatusEnum.SUCCESS; - if(Objects.equals(payOrderDO.getAmount(), refundedAmount+ refundDO.getRefundAmount())){ + if(Objects.equals(payOrderDO.getPrice(), refundedAmount+ refundDO.getRefundPrice())){ //支付金额 = 已退金额 + 本次退款金额。 orderStatus = PayOrderStatusEnum.CLOSED; } // 更新支付订单 PayOrderDO updateOrderDO = new PayOrderDO(); updateOrderDO.setId(refundDO.getOrderId()) - .setRefundAmount(refundedAmount + refundDO.getRefundAmount()) + .setRefundPrice(refundedAmount + refundDO.getRefundPrice()) .setStatus(orderStatus.getStatus()) .setRefundTimes(payOrderDO.getRefundTimes() + 1) .setRefundStatus(refundDO.getType()); @@ -257,8 +262,8 @@ public class PayRefundServiceImpl implements PayRefundService { throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_REFUND_ALL_REFUNDED); } // 校验金额 退款金额不能大于 原定的金额 - if (reqDTO.getAmount() + order.getRefundAmount() > order.getAmount()){ - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_REFUND_AMOUNT_EXCEED); + if (reqDTO.getPrice() + order.getRefundPrice() > order.getPrice()){ + throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_PRICE_PRICE_EXCEED); } // 校验渠道订单号 if (StrUtil.isEmpty(order.getChannelOrderNo())) { diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test-integration/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceIntegrationTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test-integration/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceIntegrationTest.java index 983bd16b5..55a37ad1a 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test-integration/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceIntegrationTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test-integration/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceIntegrationTest.java @@ -30,7 +30,7 @@ public class PayOrderServiceIntegrationTest extends BaseDbIntegrationTest { reqDTO.setMerchantOrderId(String.valueOf(System.currentTimeMillis())); reqDTO.setSubject("标题"); reqDTO.setBody("内容"); - reqDTO.setAmount(100); + reqDTO.setPrice(100); reqDTO.setExpireTime(DateUtils.addTime(Duration.ofDays(1))); // 发起请求 payOrderService.createPayOrder(reqDTO); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java index 3fad0745b..81536aba3 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/app/PayAppServiceTest.java @@ -3,27 +3,42 @@ package cn.iocoder.yudao.module.pay.service.app; import cn.hutool.core.util.RandomUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppCreateReqVO; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageReqVO; import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppUpdateReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO; import cn.iocoder.yudao.module.pay.dal.mysql.app.PayAppMapper; +import cn.iocoder.yudao.module.pay.service.order.PayOrderService; +import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; import org.junit.jupiter.api.Test; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; import java.time.LocalDateTime; +import java.util.Collections; +import java.util.Map; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_NOT_FOUND; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.*; +import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; +/** + * {@link PayAppServiceImpl} 的单元测试 + * + * @author aquan + */ @Import(PayAppServiceImpl.class) public class PayAppServiceTest extends BaseDbUnitTest { @@ -33,17 +48,23 @@ public class PayAppServiceTest extends BaseDbUnitTest { @Resource private PayAppMapper appMapper; + @MockBean + private PayOrderService orderService; + @MockBean + private PayRefundService refundService; + @Test public void testCreateApp_success() { // 准备参数 PayAppCreateReqVO reqVO = randomPojo(PayAppCreateReqVO.class, o -> - o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus()))); + o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus())) + .setPayNotifyUrl(randomURL()) + .setRefundNotifyUrl(randomURL())); // 调用 Long appId = appService.createApp(reqVO); // 断言 assertNotNull(appId); - // 校验记录的属性是否正确 PayAppDO app = appMapper.selectById(appId); assertPojoEquals(reqVO, app); } @@ -51,12 +72,12 @@ public class PayAppServiceTest extends BaseDbUnitTest { @Test public void testUpdateApp_success() { // mock 数据 - PayAppDO dbApp = randomPojo(PayAppDO.class, o -> - o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + PayAppDO dbApp = randomPojo(PayAppDO.class); appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 // 准备参数 PayAppUpdateReqVO reqVO = randomPojo(PayAppUpdateReqVO.class, o -> { o.setStatus(CommonStatusEnum.ENABLE.getStatus()); + o.setPayNotifyUrl(randomURL()).setRefundNotifyUrl(randomURL()); o.setId(dbApp.getId()); // 设置更新的 ID }); @@ -77,10 +98,26 @@ public class PayAppServiceTest extends BaseDbUnitTest { } @Test - public void testDeleteApp_success() { + public void testUpdateAppStatus() { // mock 数据 PayAppDO dbApp = randomPojo(PayAppDO.class, o -> - o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus()))); + o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + + // 准备参数 + Long id = dbApp.getId(); + Integer status = CommonStatusEnum.ENABLE.getStatus(); + // 调用 + appService.updateAppStatus(id, status); + // 断言 + PayAppDO app = appMapper.selectById(id); // 获取最新的 + assertEquals(status, app.getStatus()); + } + + @Test + public void testDeleteApp_success() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class); appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 // 准备参数 Long id = dbApp.getId(); @@ -100,15 +137,71 @@ public class PayAppServiceTest extends BaseDbUnitTest { assertServiceException(() -> appService.deleteApp(id), PAY_APP_NOT_FOUND); } + @Test + public void testDeleteApp_existOrder() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp.getId(); + // mock 订单有订单 + when(orderService.getOrderCountByAppId(eq(id))).thenReturn(10L); + + // 调用, 并断言异常 + assertServiceException(() -> appService.deleteApp(id), PAY_APP_EXIST_ORDER_CANT_DELETE); + } + + @Test + public void testDeleteApp_existRefund() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp.getId(); + // mock 订单有订单 + when(refundService.getRefundCountByAppId(eq(id))).thenReturn(10L); + + // 调用, 并断言异常 + assertServiceException(() -> appService.deleteApp(id), PAY_APP_EXIST_REFUND_CANT_DELETE); + } + + @Test + public void testApp() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp.getId(); + + // 调用 + PayAppDO app = appService.getApp(id); + // 校验数据一致 + assertPojoEquals(app, dbApp); + } + + @Test + public void testAppMap() { + // mock 数据 + PayAppDO dbApp01 = randomPojo(PayAppDO.class); + appMapper.insert(dbApp01);// @Sql: 先插入出一条存在的数据 + PayAppDO dbApp02 = randomPojo(PayAppDO.class); + appMapper.insert(dbApp02);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp01.getId(); + + // 调用 + Map appMap = appService.getAppMap(singleton(id)); + // 校验数据一致 + assertEquals(1, appMap.size()); + assertPojoEquals(dbApp01, appMap.get(id)); + } + @Test public void testGetAppPage() { // mock 数据 PayAppDO dbApp = randomPojo(PayAppDO.class, o -> { // 等会查询到 o.setName("灿灿姐的杂货铺"); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setRemark("敏敏姐的小卖铺"); - o.setPayNotifyUrl("https://www.hc.com"); - o.setRefundNotifyUrl("https://www.xm.com"); o.setCreateTime(buildTime(2021,11,20)); }); @@ -117,22 +210,13 @@ public class PayAppServiceTest extends BaseDbUnitTest { appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺"))); // 测试 status 不匹配 appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); - // 测试 remark 不匹配 - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部"))); - // 测试 payNotifyUrl 不匹配 - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com"))); - // 测试 refundNotifyUrl 不匹配 - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com"))); // 测试 createTime 不匹配 appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21)))); // 准备参数 PayAppPageReqVO reqVO = new PayAppPageReqVO(); reqVO.setName("灿灿姐的杂货铺"); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setRemark("敏敏姐的小卖铺"); - reqVO.setPayNotifyUrl("https://www.hc.com"); - reqVO.setRefundNotifyUrl("https://www.xm.com"); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021,11,19),buildTime(2021,11,21)})); + reqVO.setCreateTime(buildBetweenTime(2021, 11, 19, 2021, 11, 21)); // 调用 PageResult pageResult = appService.getAppPage(reqVO); @@ -142,4 +226,37 @@ public class PayAppServiceTest extends BaseDbUnitTest { assertPojoEquals(dbApp, pageResult.getList().get(0)); } + @Test + public void testValidPayApp_success() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class, + o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp.getId(); + + // 调用 + PayAppDO app = appService.validPayApp(id); + // 校验数据一致 + assertPojoEquals(app, dbApp); + } + + @Test + public void testValidPayApp_notFound() { + assertServiceException(() -> appService.validPayApp(randomLongId()), PAY_APP_NOT_FOUND); + } + + @Test + public void testValidPayApp_disable() { + // mock 数据 + PayAppDO dbApp = randomPojo(PayAppDO.class, + o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())); + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long id = dbApp.getId(); + + // 调用,并断言异常 + assertServiceException(() -> appService.validPayApp(id), PAY_APP_IS_DISABLE); + } + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceTest.java index 614af37f5..0a5d33495 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceTest.java @@ -1,38 +1,40 @@ package cn.iocoder.yudao.module.pay.service.channel; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; -import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig; import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPayClientConfig; import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO; -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO; import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO; import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO; import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper; import com.alibaba.fastjson.JSON; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; import javax.validation.Validator; -import java.time.LocalDateTime; -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; +import java.util.Collections; +import java.util.List; + import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_EXIST_SAME_CHANNEL_ERROR; import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_NOT_EXISTS; import static org.junit.jupiter.api.Assertions.*; @Import({PayChannelServiceImpl.class}) public class PayChannelServiceTest extends BaseDbUnitTest { + private static final String ALIPAY_SERVER_URL = "https://openapi.alipay.com/gateway.do"; + @Resource private PayChannelServiceImpl channelService; @@ -44,110 +46,62 @@ public class PayChannelServiceTest extends BaseDbUnitTest { @MockBean private Validator validator; + @BeforeEach + public void setUp() { + channelService.setChannelCache(null); + } + @Test - public void testCreateWechatVersion2Channel_success() { + public void testCreateChannel_success() { // 准备参数 - WxPayClientConfig v2Config = getV2Config(); + WxPayClientConfig config = randomWxPayClientConfig(); PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> { + o.setStatus(randomCommonStatus()); o.setCode(PayChannelEnum.WX_PUB.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(JSON.toJSONString(v2Config)); + o.setConfig(JsonUtils.toJsonString(config)); }); // 调用 Long channelId = channelService.createChannel(reqVO); - // 断言 - assertNotNull(channelId); // 校验记录的属性是否正确 PayChannelDO channel = channelMapper.selectById(channelId); assertPojoEquals(reqVO, channel, "config"); - // 关于config 对象应该拿出来重新对比 - assertPojoEquals(v2Config, channel.getConfig()); + assertPojoEquals(config, channel.getConfig()); + // 校验缓存 + assertEquals(1, channelService.getChannelCache().size()); + assertEquals(channel, channelService.getChannelCache().get(0)); } @Test - public void testCreateWechatVersion3Channel_success() { + public void testCreateChannel_exists() { + // mock 数据 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class, + o -> o.setConfig(randomWxPayClientConfig())); + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 - WxPayClientConfig v3Config = getV3Config(); PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> { - o.setCode(PayChannelEnum.WX_PUB.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(JSON.toJSONString(v3Config)); + o.setAppId(dbChannel.getAppId()); + o.setCode(dbChannel.getCode()); }); - // 调用 - Long channelId = channelService.createChannel(reqVO); - // 断言 - assertNotNull(channelId); - // 校验记录的属性是否正确 - PayChannelDO channel = channelMapper.selectById(channelId); - assertPojoEquals(reqVO, channel, "config"); - // 关于config 对象应该拿出来重新对比 - assertPojoEquals(v3Config, channel.getConfig()); - } - - @Test - public void testCreateAliPayPublicKeyChannel_success() { - // 准备参数 - - AlipayPayClientConfig payClientConfig = getPublicKeyConfig(); - PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> { - o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(JSON.toJSONString(payClientConfig)); - }); - - // 调用 - Long channelId = channelService.createChannel(reqVO); - // 断言 - assertNotNull(channelId); - // 校验记录的属性是否正确 - PayChannelDO channel = channelMapper.selectById(channelId); - assertPojoEquals(reqVO, channel, "config"); - // 关于config 对象应该拿出来重新对比 - assertPojoEquals(payClientConfig, channel.getConfig()); - - } - - @Test - public void testCreateAliPayCertificateChannel_success() { - // 准备参数 - - AlipayPayClientConfig payClientConfig = getCertificateConfig(); - PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> { - o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(JSON.toJSONString(payClientConfig)); - }); - - // 调用 - Long channelId = channelService.createChannel(reqVO); - // 断言 - assertNotNull(channelId); - // 校验记录的属性是否正确 - PayChannelDO channel = channelMapper.selectById(channelId); - assertPojoEquals(reqVO, channel, "config"); - // 关于config 对象应该拿出来重新对比 - assertPojoEquals(payClientConfig, channel.getConfig()); + // 调用, 并断言异常 + assertServiceException(() -> channelService.createChannel(reqVO), CHANNEL_EXIST_SAME_CHANNEL_ERROR); } @Test public void testUpdateChannel_success() { // mock 数据 - AlipayPayClientConfig payClientConfig = getCertificateConfig(); PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(payClientConfig); + o.setConfig(randomAlipayPayClientConfig()); }); channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 - AlipayPayClientConfig payClientPublicKeyConfig = getPublicKeyConfig(); + AlipayPayClientConfig config = randomAlipayPayClientConfig(); PayChannelUpdateReqVO reqVO = randomPojo(PayChannelUpdateReqVO.class, o -> { - o.setCode(dbChannel.getCode()); - o.setStatus(dbChannel.getStatus()); - o.setConfig(JSON.toJSONString(payClientPublicKeyConfig)); o.setId(dbChannel.getId()); // 设置更新的 ID + o.setStatus(randomCommonStatus()); + o.setConfig(JsonUtils.toJsonString(config)); }); // 调用 @@ -155,15 +109,17 @@ public class PayChannelServiceTest extends BaseDbUnitTest { // 校验是否更新正确 PayChannelDO channel = channelMapper.selectById(reqVO.getId()); // 获取最新的 assertPojoEquals(reqVO, channel, "config"); - assertPojoEquals(payClientPublicKeyConfig, channel.getConfig()); + assertPojoEquals(config, channel.getConfig()); + // 校验缓存 + assertEquals(1, channelService.getChannelCache().size()); + assertEquals(channel, channelService.getChannelCache().get(0)); } @Test public void testUpdateChannel_notExists() { // 准备参数 - AlipayPayClientConfig payClientPublicKeyConfig = getPublicKeyConfig(); + AlipayPayClientConfig payClientPublicKeyConfig = randomAlipayPayClientConfig(); PayChannelUpdateReqVO reqVO = randomPojo(PayChannelUpdateReqVO.class, o -> { - o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setConfig(JSON.toJSONString(payClientPublicKeyConfig)); }); @@ -175,11 +131,9 @@ public class PayChannelServiceTest extends BaseDbUnitTest { @Test public void testDeleteChannel_success() { // mock 数据 - AlipayPayClientConfig payClientConfig = getCertificateConfig(); PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setConfig(payClientConfig); + o.setConfig(randomAlipayPayClientConfig()); }); channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 @@ -189,6 +143,8 @@ public class PayChannelServiceTest extends BaseDbUnitTest { channelService.deleteChannel(id); // 校验数据不存在了 assertNull(channelMapper.selectById(id)); + // 校验缓存 + assertEquals(0, channelService.getChannelCache().size()); } @Test @@ -200,119 +156,80 @@ public class PayChannelServiceTest extends BaseDbUnitTest { assertServiceException(() -> channelService.deleteChannel(id), CHANNEL_NOT_EXISTS); } - @Test // TODO 请修改 null 为需要的值 - public void testGetChannelPage() { + @Test + public void testGetChannel() { // mock 数据 - AlipayPayClientConfig payClientConfig = getCertificateConfig(); - PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { // 等会查询到 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - o.setStatus(CommonStatusEnum.ENABLE.getStatus()); - o.setRemark("灿灿子的支付渠道"); - o.setFeeRate(0.03); - o.setAppId(1L); - o.setConfig(payClientConfig); - o.setCreateTime(buildTime(2021,11,20)); + o.setConfig(randomAlipayPayClientConfig()); }); - channelMapper.insert(dbChannel); - // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的 - dbChannel.setConfig(null); - // 测试 code 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o -> { - o.setConfig(payClientConfig); - o.setCode(PayChannelEnum.WX_PUB.getCode()); - })); - // 测试 status 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o -> { - o.setConfig(payClientConfig); - o.setStatus(CommonStatusEnum.DISABLE.getStatus()); - })); - // 测试 remark 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o ->{ - o.setConfig(payClientConfig); - o.setRemark("敏敏子的渠道"); - })); - // 测试 feeRate 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o -> { - o.setConfig(payClientConfig); - o.setFeeRate(1.23); - })); - // 测试 appId 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o -> { - o.setConfig(payClientConfig); - o.setAppId(2L); - })); - // 测试 createTime 不匹配 - channelMapper.insert(cloneIgnoreId(dbChannel, o -> { - o.setConfig(payClientConfig); - o.setCreateTime(buildTime(2021, 10, 20)); - })); + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据 // 准备参数 - PayChannelPageReqVO reqVO = new PayChannelPageReqVO(); - reqVO.setCode(PayChannelEnum.ALIPAY_APP.getCode()); - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - reqVO.setRemark("灿灿子的支付渠道"); - reqVO.setFeeRate(0.03); - reqVO.setAppId(1L); - reqVO.setConfig(JSON.toJSONString(payClientConfig)); - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021,11,19),buildTime(2021,11,21)})); + Long id = dbChannel.getId(); // 调用 - PageResult pageResult = channelService.getChannelPage(reqVO); + PayChannelDO channel = channelService.getChannel(id); + // 校验是否更新正确 + assertPojoEquals(dbChannel, channel); + } + + @Test + public void testGetChannelListByAppIds() { + // mock 数据 + PayChannelDO dbChannel01 = randomPojo(PayChannelDO.class, o -> { + o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); + o.setConfig(randomAlipayPayClientConfig()); + }); + channelMapper.insert(dbChannel01);// @Sql: 先插入出一条存在的数据 + PayChannelDO dbChannel02 = randomPojo(PayChannelDO.class, o -> { + o.setCode(PayChannelEnum.WX_PUB.getCode()); + o.setConfig(randomWxPayClientConfig()); + }); + channelMapper.insert(dbChannel02);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long appId = dbChannel01.getAppId(); + + // 调用 + List channels = channelService.getChannelListByAppIds(Collections.singleton(appId)); + // 校验是否更新正确 + assertEquals(1, channels.size()); + assertPojoEquals(dbChannel01, channels.get(0)); + } + + @Test + public void testGetChannelByAppIdAndCode() { + // mock 数据 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { + o.setCode(PayChannelEnum.ALIPAY_APP.getCode()); + o.setConfig(randomAlipayPayClientConfig()); + }); + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据 + // 准备参数 + Long appId = dbChannel.getAppId(); + String code = dbChannel.getCode();; + + // 调用 + PayChannelDO channel = channelService.getChannelByAppIdAndCode(appId, code); // 断言 - assertEquals(1, pageResult.getTotal()); - assertEquals(1, pageResult.getList().size()); - assertPojoEquals(dbChannel, pageResult.getList().get(0), "config"); - assertPojoEquals(payClientConfig, pageResult.getList().get(0).getConfig()); - + assertPojoEquals(channel, dbChannel); } - public WxPayClientConfig getV2Config() { + public WxPayClientConfig randomWxPayClientConfig() { return new WxPayClientConfig() - .setAppId("APP00001") - .setMchId("MCH00001") + .setAppId(randomString()) + .setMchId(randomString()) .setApiVersion(WxPayClientConfig.API_VERSION_V2) - .setMchKey("dsa1d5s6a1d6sa16d1sa56d15a61das6") - .setApiV3Key("") - .setPrivateCertContent("") - .setPrivateKeyContent(""); + .setMchKey(randomString()); } - public WxPayClientConfig getV3Config() { - return new WxPayClientConfig() - .setAppId("APP00001") - .setMchId("MCH00001") - .setApiVersion(WxPayClientConfig.API_VERSION_V3) - .setMchKey("") - .setApiV3Key("sdadasdsadadsa") - .setPrivateKeyContent("dsa445das415d15asd16ad156as") - .setPrivateCertContent("dsadasd45asd4s5a"); - - } - - public AlipayPayClientConfig getPublicKeyConfig() { + public AlipayPayClientConfig randomAlipayPayClientConfig() { return new AlipayPayClientConfig() - .setServerUrl(AlipayPayClientConfig.SERVER_URL_PROD) - .setAppId("APP00001") + .setServerUrl(randomURL()) + .setAppId(randomString()) .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT) .setMode(AlipayPayClientConfig.MODE_PUBLIC_KEY) - .setPrivateKey("13131321312") - .setAlipayPublicKey("13321321321") - .setAppCertContent("") - .setAlipayPublicCertContent("") - .setRootCertContent(""); - } - - public AlipayPayClientConfig getCertificateConfig() { - return new AlipayPayClientConfig() - .setServerUrl(AlipayPayClientConfig.SERVER_URL_PROD) - .setAppId("APP00001") - .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT) - .setMode(AlipayPayClientConfig.MODE_CERTIFICATE) - .setPrivateKey("") - .setAlipayPublicKey("") - .setAppCertContent("13321321321sda") - .setAlipayPublicCertContent("13321321321aqeqw") - .setRootCertContent("13321321321dsad"); + .setPrivateKey(randomString()) + .setAlipayPublicKey(randomString()); } } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java index eaad15c03..7d62c3cc4 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceTest.java @@ -75,9 +75,9 @@ public class PayOrderServiceTest extends BaseDbUnitTest { o.setBody("斌斌子送给灿灿子的炸弹猫"); o.setNotifyUrl("https://hc.com/lbh"); o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); - o.setAmount(10000); + o.setPrice(10000); o.setChannelFeeRate(0.01); - o.setChannelFeeAmount(1L); + o.setChannelFeePrice(1L); o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); o.setUserIp("127.0.0.1"); o.setCreateTime(LocalDateTime.of(2018, 1, 1, 10, 1, 0)); @@ -87,7 +87,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { o.setSuccessExtensionId(1L); o.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); o.setRefundTimes(0); - o.setRefundAmount(0L); + o.setRefundPrice(0L); o.setChannelUserId("1008611"); o.setChannelOrderNo(channelOrderId); o.setUpdateTime(LocalDateTime.of(2018, 1, 1, 10, 10, 15)); @@ -143,9 +143,9 @@ public class PayOrderServiceTest extends BaseDbUnitTest { o.setBody("斌斌子送给灿灿子的炸弹猫"); o.setNotifyUrl("https://hc.com/lbh"); o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); - o.setAmount(10000); + o.setPrice(10000); o.setChannelFeeRate(0.01); - o.setChannelFeeAmount(1L); + o.setChannelFeePrice(1L); o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()); o.setUserIp("127.0.0.1"); o.setCreateTime(LocalDateTime.of(2018, 1, 1, 10, 1, 0)); @@ -155,7 +155,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest { o.setSuccessExtensionId(1L); o.setRefundStatus(PayRefundTypeEnum.NO.getStatus()); o.setRefundTimes(0); - o.setRefundAmount(0L); + o.setRefundPrice(0L); o.setChannelUserId("1008611"); o.setChannelOrderNo(channelOrderId); o.setUpdateTime(LocalDateTime.of(2018, 1, 1, 10, 10, 15)); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java index 74c965e4b..a3692a4e2 100755 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceTest.java @@ -69,8 +69,8 @@ public class PayRefundServiceTest extends BaseDbUnitTest { o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); o.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); o.setType(PayRefundTypeEnum.SOME.getStatus()); - o.setPayAmount(100); - o.setRefundAmount(500); + o.setPayPrice(100); + o.setRefundPrice(500); o.setReason("就是想退款了,你有意见吗"); o.setUserIp("127.0.0.1"); o.setChannelOrderNo("CH0000001"); @@ -134,8 +134,8 @@ public class PayRefundServiceTest extends BaseDbUnitTest { o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus()); o.setStatus(PayRefundStatusEnum.SUCCESS.getStatus()); o.setType(PayRefundTypeEnum.SOME.getStatus()); - o.setPayAmount(100); - o.setRefundAmount(500); + o.setPayPrice(100); + o.setRefundPrice(500); o.setReason("就是想退款了,你有意见吗"); o.setUserIp("127.0.0.1"); o.setChannelOrderNo("CH0000001"); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/clean.sql b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/clean.sql index 7430b6bfe..2a4610d02 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/clean.sql @@ -1,4 +1,3 @@ -DELETE FROM pay_merchant; DELETE FROM pay_app; DELETE FROM pay_channel; DELETE FROM pay_order; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql index 09cfa2887..fea1365a5 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql @@ -1,18 +1,3 @@ -CREATE TABLE IF NOT EXISTS "pay_merchant" ( - "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - "no" varchar(32) NOT NULL, - "name" varchar(64) NOT NULL, - "short_name" varchar(64) NOT NULL, - "status" tinyint NOT NULL, - "remark" varchar(255) DEFAULT NULL, - "creator" varchar(64) DEFAULT '', - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updater" varchar(64) DEFAULT '', - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - "deleted" bit(1) NOT NULL DEFAULT FALSE, - PRIMARY KEY ("id") -) COMMENT '支付商户信息'; - CREATE TABLE IF NOT EXISTS "pay_app" ( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, "name" varchar(64) NOT NULL, @@ -20,14 +5,13 @@ CREATE TABLE IF NOT EXISTS "pay_app" ( "remark" varchar(255) DEFAULT NULL, `pay_notify_url` varchar(1024) NOT NULL, `refund_notify_url` varchar(1024) NOT NULL, - `merchant_id` bigint(20) NOT NULL, "creator" varchar(64) DEFAULT '', "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, "updater" varchar(64) DEFAULT '', "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, "deleted" bit(1) NOT NULL DEFAULT FALSE, PRIMARY KEY ("id") -) COMMENT = '支付应用信息'; +) COMMENT = '支付应用'; CREATE TABLE IF NOT EXISTS "pay_channel" ( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, @@ -35,7 +19,6 @@ CREATE TABLE IF NOT EXISTS "pay_channel" ( "status" tinyint(4) NOT NULL, "remark" varchar(255) DEFAULT NULL, "fee_rate" double NOT NULL DEFAULT 0, - "merchant_id" bigint(20) NOT NULL, "app_id" bigint(20) NOT NULL, "config" varchar(10240) NOT NULL, "creator" varchar(64) NULL DEFAULT '', @@ -49,7 +32,6 @@ CREATE TABLE IF NOT EXISTS "pay_channel" ( CREATE TABLE IF NOT EXISTS `pay_order` ( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `merchant_id` bigint(20) NOT NULL, `app_id` bigint(20) NOT NULL, `channel_id` bigint(20) DEFAULT NULL, `channel_code` varchar(32) DEFAULT NULL, @@ -82,7 +64,6 @@ CREATE TABLE IF NOT EXISTS `pay_order` ( CREATE TABLE IF NOT EXISTS `pay_refund` ( "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY, - `merchant_id` bigint(20) NOT NULL, `app_id` bigint(20) NOT NULL, `channel_id` bigint(20) NOT NULL, `channel_code` varchar(32) NOT NULL, diff --git a/yudao-server/pom.xml b/yudao-server/pom.xml index a7fc5c2c7..02f7707f1 100644 --- a/yudao-server/pom.xml +++ b/yudao-server/pom.xml @@ -53,7 +53,7 @@ - + cn.iocoder.boot yudao-module-pay-biz diff --git a/yudao-ui-admin/src/api/pay/channel.js b/yudao-ui-admin/src/api/pay/channel.js index 68e203807..727fde092 100644 --- a/yudao-ui-admin/src/api/pay/channel.js +++ b/yudao-ui-admin/src/api/pay/channel.js @@ -27,15 +27,6 @@ export function deleteChannel(id) { }) } -// 获得支付渠道分页 -export function getChannelPage(query) { - return request({ - url: '/pay/channel/page', - method: 'get', - params: query - }) -} - // 获得支付渠道 export function getChannel(appId,code) { return request({ diff --git a/yudao-ui-admin/src/plugins/tab.js b/yudao-ui-admin/src/plugins/tab.js index 00fd8fc0d..c5397f2d5 100644 --- a/yudao-ui-admin/src/plugins/tab.js +++ b/yudao-ui-admin/src/plugins/tab.js @@ -36,6 +36,9 @@ export default { return router.push(lastPath || '/'); }); } + if (typeof obj === "function") { + return store.dispatch('tagsView/delView', router.currentRoute).then(obj); + } return store.dispatch('tagsView/delView', obj); }, // 关闭所有tab页签 diff --git a/yudao-ui-admin/src/router/index.js b/yudao-ui-admin/src/router/index.js index 1d64f59bc..a1f102173 100644 --- a/yudao-ui-admin/src/router/index.js +++ b/yudao-ui-admin/src/router/index.js @@ -227,14 +227,14 @@ export const constantRoutes = [ component: Layout, hidden: true, children: [{ - path: 'order/submit', - name: 'PayOrderSubmit', + path: 'cashier', + name: 'PayCashier', hidden: true, meta: { title: '收银台', noCache: true }, - component: (resolve) => require(['@/views/pay/order/submit'], resolve) + component: (resolve) => require(['@/views/pay/cashier'], resolve) }] } ] diff --git a/yudao-ui-admin/src/utils/dict.js b/yudao-ui-admin/src/utils/dict.js index 8e154114d..3f6cfbbd4 100644 --- a/yudao-ui-admin/src/utils/dict.js +++ b/yudao-ui-admin/src/utils/dict.js @@ -54,7 +54,7 @@ export const DICT_TYPE = { PAY_CHANNEL_ALIPAY_SIGN_TYPE: 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型 PAY_CHANNEL_ALIPAY_MODE: 'pay_channel_alipay_mode', // 支付宝公钥类型 PAY_CHANNEL_ALIPAY_SERVER_TYPE: 'pay_channel_alipay_server_type', // 支付宝网关地址 - PAY_CHANNEL_CODE_TYPE: 'pay_channel_code_type', // 支付渠道编码类型 + PAY_CHANNEL_CODE: 'pay_channel_code', // 支付渠道编码类型 PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status', // 商户支付订单回调状态 PAY_ORDER_STATUS: 'pay_order_status', // 商户支付订单状态 PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status', // 商户支付订单退款状态 diff --git a/yudao-ui-admin/src/views/mall/trade/order/detail.vue b/yudao-ui-admin/src/views/mall/trade/order/detail.vue index 15bc705a9..8b10788b4 100644 --- a/yudao-ui-admin/src/views/mall/trade/order/detail.vue +++ b/yudao-ui-admin/src/views/mall/trade/order/detail.vue @@ -17,7 +17,7 @@ {{ order.remark }} {{ order.payOrderId }} - + {{ order.user.nickname }} diff --git a/yudao-ui-admin/src/views/mall/trade/order/index.vue b/yudao-ui-admin/src/views/mall/trade/order/index.vue index fb25056b6..be5e17432 100644 --- a/yudao-ui-admin/src/views/mall/trade/order/index.vue +++ b/yudao-ui-admin/src/views/mall/trade/order/index.vue @@ -42,7 +42,7 @@ - @@ -86,7 +86,7 @@ 支付方式: - + 未支付 @@ -113,7 +113,7 @@ - +