Commit 927f71c7e25cb068495b78fba6039f47f973eb02

Authored by puhui999
2 parents e7d86436 fbb63ee2

Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product

Showing 86 changed files with 935 additions and 1130 deletions
sql/mysql/ruoyi-vue-pro.sql
... ... @@ -11,7 +11,7 @@
11 11 Target Server Version : 80026
12 12 File Encoding : 65001
13 13  
14   - Date: 13/04/2023 23:37:01
  14 + Date: 09/07/2023 20:25:37
15 15 */
16 16  
17 17 SET NAMES utf8mb4;
... ... @@ -415,7 +415,7 @@ CREATE TABLE `bpm_task_assign_rule` (
415 415 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
416 416 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
417 417 PRIMARY KEY (`id`) USING BTREE
418   -) ENGINE = InnoDB AUTO_INCREMENT = 275 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表';
  418 +) ENGINE = InnoDB AUTO_INCREMENT = 276 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表';
419 419  
420 420 -- ----------------------------
421 421 -- Records of bpm_task_assign_rule
... ... @@ -546,7 +546,7 @@ CREATE TABLE `infra_api_error_log` (
546 546 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
547 547 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
548 548 PRIMARY KEY (`id`) USING BTREE
549   -) ENGINE = InnoDB AUTO_INCREMENT = 1110 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
  549 +) ENGINE = InnoDB AUTO_INCREMENT = 1291 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志';
550 550  
551 551 -- ----------------------------
552 552 -- Records of infra_api_error_log
... ... @@ -584,7 +584,7 @@ CREATE TABLE `infra_codegen_column` (
584 584 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
585 585 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
586 586 PRIMARY KEY (`id`) USING BTREE
587   -) ENGINE = InnoDB AUTO_INCREMENT = 1688 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
  587 +) ENGINE = InnoDB AUTO_INCREMENT = 1698 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义';
588 588  
589 589 -- ----------------------------
590 590 -- Records of infra_codegen_column
... ... @@ -644,7 +644,7 @@ CREATE TABLE `infra_config` (
644 644 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
645 645 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
646 646 PRIMARY KEY (`id`) USING BTREE
647   -) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '参数配置表';
  647 +) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '参数配置表';
648 648  
649 649 -- ----------------------------
650 650 -- Records of infra_config
... ... @@ -655,6 +655,7 @@ INSERT INTO `infra_config` (`id`, `category`, `type`, `name`, `config_key`, `val
655 655 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');
656 656 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');
657 657 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');
  658 +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');
658 659 COMMIT;
659 660  
660 661 -- ----------------------------
... ... @@ -699,7 +700,7 @@ CREATE TABLE `infra_file` (
699 700 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
700 701 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
701 702 PRIMARY KEY (`id`) USING BTREE
702   -) ENGINE = InnoDB AUTO_INCREMENT = 912 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
  703 +) ENGINE = InnoDB AUTO_INCREMENT = 953 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
703 704  
704 705 -- ----------------------------
705 706 -- Records of infra_file
... ... @@ -753,7 +754,7 @@ CREATE TABLE `infra_file_content` (
753 754 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
754 755 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
755 756 PRIMARY KEY (`id`) USING BTREE
756   -) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
  757 +) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表';
757 758  
758 759 -- ----------------------------
759 760 -- Records of infra_file_content
... ... @@ -812,7 +813,7 @@ CREATE TABLE `infra_job_log` (
812 813 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
813 814 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
814 815 PRIMARY KEY (`id`) USING BTREE
815   -) ENGINE = InnoDB AUTO_INCREMENT = 168767 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '定时任务日志表';
  816 +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '定时任务日志表';
816 817  
817 818 -- ----------------------------
818 819 -- Records of infra_job_log
... ... @@ -867,7 +868,7 @@ CREATE TABLE `member_user` (
867 868 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
868 869 PRIMARY KEY (`id`) USING BTREE,
869 870 UNIQUE INDEX `uk_mobile`(`mobile` ASC) USING BTREE COMMENT '手机号'
870   -) ENGINE = InnoDB AUTO_INCREMENT = 247 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户';
  871 +) ENGINE = InnoDB AUTO_INCREMENT = 248 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户';
871 872  
872 873 -- ----------------------------
873 874 -- Records of member_user
... ... @@ -935,7 +936,7 @@ CREATE TABLE `system_dict_data` (
935 936 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
936 937 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
937 938 PRIMARY KEY (`id`) USING BTREE
938   -) ENGINE = InnoDB AUTO_INCREMENT = 1234 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
  939 +) ENGINE = InnoDB AUTO_INCREMENT = 1341 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表';
939 940  
940 941 -- ----------------------------
941 942 -- Records of system_dict_data
... ... @@ -1147,6 +1148,24 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st
1147 1148 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');
1148 1149 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');
1149 1150 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');
  1151 +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');
  1152 +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');
  1153 +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');
  1154 +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');
  1155 +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');
  1156 +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');
  1157 +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');
  1158 +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');
  1159 +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');
  1160 +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');
  1161 +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');
  1162 +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');
  1163 +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');
  1164 +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');
  1165 +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');
  1166 +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');
  1167 +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');
  1168 +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');
1150 1169 COMMIT;
1151 1170  
1152 1171 -- ----------------------------
... ... @@ -1167,7 +1186,7 @@ CREATE TABLE `system_dict_type` (
1167 1186 `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间',
1168 1187 PRIMARY KEY (`id`) USING BTREE,
1169 1188 UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE
1170   -) ENGINE = InnoDB AUTO_INCREMENT = 169 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
  1189 +) ENGINE = InnoDB AUTO_INCREMENT = 173 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表';
1171 1190  
1172 1191 -- ----------------------------
1173 1192 -- Records of system_dict_type
... ... @@ -1233,6 +1252,10 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat
1233 1252 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');
1234 1253 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');
1235 1254 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');
  1255 +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');
  1256 +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');
  1257 +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');
  1258 +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');
1236 1259 COMMIT;
1237 1260  
1238 1261 -- ----------------------------
... ... @@ -1252,7 +1275,7 @@ CREATE TABLE `system_error_code` (
1252 1275 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1253 1276 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1254 1277 PRIMARY KEY (`id`) USING BTREE
1255   -) ENGINE = InnoDB AUTO_INCREMENT = 5832 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表';
  1278 +) ENGINE = InnoDB AUTO_INCREMENT = 5833 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '错误码表';
1256 1279  
1257 1280 -- ----------------------------
1258 1281 -- Records of system_error_code
... ... @@ -1281,7 +1304,7 @@ CREATE TABLE `system_login_log` (
1281 1304 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1282 1305 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
1283 1306 PRIMARY KEY (`id`) USING BTREE
1284   -) ENGINE = InnoDB AUTO_INCREMENT = 2163 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
  1307 +) ENGINE = InnoDB AUTO_INCREMENT = 2223 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录';
1285 1308  
1286 1309 -- ----------------------------
1287 1310 -- Records of system_login_log
... ... @@ -1411,7 +1434,7 @@ CREATE TABLE `system_menu` (
1411 1434 `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
1412 1435 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
1413 1436 PRIMARY KEY (`id`) USING BTREE
1414   -) ENGINE = InnoDB AUTO_INCREMENT = 2162 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
  1437 +) ENGINE = InnoDB AUTO_INCREMENT = 2301 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表';
1415 1438  
1416 1439 -- ----------------------------
1417 1440 -- Records of system_menu
... ... @@ -1550,7 +1573,6 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i
1550 1573 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');
1551 1574 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');
1552 1575 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');
1553   -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');
1554 1576 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');
1555 1577 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');
1556 1578 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
1576 1598 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');
1577 1599 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');
1578 1600 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');
1579   -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');
1580   -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');
1581   -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');
1582   -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');
1583   -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');
1584   -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');
1585 1601 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');
1586 1602 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');
1587 1603 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
1692 1708 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');
1693 1709 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');
1694 1710 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');
1695   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1696   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1697   - `updater`, `update_time`, `deleted`)
1698   -VALUES (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', NULL, 0, b'1', b'1',
1699   - b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0');
1700   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1701   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1702   - `updater`, `update_time`, `deleted`)
1703   -VALUES (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', NULL, 0, b'1', b'1',
1704   - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
1705   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1706   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1707   - `updater`, `update_time`, `deleted`)
1708   -VALUES (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', NULL, 0, b'1', b'1',
1709   - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
1710   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1711   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1712   - `updater`, `update_time`, `deleted`)
1713   -VALUES (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', NULL, 0, b'1', b'1',
1714   - b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0');
1715   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1716   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1717   - `updater`, `update_time`, `deleted`)
1718   -VALUES (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range',
1719   - 'mall/promotion/seckill/seckillActivity/index', 'PromotionSeckillActivity', 0, b'1', b'1', b'1', '',
1720   - '2022-11-06 22:24:49', '1', '2023-04-08 11:46:02', b'0');
1721   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1722   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1723   - `updater`, `update_time`, `deleted`)
1724   -VALUES (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1725   - '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
1726   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1727   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1728   - `updater`, `update_time`, `deleted`)
1729   -VALUES (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
1730   - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
1731   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1732   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1733   - `updater`, `update_time`, `deleted`)
1734   -VALUES (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
1735   - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
1736   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1737   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1738   - `updater`, `update_time`, `deleted`)
1739   -VALUES (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
1740   - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
1741   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1742   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1743   - `updater`, `update_time`, `deleted`)
1744   -VALUES (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', NULL, 0, b'1', b'1', b'1',
1745   - '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0');
1746   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1747   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1748   - `updater`, `update_time`, `deleted`)
1749   -VALUES (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/SeckillConfig/index',
1750   - 'PromotionSeckillConfig', 0, b'0', b'1', b'1', '', '2022-11-15 19:46:50', '1', '2023-04-08 11:46:17', b'0');
1751   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1752   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1753   - `updater`, `update_time`, `deleted`)
1754   -VALUES (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1755   - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
1756   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1757   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1758   - `updater`, `update_time`, `deleted`)
1759   -VALUES (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1760   - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
1761   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1762   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1763   - `updater`, `update_time`, `deleted`)
1764   -VALUES (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1765   - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
1766   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1767   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1768   - `updater`, `update_time`, `deleted`)
1769   -VALUES (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1770   - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
1771   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1772   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1773   - `updater`, `update_time`, `deleted`)
1774   -VALUES (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1775   - '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0');
1776   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1777   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1778   - `updater`, `update_time`, `deleted`)
1779   -VALUES (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, NULL, 0, b'1', b'1', b'1', '1', '2022-11-19 18:57:19',
1780   - '1', '2022-12-10 16:32:57', b'0');
1781   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1782   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1783   - `updater`, `update_time`, `deleted`)
1784   -VALUES (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index',
1785   - 'TradeAfterSale', 0, b'1', b'1', b'1', '', '2022-11-19 20:15:32', '1', '2023-04-08 11:43:19', b'0');
1786   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1787   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1788   - `updater`, `update_time`, `deleted`)
1789   -VALUES (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', NULL, 0, b'1', b'1', b'1', '',
1790   - '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0');
1791   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1792   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1793   - `updater`, `update_time`, `deleted`)
1794   -VALUES (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', NULL, 0, b'1', b'1', b'1', '1',
1795   - '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0');
1796   -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`,
1797   - `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`,
1798   - `updater`, `update_time`, `deleted`)
1799   -VALUES (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 'TradeOrder', 0, b'1', b'1',
1800   - b'1', '1', '2022-12-10 21:05:44', '1', '2023-04-08 11:42:23', b'0');
1801   -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');
1802   -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');
1803   -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');
1804   -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');
1805   -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');
1806   -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');
  1711 +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');
  1712 +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');
  1713 +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');
  1714 +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');
  1715 +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');
  1716 +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');
  1717 +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');
  1718 +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');
  1719 +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');
  1720 +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');
  1721 +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');
  1722 +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');
  1723 +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');
  1724 +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');
  1725 +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');
  1726 +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');
  1727 +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');
  1728 +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');
  1729 +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');
  1730 +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');
1807 1731 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');
1808 1732 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');
1809 1733 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
1883 1807 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');
1884 1808 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');
1885 1809 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');
  1810 +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');
  1811 +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');
  1812 +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');
  1813 +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');
  1814 +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');
  1815 +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');
  1816 +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');
  1817 +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');
  1818 +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');
  1819 +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');
  1820 +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');
  1821 +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');
  1822 +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');
  1823 +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');
  1824 +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');
  1825 +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');
  1826 +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');
  1827 +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');
  1828 +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');
  1829 +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');
  1830 +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');
  1831 +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');
  1832 +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');
  1833 +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');
  1834 +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');
  1835 +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');
  1836 +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');
  1837 +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');
  1838 +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');
  1839 +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');
  1840 +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');
  1841 +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');
  1842 +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');
  1843 +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');
  1844 +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');
  1845 +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');
  1846 +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');
  1847 +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');
  1848 +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');
1886 1849 COMMIT;
1887 1850  
1888 1851 -- ----------------------------
... ... @@ -1999,7 +1962,7 @@ CREATE TABLE `system_oauth2_access_token` (
1999 1962 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2000 1963 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2001 1964 PRIMARY KEY (`id`) USING BTREE
2002   -) ENGINE = InnoDB AUTO_INCREMENT = 1785 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
  1965 +) ENGINE = InnoDB AUTO_INCREMENT = 2007 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌';
2003 1966  
2004 1967 -- ----------------------------
2005 1968 -- Records of system_oauth2_access_token
... ... @@ -2121,7 +2084,7 @@ CREATE TABLE `system_oauth2_refresh_token` (
2121 2084 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2122 2085 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2123 2086 PRIMARY KEY (`id`) USING BTREE
2124   -) ENGINE = InnoDB AUTO_INCREMENT = 738 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
  2087 +) ENGINE = InnoDB AUTO_INCREMENT = 785 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌';
2125 2088  
2126 2089 -- ----------------------------
2127 2090 -- Records of system_oauth2_refresh_token
... ... @@ -2161,7 +2124,7 @@ CREATE TABLE `system_operate_log` (
2161 2124 `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
2162 2125 `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
2163 2126 PRIMARY KEY (`id`) USING BTREE
2164   -) ENGINE = InnoDB AUTO_INCREMENT = 6440 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
  2127 +) ENGINE = InnoDB AUTO_INCREMENT = 6601 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录';
2165 2128  
2166 2129 -- ----------------------------
2167 2130 -- Records of system_operate_log
... ... @@ -2743,7 +2706,6 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t
2743 2706 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);
2744 2707 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);
2745 2708 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);
2746   -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);
2747 2709 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);
2748 2710 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);
2749 2711 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
2771 2733 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);
2772 2734 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);
2773 2735 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);
2774   -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);
2775   -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);
2776   -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);
2777   -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);
2778   -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);
2779   -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);
2780 2736 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);
2781 2737 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);
2782 2738 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` (
3321 3277 BEGIN;
3322 3278 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');
3323 3279 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');
3324   -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');
  3280 +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');
3325 3281 COMMIT;
3326 3282  
3327 3283 -- ----------------------------
... ... @@ -3459,7 +3415,7 @@ CREATE TABLE `system_users` (
3459 3415 -- Records of system_users
3460 3416 -- ----------------------------
3461 3417 BEGIN;
3462   -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);
  3418 +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);
3463 3419 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);
3464 3420 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);
3465 3421 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);
... ...
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/PayClientConfig.java
1 1 package cn.iocoder.yudao.framework.pay.core.client;
2 2  
  3 +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
3 4 import com.fasterxml.jackson.annotation.JsonTypeInfo;
4 5  
5 6 import javax.validation.ConstraintViolation;
... ... @@ -20,23 +21,10 @@ import java.util.Set;
20 21 public interface PayClientConfig {
21 22  
22 23 /**
23   - * 配置验证参数是
24   - *
25   - * @param validator 校验对象
26   - * @return 配置好的验证参数
27   - */
28   - Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator);
29   -
30   - // TODO @aquan:貌似抽象一个 validation group 就好了!
31   - /**
32 24 * 参数校验
33 25 *
34 26 * @param validator 校验对象
35 27 */
36   - default void validate(Validator validator) {
37   - Set<ConstraintViolation<PayClientConfig>> violations = verifyParam(validator);
38   - if (!violations.isEmpty()) {
39   - throw new ConstraintViolationException(violations);
40   - }
41   - }
  28 + void validate(Validator validator);
  29 +
42 30 }
... ...
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/dto/order/PayOrderUnifiedRespDTO.java
1 1 package cn.iocoder.yudao.framework.pay.core.client.dto.order;
2 2  
  3 +import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO;
3 4 import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
4   -import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum;
5 5 import lombok.Data;
6 6  
7 7 /**
... ... @@ -24,19 +24,15 @@ public class PayOrderUnifiedRespDTO {
24 24 private String displayContent;
25 25  
26 26 /**
27   - * 支付状态
  27 + * 同步的通知信息
28 28 *
29   - * 枚举 {@link PayOrderStatusRespEnum} 类
  29 + * 目前只有 bar 条码支付才会出现,它是支付发起时,直接返回是否支付成功的,而其它支付还是异步通知
30 30 */
31   - private Integer status;
  31 + private PayOrderNotifyRespDTO notify;
32 32  
33 33 public PayOrderUnifiedRespDTO(String displayMode, String displayContent) {
34   - this(displayMode, displayContent, PayOrderStatusRespEnum.WAITING.getStatus());
35   - }
36   -
37   - public PayOrderUnifiedRespDTO(String displayMode, String displayContent, Integer status) {
38 34 this.displayMode = displayMode;
39 35 this.displayContent = displayContent;
40   - this.status = status;
41 36 }
  37 +
42 38 }
... ...
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPayClientConfig.java
1 1 package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
2 2  
  3 +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
3 4 import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig;
4 5 import lombok.Data;
5 6  
... ... @@ -19,15 +20,6 @@ import java.util.Set;
19 20 public class AlipayPayClientConfig implements PayClientConfig {
20 21  
21 22 /**
22   - * 网关地址 - 线上
23   - */
24   - public static final String SERVER_URL_PROD = "https://openapi.alipay.com/gateway.do";
25   - /**
26   - * 网关地址 - 沙箱
27   - */
28   - public static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do";
29   -
30   - /**
31 23 * 公钥类型 - 公钥模式
32 24 */
33 25 public static final Integer MODE_PUBLIC_KEY = 1;
... ... @@ -43,8 +35,9 @@ public class AlipayPayClientConfig implements PayClientConfig {
43 35  
44 36 /**
45 37 * 网关地址
46   - * 1. {@link #SERVER_URL_PROD}
47   - * 2. {@link #SERVER_URL_SANDBOX}
  38 + *
  39 + * 1. <a href="https://openapi.alipay.com/gateway.do">生产环境</a>
  40 + * 2. <a href="https://openapi-sandbox.dl.alipaydev.com/gateway.do">沙箱环境</a>
48 41 */
49 42 @NotBlank(message = "网关地址不能为空", groups = {ModePublicKey.class, ModeCertificate.class})
50 43 private String serverUrl;
... ... @@ -108,9 +101,8 @@ public class AlipayPayClientConfig implements PayClientConfig {
108 101 }
109 102  
110 103 @Override
111   - public Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator) {
112   - // TODO 芋艿:参数校验
113   - return validator.validate(this,
  104 + public void validate(Validator validator) {
  105 + ValidationUtils.validate(validator, this,
114 106 MODE_PUBLIC_KEY.equals(this.getMode()) ? ModePublicKey.class : ModeCertificate.class);
115 107 }
116 108  
... ...
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;
5 5 import cn.hutool.core.util.StrUtil;
6 6 import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
7 7 import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
  8 +import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO;
8 9 import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO;
9 10 import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO;
10 11 import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedReqDTO;
11 12 import cn.iocoder.yudao.framework.pay.core.client.dto.refund.PayRefundUnifiedRespDTO;
12 13 import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
13 14 import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderDisplayModeEnum;
14   -import cn.iocoder.yudao.framework.pay.core.enums.order.PayOrderStatusRespEnum;
15 15 import com.github.binarywang.wxpay.bean.request.WxPayMicropayRequest;
16 16 import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult;
17 17 import com.github.binarywang.wxpay.constant.WxPayConstants;
... ... @@ -70,9 +70,15 @@ public class WxBarPayClient extends AbstractWxPayClient {
70 70 try {
71 71 WxPayMicropayResult response = client.micropay(request);
72 72 // 支付成功(例如说,用户输入了密码)
  73 + PayOrderNotifyRespDTO notify = PayOrderNotifyRespDTO.builder()
  74 + .orderExtensionNo(response.getOutTradeNo())
  75 + .channelOrderNo(response.getTransactionId())
  76 + .channelUserId(response.getOpenid())
  77 + .successTime(parseDateV2(response.getTimeEnd()))
  78 + .build();
73 79 return new PayOrderUnifiedRespDTO(PayOrderDisplayModeEnum.BAR_CODE.getMode(),
74   - JsonUtils.toJsonString(response),
75   - PayOrderStatusRespEnum.SUCCESS.getStatus());
  80 + JsonUtils.toJsonString(response))
  81 + .setNotify(notify);
76 82 } catch (WxPayException ex) {
77 83 // 如果不满足这 3 种任一的,则直接抛出 WxPayException 异常,不仅需处理
78 84 // 1. SYSTEMERROR:接口返回错误:请立即调用被扫订单结果查询API,查询当前订单状态,并根据订单的状态决定下一步的操作。
... ...
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/WxPayClientConfig.java
1 1 package cn.iocoder.yudao.framework.pay.core.client.impl.weixin;
2 2  
3 3 import cn.hutool.core.io.IoUtil;
  4 +import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
4 5 import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig;
5 6 import lombok.Data;
6 7  
7   -import javax.validation.ConstraintViolation;
8 8 import javax.validation.Validator;
9 9 import javax.validation.constraints.NotBlank;
10 10 import java.io.FileInputStream;
11 11 import java.io.FileNotFoundException;
12   -import java.util.Set;
13 12  
14 13 /**
15 14 * 微信支付的 PayClientConfig 实现类
... ... @@ -100,8 +99,9 @@ public class WxPayClientConfig implements PayClientConfig {
100 99 }
101 100  
102 101 @Override
103   - public Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator) {
104   - return validator.validate(this, this.getApiVersion().equals(API_VERSION_V2) ? V2.class : V3.class);
  102 + public void validate(Validator validator) {
  103 + ValidationUtils.validate(validator, this,
  104 + API_VERSION_V2.equals(this.getApiVersion()) ? V2.class : V3.class);
105 105 }
106 106  
107 107 public static void main(String[] args) throws FileNotFoundException {
... ...
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;
24 24 @Disabled
25 25 public class PayClientFactoryImplIntegrationTest {
26 26  
  27 + private static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do";
  28 +
27 29 private final PayClientFactoryImpl payClientFactory = new PayClientFactoryImpl();
28 30  
29 31 /**
... ... @@ -79,7 +81,7 @@ public class PayClientFactoryImplIntegrationTest {
79 81 // 创建配置
80 82 AlipayPayClientConfig config = new AlipayPayClientConfig();
81 83 config.setAppId("2021000118634035");
82   - config.setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX);
  84 + config.setServerUrl(SERVER_URL_SANDBOX);
83 85 config.setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT);
84 86 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=");
85 87 config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB");
... ... @@ -103,7 +105,7 @@ public class PayClientFactoryImplIntegrationTest {
103 105 // 创建配置
104 106 AlipayPayClientConfig config = new AlipayPayClientConfig();
105 107 config.setAppId("2021000118634035");
106   - config.setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX);
  108 + config.setServerUrl(SERVER_URL_SANDBOX);
107 109 config.setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT);
108 110 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=");
109 111 config.setAlipayPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnq90KnF4dTnlzzmxpujbI05OYqi5WxAS6cL0gnZFv2gK51HExF8v/BaP7P979PhFMgWTqmOOI+Dtno5s+yD09XTY1WkshbLk6i4g2Xlr8fyW9ODnkU88RI2w9UdPhQU4cPPwBNlrsYhKkVK2OxwM3kFqjoBBY0CZoZCsSQ3LDH5WeZqPArlsS6xa2zqJBuuoKjMrdpELl3eXSjP8K54eDJCbeetCZNKWLL3DPahTPB7LZikfYmslb0QUvCgGapD0xkS7eVq70NaL1G57MWABs4tbfWgxike4Daj3EfUrzIVspQxj7w8HEj9WozJPgL88kSJSits0pqD3n5r8HSuseQIDAQAB");
... ...
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;
22 22  
23 23 public class AlipayQrPayClientTest extends BaseMockitoUnitTest {
24 24  
  25 + private static final String SERVER_URL_SANDBOX = "https://openapi.alipaydev.com/gateway.do";
  26 +
25 27 private final AlipayPayClientConfig config = new AlipayPayClientConfig()
26 28 .setAppId("2021000118634035")
27   - .setServerUrl(AlipayPayClientConfig.SERVER_URL_SANDBOX)
  29 + .setServerUrl(SERVER_URL_SANDBOX)
28 30 .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT)
29 31 // TODO @tina:key 可以随机就好,简洁一点哈。
30 32 .setPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHsEV1cDupwJ" +
... ...
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 {
82 82 * 将多租户编号,添加到 header 中
83 83 *
84 84 * @param headers HTTP 请求 headers
  85 + * @param tenantId 租户编号
85 86 */
86   - public static void addTenantHeader(Map<String, String> headers) {
87   - Long tenantId = TenantContextHolder.getTenantId();
  87 + public static void addTenantHeader(Map<String, String> headers, Long tenantId) {
88 88 if (tenantId != null) {
89 89 headers.put(HEADER_TENANT_ID, tenantId.toString());
90 90 }
... ...
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 {
102 102 return randomString() + "@qq.com";
103 103 }
104 104  
  105 + public static String randomURL() {
  106 + return "https://www.iocoder.cn/" + randomString();
  107 + }
  108 +
105 109 @SafeVarargs
106 110 public static <T> T randomPojo(Class<T> clazz, Consumer<T>... consumers) {
107 111 T pojo = PODAM_FACTORY.manufacturePojo(clazz);
... ...
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 {
38 38  
39 39 @Mappings({
40 40 @Mapping(source = "afterSale.applyReason", target = "reason"),
41   - @Mapping(source = "afterSale.refundPrice", target = "amount")
  41 + @Mapping(source = "afterSale.refundPrice", target = "price")
42 42 })
43 43 PayRefundCreateReqDTO convert(String userIp, TradeAfterSaleDO afterSale,
44 44 TradeOrderProperties orderProperties);
... ...
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 {
106 106 createReqDTO.setSubject(subject);
107 107 createReqDTO.setBody(subject); // TODO 芋艿:临时写死
108 108 // 订单相关字段
109   - createReqDTO.setAmount(order.getPayPrice()).setExpireTime(addTime(orderProperties.getExpireTime()));
  109 + createReqDTO.setPrice(order.getPayPrice()).setExpireTime(addTime(orderProperties.getExpireTime()));
110 110 return createReqDTO;
111 111 }
112 112  
... ... @@ -238,7 +238,7 @@ public interface TradeOrderConvert {
238 238 AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
239 239 orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime()));
240 240 if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
241   - orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode()));
  241 + orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE, order.getPayChannelCode()));
242 242 }
243 243 // 处理商品属性
244 244 Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId);
... ...
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 {
320 320 throw exception(ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS);
321 321 }
322 322 // 校验支付金额一致
323   - if (ObjectUtil.notEqual(payOrder.getAmount(), order.getPayPrice())) {
  323 + if (ObjectUtil.notEqual(payOrder.getPrice(), order.getPayPrice())) {
324 324 log.error("[validateOrderPaid][order({}) payOrder({}) 支付金额不匹配,请进行处理!order 数据是:{},payOrder 数据是:{}]",
325 325 id, payOrderId, JsonUtils.toJsonString(order), JsonUtils.toJsonString(payOrder));
326 326 throw exception(ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH);
... ...
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 {
144 144 assertNotNull(createReqDTO.getMerchantOrderId()); // 由于 tradeOrderId 后生成,只能校验非空
145 145 assertEquals(createReqDTO.getSubject(), "商品 1 等多件");
146 146 assertNull(createReqDTO.getBody());
147   - assertEquals(createReqDTO.getAmount(), 80);
  147 + assertEquals(createReqDTO.getPrice(), 80);
148 148 assertNotNull(createReqDTO.getExpireTime());
149 149 return true;
150 150 }))).thenReturn(1000L);
... ... @@ -257,7 +257,7 @@ public class TradeOrderServiceTest extends BaseDbUnitTest {
257 257 // mock 方法(支付单)
258 258 when(payOrderApi.getOrder(eq(10L))).thenReturn(randomPojo(PayOrderRespDTO.class,
259 259 o -> o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus()).setChannelCode("wx_pub")
260   - .setMerchantOrderId("1")).setAmount(100));
  260 + .setMerchantOrderId("1")).setPrice(100));
261 261  
262 262 // 调用
263 263 tradeOrderService.updateOrderPaid(id, payOrderId);
... ...
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 {
42 42 /**
43 43 * 商品描述
44 44 */
45   -// @NotEmpty(message = "商品描述信息不能为空")
46 45 @Length(max = 128, message = "商品描述信息长度不能超过128")
47 46 private String body;
48 47  
... ... @@ -53,7 +52,7 @@ public class PayOrderCreateReqDTO implements Serializable {
53 52 */
54 53 @NotNull(message = "支付金额不能为空")
55 54 @DecimalMin(value = "0", inclusive = false, message = "支付金额必须大于零")
56   - private Integer amount;
  55 + private Integer price;
57 56  
58 57 /**
59 58 * 支付过期时间
... ...
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 {
35 35 /**
36 36 * 支付金额,单位:分
37 37 */
38   - private Integer amount;
  38 + private Integer price;
39 39 /**
40 40 * 支付状态
41 41 *
... ...
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 {
48 48 */
49 49 @NotNull(message = "退款金额不能为空")
50 50 @Min(value = 1, message = "退款金额必须大于零")
51   - private Integer amount;
  51 + private Integer price;
52 52 }
... ...
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 {
30 30 /**
31 31 * 退款金额,单位:分
32 32 */
33   - private Integer refundAmount;
  33 + private Integer refundPrice;
34 34  
35 35 // ========== 商户相关字段 ==========
36 36 /**
... ...
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;
7 7 */
8 8 public interface DictTypeConstants {
9 9  
10   - String CHANNEL_CODE_TYPE = "pay_channel_code_type"; // 支付-渠道名
  10 + String CHANNEL_CODE = "pay_channel_code"; // 支付-渠道名
11 11  
12 12 String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态
13 13 String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态
... ...
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 {
12 12 // ========== APP 模块 1007000000 ==========
13 13 ErrorCode PAY_APP_NOT_FOUND = new ErrorCode(1007000000, "App 不存在");
14 14 ErrorCode PAY_APP_IS_DISABLE = new ErrorCode(1007000002, "App 已经被禁用");
15   - ErrorCode PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE = new ErrorCode(1007000003, "支付应用存在交易中的订单,无法删除");
  15 + ErrorCode PAY_APP_EXIST_ORDER_CANT_DELETE = new ErrorCode(1007000003, "支付应用存在支付订单,无法删除");
  16 + ErrorCode PAY_APP_EXIST_REFUND_CANT_DELETE = new ErrorCode(1007000004, "支付应用存在退款订单,无法删除");
16 17  
17 18 // ========== CHANNEL 模块 1007001000 ==========
18 19 ErrorCode PAY_CHANNEL_NOT_FOUND = new ErrorCode(1007001000, "支付渠道的配置不存在");
... ... @@ -25,22 +26,19 @@ public interface ErrorCodeConstants {
25 26 ErrorCode PAY_ORDER_NOT_FOUND = new ErrorCode(1007002000, "支付订单不存在");
26 27 ErrorCode PAY_ORDER_STATUS_IS_NOT_WAITING = new ErrorCode(1007002001, "支付订单不处于待支付");
27 28 ErrorCode PAY_ORDER_STATUS_IS_NOT_SUCCESS = new ErrorCode(1007002002, "支付订单不处于已支付");
  29 + ErrorCode PAY_ORDER_IS_EXPIRED = new ErrorCode(1007002003, "支付订单已经过期");
28 30  
29 31 // ========== ORDER 模块(拓展单) 1007003000 ==========
30 32 ErrorCode PAY_ORDER_EXTENSION_NOT_FOUND = new ErrorCode(1007003000, "支付交易拓展单不存在");
31 33 ErrorCode PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING = new ErrorCode(1007003001, "支付交易拓展单不处于待支付");
32 34  
33 35 // ========== 支付模块(退款) 1007006000 ==========
34   - ErrorCode PAY_REFUND_AMOUNT_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额");
  36 + ErrorCode PAY_PRICE_PRICE_EXCEED = new ErrorCode(1007006000, "退款金额超过订单可退款金额");
35 37 ErrorCode PAY_REFUND_ALL_REFUNDED = new ErrorCode(1007006001, "订单已经全额退款");
36 38 ErrorCode PAY_REFUND_CHN_ORDER_NO_IS_NULL = new ErrorCode(1007006002, "该订单的渠道订单为空");
37 39 ErrorCode PAY_REFUND_SUCCEED = new ErrorCode(1007006003, "已经退款成功");
38 40 ErrorCode PAY_REFUND_NOT_FOUND = new ErrorCode(1007006004, "支付退款单不存在");
39 41  
40   - // ========== 支付商户信息 1007004000 ==========
41   - ErrorCode PAY_MERCHANT_NOT_EXISTS = new ErrorCode(1007004000, "支付商户信息不存在");
42   - ErrorCode PAY_MERCHANT_EXIST_APP_CANT_DELETE = new ErrorCode(1007004001, "支付商户存在支付应用,无法删除");
43   -
44 42 // ========== 示例订单 1007900000 ==========
45 43 ErrorCode PAY_DEMO_ORDER_NOT_FOUND = new ErrorCode(1007900000, "示例订单不存在");
46 44 ErrorCode PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID = new ErrorCode(1007900001, "示例订单更新支付状态失败,订单不是【未支付】状态");
... ...
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;
24 24 import java.util.*;
25 25  
26 26 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  27 +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
27 28  
28 29 @Slf4j
29 30 @Tag(name = "管理后台 - 支付应用信息")
... ... @@ -78,15 +79,6 @@ public class PayAppController {
78 79 return success(PayAppConvert.INSTANCE.convert(app));
79 80 }
80 81  
81   - @GetMapping("/list")
82   - @Operation(summary = "获得支付应用信息列表")
83   - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
84   - @PreAuthorize("@ss.hasPermission('pay:app:query')")
85   - public CommonResult<List<PayAppRespVO>> getAppList(@RequestParam("ids") Collection<Long> ids) {
86   - List<PayAppDO> list = appService.getAppList(ids);
87   - return success(PayAppConvert.INSTANCE.convertList(list));
88   - }
89   -
90 82 @GetMapping("/page")
91 83 @Operation(summary = "获得支付应用信息分页")
92 84 @PreAuthorize("@ss.hasPermission('pay:app:query')")
... ... @@ -94,34 +86,15 @@ public class PayAppController {
94 86 // 得到应用分页列表
95 87 PageResult<PayAppDO> pageResult = appService.getAppPage(pageVO);
96 88 if (CollUtil.isEmpty(pageResult.getList())) {
97   - return success(new PageResult<>(pageResult.getTotal()));
  89 + return success(PageResult.empty());
98 90 }
99 91  
100 92 // 得到所有的应用编号,查出所有的渠道
101   - Collection<Long> payAppIds = CollectionUtils.convertList(pageResult.getList(), PayAppDO::getId);
102   - List<PayChannelDO> channels = channelService.getChannelListByAppIds(payAppIds);
103   - // TODO @aquan:可以基于 appId 简历一个 multiMap。这样下面,直接 get 到之后,CollUtil buildSet 即可
104   - Iterator<PayChannelDO> iterator = channels.iterator();
105   -
106   - // 利用反射将渠道数据复制到返回的数据结构中去
107   - List<PayAppPageItemRespVO> appList = new ArrayList<>(pageResult.getList().size());
108   - pageResult.getList().forEach(app -> {
109   - // 写入应用信息的数据
110   - PayAppPageItemRespVO respVO = PayAppConvert.INSTANCE.pageConvert(app);
111   - // 写入支付渠道信息的数据
112   - Set<String> channelCodes = new HashSet<>(PayChannelEnum.values().length);
113   - while (iterator.hasNext()) {
114   - PayChannelDO channelDO = iterator.next();
115   - if (channelDO.getAppId().equals(app.getId())) {
116   - channelCodes.add(channelDO.getCode());
117   - iterator.remove();
118   - }
119   - }
120   - respVO.setChannelCodes(channelCodes);
121   - appList.add(respVO);
122   - });
  93 + Collection<Long> appIds = convertList(pageResult.getList(), PayAppDO::getId);
  94 + List<PayChannelDO> channels = channelService.getChannelListByAppIds(appIds);
123 95  
124   - return success(new PageResult<>(appList, pageResult.getTotal()));
  96 + // 拼接后返回
  97 + return success(PayAppConvert.INSTANCE.convertPage(pageResult, channels));
125 98 }
126 99  
127 100 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/app/vo/PayAppBaseVO.java
1 1 package cn.iocoder.yudao.module.pay.controller.admin.app.vo;
  2 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
2 4 import io.swagger.v3.oas.annotations.media.Schema;
3 5 import lombok.*;
  6 +import org.hibernate.validator.constraints.URL;
  7 +
4 8 import javax.validation.constraints.*;
5 9  
6 10 /**
... ... @@ -10,23 +14,26 @@ import javax.validation.constraints.*;
10 14 @Data
11 15 public class PayAppBaseVO {
12 16  
13   - @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + @Schema(description = "应用名", requiredMode = Schema.RequiredMode.REQUIRED, example = "小豆")
14 18 @NotNull(message = "应用名不能为空")
15 19 private String name;
16 20  
17   - @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED)
  21 + @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
18 22 @NotNull(message = "开启状态不能为空")
  23 + @InEnum(CommonStatusEnum.class)
19 24 private Integer status;
20 25  
21   - @Schema(description = "备注")
  26 + @Schema(description = "备注", example = "我是一个测试应用")
22 27 private String remark;
23 28  
24   - @Schema(description = "支付结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED)
  29 + @Schema(description = "支付结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/pay-callback")
25 30 @NotNull(message = "支付结果的回调地址不能为空")
  31 + @URL(message = "支付结果的回调地址必须为 URL 格式")
26 32 private String payNotifyUrl;
27 33  
28   - @Schema(description = "退款结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED)
  34 + @Schema(description = "退款结果的回调地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://127.0.0.1:48080/refund-callback")
29 35 @NotNull(message = "退款结果的回调地址不能为空")
  36 + @URL(message = "退款结果的回调地址必须为 URL 格式")
30 37 private String refundNotifyUrl;
31 38  
32 39 }
... ...
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;
14 14 @ToString(callSuper = true)
15 15 public class PayAppPageItemRespVO extends PayAppBaseVO {
16 16  
17   - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
18 18 private Long id;
19 19  
20 20 @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
21 21 private LocalDateTime createTime;
22 22  
23   - @Schema(description = "渠道编码集合", requiredMode = Schema.RequiredMode.REQUIRED, example = "[alipay_pc, alipay_wap]")
  23 + @Schema(description = "已配置的支付渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "[alipay_pc, alipay_wap]")
24 24 private Set<String> channelCodes;
25 25  
26 26 }
... ...
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_
17 17 @ToString(callSuper = true)
18 18 public class PayAppPageReqVO extends PageParam {
19 19  
20   - @Schema(description = "应用名")
  20 + @Schema(description = "应用名", example = "小豆")
21 21 private String name;
22 22  
23   - @Schema(description = "开启状态")
  23 + @Schema(description = "开启状态", example = "0")
24 24 private Integer status;
25 25  
26   - @Schema(description = "备注")
27   - private String remark;
28   -
29   - @Schema(description = "支付结果的回调地址")
30   - private String payNotifyUrl;
31   -
32   - @Schema(description = "退款结果的回调地址")
33   - private String refundNotifyUrl;
34   -
35 26 @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
36 27 @Schema(description = "创建时间")
37 28 private LocalDateTime[] createTime;
... ...
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;
10 10 @ToString(callSuper = true)
11 11 public class PayAppRespVO extends PayAppBaseVO {
12 12  
13   - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED)
  13 + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
14 14 private Long id;
15 15  
16 16 @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
... ...
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.*;
9 9 @ToString(callSuper = true)
10 10 public class PayAppUpdateReqVO extends PayAppBaseVO {
11 11  
12   - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED)
  12 + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
13 13 @NotNull(message = "应用编号不能为空")
14 14 private Long id;
15 15  
... ...
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;
9 9 @Data
10 10 public class PayAppUpdateStatusReqVO {
11 11  
12   - @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
13   - @NotNull(message = "商户编号不能为空")
  12 + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
  13 + @NotNull(message = "应用编号不能为空")
14 14 private Long id;
15 15  
16   - @Schema(description = "状态,见 SysCommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  16 + @Schema(description = "状态,见 SysCommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
17 17 @NotNull(message = "状态不能为空")
18 18 private Integer status;
19 19  
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/PayChannelController.java
1 1 package cn.iocoder.yudao.module.pay.controller.admin.channel;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
4   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 4 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO;
6   -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO;
7 5 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelRespVO;
8 6 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO;
9 7 import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert;
... ... @@ -11,7 +9,6 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
11 9 import cn.iocoder.yudao.module.pay.service.channel.PayChannelService;
12 10 import io.swagger.v3.oas.annotations.Operation;
13 11 import io.swagger.v3.oas.annotations.Parameter;
14   -import io.swagger.v3.oas.annotations.Parameters;
15 12 import io.swagger.v3.oas.annotations.tags.Tag;
16 13 import org.springframework.security.access.prepost.PreAuthorize;
17 14 import org.springframework.validation.annotation.Validated;
... ... @@ -59,39 +56,19 @@ public class PayChannelController {
59 56 }
60 57  
61 58 @GetMapping("/get")
62   - @Operation(summary = "获得支付渠道 ")
  59 + @Operation(summary = "获得支付渠道")
63 60 @Parameter(name = "id", description = "编号", required = true, example = "1024")
64 61 @PreAuthorize("@ss.hasPermission('pay:channel:query')")
65   - public CommonResult<PayChannelRespVO> getChannel(@RequestParam("id") Long id) {
66   - PayChannelDO channel = channelService.getChannel(id);
67   - return success(PayChannelConvert.INSTANCE.convert(channel));
68   - }
69   -
70   - @GetMapping("/page")
71   - @Operation(summary = "获得支付渠道分页")
72   - @PreAuthorize("@ss.hasPermission('pay:channel:query')")
73   - public CommonResult<PageResult<PayChannelRespVO>> getChannelPage(@Valid PayChannelPageReqVO pageVO) {
74   - PageResult<PayChannelDO> pageResult = channelService.getChannelPage(pageVO);
75   - return success(PayChannelConvert.INSTANCE.convertPage(pageResult));
76   - }
77   -
78   - // TODO 芋艿:需要 review 下实现
79   - @GetMapping("/get-channel")
80   - @Operation(summary = "根据条件查询微信支付渠道")
81   - @Parameters({
82   - @Parameter(name = "appId", description = "应用编号", required = true, example = "1"),
83   - @Parameter(name = "code", description = "支付渠道编码", required = true, example = "wx_pub")
84   - })
85   - @PreAuthorize("@ss.hasPermission('pay:channel:query')")
86   - public CommonResult<PayChannelRespVO> getChannel(@RequestParam Long appId, @RequestParam String code) {
87   - // 獲取渠道
88   - PayChannelDO channel = channelService.getChannelByConditions(appId, code);
89   - if (channel == null) {
90   - return success(new PayChannelRespVO());
  62 + public CommonResult<PayChannelRespVO> getChannel(@RequestParam(value = "id", required = false) Long id,
  63 + @RequestParam(value = "appId", required = false) Long appId,
  64 + @RequestParam(value = "code", required = false) String code) {
  65 + PayChannelDO channel = null;
  66 + if (id != null) {
  67 + channel = channelService.getChannel(id);
  68 + } else if (appId != null && code != null) {
  69 + channel = channelService.getChannelByAppIdAndCode(appId, code);
91 70 }
92   - // 拼凑数据
93   - PayChannelRespVO respVo = PayChannelConvert.INSTANCE.convert(channel);
94   - return success(respVo);
  71 + return success(PayChannelConvert.INSTANCE.convert(channel));
95 72 }
96 73  
97 74 @GetMapping("/get-enable-code-list")
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelBaseVO.java
1 1 package cn.iocoder.yudao.module.pay.controller.admin.channel.vo;
  2 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  3 +import cn.iocoder.yudao.framework.common.validation.InEnum;
2 4 import io.swagger.v3.oas.annotations.media.Schema;
3 5 import lombok.*;
4 6 import javax.validation.constraints.*;
... ... @@ -10,22 +12,19 @@ import javax.validation.constraints.*;
10 12 @Data
11 13 public class PayChannelBaseVO {
12 14  
13   - @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED)
14   - @NotNull(message = "渠道编码不能为空")
15   - private String code;
16   -
17   - @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED)
  15 + @Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
18 16 @NotNull(message = "开启状态不能为空")
  17 + @InEnum(CommonStatusEnum.class)
19 18 private Integer status;
20 19  
21   - @Schema(description = "备注")
  20 + @Schema(description = "备注", example = "我是小备注")
22 21 private String remark;
23 22  
24   - @Schema(description = "渠道费率,单位:百分比", requiredMode = Schema.RequiredMode.REQUIRED)
  23 + @Schema(description = "渠道费率,单位:百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
25 24 @NotNull(message = "渠道费率,单位:百分比不能为空")
26 25 private Double feeRate;
27 26  
28   - @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED)
  27 + @Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
29 28 @NotNull(message = "应用编号不能为空")
30 29 private Long appId;
31 30  
... ...
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;
6 6 import lombok.ToString;
7 7  
8 8 import javax.validation.constraints.NotBlank;
  9 +import javax.validation.constraints.NotNull;
9 10  
10 11 @Schema(description = "管理后台 - 支付渠道 创建 Request VO")
11 12 @Data
... ... @@ -13,6 +14,10 @@ import javax.validation.constraints.NotBlank;
13 14 @ToString(callSuper = true)
14 15 public class PayChannelCreateReqVO extends PayChannelBaseVO {
15 16  
  17 + @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "alipay_pc")
  18 + @NotNull(message = "渠道编码不能为空")
  19 + private String code;
  20 +
16 21 @Schema(description = "渠道配置的 json 字符串")
17 22 @NotBlank(message = "渠道配置不能为空")
18 23 private String config;
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/channel/vo/PayChannelPageReqVO.java deleted
1   -package cn.iocoder.yudao.module.pay.controller.admin.channel.vo;
2   -
3   -import cn.iocoder.yudao.framework.common.pojo.PageParam;
4   -import io.swagger.v3.oas.annotations.media.Schema;
5   -import lombok.Data;
6   -import lombok.EqualsAndHashCode;
7   -import lombok.ToString;
8   -import org.springframework.format.annotation.DateTimeFormat;
9   -
10   -import java.time.LocalDateTime;
11   -
12   -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
13   -
14   -@Schema(description = "管理后台 - 支付渠道 分页 Request VO")
15   -@Data
16   -@EqualsAndHashCode(callSuper = true)
17   -@ToString(callSuper = true)
18   -public class PayChannelPageReqVO extends PageParam {
19   -
20   - @Schema(description = "渠道编码")
21   - private String code;
22   -
23   - @Schema(description = "开启状态")
24   - private Integer status;
25   -
26   - @Schema(description = "备注")
27   - private String remark;
28   -
29   - @Schema(description = "渠道费率,单位:百分比")
30   - private Double feeRate;
31   -
32   - @Schema(description = "应用编号")
33   - private Long appId;
34   -
35   - @Schema(description = "支付渠道配置")
36   - private String config;
37   -
38   - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
39   - @Schema(description = "创建时间")
40   - private LocalDateTime[] createTime;
41   -
42   -}
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;
10 10 @ToString(callSuper = true)
11 11 public class PayChannelRespVO extends PayChannelBaseVO {
12 12  
13   - @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED)
  13 + @Schema(description = "商户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
14 14 private Long id;
15 15  
16   - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  16 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
17 17 private LocalDateTime createTime;
18 18  
  19 + @Schema(description = "渠道编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "alipay_pc")
  20 + private String code;
  21 +
19 22 @Schema(description = "配置", requiredMode = Schema.RequiredMode.REQUIRED)
20 23 private String config;
  24 +
21 25 }
... ...
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 {
16 16 @Schema(description = "渠道配置的json字符串")
17 17 @NotBlank(message = "渠道配置不能为空")
18 18 private String config;
  19 +
19 20 }
... ...
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 {
28 28 private Integer price;
29 29  
30 30 @Schema(description = "是否已支付", requiredMode = Schema.RequiredMode.REQUIRED)
31   - private Boolean payed;
  31 + private Boolean payStatus;
32 32  
33 33 @Schema(description = "支付订单编号", example = "16863")
34 34 private Long payOrderId;
... ...
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 {
49 49  
50 50 @Schema(description = "支付金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
51 51 @NotNull(message = "支付金额,单位:分不能为空")
52   - private Long amount;
53   -
54   - @Schema(description = "支付金额,单位:分", required = true)
55   - @NotNull(message = "支付金额,单位:分不能为空")
56 52 private Long price;
57 53  
58 54 @Schema(description = "渠道手续费,单位:百分比")
59 55 private Double channelFeeRate;
60 56  
61 57 @Schema(description = "渠道手续金额,单位:分")
62   - private Long channelFeeAmount;
  58 + private Long channelFeePrice;
63 59  
64 60 @Schema(description = "支付状态", requiredMode = Schema.RequiredMode.REQUIRED)
65 61 @NotNull(message = "支付状态不能为空")
... ... @@ -95,7 +91,7 @@ public class PayOrderBaseVO {
95 91  
96 92 @Schema(description = "退款总金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED)
97 93 @NotNull(message = "退款总金额,单位:分不能为空")
98   - private Long refundAmount;
  94 + private Long refundPrice;
99 95  
100 96 @Schema(description = "渠道用户编号")
101 97 private String channelUserId;
... ...
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 {
35 35 private String no;
36 36  
37 37 @ExcelProperty("支付金额,单位:元")
38   - private String amount;
  38 + private String price;
39 39  
40 40 @ExcelProperty("渠道手续金额,单位:元")
41   - private String channelFeeAmount;
  41 + private String channelFeePrice;
42 42  
43 43 @ExcelProperty("渠道手续费,单位:百分比")
44 44 private String channelFeeRate;
... ... @@ -80,7 +80,7 @@ public class PayOrderExcelVO {
80 80 private Integer refundTimes;
81 81  
82 82 @ExcelProperty("退款总金额,单位:元")
83   - private String refundAmount;
  83 + private String refundPrice;
84 84  
85 85 @ExcelProperty("商品描述")
86 86 private String body;
... ...
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 {
37 37 private Integer notifyStatus;
38 38  
39 39 @Schema(description = "支付金额,单位:分")
40   - private Long amount;
  40 + private Long price;
41 41  
42 42 @Schema(description = "渠道手续费,单位:百分比")
43 43 private Double channelFeeRate;
44 44  
45 45 @Schema(description = "渠道手续金额,单位:分")
46   - private Long channelFeeAmount;
  46 + private Long channelFeePrice;
47 47  
48 48 @Schema(description = "支付状态")
49 49 private Integer status;
... ... @@ -73,7 +73,7 @@ public class PayOrderExportReqVO {
73 73 private Integer refundTimes;
74 74  
75 75 @Schema(description = "退款总金额,单位:分")
76   - private Long refundAmount;
  76 + private Long refundPrice;
77 77  
78 78 @Schema(description = "渠道用户编号")
79 79 private String channelUserId;
... ...
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 {
42 42 private Integer notifyStatus;
43 43  
44 44 @Schema(description = "支付金额,单位:分")
45   - private Long amount;
  45 + private Long price;
46 46  
47 47 @Schema(description = "渠道手续费,单位:百分比")
48 48 private Double channelFeeRate;
49 49  
50 50 @Schema(description = "渠道手续金额,单位:分")
51   - private Long channelFeeAmount;
  51 + private Long channelFeePrice;
52 52  
53 53 @Schema(description = "支付状态")
54 54 private Integer status;
... ... @@ -78,7 +78,7 @@ public class PayOrderPageReqVO extends PageParam {
78 78 private Integer refundTimes;
79 79  
80 80 @Schema(description = "退款总金额,单位:分")
81   - private Long refundAmount;
  81 + private Long refundPrice;
82 82  
83 83 @Schema(description = "渠道用户编号")
84 84 private String channelUserId;
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitRespVO.java
1 1 package cn.iocoder.yudao.module.pay.controller.admin.order.vo;
2 2  
3 3 import io.swagger.v3.oas.annotations.media.Schema;
4   -import lombok.AllArgsConstructor;
5   -import lombok.Builder;
6 4 import lombok.Data;
7   -import lombok.NoArgsConstructor;
8   -import lombok.experimental.Accessors;
9 5  
10 6 @Schema(description = "管理后台 - 支付订单提交 Response VO")
11 7 @Data
12 8 public class PayOrderSubmitRespVO {
13 9  
  10 + @Schema(description = "支付状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") // 参见 PayOrderStatusEnum 枚举
  11 + private Integer status;
  12 +
14 13 @Schema(description = "展示模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "url") // 参见 PayDisplayModeEnum 枚举
15 14 private String displayMode;
16   -
17 15 @Schema(description = "展示内容", requiredMode = Schema.RequiredMode.REQUIRED)
18 16 private String displayContent;
19 17  
... ...
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 {
53 53 private Integer type;
54 54  
55 55 @ExcelProperty("支付金额,单位:元")
56   - private String payAmount;
  56 + private String payPrice;
57 57  
58 58 @ExcelProperty("退款金额,单位:元")
59   - private String refundAmount;
  59 + private String refundPrice;
60 60  
61 61 @ExcelProperty("退款原因")
62 62 private String reason;
... ...
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 {
46 46 private Integer type;
47 47  
48 48 @Schema(description = "支付金额,单位分")
49   - private Long payAmount;
  49 + private Long payPrice;
50 50  
51 51 @Schema(description = "退款金额,单位分")
52   - private Long refundAmount;
  52 + private Long refundPrice;
53 53  
54 54 @Schema(description = "退款原因")
55 55 private String reason;
... ...
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 {
51 51 private Integer type;
52 52  
53 53 @Schema(description = "支付金额,单位分")
54   - private Long payAmount;
  54 + private Long payPrice;
55 55  
56 56 @Schema(description = "退款金额,单位分")
57   - private Long refundAmount;
  57 + private Long refundPrice;
58 58  
59 59 @Schema(description = "退款原因")
60 60 private String reason;
... ...
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}}
19 19 "id": 202,
20 20 "channelCode": "wx_bar",
21 21 "channelExtras": {
22   - "authCode": "132990241553789274"
  22 + "authCode": "134042110834344848"
23 23 }
24 24 }
25 25  
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/app/PayAppConvert.java
1 1 package cn.iocoder.yudao.module.pay.convert.app;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
  4 +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
4 5 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppCreateReqVO;
5 6 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageItemRespVO;
6 7 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppRespVO;
7 8 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppUpdateReqVO;
8 9 import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
  10 +import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
9 11 import org.mapstruct.Mapper;
10 12 import org.mapstruct.factory.Mappers;
11 13  
12 14 import java.util.List;
  15 +import java.util.Map;
  16 +import java.util.Set;
  17 +import java.util.function.Consumer;
13 18  
14 19 /**
15 20 * 支付应用信息 Convert
... ... @@ -31,6 +36,14 @@ public interface PayAppConvert {
31 36  
32 37 List<PayAppRespVO> convertList(List<PayAppDO> list);
33 38  
34   - PageResult<PayAppRespVO> convertPage(PageResult<PayAppDO> page);
  39 + PageResult<PayAppPageItemRespVO> convertPage(PageResult<PayAppDO> page);
  40 +
  41 + default PageResult<PayAppPageItemRespVO> convertPage(PageResult<PayAppDO> pageResult, List<PayChannelDO> channels) {
  42 + PageResult<PayAppPageItemRespVO> voPageResult = convertPage(pageResult);
  43 + // 处理 channel 关系
  44 + Map<Long, Set<String>> appIdChannelMap = CollectionUtils.convertMultiMap2(channels, PayChannelDO::getAppId, PayChannelDO::getCode);
  45 + voPageResult.getList().forEach(app -> app.setChannelCodes(appIdChannelMap.get(app.getId())));
  46 + return voPageResult;
  47 + }
35 48  
36 49 }
... ...
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 {
27 27  
28 28 PayOrderConvert INSTANCE = Mappers.getMapper(PayOrderConvert.class);
29 29  
30   - @Mapping(source = "amount", target = "price")
31 30 PayOrderRespVO convert(PayOrderDO bean);
32 31  
33 32 PayOrderRespDTO convert2(PayOrderDO order);
... ... @@ -40,8 +39,6 @@ public interface PayOrderConvert {
40 39  
41 40 PageResult<PayOrderRespVO> convertPage(PageResult<PayOrderDO> page);
42 41  
43   - List<PayOrderExcelVO> convertList02(List<PayOrderDO> list);
44   -
45 42 /**
46 43 * 订单 DO 转自定义分页对象
47 44 *
... ... @@ -76,14 +73,14 @@ public interface PayOrderConvert {
76 73  
77 74 BigDecimal multiple = new BigDecimal(100);
78 75  
79   - payOrderExcelVO.setAmount(BigDecimal.valueOf(bean.getAmount())
  76 + payOrderExcelVO.setPrice(BigDecimal.valueOf(bean.getPrice())
80 77 .divide(multiple, 2, RoundingMode.HALF_UP).toString());
81 78  
82   - payOrderExcelVO.setChannelFeeAmount(BigDecimal.valueOf(bean.getChannelFeeAmount())
  79 + payOrderExcelVO.setChannelFeePrice(BigDecimal.valueOf(bean.getChannelFeePrice())
83 80 .divide(multiple, 2, RoundingMode.HALF_UP).toString());
84 81 payOrderExcelVO.setChannelFeeRate(java.math.BigDecimal.valueOf(bean.getChannelFeeRate())
85 82 .multiply(multiple).toString());
86   - payOrderExcelVO.setRefundAmount(BigDecimal.valueOf(bean.getRefundAmount())
  83 + payOrderExcelVO.setRefundPrice(BigDecimal.valueOf(bean.getRefundPrice())
87 84 .divide(multiple, 2, RoundingMode.HALF_UP).toString());
88 85  
89 86 return payOrderExcelVO;
... ... @@ -96,7 +93,7 @@ public interface PayOrderConvert {
96 93  
97 94 PayOrderUnifiedReqDTO convert2(PayOrderSubmitReqVO reqVO, String userIp);
98 95  
99   - PayOrderSubmitRespVO convert(PayOrderUnifiedRespDTO bean);
  96 + PayOrderSubmitRespVO convert(PayOrderDO order, PayOrderUnifiedRespDTO unifiedRespDTO);
100 97  
101 98 AppPayOrderSubmitRespVO convert3(PayOrderSubmitRespVO bean);
102 99  
... ...
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 {
77 77 payRefundExcelVO.setCreateTime(bean.getCreateTime());
78 78  
79 79 BigDecimal multiple = new BigDecimal(100);
80   - payRefundExcelVO.setPayAmount(BigDecimal.valueOf(bean.getPayAmount())
  80 + payRefundExcelVO.setPayPrice(BigDecimal.valueOf(bean.getPayPrice())
81 81 .divide(multiple, 2, RoundingMode.HALF_UP).toString());
82   - payRefundExcelVO.setRefundAmount(BigDecimal.valueOf(bean.getRefundAmount())
  82 + payRefundExcelVO.setRefundPrice(BigDecimal.valueOf(bean.getRefundPrice())
83 83 .divide(multiple, 2, RoundingMode.HALF_UP).toString());
84 84  
85 85 return payRefundExcelVO;
... ... @@ -87,7 +87,7 @@ public interface PayRefundConvert {
87 87  
88 88 //TODO 太多需要处理了, 暂时不用
89 89 @Mappings(value = {
90   - @Mapping(source = "amount", target = "payAmount"),
  90 + @Mapping(source = "price", target = "payPrice"),
91 91 @Mapping(source = "id", target = "orderId"),
92 92 @Mapping(target = "status",ignore = true)
93 93 })
... ...
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;
7 7 import lombok.*;
8 8  
9 9 import java.time.LocalDateTime;
10   -import java.util.Date;
11 10  
12 11 /**
13 12 * 示例订单
... ... @@ -53,7 +52,7 @@ public class PayDemoOrderDO extends BaseDO {
53 52 /**
54 53 * 是否支付
55 54 */
56   - private Boolean payed;
  55 + private Boolean payStatus;
57 56 /**
58 57 * 支付订单编号
59 58 *
... ...
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 {
67 67 /**
68 68 * 交易金额, 单位分
69 69 */
70   - private Integer amount;
  70 + private Integer price;
71 71  
72 72 /**
73 73 * 余额, 单位分
... ... @@ -83,4 +83,4 @@ public class MemberWalletTransactionDO extends BaseDO {
83 83 * 交易时间
84 84 */
85 85 private LocalDateTime transactionTime;
86   -}
87 86 \ No newline at end of file
  87 +}
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/notify/PayNotifyTaskDO.java
1 1 package cn.iocoder.yudao.module.pay.dal.dataobject.notify;
2 2  
3   -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
  3 +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
4 4 import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
5 5 import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO;
6 6 import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO;
... ... @@ -25,7 +25,7 @@ import java.time.LocalDateTime;
25 25 @Data
26 26 @EqualsAndHashCode(callSuper = true)
27 27 @Accessors(chain = true)
28   -public class PayNotifyTaskDO extends BaseDO {
  28 +public class PayNotifyTaskDO extends TenantBaseDO {
29 29  
30 30 /**
31 31 * 通知频率,单位为秒。
... ...
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 {
76 76 * 枚举 {@link PayOrderNotifyStatusEnum}
77 77 */
78 78 private Integer notifyStatus;
79   -// /**
80   -// * 商户拓展参数
81   -// */
82   -// private Map<String, String> merchantExtras;
83 79  
84 80 // ========== 订单相关字段 ==========
85 81  
86 82 /**
87 83 * 支付金额,单位:分
88 84 */
89   - private Integer amount;
  85 + private Integer price;
90 86 /**
91 87 * 渠道手续费,单位:百分比
92 88 *
... ... @@ -96,7 +92,7 @@ public class PayOrderDO extends BaseDO {
96 92 /**
97 93 * 渠道手续金额,单位:分
98 94 */
99   - private Long channelFeeAmount;
  95 + private Long channelFeePrice;
100 96 /**
101 97 * 支付状态
102 98 *
... ... @@ -140,7 +136,7 @@ public class PayOrderDO extends BaseDO {
140 136 /**
141 137 * 退款总金额,单位:分
142 138 */
143   - private Long refundAmount;
  139 + private Long refundPrice;
144 140  
145 141 // ========== 渠道相关字段 ==========
146 142 /**
... ...
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 {
124 124 /**
125 125 * 支付金额,单位:分
126 126 */
127   - private Integer payAmount;
  127 + private Integer payPrice;
128 128 /**
129 129 * 退款金额,单位:分
130 130 */
131   - private Integer refundAmount;
  131 + private Integer refundPrice;
132 132  
133 133 /**
134 134 * 退款原因
... ...
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;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 4 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
  5 +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
5 6 import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
6 7 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageReqVO;
7 8 import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
... ... @@ -11,14 +12,11 @@ import org.apache.ibatis.annotations.Mapper;
11 12 public interface PayAppMapper extends BaseMapperX<PayAppDO> {
12 13  
13 14 default PageResult<PayAppDO> selectPage(PayAppPageReqVO reqVO) {
14   - return selectPage(reqVO, new QueryWrapperX<PayAppDO>()
15   - .likeIfPresent("name", reqVO.getName())
16   - .eqIfPresent("status", reqVO.getStatus())
17   - .eqIfPresent("remark", reqVO.getRemark())
18   - .eqIfPresent("pay_notify_url", reqVO.getPayNotifyUrl())
19   - .eqIfPresent("refund_notify_url", reqVO.getRefundNotifyUrl())
20   - .betweenIfPresent("create_time", reqVO.getCreateTime())
21   - .orderByDesc("id"));
  15 + return selectPage(reqVO, new LambdaQueryWrapperX<PayAppDO>()
  16 + .likeIfPresent(PayAppDO::getName, reqVO.getName())
  17 + .eqIfPresent(PayAppDO::getStatus, reqVO.getStatus())
  18 + .betweenIfPresent(PayAppDO::getCreateTime, reqVO.getCreateTime())
  19 + .orderByDesc(PayAppDO::getId));
22 20 }
23 21  
24 22 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/channel/PayChannelMapper.java
1 1 package cn.iocoder.yudao.module.pay.dal.mysql.channel;
2 2  
3   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 3 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
5 4 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
6   -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
7   -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO;
8 5 import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
9 6 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
10 7 import org.apache.ibatis.annotations.Mapper;
  8 +import org.apache.ibatis.annotations.Select;
11 9  
  10 +import java.time.LocalDateTime;
12 11 import java.util.Collection;
13 12 import java.util.List;
14 13  
... ... @@ -19,41 +18,8 @@ public interface PayChannelMapper extends BaseMapperX&lt;PayChannelDO&gt; {
19 18 return selectOne(PayChannelDO::getAppId, appId, PayChannelDO::getCode, code);
20 19 }
21 20  
22   - default PageResult<PayChannelDO> selectPage(PayChannelPageReqVO reqVO) {
23   - return selectPage(reqVO, new QueryWrapperX<PayChannelDO>()
24   - .eqIfPresent("code", reqVO.getCode())
25   - .eqIfPresent("status", reqVO.getStatus())
26   - .eqIfPresent("remark", reqVO.getRemark())
27   - .eqIfPresent("fee_rate", reqVO.getFeeRate())
28   - .eqIfPresent("app_id", reqVO.getAppId())
29   - .betweenIfPresent("create_time", reqVO.getCreateTime())
30   - .orderByDesc("id"));
31   - }
32   -
33   - /**
34   - * 根据条件获取渠道
35   - *
36   - * @param appId 应用编号
37   - * @param code 渠道编码
38   - * @return 数量
39   - */
40   - default PayChannelDO selectOne(Long appId, String code) {
41   - return this.selectOne((new QueryWrapper<PayChannelDO>().lambda()
42   - .eq(PayChannelDO::getAppId, appId)
43   - .eq(PayChannelDO::getCode, code)
44   - ));
45   - }
46   -
47   - // TODO @aquan:select 命名
48   - /**
49   - * 根据支付应用ID集合获得支付渠道列表
50   - *
51   - * @param appIds 应用编号集合
52   - * @return 支付渠道列表
53   - */
54   - default List<PayChannelDO> getChannelListByAppIds(Collection<Long> appIds){
55   - return this.selectList(new QueryWrapper<PayChannelDO>().lambda()
56   - .in(PayChannelDO::getAppId, appIds));
  21 + default List<PayChannelDO> selectListByAppIds(Collection<Long> appIds){
  22 + return selectList(PayChannelDO::getAppId, appIds);
57 23 }
58 24  
59 25 default List<PayChannelDO> selectListByAppId(Long appId, Integer status) {
... ... @@ -62,4 +28,7 @@ public interface PayChannelMapper extends BaseMapperX&lt;PayChannelDO&gt; {
62 28 .eq(PayChannelDO::getStatus, status));
63 29 }
64 30  
  31 + @Select("SELECT COUNT(*) FROM pay_channel WHERE update_time > #{maxUpdateTime}")
  32 + Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime);
  33 +
65 34 }
... ...
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&lt;PayDemoOrderDO&gt; {
22 22  
23 23 default int updateByIdAndPayed(Long id, boolean wherePayed, PayDemoOrderDO updateObj) {
24 24 return update(updateObj, new LambdaQueryWrapperX<PayDemoOrderDO>()
25   - .eq(PayDemoOrderDO::getId, id).eq(PayDemoOrderDO::getPayed, wherePayed));
  25 + .eq(PayDemoOrderDO::getId, id).eq(PayDemoOrderDO::getPayStatus, wherePayed));
26 26 }
27 27  
28 28 }
... ...
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&lt;PayOrderDO&gt; {
50 50 .in(PayOrderDO::getId, idList));
51 51 }
52 52  
53   - /**
54   - * 查询符合的订单数量
55   - *
56   - * @param appId 应用编号
57   - * @param status 订单状态
58   - * @return 条数
59   - */
60   - default Long selectCount(Long appId, Integer status) {
61   - return selectCount(new LambdaQueryWrapper<PayOrderDO>()
62   - .eq(PayOrderDO::getAppId, appId)
63   - .in(PayOrderDO::getStatus, status));
  53 + default Long selectCountByAppId(Long appId) {
  54 + return selectCount(PayOrderDO::getAppId, appId);
64 55 }
65 56  
66 57 default PayOrderDO selectByAppIdAndMerchantOrderId(Long appId, String merchantOrderId) {
... ...
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;
6 6 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
7 7 import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX;
8 8 import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO;
9   -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
10 9 import org.apache.ibatis.annotations.Mapper;
11 10  
12 11 import java.util.List;
... ... @@ -38,11 +37,8 @@ public interface PayRefundMapper extends BaseMapperX&lt;PayRefundDO&gt; {
38 37 .orderByDesc("id"));
39 38 }
40 39  
41   - default Long selectCount(Long appId, Integer status) {
42   -
43   - return selectCount(new LambdaQueryWrapper<PayRefundDO>()
44   - .eq(PayRefundDO::getAppId, appId)
45   - .eq(PayRefundDO::getStatus, status));
  40 + default Long selectCountByApp(Long appId) {
  41 + return selectCount(PayRefundDO::getAppId, appId);
46 42 }
47 43  
48 44 default PayRefundDO selectByReqNo(String reqNo) {
... ... @@ -52,4 +48,5 @@ public interface PayRefundMapper extends BaseMapperX&lt;PayRefundDO&gt; {
52 48 default PayRefundDO selectByTradeNoAndMerchantRefundNo(String tradeNo, String merchantRefundNo){
53 49 return selectOne("trade_no", tradeNo, "merchant_refund_no", merchantRefundNo);
54 50 }
  51 +
55 52 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/job/package-info.java
  1 +/**
  2 + * 占位,无特殊含义
  3 + */
1 4 package cn.iocoder.yudao.module.pay.job;
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/app/PayAppService.java
... ... @@ -36,6 +36,14 @@ public interface PayAppService {
36 36 void updateApp(@Valid PayAppUpdateReqVO updateReqVO);
37 37  
38 38 /**
  39 + * 修改应用信息状态
  40 + *
  41 + * @param id 应用编号
  42 + * @param status 状态
  43 + */
  44 + void updateAppStatus(Long id, Integer status);
  45 +
  46 + /**
39 47 * 删除支付应用信息
40 48 *
41 49 * @param id 编号
... ... @@ -67,14 +75,6 @@ public interface PayAppService {
67 75 PageResult<PayAppDO> getAppPage(PayAppPageReqVO pageReqVO);
68 76  
69 77 /**
70   - * 修改应用信息状态
71   - *
72   - * @param id 应用编号
73   - * @param status 状态{@link cn.iocoder.yudao.framework.common.enums.CommonStatusEnum}
74   - */
75   - void updateAppStatus(Long id, Integer status);
76   -
77   - /**
78 78 * 获得指定编号的商户 Map
79 79 *
80 80 * @param ids 应用编号集合
... ... @@ -85,7 +85,6 @@ public interface PayAppService {
85 85 return CollectionUtils.convertMap(list, PayAppDO::getId);
86 86 }
87 87  
88   -
89 88 /**
90 89 * 支付应用的合法性
91 90 *
... ...
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;
9 9 import cn.iocoder.yudao.module.pay.convert.app.PayAppConvert;
10 10 import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
11 11 import cn.iocoder.yudao.module.pay.dal.mysql.app.PayAppMapper;
12   -import cn.iocoder.yudao.module.pay.dal.mysql.order.PayOrderMapper;
13 12 import cn.iocoder.yudao.module.pay.dal.mysql.refund.PayRefundMapper;
14 13 import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants;
15 14 import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum;
16 15 import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum;
17   -import com.google.common.annotations.VisibleForTesting;
  16 +import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
  17 +import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
  18 +import org.springframework.context.annotation.Lazy;
18 19 import org.springframework.stereotype.Service;
19 20 import org.springframework.validation.annotation.Validated;
20 21  
... ... @@ -23,11 +24,10 @@ import java.util.Collection;
23 24 import java.util.List;
24 25  
25 26 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
26   -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE;
27   -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_NOT_FOUND;
  27 +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.*;
28 28  
29 29 /**
30   - * 支付应用信息 Service 实现类
  30 + * 支付应用 Service 实现类
31 31 *
32 32 * @author aquan
33 33 */
... ... @@ -37,11 +37,13 @@ public class PayAppServiceImpl implements PayAppService {
37 37  
38 38 @Resource
39 39 private PayAppMapper appMapper;
40   - // TODO 芋艿:不能调用对方的 mapper
  40 +
41 41 @Resource
42   - private PayOrderMapper orderMapper;
  42 + @Lazy // 延迟加载,避免循环依赖报错
  43 + private PayOrderService orderService;
43 44 @Resource
44   - private PayRefundMapper refundMapper;
  45 + @Lazy // 延迟加载,避免循环依赖报错
  46 + private PayRefundService refundService;
45 47  
46 48 @Override
47 49 public Long createApp(PayAppCreateReqVO createReqVO) {
... ... @@ -55,17 +57,31 @@ public class PayAppServiceImpl implements PayAppService {
55 57 @Override
56 58 public void updateApp(PayAppUpdateReqVO updateReqVO) {
57 59 // 校验存在
58   - this.validateAppExists(updateReqVO.getId());
  60 + validateAppExists(updateReqVO.getId());
59 61 // 更新
60 62 PayAppDO updateObj = PayAppConvert.INSTANCE.convert(updateReqVO);
61 63 appMapper.updateById(updateObj);
62 64 }
63 65  
64 66 @Override
  67 + public void updateAppStatus(Long id, Integer status) {
  68 + // 校验商户存在
  69 + validateAppExists(id);
  70 + // 更新状态
  71 + appMapper.updateById(new PayAppDO().setId(id).setStatus(status));
  72 + }
  73 +
  74 + @Override
65 75 public void deleteApp(Long id) {
66 76 // 校验存在
67   - this.validateAppExists(id);
68   - this.validateOrderTransactionExist(id);
  77 + validateAppExists(id);
  78 + // 校验关联数据是否存在
  79 + if (orderService.getOrderCountByAppId(id) > 0) {
  80 + throw exception(PAY_APP_EXIST_ORDER_CANT_DELETE);
  81 + }
  82 + if (refundService.getRefundCountByAppId(id) > 0) {
  83 + throw exception(PAY_APP_EXIST_REFUND_CANT_DELETE);
  84 + }
69 85  
70 86 // 删除
71 87 appMapper.deleteById(id);
... ... @@ -93,58 +109,15 @@ public class PayAppServiceImpl implements PayAppService {
93 109 }
94 110  
95 111 @Override
96   - public void updateAppStatus(Long id, Integer status) {
97   - // 校验商户存在
98   - this.checkAppExists(id);
99   - // 更新状态
100   - PayAppDO app = new PayAppDO();
101   - app.setId(id);
102   - app.setStatus(status);
103   - appMapper.updateById(app);
104   - }
105   -
106   - /**
107   - * 检查商户是否存在
108   - *
109   - * @param id 商户编号
110   - */
111   - @VisibleForTesting
112   - public void checkAppExists(Long id) {
113   - if (id == null) {
114   - return;
115   - }
116   - PayAppDO payApp = appMapper.selectById(id);
117   - if (payApp == null) {
118   - throw exception(PAY_APP_NOT_FOUND);
119   - }
120   - }
121   -
122   - /**
123   - * 验证是否存在交易中或者退款中等处理中状态的订单
124   - *
125   - * @param appId 应用 ID
126   - */
127   - private void validateOrderTransactionExist(Long appId) {
128   - // 查看交易订单
129   - if (orderMapper.selectCount(appId, PayOrderStatusEnum.WAITING.getStatus()) > 0) {
130   - throw exception(PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE);
131   - }
132   - // 查看退款订单
133   - if (refundMapper.selectCount(appId, PayRefundStatusEnum.CREATE.getStatus()) > 0) {
134   - throw exception(PAY_APP_EXIST_TRANSACTION_ORDER_CANT_DELETE);
135   - }
136   - }
137   -
138   - @Override
139 112 public PayAppDO validPayApp(Long id) {
140 113 PayAppDO app = appMapper.selectById(id);
141 114 // 校验是否存在
142 115 if (app == null) {
143   - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_APP_NOT_FOUND);
  116 + throw exception(ErrorCodeConstants.PAY_APP_NOT_FOUND);
144 117 }
145 118 // 校验是否禁用
146 119 if (CommonStatusEnum.DISABLE.getStatus().equals(app.getStatus())) {
147   - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_APP_IS_DISABLE);
  120 + throw exception(ErrorCodeConstants.PAY_APP_IS_DISABLE);
148 121 }
149 122 return app;
150 123 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelService.java
1 1 package cn.iocoder.yudao.module.pay.service.channel;
2 2  
3 3 import cn.iocoder.yudao.framework.common.exception.ServiceException;
4   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 4 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO;
6   -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO;
7 5 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO;
8 6 import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
9 7  
... ... @@ -19,11 +17,6 @@ import java.util.List;
19 17 public interface PayChannelService {
20 18  
21 19 /**
22   - * 初始化支付客户端
23   - */
24   - void initLocalCache();
25   -
26   - /**
27 20 * 创建支付渠道
28 21 *
29 22 * @param createReqVO 创建信息
... ... @@ -54,15 +47,7 @@ public interface PayChannelService {
54 47 PayChannelDO getChannel(Long id);
55 48  
56 49 /**
57   - * 获得支付渠道分页
58   - *
59   - * @param pageReqVO 分页查询
60   - * @return 支付渠道分页
61   - */
62   - PageResult<PayChannelDO> getChannelPage(PayChannelPageReqVO pageReqVO);
63   -
64   - /**
65   - * 根据支付应用ID集合获得支付渠道列表
  50 + * 根据支付应用 ID 集合,获得支付渠道列表
66 51 *
67 52 * @param appIds 应用编号集合
68 53 * @return 支付渠道列表
... ... @@ -72,11 +57,11 @@ public interface PayChannelService {
72 57 /**
73 58 * 根据条件获取渠道
74 59 *
75   - * @param appid 应用编号
  60 + * @param appId 应用编号
76 61 * @param code 渠道编码
77 62 * @return 数量
78 63 */
79   - PayChannelDO getChannelByConditions(Long appid, String code);
  64 + PayChannelDO getChannelByAppIdAndCode(Long appId, String code);
80 65  
81 66 /**
82 67 * 支付渠道的合法性
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceImpl.java
1 1 package cn.iocoder.yudao.module.pay.service.channel;
2 2  
  3 +import cn.hutool.core.collection.CollUtil;
  4 +import cn.hutool.core.lang.Assert;
3 5 import cn.hutool.core.util.ObjectUtil;
4   -import cn.hutool.json.JSONUtil;
5 6 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
6   -import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
7   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
  7 +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
  8 +import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
8 9 import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig;
9 10 import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
10 11 import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
11 12 import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
12 13 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO;
13   -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO;
14 14 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO;
15 15 import cn.iocoder.yudao.module.pay.convert.channel.PayChannelConvert;
16 16 import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
17 17 import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper;
18 18 import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants;
  19 +import lombok.Getter;
  20 +import lombok.Setter;
19 21 import lombok.extern.slf4j.Slf4j;
  22 +import org.springframework.scheduling.annotation.Scheduled;
20 23 import org.springframework.stereotype.Service;
21 24 import org.springframework.validation.annotation.Validated;
22 25  
23 26 import javax.annotation.PostConstruct;
24 27 import javax.annotation.Resource;
25 28 import javax.validation.Validator;
  29 +import java.time.LocalDateTime;
26 30 import java.util.Collection;
27 31 import java.util.List;
  32 +import java.util.concurrent.TimeUnit;
28 33  
29 34 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
30 35 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
40 45 @Validated
41 46 public class PayChannelServiceImpl implements PayChannelService {
42 47  
  48 + @Getter // 为了方便测试,这里提供 getter 方法
  49 + @Setter
  50 + private volatile List<PayChannelDO> channelCache;
  51 +
43 52 @Resource
44 53 private PayClientFactory payClientFactory;
45 54  
... ... @@ -52,7 +61,6 @@ public class PayChannelServiceImpl implements PayChannelService {
52 61 /**
53 62 * 初始化 {@link #payClientFactory} 缓存
54 63 */
55   - @Override
56 64 @PostConstruct
57 65 public void initLocalCache() {
58 66 // 注意:忽略自动多租户,因为要全局初始化缓存
... ... @@ -64,49 +72,101 @@ public class PayChannelServiceImpl implements PayChannelService {
64 72 // 第二步:构建缓存:创建或更新支付 Client
65 73 channels.forEach(payChannel -> payClientFactory.createOrUpdatePayClient(payChannel.getId(),
66 74 payChannel.getCode(), payChannel.getConfig()));
  75 + this.channelCache = channels;
67 76 });
68 77 }
69 78  
  79 + /**
  80 + * 通过定时任务轮询,刷新缓存
  81 + *
  82 + * 目的:多节点部署时,通过轮询”通知“所有节点,进行刷新
  83 + */
  84 + @Scheduled(initialDelay = 60, fixedRate = 60, timeUnit = TimeUnit.SECONDS)
  85 + public void refreshLocalCache() {
  86 + // 情况一:如果缓存里没有数据,则直接刷新缓存
  87 + if (CollUtil.isEmpty(channelCache)) {
  88 + initLocalCache();
  89 + return;
  90 + }
  91 +
  92 + // 情况二,如果缓存里数据,则通过 updateTime 判断是否有数据变更,有变更则刷新缓存
  93 + LocalDateTime maxTime = CollectionUtils.getMaxValue(channelCache, PayChannelDO::getUpdateTime);
  94 + if (channelMapper.selectCountByUpdateTimeGt(maxTime) > 0) {
  95 + initLocalCache();
  96 + }
  97 + }
  98 +
70 99 @Override
71 100 public Long createChannel(PayChannelCreateReqVO reqVO) {
72 101 // 断言是否有重复的
73   - PayChannelDO channelDO = this.getChannelByConditions(reqVO.getAppId(), reqVO.getCode());
74   - if (ObjectUtil.isNotNull(channelDO)) {
  102 + PayChannelDO dbChannel = getChannelByAppIdAndCode(reqVO.getAppId(), reqVO.getCode());
  103 + if (dbChannel != null) {
75 104 throw exception(CHANNEL_EXIST_SAME_CHANNEL_ERROR);
76 105 }
77 106  
78 107 // 新增渠道
79   - PayChannelDO channel = PayChannelConvert.INSTANCE.convert(reqVO);
80   - settingConfigAndCheckParam(channel, reqVO.getConfig());
  108 + PayChannelDO channel = PayChannelConvert.INSTANCE.convert(reqVO)
  109 + .setConfig(parseConfig(reqVO.getCode(), reqVO.getConfig()));
81 110 channelMapper.insert(channel);
82   - // TODO 芋艿:缺少刷新本地缓存的机制
  111 +
  112 + // 刷新缓存
  113 + refreshLocalCache();
83 114 return channel.getId();
84 115 }
85 116  
86 117 @Override
87 118 public void updateChannel(PayChannelUpdateReqVO updateReqVO) {
88 119 // 校验存在
89   - this.validateChannelExists(updateReqVO.getId());
  120 + PayChannelDO dbChannel = validateChannelExists(updateReqVO.getId());
  121 +
90 122 // 更新
91   - PayChannelDO channel = PayChannelConvert.INSTANCE.convert(updateReqVO);
92   - settingConfigAndCheckParam(channel, updateReqVO.getConfig());
  123 + PayChannelDO channel = PayChannelConvert.INSTANCE.convert(updateReqVO)
  124 + .setConfig(parseConfig(dbChannel.getCode(), updateReqVO.getConfig()));
93 125 channelMapper.updateById(channel);
94   - // TODO 芋艿:缺少刷新本地缓存的机制
  126 +
  127 + // 刷新缓存
  128 + refreshLocalCache();
  129 + }
  130 +
  131 + /**
  132 + * 解析并校验配置
  133 + *
  134 + * @param code 渠道编码
  135 + * @param configStr 配置
  136 + * @return 支付配置
  137 + */
  138 + private PayClientConfig parseConfig(String code, String configStr) {
  139 + // 解析配置
  140 + Class<? extends PayClientConfig> payClass = PayChannelEnum.getByCode(code).getConfigClass();
  141 + if (ObjectUtil.isNull(payClass)) {
  142 + throw exception(CHANNEL_NOT_EXISTS);
  143 + }
  144 + PayClientConfig config = JsonUtils.parseObject2(configStr, payClass);
  145 + Assert.notNull(config);
  146 +
  147 + // 验证参数
  148 + config.validate(validator);
  149 + return config;
95 150 }
96 151  
97 152 @Override
98 153 public void deleteChannel(Long id) {
99 154 // 校验存在
100   - this.validateChannelExists(id);
  155 + validateChannelExists(id);
  156 +
101 157 // 删除
102 158 channelMapper.deleteById(id);
103   - // TODO 芋艿:缺少刷新本地缓存的机制
  159 +
  160 + // 刷新缓存
  161 + refreshLocalCache();
104 162 }
105 163  
106   - private void validateChannelExists(Long id) {
107   - if (channelMapper.selectById(id) == null) {
  164 + private PayChannelDO validateChannelExists(Long id) {
  165 + PayChannelDO channel = channelMapper.selectById(id);
  166 + if (channel == null) {
108 167 throw exception(CHANNEL_NOT_EXISTS);
109 168 }
  169 + return channel;
110 170 }
111 171  
112 172 @Override
... ... @@ -115,44 +175,19 @@ public class PayChannelServiceImpl implements PayChannelService {
115 175 }
116 176  
117 177 @Override
118   - public PageResult<PayChannelDO> getChannelPage(PayChannelPageReqVO pageReqVO) {
119   - return channelMapper.selectPage(pageReqVO);
120   - }
121   -
122   - @Override
123 178 public List<PayChannelDO> getChannelListByAppIds(Collection<Long> appIds) {
124   - return channelMapper.getChannelListByAppIds(appIds);
  179 + return channelMapper.selectListByAppIds(appIds);
125 180 }
126 181  
127 182 @Override
128   - public PayChannelDO getChannelByConditions(Long appid, String code) {
129   - return this.channelMapper.selectOne(appid, code);
130   - }
131   -
132   - /**
133   - * 设置渠道配置以及参数校验
134   - *
135   - * @param channel 渠道
136   - * @param configStr 配置
137   - */
138   - private void settingConfigAndCheckParam(PayChannelDO channel, String configStr) {
139   - // 得到这个渠道是微信的还是支付宝的
140   - Class<? extends PayClientConfig> payClass = PayChannelEnum.getByCode(channel.getCode()).getConfigClass();
141   - if (ObjectUtil.isNull(payClass)) {
142   - throw exception(CHANNEL_NOT_EXISTS);
143   - }
144   - // TODO @芋艿:不要使用 hutool 的 json 工具,用项目的
145   - PayClientConfig config = JSONUtil.toBean(configStr, payClass);
146   -
147   - // 验证参数
148   - config.validate(validator);
149   - channel.setConfig(config);
  183 + public PayChannelDO getChannelByAppIdAndCode(Long appId, String code) {
  184 + return channelMapper.selectByAppIdAndCode(appId, code);
150 185 }
151 186  
152 187 @Override
153 188 public PayChannelDO validPayChannel(Long id) {
154 189 PayChannelDO channel = channelMapper.selectById(id);
155   - this.validPayChannel(channel);
  190 + validPayChannel(channel);
156 191 return channel;
157 192 }
158 193  
... ... @@ -163,18 +198,18 @@ public class PayChannelServiceImpl implements PayChannelService {
163 198 return channel;
164 199 }
165 200  
166   - @Override
167   - public List<PayChannelDO> getEnableChannelList(Long appId) {
168   - return channelMapper.selectListByAppId(appId, CommonStatusEnum.ENABLE.getStatus());
169   - }
170   -
171 201 private void validPayChannel(PayChannelDO channel) {
172 202 if (channel == null) {
173   - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_CHANNEL_NOT_FOUND);
  203 + throw exception(ErrorCodeConstants.PAY_CHANNEL_NOT_FOUND);
174 204 }
175 205 if (CommonStatusEnum.DISABLE.getStatus().equals(channel.getStatus())) {
176   - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_CHANNEL_IS_DISABLE);
  206 + throw exception(ErrorCodeConstants.PAY_CHANNEL_IS_DISABLE);
177 207 }
178 208 }
179 209  
  210 + @Override
  211 + public List<PayChannelDO> getEnableChannelList(Long appId) {
  212 + return channelMapper.selectListByAppId(appId, CommonStatusEnum.ENABLE.getStatus());
  213 + }
  214 +
180 215 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/demo/PayDemoOrderServiceImpl.java
1 1 package cn.iocoder.yudao.module.pay.service.demo;
2 2  
3 3 import cn.hutool.core.lang.Assert;
4   -import cn.hutool.core.util.ObjectUtil;
5 4 import cn.iocoder.yudao.framework.common.pojo.PageParam;
6 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
7   -import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
8 6 import cn.iocoder.yudao.module.pay.api.order.PayOrderApi;
9 7 import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO;
10 8 import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderRespDTO;
... ... @@ -85,14 +83,14 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
85 83 // 1.2 插入 demo 订单
86 84 PayDemoOrderDO demoOrder = new PayDemoOrderDO().setUserId(userId)
87 85 .setSpuId(createReqVO.getSpuId()).setSpuName(spuName)
88   - .setPrice(price).setPayed(false).setRefundPrice(0);
  86 + .setPrice(price).setPayStatus(false).setRefundPrice(0);
89 87 payDemoOrderMapper.insert(demoOrder);
90 88  
91 89 // 2.1 创建支付单
92 90 Long payOrderId = payOrderApi.createOrder(new PayOrderCreateReqDTO()
93 91 .setAppId(PAY_APP_ID).setUserIp(getClientIP()) // 支付应用
94 92 .setMerchantOrderId(demoOrder.getId().toString()) // 业务的订单编号
95   - .setSubject(spuName).setBody("").setAmount(price) // 价格信息
  93 + .setSubject(spuName).setBody("").setPrice(price) // 价格信息
96 94 .setExpireTime(addTime(Duration.ofHours(2L)))); // 支付的过期时间
97 95 // 2.2 更新支付单到 demo 订单
98 96 payDemoOrderMapper.updateById(new PayDemoOrderDO().setId(demoOrder.getId())
... ... @@ -101,12 +99,6 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
101 99 return demoOrder.getId();
102 100 }
103 101  
104   -// private void validateDemoOrderExists(Long id) {
105   -// if (demoOrderMapper.selectById(id) == null) {
106   -// throw exception(DEMO_ORDER_NOT_EXISTS);
107   -// }
108   -// }
109   -
110 102 @Override
111 103 public PayDemoOrderDO getDemoOrder(Long id) {
112 104 return payDemoOrderMapper.selectById(id);
... ... @@ -124,7 +116,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
124 116  
125 117 // 更新 PayDemoOrderDO 状态为已支付
126 118 int updateCount = payDemoOrderMapper.updateByIdAndPayed(id, false,
127   - new PayDemoOrderDO().setPayed(true).setPayTime(LocalDateTime.now())
  119 + new PayDemoOrderDO().setPayStatus(true).setPayTime(LocalDateTime.now())
128 120 .setPayChannelCode(payOrder.getChannelCode()));
129 121 if (updateCount == 0) {
130 122 throw exception(PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID);
... ... @@ -148,7 +140,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
148 140 throw exception(PAY_DEMO_ORDER_NOT_FOUND);
149 141 }
150 142 // 1.2 校验订单未支付
151   - if (order.getPayed()) {
  143 + if (order.getPayStatus()) {
152 144 log.error("[validateDemoOrderCanPaid][order({}) 不处于待支付状态,请进行处理!order 数据是:{}]",
153 145 id, toJsonString(order));
154 146 throw exception(PAY_DEMO_ORDER_UPDATE_PAID_STATUS_NOT_UNPAID);
... ... @@ -173,7 +165,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
173 165 throw exception(PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_ORDER_STATUS_NOT_SUCCESS);
174 166 }
175 167 // 2.3 校验支付金额一致
176   - if (notEqual(payOrder.getAmount(), order.getPrice())) {
  168 + if (notEqual(payOrder.getPrice(), order.getPrice())) {
177 169 log.error("[validateDemoOrderCanPaid][order({}) payOrder({}) 支付金额不匹配,请进行处理!order 数据是:{},payOrder 数据是:{}]",
178 170 id, payOrderId, toJsonString(order), toJsonString(payOrder));
179 171 throw exception(PAY_DEMO_ORDER_UPDATE_PAID_FAIL_PAY_PRICE_NOT_MATCH);
... ... @@ -196,7 +188,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
196 188 Long payRefundId = payRefundApi.createPayRefund(new PayRefundCreateReqDTO()
197 189 .setAppId(PAY_APP_ID).setUserIp(getClientIP()) // 支付应用
198 190 .setPayOrderId(order.getPayOrderId()) // 支付单号
199   - .setReason("想退钱").setAmount(order.getPrice()));// 价格信息
  191 + .setReason("想退钱").setPrice(order.getPrice()));// 价格信息
200 192 // 2.2 更新退款单到 demo 订单
201 193 payDemoOrderMapper.updateById(new PayDemoOrderDO().setId(id)
202 194 .setPayRefundId(payRefundId).setRefundPrice(order.getPrice()));
... ... @@ -209,7 +201,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
209 201 throw exception(PAY_DEMO_ORDER_NOT_FOUND);
210 202 }
211 203 // 校验订单是否支付
212   - if (!order.getPayed()) {
  204 + if (!order.getPayStatus()) {
213 205 throw exception(PAY_DEMO_ORDER_REFUND_FAIL_NOT_PAID);
214 206 }
215 207 // 校验订单是否已退款
... ... @@ -251,7 +243,7 @@ public class PayDemoOrderServiceImpl implements PayDemoOrderService {
251 243 throw exception(PAY_DEMO_ORDER_REFUND_FAIL_REFUND_NOT_SUCCESS);
252 244 }
253 245 // 2.3 校验退款金额一致
254   - if (notEqual(payRefund.getRefundAmount(), order.getPrice())) {
  246 + if (notEqual(payRefund.getRefundPrice(), order.getPrice())) {
255 247 log.error("[validateDemoOrderCanRefunded][order({}) payRefund({}) 退款金额不匹配,请进行处理!order 数据是:{},payRefund 数据是:{}]",
256 248 id, payRefundId, toJsonString(order), toJsonString(payRefund));
257 249 throw exception(PAY_DEMO_ORDER_REFUND_FAIL_REFUND_PRICE_NOT_MATCH);
... ...
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;
2 2  
3 3 import cn.hutool.core.collection.CollUtil;
4 4 import cn.hutool.core.exceptions.ExceptionUtil;
  5 +import cn.hutool.core.util.ObjectUtil;
5 6 import cn.hutool.http.HttpResponse;
6 7 import cn.hutool.http.HttpUtil;
7 8 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
... ... @@ -24,10 +25,11 @@ import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
24 25 import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
25 26 import lombok.extern.slf4j.Slf4j;
26 27 import org.springframework.context.annotation.Lazy;
27   -import org.springframework.scheduling.annotation.Async;
28 28 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
29 29 import org.springframework.stereotype.Service;
30 30 import org.springframework.transaction.annotation.Transactional;
  31 +import org.springframework.transaction.support.TransactionSynchronization;
  32 +import org.springframework.transaction.support.TransactionSynchronizationManager;
31 33  
32 34 import javax.annotation.Resource;
33 35 import javax.validation.Valid;
... ... @@ -41,7 +43,6 @@ import java.util.concurrent.CountDownLatch;
41 43 import java.util.concurrent.TimeUnit;
42 44  
43 45 import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.addTime;
44   -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.afterNow;
45 46 import static cn.iocoder.yudao.module.pay.framework.job.config.PayJobConfiguration.NOTIFY_THREAD_POOL_TASK_EXECUTOR;
46 47  
47 48 /**
... ... @@ -86,6 +87,7 @@ public class PayNotifyServiceImpl implements PayNotifyService {
86 87 private PayNotifyServiceImpl self;
87 88  
88 89 @Override
  90 + @Transactional(rollbackFor = Exception.class)
89 91 public void createPayNotifyTask(PayNotifyTaskCreateReqDTO reqDTO) {
90 92 PayNotifyTaskDO task = new PayNotifyTaskDO();
91 93 task.setType(reqDTO.getType()).setDataId(reqDTO.getDataId());
... ... @@ -105,8 +107,13 @@ public class PayNotifyServiceImpl implements PayNotifyService {
105 107 // 执行插入
106 108 payNotifyTaskMapper.insert(task);
107 109  
108   - // 异步直接发起任务。虽然会有定时任务扫描,但是会导致延迟
109   - self.executeNotifyAsync(task);
  110 + // 必须在事务提交后,在发起任务,否则 PayNotifyTaskDO 还没入库,就提前回调接入的业务
  111 + TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
  112 + @Override
  113 + public void afterCommit() {
  114 + executeNotify(task);
  115 + }
  116 + });
110 117 }
111 118  
112 119 @Override
... ... @@ -121,7 +128,7 @@ public class PayNotifyServiceImpl implements PayNotifyService {
121 128 CountDownLatch latch = new CountDownLatch(tasks.size());
122 129 tasks.forEach(task -> threadPoolTaskExecutor.execute(() -> {
123 130 try {
124   - executeNotifySync(task);
  131 + executeNotify(task);
125 132 } finally {
126 133 latch.countDown();
127 134 }
... ... @@ -151,39 +158,30 @@ public class PayNotifyServiceImpl implements PayNotifyService {
151 158 }
152 159  
153 160 /**
154   - * 异步执行单个支付通知
155   - *
156   - * @param task 通知任务
157   - */
158   - @Async
159   - public void executeNotifyAsync(PayNotifyTaskDO task) {
160   - self.executeNotifySync(task); // 使用 self,避免事务不发起
161   - }
162   -
163   - /**
164 161 * 同步执行单个支付通知
165 162 *
166 163 * @param task 通知任务
167 164 */
168   - public void executeNotifySync(PayNotifyTaskDO task) {
  165 + public void executeNotify(PayNotifyTaskDO task) {
169 166 // 分布式锁,避免并发问题
170 167 payNotifyLockCoreRedisDAO.lock(task.getId(), NOTIFY_TIMEOUT_MILLIS, () -> {
171 168 // 校验,当前任务是否已经被通知过
172 169 // 虽然已经通过分布式加锁,但是可能同时满足通知的条件,然后都去获得锁。此时,第一个执行完后,第二个还是能拿到锁,然后会再执行一次。
  170 + // 因此,此处我们通过第 notifyTimes 通知次数是否匹配来判断
173 171 PayNotifyTaskDO dbTask = payNotifyTaskMapper.selectById(task.getId());
174   - if (afterNow(dbTask.getNextNotifyTime())) {
175   - log.info("[executeNotifySync][dbTask({}) 任务被忽略,原因是未到达下次通知时间,可能是因为并发执行了]",
176   - JsonUtils.toJsonString(dbTask));
  172 + if (ObjectUtil.notEqual(task.getNotifyTimes(), dbTask.getNotifyTimes())) {
  173 + log.warn("[executeNotifySync][task({}) 任务被忽略,原因是它的通知不是第 ({}) 次,可能是因为并发执行了]",
  174 + JsonUtils.toJsonString(task), dbTask.getNotifyTimes());
177 175 return;
178 176 }
179 177  
180 178 // 执行通知
181   - self.executeNotify(dbTask);
  179 + self.executeNotify0(dbTask);
182 180 });
183 181 }
184 182  
185 183 @Transactional
186   - public void executeNotify(PayNotifyTaskDO task) {
  184 + public void executeNotify0(PayNotifyTaskDO task) {
187 185 // 发起回调
188 186 CommonResult<?> invokeResult = null;
189 187 Throwable invokeException = null;
... ... @@ -223,7 +221,7 @@ public class PayNotifyServiceImpl implements PayNotifyService {
223 221 }
224 222 // 拼接 header 参数
225 223 Map<String, String> headers = new HashMap<>();
226   - TenantUtils.addTenantHeader(headers);
  224 + TenantUtils.addTenantHeader(headers, task.getTenantId());
227 225  
228 226 // 发起请求
229 227 try (HttpResponse response = HttpUtil.createPost(task.getNotifyUrl())
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderService.java
... ... @@ -33,6 +33,14 @@ public interface PayOrderService {
33 33 PayOrderDO getOrder(Long id);
34 34  
35 35 /**
  36 + * 获得指定应用的订单数量
  37 + *
  38 + * @param appId 应用编号
  39 + * @return 订单数量
  40 + */
  41 + Long getOrderCountByAppId(Long appId);
  42 +
  43 + /**
36 44 * 获得支付订单
37 45 * 分页
38 46 *
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java
1 1 package cn.iocoder.yudao.module.pay.service.order;
2 2  
3 3 import cn.hutool.core.date.DateUtil;
  4 +import cn.hutool.core.lang.Pair;
4 5 import cn.hutool.core.util.ObjectUtil;
5 6 import cn.hutool.core.util.RandomUtil;
6 7 import cn.iocoder.yudao.framework.common.pojo.PageResult;
  8 +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
7 9 import cn.iocoder.yudao.framework.pay.config.PayProperties;
8 10 import cn.iocoder.yudao.framework.pay.core.client.PayClient;
9 11 import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
... ... @@ -28,6 +30,7 @@ import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants;
28 30 import cn.iocoder.yudao.module.pay.enums.notify.PayNotifyTypeEnum;
29 31 import cn.iocoder.yudao.module.pay.enums.order.PayOrderNotifyStatusEnum;
30 32 import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum;
  33 +import cn.iocoder.yudao.module.pay.enums.refund.PayRefundTypeEnum;
31 34 import cn.iocoder.yudao.module.pay.service.app.PayAppService;
32 35 import cn.iocoder.yudao.module.pay.service.channel.PayChannelService;
33 36 import cn.iocoder.yudao.module.pay.service.notify.PayNotifyService;
... ... @@ -41,6 +44,7 @@ import javax.annotation.Resource;
41 44 import java.time.LocalDateTime;
42 45 import java.util.Collection;
43 46 import java.util.List;
  47 +import java.util.Objects;
44 48  
45 49 import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
46 50 import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
... ... @@ -79,6 +83,11 @@ public class PayOrderServiceImpl implements PayOrderService {
79 83 }
80 84  
81 85 @Override
  86 + public Long getOrderCountByAppId(Long appId) {
  87 + return orderMapper.selectCountByAppId(appId);
  88 + }
  89 +
  90 + @Override
82 91 public PageResult<PayOrderDO> getOrderPage(PayOrderPageReqVO pageReqVO) {
83 92 return orderMapper.selectPage(pageReqVO);
84 93 }
... ... @@ -109,22 +118,19 @@ public class PayOrderServiceImpl implements PayOrderService {
109 118 }
110 119  
111 120 // 创建支付交易单
112   - order = PayOrderConvert.INSTANCE.convert(reqDTO).setAppId(app.getId());
113   - // 商户相关字段
114   - order.setNotifyUrl(app.getPayNotifyUrl())
115   - .setNotifyStatus(PayOrderNotifyStatusEnum.NO.getStatus());
116   - // 订单相关字段
117   - order.setStatus(PayOrderStatusEnum.WAITING.getStatus());
118   - // 退款相关字段
119   - // todo @芋艿 创建支付的订单的退款状态枚举是不是有问题,应该是 PayRefundTypeEnum 吧 您这填写的是 PayOrderNotifyStatusEnum 回调状态枚举
120   - order.setRefundStatus(PayOrderNotifyStatusEnum.NO.getStatus())
121   - .setRefundTimes(0).setRefundAmount(0L);
  121 + order = PayOrderConvert.INSTANCE.convert(reqDTO).setAppId(app.getId())
  122 + // 商户相关字段
  123 + .setNotifyUrl(app.getPayNotifyUrl()).setNotifyStatus(PayOrderNotifyStatusEnum.NO.getStatus())
  124 + // 订单相关字段
  125 + .setStatus(PayOrderStatusEnum.WAITING.getStatus())
  126 + // 退款相关字段
  127 + .setRefundStatus(PayRefundTypeEnum.NO.getStatus()).setRefundTimes(0).setRefundPrice(0L);
122 128 orderMapper.insert(order);
123   - // 最终返回
124 129 return order.getId();
125 130 }
126 131  
127 132 @Override
  133 + @Transactional(rollbackFor = Exception.class)
128 134 public PayOrderSubmitRespVO submitPayOrder(PayOrderSubmitReqVO reqVO, String userIp) {
129 135 // 1. 获得 PayOrderDO ,并校验其是否存在
130 136 PayOrderDO order = validatePayOrderCanSubmit(reqVO.getId());
... ... @@ -147,12 +153,18 @@ public class PayOrderServiceImpl implements PayOrderService {
147 153 .setNotifyUrl(genChannelPayNotifyUrl(channel))
148 154 .setReturnUrl(reqVO.getReturnUrl())
149 155 // 订单相关字段
150   - .setAmount(order.getAmount()).setExpireTime(order.getExpireTime());
  156 + .setAmount(order.getPrice()).setExpireTime(order.getExpireTime());
151 157 PayOrderUnifiedRespDTO unifiedOrderRespDTO = client.unifiedOrder(unifiedOrderReqDTO);
152 158  
153   - // TODO 轮询三方接口,是否已经支付的任务
  159 + // 4. 如果调用直接支付成功,则直接更新支付单状态为成功。例如说:付款码支付,免密支付时,就直接验证支付成功
  160 + if (unifiedOrderRespDTO.getNotify() != null) {
  161 + notifyPayOrderSuccess(channel, unifiedOrderRespDTO.getNotify(), null);
  162 + // 此处需要读取最新的状态
  163 + order = orderMapper.selectById(order.getId());
  164 + }
  165 +
154 166 // 返回成功
155   - return PayOrderConvert.INSTANCE.convert(unifiedOrderRespDTO);
  167 + return PayOrderConvert.INSTANCE.convert(order, unifiedOrderRespDTO);
156 168 }
157 169  
158 170 private PayOrderDO validatePayOrderCanSubmit(Long id) {
... ... @@ -163,6 +175,9 @@ public class PayOrderServiceImpl implements PayOrderService {
163 175 if (!PayOrderStatusEnum.WAITING.getStatus().equals(order.getStatus())) { // 校验状态,必须是待支付
164 176 throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING);
165 177 }
  178 + if (LocalDateTimeUtils.beforeNow(order.getExpireTime())) { // 校验是否过期
  179 + throw exception(ErrorCodeConstants.PAY_ORDER_IS_EXPIRED);
  180 + }
166 181 return order;
167 182 }
168 183  
... ... @@ -214,17 +229,22 @@ public class PayOrderServiceImpl implements PayOrderService {
214 229 public void notifyPayOrder(Long channelId, PayOrderNotifyRespDTO notify, PayNotifyReqDTO rawNotify) {
215 230 // 校验支付渠道是否有效
216 231 PayChannelDO channel = channelService.validPayChannel(channelId);
217   - TenantUtils.execute(channel.getTenantId(), () -> {
218   - // 1. 更新 PayOrderExtensionDO 支付成功
219   - PayOrderExtensionDO orderExtension = updatePayOrderExtensionSuccess(notify.getOrderExtensionNo(),
220   - rawNotify);
221   - // 2. 更新 PayOrderDO 支付成功
222   - PayOrderDO order = updatePayOrderSuccess(channel, orderExtension, notify);
223   -
224   - // 3. 插入支付通知记录
225   - notifyService.createPayNotifyTask(PayNotifyTaskCreateReqDTO.builder()
226   - .type(PayNotifyTypeEnum.ORDER.getType()).dataId(order.getId()).build());
227   - });
  232 + // 更新支付订单为已支付
  233 + TenantUtils.execute(channel.getTenantId(), () -> notifyPayOrderSuccess(channel, notify, rawNotify));
  234 + }
  235 +
  236 + private void notifyPayOrderSuccess(PayChannelDO channel, PayOrderNotifyRespDTO notify, PayNotifyReqDTO rawNotify) {
  237 + // 1. 更新 PayOrderExtensionDO 支付成功
  238 + PayOrderExtensionDO orderExtension = updatePayOrderExtensionSuccess(notify.getOrderExtensionNo(), rawNotify);
  239 + // 2. 更新 PayOrderDO 支付成功
  240 + Pair<Boolean, PayOrderDO> order = updatePayOrderSuccess(channel, orderExtension, notify);
  241 + if (order.getKey()) { // 如果之前已经成功回调,则直接返回,不用重复记录支付通知记录;例如说:支付平台重复回调
  242 + return;
  243 + }
  244 +
  245 + // 3. 插入支付通知记录
  246 + notifyService.createPayNotifyTask(PayNotifyTaskCreateReqDTO.builder()
  247 + .type(PayNotifyTypeEnum.ORDER.getType()).dataId(order.getValue().getId()).build());
228 248 }
229 249  
230 250 /**
... ... @@ -235,15 +255,20 @@ public class PayOrderServiceImpl implements PayOrderService {
235 255 * @return PayOrderExtensionDO 对象
236 256 */
237 257 private PayOrderExtensionDO updatePayOrderExtensionSuccess(String no, PayNotifyReqDTO rawNotify) {
238   - // 1.1 查询 PayOrderExtensionDO
  258 + // 1. 查询 PayOrderExtensionDO
239 259 PayOrderExtensionDO orderExtension = orderExtensionMapper.selectByNo(no);
240 260 if (orderExtension == null) {
241 261 throw exception(ErrorCodeConstants.PAY_ORDER_EXTENSION_NOT_FOUND);
242 262 }
  263 + if (PayOrderStatusEnum.isSuccess(orderExtension.getStatus())) { // 如果已经是成功,直接返回,不用重复更新
  264 + log.info("[updatePayOrderSuccess][支付拓展单({}) 已经是已支付,无需更新为已支付]", orderExtension.getId());
  265 + return orderExtension;
  266 + }
243 267 if (ObjectUtil.notEqual(orderExtension.getStatus(), PayOrderStatusEnum.WAITING.getStatus())) { // 校验状态,必须是待支付
244 268 throw exception(ErrorCodeConstants.PAY_ORDER_EXTENSION_STATUS_IS_NOT_WAITING);
245 269 }
246   - // 1.2 更新 PayOrderExtensionDO
  270 +
  271 + // 2. 更新 PayOrderExtensionDO
247 272 int updateCounts = orderExtensionMapper.updateByIdAndStatus(orderExtension.getId(),
248 273 PayOrderStatusEnum.WAITING.getStatus(), PayOrderExtensionDO.builder().id(orderExtension.getId())
249 274 .status(PayOrderStatusEnum.SUCCESS.getStatus())
... ... @@ -261,19 +286,26 @@ public class PayOrderServiceImpl implements PayOrderService {
261 286 * @param channel 支付渠道
262 287 * @param orderExtension 支付拓展单
263 288 * @param notify 通知回调
264   - * @return PayOrderDO 对象
  289 + * @return key:是否之前已经成功回调
  290 + * value:PayOrderDO 对象
265 291 */
266   - private PayOrderDO updatePayOrderSuccess(PayChannelDO channel, PayOrderExtensionDO orderExtension,
267   - PayOrderNotifyRespDTO notify) {
268   - // 2.1 判断 PayOrderDO 是否处于待支付
  292 + private Pair<Boolean, PayOrderDO> updatePayOrderSuccess(PayChannelDO channel, PayOrderExtensionDO orderExtension,
  293 + PayOrderNotifyRespDTO notify) {
  294 + // 1. 判断 PayOrderDO 是否处于待支付
269 295 PayOrderDO order = orderMapper.selectById(orderExtension.getOrderId());
270 296 if (order == null) {
271 297 throw exception(ErrorCodeConstants.PAY_ORDER_NOT_FOUND);
272 298 }
  299 + if (PayOrderStatusEnum.isSuccess(order.getStatus()) // 如果已经是成功,直接返回,不用重复更新
  300 + && Objects.equals(order.getSuccessExtensionId(), orderExtension.getId())) {
  301 + log.info("[updatePayOrderSuccess][支付订单({}) 已经是已支付,无需更新为已支付]", order.getId());
  302 + return Pair.of(true, order);
  303 + }
273 304 if (!PayOrderStatusEnum.WAITING.getStatus().equals(order.getStatus())) { // 校验状态,必须是待支付
274 305 throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING);
275 306 }
276   - // 2.2 更新 PayOrderDO
  307 +
  308 + // 2. 更新 PayOrderDO
277 309 int updateCounts = orderMapper.updateByIdAndStatus(order.getId(), PayOrderStatusEnum.WAITING.getStatus(),
278 310 PayOrderDO.builder().status(PayOrderStatusEnum.SUCCESS.getStatus())
279 311 .channelId(channel.getId()).channelCode(channel.getCode())
... ... @@ -284,7 +316,7 @@ public class PayOrderServiceImpl implements PayOrderService {
284 316 throw exception(ErrorCodeConstants.PAY_ORDER_STATUS_IS_NOT_WAITING);
285 317 }
286 318 log.info("[updatePayOrderSuccess][支付订单({}) 更新为已支付]", order.getId());
287   - return order;
  319 + return Pair.of(false, order);
288 320 }
289 321  
290 322 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundService.java
... ... @@ -26,6 +26,14 @@ public interface PayRefundService {
26 26 PayRefundDO getRefund(Long id);
27 27  
28 28 /**
  29 + * 获得指定应用的退款数量
  30 + *
  31 + * @param appId 应用编号
  32 + * @return 退款数量
  33 + */
  34 + Long getRefundCountByAppId(Long appId);
  35 +
  36 + /**
29 37 * 获得退款订单分页
30 38 *
31 39 * @param pageReqVO 分页查询
... ...
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/refund/PayRefundServiceImpl.java
... ... @@ -81,6 +81,11 @@ public class PayRefundServiceImpl implements PayRefundService {
81 81 }
82 82  
83 83 @Override
  84 + public Long getRefundCountByAppId(Long appId) {
  85 + return refundMapper.selectCountByApp(appId);
  86 + }
  87 +
  88 + @Override
84 89 public PageResult<PayRefundDO> getRefundPage(PayRefundPageReqVO pageReqVO) {
85 90 return refundMapper.selectPage(pageReqVO);
86 91 }
... ... @@ -117,7 +122,7 @@ public class PayRefundServiceImpl implements PayRefundService {
117 122 validatePayRefund(reqDTO, order);
118 123 // 退款类型
119 124 PayRefundTypeEnum refundType = PayRefundTypeEnum.SOME;
120   - if (Objects.equals(reqDTO.getAmount(), order.getAmount())) {
  125 + if (Objects.equals(reqDTO.getPrice(), order.getPrice())) {
121 126 refundType = PayRefundTypeEnum.ALL;
122 127 }
123 128 PayOrderExtensionDO orderExtensionDO = orderExtensionService.getOrderExtension(order.getSuccessExtensionId());
... ... @@ -144,8 +149,8 @@ public class PayRefundServiceImpl implements PayRefundService {
144 149 .orderId(order.getId())
145 150 .merchantRefundNo(merchantRefundId) // TODO 芋艿:需要优化
146 151 .notifyUrl(app.getRefundNotifyUrl())
147   - .payAmount(order.getAmount())
148   - .refundAmount(reqDTO.getAmount())
  152 + .payPrice(order.getPrice())
  153 + .refundPrice(reqDTO.getPrice())
149 154 .userIp(reqDTO.getUserIp())
150 155 .merchantOrderId(order.getMerchantOrderId())
151 156 .tradeNo(orderExtensionDO.getNo())
... ... @@ -159,7 +164,7 @@ public class PayRefundServiceImpl implements PayRefundService {
159 164 // TODO @jason:搞到 convert 里。一些额外的自动,手动 set 下;
160 165 PayRefundUnifiedReqDTO unifiedReqDTO = new PayRefundUnifiedReqDTO();
161 166 unifiedReqDTO.setUserIp(reqDTO.getUserIp())
162   - .setAmount(reqDTO.getAmount())
  167 + .setAmount(reqDTO.getPrice())
163 168 .setChannelOrderNo(order.getChannelOrderNo())
164 169 .setPayTradeNo(orderExtensionDO.getNo())
165 170 .setMerchantRefundId(merchantRefundId) // TODO 芋艿:需要优化
... ... @@ -209,17 +214,17 @@ public class PayRefundServiceImpl implements PayRefundService {
209 214  
210 215 // 得到已退金额
211 216 PayOrderDO payOrderDO = orderService.getOrder(refundDO.getOrderId());
212   - Long refundedAmount = payOrderDO.getRefundAmount();
  217 + Long refundedAmount = payOrderDO.getRefundPrice();
213 218  
214 219 PayOrderStatusEnum orderStatus = PayOrderStatusEnum.SUCCESS;
215   - if(Objects.equals(payOrderDO.getAmount(), refundedAmount+ refundDO.getRefundAmount())){
  220 + if(Objects.equals(payOrderDO.getPrice(), refundedAmount+ refundDO.getRefundPrice())){
216 221 //支付金额 = 已退金额 + 本次退款金额。
217 222 orderStatus = PayOrderStatusEnum.CLOSED;
218 223 }
219 224 // 更新支付订单
220 225 PayOrderDO updateOrderDO = new PayOrderDO();
221 226 updateOrderDO.setId(refundDO.getOrderId())
222   - .setRefundAmount(refundedAmount + refundDO.getRefundAmount())
  227 + .setRefundPrice(refundedAmount + refundDO.getRefundPrice())
223 228 .setStatus(orderStatus.getStatus())
224 229 .setRefundTimes(payOrderDO.getRefundTimes() + 1)
225 230 .setRefundStatus(refundDO.getType());
... ... @@ -257,8 +262,8 @@ public class PayRefundServiceImpl implements PayRefundService {
257 262 throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_REFUND_ALL_REFUNDED);
258 263 }
259 264 // 校验金额 退款金额不能大于 原定的金额
260   - if (reqDTO.getAmount() + order.getRefundAmount() > order.getAmount()){
261   - throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_REFUND_AMOUNT_EXCEED);
  265 + if (reqDTO.getPrice() + order.getRefundPrice() > order.getPrice()){
  266 + throw ServiceExceptionUtil.exception(ErrorCodeConstants.PAY_PRICE_PRICE_EXCEED);
262 267 }
263 268 // 校验渠道订单号
264 269 if (StrUtil.isEmpty(order.getChannelOrderNo())) {
... ...
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 {
30 30 reqDTO.setMerchantOrderId(String.valueOf(System.currentTimeMillis()));
31 31 reqDTO.setSubject("标题");
32 32 reqDTO.setBody("内容");
33   - reqDTO.setAmount(100);
  33 + reqDTO.setPrice(100);
34 34 reqDTO.setExpireTime(DateUtils.addTime(Duration.ofDays(1)));
35 35 // 发起请求
36 36 payOrderService.createPayOrder(reqDTO);
... ...
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;
3 3 import cn.hutool.core.util.RandomUtil;
4 4 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
5 5 import cn.iocoder.yudao.framework.common.pojo.PageResult;
  6 +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
6 7 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
  8 +import cn.iocoder.yudao.framework.test.core.util.RandomUtils;
7 9 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppCreateReqVO;
8 10 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppPageReqVO;
9 11 import cn.iocoder.yudao.module.pay.controller.admin.app.vo.PayAppUpdateReqVO;
10 12 import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
11 13 import cn.iocoder.yudao.module.pay.dal.mysql.app.PayAppMapper;
  14 +import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
  15 +import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
12 16 import org.junit.jupiter.api.Test;
  17 +import org.springframework.boot.test.mock.mockito.MockBean;
13 18 import org.springframework.context.annotation.Import;
14 19  
15 20 import javax.annotation.Resource;
16 21 import java.time.LocalDateTime;
  22 +import java.util.Collections;
  23 +import java.util.Map;
17 24  
  25 +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime;
18 26 import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime;
19 27 import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
20 28 import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
21 29 import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
22   -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
23   -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
24   -import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.PAY_APP_NOT_FOUND;
  30 +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
  31 +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.*;
  32 +import static java.util.Collections.singleton;
25 33 import static org.junit.jupiter.api.Assertions.*;
  34 +import static org.mockito.ArgumentMatchers.eq;
  35 +import static org.mockito.Mockito.when;
26 36  
  37 +/**
  38 + * {@link PayAppServiceImpl} 的单元测试
  39 + *
  40 + * @author aquan
  41 + */
27 42 @Import(PayAppServiceImpl.class)
28 43 public class PayAppServiceTest extends BaseDbUnitTest {
29 44  
... ... @@ -33,17 +48,23 @@ public class PayAppServiceTest extends BaseDbUnitTest {
33 48 @Resource
34 49 private PayAppMapper appMapper;
35 50  
  51 + @MockBean
  52 + private PayOrderService orderService;
  53 + @MockBean
  54 + private PayRefundService refundService;
  55 +
36 56 @Test
37 57 public void testCreateApp_success() {
38 58 // 准备参数
39 59 PayAppCreateReqVO reqVO = randomPojo(PayAppCreateReqVO.class, o ->
40   - o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus())));
  60 + o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus()))
  61 + .setPayNotifyUrl(randomURL())
  62 + .setRefundNotifyUrl(randomURL()));
41 63  
42 64 // 调用
43 65 Long appId = appService.createApp(reqVO);
44 66 // 断言
45 67 assertNotNull(appId);
46   - // 校验记录的属性是否正确
47 68 PayAppDO app = appMapper.selectById(appId);
48 69 assertPojoEquals(reqVO, app);
49 70 }
... ... @@ -51,12 +72,12 @@ public class PayAppServiceTest extends BaseDbUnitTest {
51 72 @Test
52 73 public void testUpdateApp_success() {
53 74 // mock 数据
54   - PayAppDO dbApp = randomPojo(PayAppDO.class, o ->
55   - o.setStatus(CommonStatusEnum.DISABLE.getStatus()));
  75 + PayAppDO dbApp = randomPojo(PayAppDO.class);
56 76 appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
57 77 // 准备参数
58 78 PayAppUpdateReqVO reqVO = randomPojo(PayAppUpdateReqVO.class, o -> {
59 79 o.setStatus(CommonStatusEnum.ENABLE.getStatus());
  80 + o.setPayNotifyUrl(randomURL()).setRefundNotifyUrl(randomURL());
60 81 o.setId(dbApp.getId()); // 设置更新的 ID
61 82 });
62 83  
... ... @@ -77,10 +98,26 @@ public class PayAppServiceTest extends BaseDbUnitTest {
77 98 }
78 99  
79 100 @Test
80   - public void testDeleteApp_success() {
  101 + public void testUpdateAppStatus() {
81 102 // mock 数据
82 103 PayAppDO dbApp = randomPojo(PayAppDO.class, o ->
83   - o.setStatus((RandomUtil.randomEle(CommonStatusEnum.values()).getStatus())));
  104 + o.setStatus(CommonStatusEnum.DISABLE.getStatus()));
  105 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  106 +
  107 + // 准备参数
  108 + Long id = dbApp.getId();
  109 + Integer status = CommonStatusEnum.ENABLE.getStatus();
  110 + // 调用
  111 + appService.updateAppStatus(id, status);
  112 + // 断言
  113 + PayAppDO app = appMapper.selectById(id); // 获取最新的
  114 + assertEquals(status, app.getStatus());
  115 + }
  116 +
  117 + @Test
  118 + public void testDeleteApp_success() {
  119 + // mock 数据
  120 + PayAppDO dbApp = randomPojo(PayAppDO.class);
84 121 appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
85 122 // 准备参数
86 123 Long id = dbApp.getId();
... ... @@ -101,14 +138,70 @@ public class PayAppServiceTest extends BaseDbUnitTest {
101 138 }
102 139  
103 140 @Test
  141 + public void testDeleteApp_existOrder() {
  142 + // mock 数据
  143 + PayAppDO dbApp = randomPojo(PayAppDO.class);
  144 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  145 + // 准备参数
  146 + Long id = dbApp.getId();
  147 + // mock 订单有订单
  148 + when(orderService.getOrderCountByAppId(eq(id))).thenReturn(10L);
  149 +
  150 + // 调用, 并断言异常
  151 + assertServiceException(() -> appService.deleteApp(id), PAY_APP_EXIST_ORDER_CANT_DELETE);
  152 + }
  153 +
  154 + @Test
  155 + public void testDeleteApp_existRefund() {
  156 + // mock 数据
  157 + PayAppDO dbApp = randomPojo(PayAppDO.class);
  158 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  159 + // 准备参数
  160 + Long id = dbApp.getId();
  161 + // mock 订单有订单
  162 + when(refundService.getRefundCountByAppId(eq(id))).thenReturn(10L);
  163 +
  164 + // 调用, 并断言异常
  165 + assertServiceException(() -> appService.deleteApp(id), PAY_APP_EXIST_REFUND_CANT_DELETE);
  166 + }
  167 +
  168 + @Test
  169 + public void testApp() {
  170 + // mock 数据
  171 + PayAppDO dbApp = randomPojo(PayAppDO.class);
  172 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  173 + // 准备参数
  174 + Long id = dbApp.getId();
  175 +
  176 + // 调用
  177 + PayAppDO app = appService.getApp(id);
  178 + // 校验数据一致
  179 + assertPojoEquals(app, dbApp);
  180 + }
  181 +
  182 + @Test
  183 + public void testAppMap() {
  184 + // mock 数据
  185 + PayAppDO dbApp01 = randomPojo(PayAppDO.class);
  186 + appMapper.insert(dbApp01);// @Sql: 先插入出一条存在的数据
  187 + PayAppDO dbApp02 = randomPojo(PayAppDO.class);
  188 + appMapper.insert(dbApp02);// @Sql: 先插入出一条存在的数据
  189 + // 准备参数
  190 + Long id = dbApp01.getId();
  191 +
  192 + // 调用
  193 + Map<Long, PayAppDO> appMap = appService.getAppMap(singleton(id));
  194 + // 校验数据一致
  195 + assertEquals(1, appMap.size());
  196 + assertPojoEquals(dbApp01, appMap.get(id));
  197 + }
  198 +
  199 + @Test
104 200 public void testGetAppPage() {
105 201 // mock 数据
106 202 PayAppDO dbApp = randomPojo(PayAppDO.class, o -> { // 等会查询到
107 203 o.setName("灿灿姐的杂货铺");
108 204 o.setStatus(CommonStatusEnum.ENABLE.getStatus());
109   - o.setRemark("敏敏姐的小卖铺");
110   - o.setPayNotifyUrl("https://www.hc.com");
111   - o.setRefundNotifyUrl("https://www.xm.com");
112 205 o.setCreateTime(buildTime(2021,11,20));
113 206 });
114 207  
... ... @@ -117,22 +210,13 @@ public class PayAppServiceTest extends BaseDbUnitTest {
117 210 appMapper.insert(cloneIgnoreId(dbApp, o -> o.setName("敏敏姐的杂货铺")));
118 211 // 测试 status 不匹配
119 212 appMapper.insert(cloneIgnoreId(dbApp, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())));
120   - // 测试 remark 不匹配
121   - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRemark("灿灿姐的小卖部")));
122   - // 测试 payNotifyUrl 不匹配
123   - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setPayNotifyUrl("xm.com")));
124   - // 测试 refundNotifyUrl 不匹配
125   - appMapper.insert(cloneIgnoreId(dbApp, o -> o.setRefundNotifyUrl("hc.com")));
126 213 // 测试 createTime 不匹配
127 214 appMapper.insert(cloneIgnoreId(dbApp, o -> o.setCreateTime(buildTime(2021,12,21))));
128 215 // 准备参数
129 216 PayAppPageReqVO reqVO = new PayAppPageReqVO();
130 217 reqVO.setName("灿灿姐的杂货铺");
131 218 reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
132   - reqVO.setRemark("敏敏姐的小卖铺");
133   - reqVO.setPayNotifyUrl("https://www.hc.com");
134   - reqVO.setRefundNotifyUrl("https://www.xm.com");
135   - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021,11,19),buildTime(2021,11,21)}));
  219 + reqVO.setCreateTime(buildBetweenTime(2021, 11, 19, 2021, 11, 21));
136 220  
137 221 // 调用
138 222 PageResult<PayAppDO> pageResult = appService.getAppPage(reqVO);
... ... @@ -142,4 +226,37 @@ public class PayAppServiceTest extends BaseDbUnitTest {
142 226 assertPojoEquals(dbApp, pageResult.getList().get(0));
143 227 }
144 228  
  229 + @Test
  230 + public void testValidPayApp_success() {
  231 + // mock 数据
  232 + PayAppDO dbApp = randomPojo(PayAppDO.class,
  233 + o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus()));
  234 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  235 + // 准备参数
  236 + Long id = dbApp.getId();
  237 +
  238 + // 调用
  239 + PayAppDO app = appService.validPayApp(id);
  240 + // 校验数据一致
  241 + assertPojoEquals(app, dbApp);
  242 + }
  243 +
  244 + @Test
  245 + public void testValidPayApp_notFound() {
  246 + assertServiceException(() -> appService.validPayApp(randomLongId()), PAY_APP_NOT_FOUND);
  247 + }
  248 +
  249 + @Test
  250 + public void testValidPayApp_disable() {
  251 + // mock 数据
  252 + PayAppDO dbApp = randomPojo(PayAppDO.class,
  253 + o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()));
  254 + appMapper.insert(dbApp);// @Sql: 先插入出一条存在的数据
  255 + // 准备参数
  256 + Long id = dbApp.getId();
  257 +
  258 + // 调用,并断言异常
  259 + assertServiceException(() -> appService.validPayApp(id), PAY_APP_IS_DISABLE);
  260 + }
  261 +
145 262 }
... ...
yudao-module-pay/yudao-module-pay-biz/src/test/java/cn/iocoder/yudao/module/pay/service/channel/PayChannelServiceTest.java
1 1 package cn.iocoder.yudao.module.pay.service.channel;
2 2  
3 3 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
  4 +import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
5 5 import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory;
6 6 import cn.iocoder.yudao.framework.pay.core.client.impl.alipay.AlipayPayClientConfig;
7 7 import cn.iocoder.yudao.framework.pay.core.client.impl.weixin.WxPayClientConfig;
8 8 import cn.iocoder.yudao.framework.pay.core.enums.channel.PayChannelEnum;
9 9 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
10 10 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelCreateReqVO;
11   -import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelPageReqVO;
12 11 import cn.iocoder.yudao.module.pay.controller.admin.channel.vo.PayChannelUpdateReqVO;
13 12 import cn.iocoder.yudao.module.pay.dal.dataobject.channel.PayChannelDO;
14 13 import cn.iocoder.yudao.module.pay.dal.mysql.channel.PayChannelMapper;
15 14 import com.alibaba.fastjson.JSON;
  15 +import org.junit.jupiter.api.BeforeEach;
16 16 import org.junit.jupiter.api.Test;
17 17 import org.springframework.boot.test.mock.mockito.MockBean;
18 18 import org.springframework.context.annotation.Import;
19 19  
20 20 import javax.annotation.Resource;
21 21 import javax.validation.Validator;
22   -import java.time.LocalDateTime;
23 22  
24   -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime;
25   -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
  23 +import java.util.Collections;
  24 +import java.util.List;
  25 +
26 26 import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
27 27 import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException;
28   -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
29   -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
  28 +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
  29 +import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_EXIST_SAME_CHANNEL_ERROR;
30 30 import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_NOT_EXISTS;
31 31 import static org.junit.jupiter.api.Assertions.*;
32 32  
33 33 @Import({PayChannelServiceImpl.class})
34 34 public class PayChannelServiceTest extends BaseDbUnitTest {
35 35  
  36 + private static final String ALIPAY_SERVER_URL = "https://openapi.alipay.com/gateway.do";
  37 +
36 38 @Resource
37 39 private PayChannelServiceImpl channelService;
38 40  
... ... @@ -44,110 +46,62 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
44 46 @MockBean
45 47 private Validator validator;
46 48  
47   - @Test
48   - public void testCreateWechatVersion2Channel_success() {
49   - // 准备参数
50   - WxPayClientConfig v2Config = getV2Config();
51   - PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> {
52   - o.setCode(PayChannelEnum.WX_PUB.getCode());
53   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
54   - o.setConfig(JSON.toJSONString(v2Config));
55   - });
56   -
57   - // 调用
58   - Long channelId = channelService.createChannel(reqVO);
59   - // 断言
60   - assertNotNull(channelId);
61   - // 校验记录的属性是否正确
62   - PayChannelDO channel = channelMapper.selectById(channelId);
63   - assertPojoEquals(reqVO, channel, "config");
64   - // 关于config 对象应该拿出来重新对比
65   - assertPojoEquals(v2Config, channel.getConfig());
  49 + @BeforeEach
  50 + public void setUp() {
  51 + channelService.setChannelCache(null);
66 52 }
67 53  
68 54 @Test
69   - public void testCreateWechatVersion3Channel_success() {
  55 + public void testCreateChannel_success() {
70 56 // 准备参数
71   - WxPayClientConfig v3Config = getV3Config();
  57 + WxPayClientConfig config = randomWxPayClientConfig();
72 58 PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> {
  59 + o.setStatus(randomCommonStatus());
73 60 o.setCode(PayChannelEnum.WX_PUB.getCode());
74   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
75   - o.setConfig(JSON.toJSONString(v3Config));
  61 + o.setConfig(JsonUtils.toJsonString(config));
76 62 });
77 63  
78 64 // 调用
79 65 Long channelId = channelService.createChannel(reqVO);
80   - // 断言
81   - assertNotNull(channelId);
82 66 // 校验记录的属性是否正确
83 67 PayChannelDO channel = channelMapper.selectById(channelId);
84 68 assertPojoEquals(reqVO, channel, "config");
85   - // 关于config 对象应该拿出来重新对比
86   - assertPojoEquals(v3Config, channel.getConfig());
  69 + assertPojoEquals(config, channel.getConfig());
  70 + // 校验缓存
  71 + assertEquals(1, channelService.getChannelCache().size());
  72 + assertEquals(channel, channelService.getChannelCache().get(0));
87 73 }
88 74  
89 75 @Test
90   - public void testCreateAliPayPublicKeyChannel_success() {
91   - // 准备参数
92   -
93   - AlipayPayClientConfig payClientConfig = getPublicKeyConfig();
94   - PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> {
95   - o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
96   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
97   - o.setConfig(JSON.toJSONString(payClientConfig));
98   - });
99   -
100   - // 调用
101   - Long channelId = channelService.createChannel(reqVO);
102   - // 断言
103   - assertNotNull(channelId);
104   - // 校验记录的属性是否正确
105   - PayChannelDO channel = channelMapper.selectById(channelId);
106   - assertPojoEquals(reqVO, channel, "config");
107   - // 关于config 对象应该拿出来重新对比
108   - assertPojoEquals(payClientConfig, channel.getConfig());
109   -
110   - }
111   -
112   - @Test
113   - public void testCreateAliPayCertificateChannel_success() {
  76 + public void testCreateChannel_exists() {
  77 + // mock 数据
  78 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class,
  79 + o -> o.setConfig(randomWxPayClientConfig()));
  80 + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据
114 81 // 准备参数
115   -
116   - AlipayPayClientConfig payClientConfig = getCertificateConfig();
117 82 PayChannelCreateReqVO reqVO = randomPojo(PayChannelCreateReqVO.class, o -> {
118   - o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
119   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
120   - o.setConfig(JSON.toJSONString(payClientConfig));
  83 + o.setAppId(dbChannel.getAppId());
  84 + o.setCode(dbChannel.getCode());
121 85 });
122 86  
123   - // 调用
124   - Long channelId = channelService.createChannel(reqVO);
125   - // 断言
126   - assertNotNull(channelId);
127   - // 校验记录的属性是否正确
128   - PayChannelDO channel = channelMapper.selectById(channelId);
129   - assertPojoEquals(reqVO, channel, "config");
130   - // 关于config 对象应该拿出来重新对比
131   - assertPojoEquals(payClientConfig, channel.getConfig());
  87 + // 调用, 并断言异常
  88 + assertServiceException(() -> channelService.createChannel(reqVO), CHANNEL_EXIST_SAME_CHANNEL_ERROR);
132 89 }
133 90  
134 91 @Test
135 92 public void testUpdateChannel_success() {
136 93 // mock 数据
137   - AlipayPayClientConfig payClientConfig = getCertificateConfig();
138 94 PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> {
139 95 o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
140   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
141   - o.setConfig(payClientConfig);
  96 + o.setConfig(randomAlipayPayClientConfig());
142 97 });
143 98 channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据
144 99 // 准备参数
145   - AlipayPayClientConfig payClientPublicKeyConfig = getPublicKeyConfig();
  100 + AlipayPayClientConfig config = randomAlipayPayClientConfig();
146 101 PayChannelUpdateReqVO reqVO = randomPojo(PayChannelUpdateReqVO.class, o -> {
147   - o.setCode(dbChannel.getCode());
148   - o.setStatus(dbChannel.getStatus());
149   - o.setConfig(JSON.toJSONString(payClientPublicKeyConfig));
150 102 o.setId(dbChannel.getId()); // 设置更新的 ID
  103 + o.setStatus(randomCommonStatus());
  104 + o.setConfig(JsonUtils.toJsonString(config));
151 105 });
152 106  
153 107 // 调用
... ... @@ -155,15 +109,17 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
155 109 // 校验是否更新正确
156 110 PayChannelDO channel = channelMapper.selectById(reqVO.getId()); // 获取最新的
157 111 assertPojoEquals(reqVO, channel, "config");
158   - assertPojoEquals(payClientPublicKeyConfig, channel.getConfig());
  112 + assertPojoEquals(config, channel.getConfig());
  113 + // 校验缓存
  114 + assertEquals(1, channelService.getChannelCache().size());
  115 + assertEquals(channel, channelService.getChannelCache().get(0));
159 116 }
160 117  
161 118 @Test
162 119 public void testUpdateChannel_notExists() {
163 120 // 准备参数
164   - AlipayPayClientConfig payClientPublicKeyConfig = getPublicKeyConfig();
  121 + AlipayPayClientConfig payClientPublicKeyConfig = randomAlipayPayClientConfig();
165 122 PayChannelUpdateReqVO reqVO = randomPojo(PayChannelUpdateReqVO.class, o -> {
166   - o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
167 123 o.setStatus(CommonStatusEnum.ENABLE.getStatus());
168 124 o.setConfig(JSON.toJSONString(payClientPublicKeyConfig));
169 125 });
... ... @@ -175,11 +131,9 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
175 131 @Test
176 132 public void testDeleteChannel_success() {
177 133 // mock 数据
178   - AlipayPayClientConfig payClientConfig = getCertificateConfig();
179 134 PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> {
180 135 o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
181   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
182   - o.setConfig(payClientConfig);
  136 + o.setConfig(randomAlipayPayClientConfig());
183 137 });
184 138 channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据
185 139 // 准备参数
... ... @@ -189,6 +143,8 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
189 143 channelService.deleteChannel(id);
190 144 // 校验数据不存在了
191 145 assertNull(channelMapper.selectById(id));
  146 + // 校验缓存
  147 + assertEquals(0, channelService.getChannelCache().size());
192 148 }
193 149  
194 150 @Test
... ... @@ -200,119 +156,80 @@ public class PayChannelServiceTest extends BaseDbUnitTest {
200 156 assertServiceException(() -> channelService.deleteChannel(id), CHANNEL_NOT_EXISTS);
201 157 }
202 158  
203   - @Test // TODO 请修改 null 为需要的值
204   - public void testGetChannelPage() {
  159 + @Test
  160 + public void testGetChannel() {
205 161 // mock 数据
206   - AlipayPayClientConfig payClientConfig = getCertificateConfig();
207   - PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> { // 等会查询到
  162 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> {
208 163 o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
209   - o.setStatus(CommonStatusEnum.ENABLE.getStatus());
210   - o.setRemark("灿灿子的支付渠道");
211   - o.setFeeRate(0.03);
212   - o.setAppId(1L);
213   - o.setConfig(payClientConfig);
214   - o.setCreateTime(buildTime(2021,11,20));
  164 + o.setConfig(randomAlipayPayClientConfig());
215 165 });
216   - channelMapper.insert(dbChannel);
217   - // 执行拷贝的时候会出现异常,所以在插入后要重置为null 后续在写入新的
218   - dbChannel.setConfig(null);
219   - // 测试 code 不匹配
220   - channelMapper.insert(cloneIgnoreId(dbChannel, o -> {
221   - o.setConfig(payClientConfig);
222   - o.setCode(PayChannelEnum.WX_PUB.getCode());
223   - }));
224   - // 测试 status 不匹配
225   - channelMapper.insert(cloneIgnoreId(dbChannel, o -> {
226   - o.setConfig(payClientConfig);
227   - o.setStatus(CommonStatusEnum.DISABLE.getStatus());
228   - }));
229   - // 测试 remark 不匹配
230   - channelMapper.insert(cloneIgnoreId(dbChannel, o ->{
231   - o.setConfig(payClientConfig);
232   - o.setRemark("敏敏子的渠道");
233   - }));
234   - // 测试 feeRate 不匹配
235   - channelMapper.insert(cloneIgnoreId(dbChannel, o -> {
236   - o.setConfig(payClientConfig);
237   - o.setFeeRate(1.23);
238   - }));
239   - // 测试 appId 不匹配
240   - channelMapper.insert(cloneIgnoreId(dbChannel, o -> {
241   - o.setConfig(payClientConfig);
242   - o.setAppId(2L);
243   - }));
244   - // 测试 createTime 不匹配
245   - channelMapper.insert(cloneIgnoreId(dbChannel, o -> {
246   - o.setConfig(payClientConfig);
247   - o.setCreateTime(buildTime(2021, 10, 20));
248   - }));
  166 + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据
249 167 // 准备参数
250   - PayChannelPageReqVO reqVO = new PayChannelPageReqVO();
251   - reqVO.setCode(PayChannelEnum.ALIPAY_APP.getCode());
252   - reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
253   - reqVO.setRemark("灿灿子的支付渠道");
254   - reqVO.setFeeRate(0.03);
255   - reqVO.setAppId(1L);
256   - reqVO.setConfig(JSON.toJSONString(payClientConfig));
257   - reqVO.setCreateTime((new LocalDateTime[]{buildTime(2021,11,19),buildTime(2021,11,21)}));
  168 + Long id = dbChannel.getId();
258 169  
259 170 // 调用
260   - PageResult<PayChannelDO> pageResult = channelService.getChannelPage(reqVO);
261   - // 断言
262   - assertEquals(1, pageResult.getTotal());
263   - assertEquals(1, pageResult.getList().size());
264   - assertPojoEquals(dbChannel, pageResult.getList().get(0), "config");
265   - assertPojoEquals(payClientConfig, pageResult.getList().get(0).getConfig());
266   -
  171 + PayChannelDO channel = channelService.getChannel(id);
  172 + // 校验是否更新正确
  173 + assertPojoEquals(dbChannel, channel);
267 174 }
268 175  
269   - public WxPayClientConfig getV2Config() {
270   - return new WxPayClientConfig()
271   - .setAppId("APP00001")
272   - .setMchId("MCH00001")
273   - .setApiVersion(WxPayClientConfig.API_VERSION_V2)
274   - .setMchKey("dsa1d5s6a1d6sa16d1sa56d15a61das6")
275   - .setApiV3Key("")
276   - .setPrivateCertContent("")
277   - .setPrivateKeyContent("");
  176 + @Test
  177 + public void testGetChannelListByAppIds() {
  178 + // mock 数据
  179 + PayChannelDO dbChannel01 = randomPojo(PayChannelDO.class, o -> {
  180 + o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
  181 + o.setConfig(randomAlipayPayClientConfig());
  182 + });
  183 + channelMapper.insert(dbChannel01);// @Sql: 先插入出一条存在的数据
  184 + PayChannelDO dbChannel02 = randomPojo(PayChannelDO.class, o -> {
  185 + o.setCode(PayChannelEnum.WX_PUB.getCode());
  186 + o.setConfig(randomWxPayClientConfig());
  187 + });
  188 + channelMapper.insert(dbChannel02);// @Sql: 先插入出一条存在的数据
  189 + // 准备参数
  190 + Long appId = dbChannel01.getAppId();
  191 +
  192 + // 调用
  193 + List<PayChannelDO> channels = channelService.getChannelListByAppIds(Collections.singleton(appId));
  194 + // 校验是否更新正确
  195 + assertEquals(1, channels.size());
  196 + assertPojoEquals(dbChannel01, channels.get(0));
278 197 }
279 198  
280   - public WxPayClientConfig getV3Config() {
281   - return new WxPayClientConfig()
282   - .setAppId("APP00001")
283   - .setMchId("MCH00001")
284   - .setApiVersion(WxPayClientConfig.API_VERSION_V3)
285   - .setMchKey("")
286   - .setApiV3Key("sdadasdsadadsa")
287   - .setPrivateKeyContent("dsa445das415d15asd16ad156as")
288   - .setPrivateCertContent("dsadasd45asd4s5a");
  199 + @Test
  200 + public void testGetChannelByAppIdAndCode() {
  201 + // mock 数据
  202 + PayChannelDO dbChannel = randomPojo(PayChannelDO.class, o -> {
  203 + o.setCode(PayChannelEnum.ALIPAY_APP.getCode());
  204 + o.setConfig(randomAlipayPayClientConfig());
  205 + });
  206 + channelMapper.insert(dbChannel);// @Sql: 先插入出一条存在的数据
  207 + // 准备参数
  208 + Long appId = dbChannel.getAppId();
  209 + String code = dbChannel.getCode();;
289 210  
  211 + // 调用
  212 + PayChannelDO channel = channelService.getChannelByAppIdAndCode(appId, code);
  213 + // 断言
  214 + assertPojoEquals(channel, dbChannel);
290 215 }
291 216  
292   - public AlipayPayClientConfig getPublicKeyConfig() {
293   - return new AlipayPayClientConfig()
294   - .setServerUrl(AlipayPayClientConfig.SERVER_URL_PROD)
295   - .setAppId("APP00001")
296   - .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT)
297   - .setMode(AlipayPayClientConfig.MODE_PUBLIC_KEY)
298   - .setPrivateKey("13131321312")
299   - .setAlipayPublicKey("13321321321")
300   - .setAppCertContent("")
301   - .setAlipayPublicCertContent("")
302   - .setRootCertContent("");
  217 + public WxPayClientConfig randomWxPayClientConfig() {
  218 + return new WxPayClientConfig()
  219 + .setAppId(randomString())
  220 + .setMchId(randomString())
  221 + .setApiVersion(WxPayClientConfig.API_VERSION_V2)
  222 + .setMchKey(randomString());
303 223 }
304 224  
305   - public AlipayPayClientConfig getCertificateConfig() {
  225 + public AlipayPayClientConfig randomAlipayPayClientConfig() {
306 226 return new AlipayPayClientConfig()
307   - .setServerUrl(AlipayPayClientConfig.SERVER_URL_PROD)
308   - .setAppId("APP00001")
  227 + .setServerUrl(randomURL())
  228 + .setAppId(randomString())
309 229 .setSignType(AlipayPayClientConfig.SIGN_TYPE_DEFAULT)
310   - .setMode(AlipayPayClientConfig.MODE_CERTIFICATE)
311   - .setPrivateKey("")
312   - .setAlipayPublicKey("")
313   - .setAppCertContent("13321321321sda")
314   - .setAlipayPublicCertContent("13321321321aqeqw")
315   - .setRootCertContent("13321321321dsad");
  230 + .setMode(AlipayPayClientConfig.MODE_PUBLIC_KEY)
  231 + .setPrivateKey(randomString())
  232 + .setAlipayPublicKey(randomString());
316 233 }
317 234  
318 235 }
... ...
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 {
75 75 o.setBody("斌斌子送给灿灿子的炸弹猫");
76 76 o.setNotifyUrl("https://hc.com/lbh");
77 77 o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus());
78   - o.setAmount(10000);
  78 + o.setPrice(10000);
79 79 o.setChannelFeeRate(0.01);
80   - o.setChannelFeeAmount(1L);
  80 + o.setChannelFeePrice(1L);
81 81 o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus());
82 82 o.setUserIp("127.0.0.1");
83 83 o.setCreateTime(LocalDateTime.of(2018, 1, 1, 10, 1, 0));
... ... @@ -87,7 +87,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest {
87 87 o.setSuccessExtensionId(1L);
88 88 o.setRefundStatus(PayRefundTypeEnum.NO.getStatus());
89 89 o.setRefundTimes(0);
90   - o.setRefundAmount(0L);
  90 + o.setRefundPrice(0L);
91 91 o.setChannelUserId("1008611");
92 92 o.setChannelOrderNo(channelOrderId);
93 93 o.setUpdateTime(LocalDateTime.of(2018, 1, 1, 10, 10, 15));
... ... @@ -143,9 +143,9 @@ public class PayOrderServiceTest extends BaseDbUnitTest {
143 143 o.setBody("斌斌子送给灿灿子的炸弹猫");
144 144 o.setNotifyUrl("https://hc.com/lbh");
145 145 o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus());
146   - o.setAmount(10000);
  146 + o.setPrice(10000);
147 147 o.setChannelFeeRate(0.01);
148   - o.setChannelFeeAmount(1L);
  148 + o.setChannelFeePrice(1L);
149 149 o.setStatus(PayOrderStatusEnum.SUCCESS.getStatus());
150 150 o.setUserIp("127.0.0.1");
151 151 o.setCreateTime(LocalDateTime.of(2018, 1, 1, 10, 1, 0));
... ... @@ -155,7 +155,7 @@ public class PayOrderServiceTest extends BaseDbUnitTest {
155 155 o.setSuccessExtensionId(1L);
156 156 o.setRefundStatus(PayRefundTypeEnum.NO.getStatus());
157 157 o.setRefundTimes(0);
158   - o.setRefundAmount(0L);
  158 + o.setRefundPrice(0L);
159 159 o.setChannelUserId("1008611");
160 160 o.setChannelOrderNo(channelOrderId);
161 161 o.setUpdateTime(LocalDateTime.of(2018, 1, 1, 10, 10, 15));
... ...
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 {
69 69 o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus());
70 70 o.setStatus(PayRefundStatusEnum.SUCCESS.getStatus());
71 71 o.setType(PayRefundTypeEnum.SOME.getStatus());
72   - o.setPayAmount(100);
73   - o.setRefundAmount(500);
  72 + o.setPayPrice(100);
  73 + o.setRefundPrice(500);
74 74 o.setReason("就是想退款了,你有意见吗");
75 75 o.setUserIp("127.0.0.1");
76 76 o.setChannelOrderNo("CH0000001");
... ... @@ -134,8 +134,8 @@ public class PayRefundServiceTest extends BaseDbUnitTest {
134 134 o.setNotifyStatus(PayOrderNotifyStatusEnum.SUCCESS.getStatus());
135 135 o.setStatus(PayRefundStatusEnum.SUCCESS.getStatus());
136 136 o.setType(PayRefundTypeEnum.SOME.getStatus());
137   - o.setPayAmount(100);
138   - o.setRefundAmount(500);
  137 + o.setPayPrice(100);
  138 + o.setRefundPrice(500);
139 139 o.setReason("就是想退款了,你有意见吗");
140 140 o.setUserIp("127.0.0.1");
141 141 o.setChannelOrderNo("CH0000001");
... ...
yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/clean.sql
1   -DELETE FROM pay_merchant;
2 1 DELETE FROM pay_app;
3 2 DELETE FROM pay_channel;
4 3 DELETE FROM pay_order;
... ...
yudao-module-pay/yudao-module-pay-biz/src/test/resources/sql/create_tables.sql
1   -CREATE TABLE IF NOT EXISTS "pay_merchant" (
2   - "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
3   - "no" varchar(32) NOT NULL,
4   - "name" varchar(64) NOT NULL,
5   - "short_name" varchar(64) NOT NULL,
6   - "status" tinyint NOT NULL,
7   - "remark" varchar(255) DEFAULT NULL,
8   - "creator" varchar(64) DEFAULT '',
9   - "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
10   - "updater" varchar(64) DEFAULT '',
11   - "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
12   - "deleted" bit(1) NOT NULL DEFAULT FALSE,
13   - PRIMARY KEY ("id")
14   -) COMMENT '支付商户信息';
15   -
16 1 CREATE TABLE IF NOT EXISTS "pay_app" (
17 2 "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
18 3 "name" varchar(64) NOT NULL,
... ... @@ -20,14 +5,13 @@ CREATE TABLE IF NOT EXISTS &quot;pay_app&quot; (
20 5 "remark" varchar(255) DEFAULT NULL,
21 6 `pay_notify_url` varchar(1024) NOT NULL,
22 7 `refund_notify_url` varchar(1024) NOT NULL,
23   - `merchant_id` bigint(20) NOT NULL,
24 8 "creator" varchar(64) DEFAULT '',
25 9 "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
26 10 "updater" varchar(64) DEFAULT '',
27 11 "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
28 12 "deleted" bit(1) NOT NULL DEFAULT FALSE,
29 13 PRIMARY KEY ("id")
30   -) COMMENT = '支付应用信息';
  14 +) COMMENT = '支付应用';
31 15  
32 16 CREATE TABLE IF NOT EXISTS "pay_channel" (
33 17 "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
... ... @@ -35,7 +19,6 @@ CREATE TABLE IF NOT EXISTS &quot;pay_channel&quot; (
35 19 "status" tinyint(4) NOT NULL,
36 20 "remark" varchar(255) DEFAULT NULL,
37 21 "fee_rate" double NOT NULL DEFAULT 0,
38   - "merchant_id" bigint(20) NOT NULL,
39 22 "app_id" bigint(20) NOT NULL,
40 23 "config" varchar(10240) NOT NULL,
41 24 "creator" varchar(64) NULL DEFAULT '',
... ... @@ -49,7 +32,6 @@ CREATE TABLE IF NOT EXISTS &quot;pay_channel&quot; (
49 32  
50 33 CREATE TABLE IF NOT EXISTS `pay_order` (
51 34 "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
52   - `merchant_id` bigint(20) NOT NULL,
53 35 `app_id` bigint(20) NOT NULL,
54 36 `channel_id` bigint(20) DEFAULT NULL,
55 37 `channel_code` varchar(32) DEFAULT NULL,
... ... @@ -82,7 +64,6 @@ CREATE TABLE IF NOT EXISTS `pay_order` (
82 64  
83 65 CREATE TABLE IF NOT EXISTS `pay_refund` (
84 66 "id" number NOT NULL GENERATED BY DEFAULT AS IDENTITY,
85   - `merchant_id` bigint(20) NOT NULL,
86 67 `app_id` bigint(20) NOT NULL,
87 68 `channel_id` bigint(20) NOT NULL,
88 69 `channel_code` varchar(32) NOT NULL,
... ...
yudao-server/pom.xml
... ... @@ -53,7 +53,7 @@
53 53 <!-- <artifactId>yudao-module-bpm-biz</artifactId>-->
54 54 <!-- <version>${revision}</version>-->
55 55 <!-- </dependency>-->
56   - <!-- 支付服务 -->
  56 + <!-- 支付服务。默认注释,保证编译速度 -->
57 57 <dependency>
58 58 <groupId>cn.iocoder.boot</groupId>
59 59 <artifactId>yudao-module-pay-biz</artifactId>
... ...
yudao-ui-admin/src/api/pay/channel.js
... ... @@ -27,15 +27,6 @@ export function deleteChannel(id) {
27 27 })
28 28 }
29 29  
30   -// 获得支付渠道分页
31   -export function getChannelPage(query) {
32   - return request({
33   - url: '/pay/channel/page',
34   - method: 'get',
35   - params: query
36   - })
37   -}
38   -
39 30 // 获得支付渠道
40 31 export function getChannel(appId,code) {
41 32 return request({
... ...
yudao-ui-admin/src/plugins/tab.js
... ... @@ -36,6 +36,9 @@ export default {
36 36 return router.push(lastPath || '/');
37 37 });
38 38 }
  39 + if (typeof obj === "function") {
  40 + return store.dispatch('tagsView/delView', router.currentRoute).then(obj);
  41 + }
39 42 return store.dispatch('tagsView/delView', obj);
40 43 },
41 44 // 关闭所有tab页签
... ...
yudao-ui-admin/src/router/index.js
... ... @@ -227,14 +227,14 @@ export const constantRoutes = [
227 227 component: Layout,
228 228 hidden: true,
229 229 children: [{
230   - path: 'order/submit',
231   - name: 'PayOrderSubmit',
  230 + path: 'cashier',
  231 + name: 'PayCashier',
232 232 hidden: true,
233 233 meta: {
234 234 title: '收银台',
235 235 noCache: true
236 236 },
237   - component: (resolve) => require(['@/views/pay/order/submit'], resolve)
  237 + component: (resolve) => require(['@/views/pay/cashier'], resolve)
238 238 }]
239 239 }
240 240 ]
... ...
yudao-ui-admin/src/utils/dict.js
... ... @@ -54,7 +54,7 @@ export const DICT_TYPE = {
54 54 PAY_CHANNEL_ALIPAY_SIGN_TYPE: 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
55 55 PAY_CHANNEL_ALIPAY_MODE: 'pay_channel_alipay_mode', // 支付宝公钥类型
56 56 PAY_CHANNEL_ALIPAY_SERVER_TYPE: 'pay_channel_alipay_server_type', // 支付宝网关地址
57   - PAY_CHANNEL_CODE_TYPE: 'pay_channel_code_type', // 支付渠道编码类型
  57 + PAY_CHANNEL_CODE: 'pay_channel_code', // 支付渠道编码类型
58 58 PAY_ORDER_NOTIFY_STATUS: 'pay_order_notify_status', // 商户支付订单回调状态
59 59 PAY_ORDER_STATUS: 'pay_order_status', // 商户支付订单状态
60 60 PAY_ORDER_REFUND_STATUS: 'pay_order_refund_status', // 商户支付订单退款状态
... ...
yudao-ui-admin/src/views/mall/trade/order/detail.vue
... ... @@ -17,7 +17,7 @@
17 17 <el-descriptions-item label="商家备注">{{ order.remark }}</el-descriptions-item>
18 18 <el-descriptions-item label="支付单号">{{ order.payOrderId }}</el-descriptions-item>
19 19 <el-descriptions-item label="付款方式">
20   - <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="order.payChannelCode" />
  20 + <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="order.payChannelCode" />
21 21 </el-descriptions-item>
22 22 <el-descriptions-item label="买家">{{ order.user.nickname }}</el-descriptions-item> <!-- TODO 芋艿:待实现:跳转会员 -->
23 23 <el-descriptions-item label="收货地址">
... ...
yudao-ui-admin/src/views/mall/trade/order/index.vue
... ... @@ -42,7 +42,7 @@
42 42 <el-col :span="6" :xs="24">
43 43 <el-form-item label="支付方式" prop="payChannelCode">
44 44 <el-select v-model="queryParams.payChannelCode" clearable style="width: 240px">
45   - <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)"
  45 + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE)"
46 46 :key="dict.value" :label="dict.label" :value="dict.value"/>
47 47 </el-select>
48 48 </el-form-item>
... ... @@ -86,7 +86,7 @@
86 86 <dict-tag :type="DICT_TYPE.TERMINAL" :value="row.terminal" />
87 87 </el-col>
88 88 <el-col :span="4">支付方式:
89   - <dict-tag v-if="row.payChannelCode" :type="DICT_TYPE.PAY_CHANNEL_CODE_TYPE" :value="row.payChannelCode" />
  89 + <dict-tag v-if="row.payChannelCode" :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="row.payChannelCode" />
90 90 <span v-else>未支付</span>
91 91 </el-col>
92 92 <el-col :span="6" align="right">
... ... @@ -113,7 +113,7 @@
113 113 </template>
114 114 </el-table-column>
115 115 <!-- TODO @小程:这里应该是一个订单下,多个商品,只展示订单上的总金额,就是 order.payPrice -->
116   - <el-table-column label="实付金额(元)" prop="amount" align="center" width="100"/>
  116 + <el-table-column label="实付金额(元)" prop="price" align="center" width="100"/>
117 117 <!-- TODO @小程:这里应该是一个订单下,多个商品,只展示订单上的收件信息;使用 order.receiverXXX 开头的字段 -->
118 118 <el-table-column label="买家/收货人" prop="buyer" header-align="center" width="auto" min-width="300">
119 119 <template v-slot="{ row }">
... ...
yudao-ui-admin/src/views/pay/app/components/aliPayChannelForm.vue
... ... @@ -41,17 +41,17 @@
41 41 </el-radio-group>
42 42 </el-form-item>
43 43 <div v-if="form.aliPayConfig.mode === 1">
44   - <el-form-item label-width="180px" label="商户私钥" prop="aliPayConfig.privateKey">
  44 + <el-form-item label-width="180px" label="应用私钥" prop="aliPayConfig.privateKey">
45 45 <el-input type="textarea" :autosize="{minRows: 8, maxRows: 8}" v-model="form.aliPayConfig.privateKey"
46   - placeholder="请输入商户私钥" clearable :style="{width: '100%'}">
  46 + placeholder="请输入应用私钥" clearable :style="{width: '100%'}">
47 47 </el-input>
48 48 </el-form-item>
49   - <el-form-item label-width="180px" label="支付宝公钥字符串" prop="aliPayConfig.alipayPublicKey">
  49 + <el-form-item label-width="180px" label="支付宝公钥" prop="aliPayConfig.alipayPublicKey">
50 50 <el-input
51 51 type="textarea"
52 52 :autosize="{minRows: 8, maxRows: 8}"
53 53 v-model="form.aliPayConfig.alipayPublicKey"
54   - placeholder="请输入支付宝公钥字符串" clearable
  54 + placeholder="请输入支付宝公钥" clearable
55 55 :style="{width: '100%'}">
56 56 </el-input>
57 57 </el-form-item>
... ...
yudao-ui-admin/src/views/pay/order/submit.vue renamed to yudao-ui-admin/src/views/pay/cashier/index.vue
... ... @@ -6,7 +6,7 @@
6 6 <el-descriptions-item label="支付单号">{{ payOrder.id }}</el-descriptions-item>
7 7 <el-descriptions-item label="商品标题">{{ payOrder.subject }}</el-descriptions-item>
8 8 <el-descriptions-item label="商品内容">{{ payOrder.body }}</el-descriptions-item>
9   - <el-descriptions-item label="支付金额">¥{{ (payOrder.amount / 100.0).toFixed(2) }}</el-descriptions-item>
  9 + <el-descriptions-item label="支付金额">¥{{ (payOrder.price / 100.0).toFixed(2) }}</el-descriptions-item>
10 10 <el-descriptions-item label="创建时间">{{ parseTime(payOrder.createTime) }}</el-descriptions-item>
11 11 <el-descriptions-item label="过期时间">{{ parseTime(payOrder.expireTime) }}</el-descriptions-item>
12 12 </el-descriptions>
... ... @@ -18,24 +18,25 @@
18 18 <el-descriptions title="选择支付宝支付">
19 19 </el-descriptions>
20 20 <div class="pay-channel-container">
21   - <div class="box" v-for="channel in aliPayChannels" :key="channel.code" @click="submit(channel.code)">
22   - <img :src="icons[channel.code]">
  21 + <div class="box" v-for="channel in channels" v-if="channel.code.indexOf('alipay_') === 0" :key="channel.code" @click="submit(channel.code)">
  22 + <img :src="channel.icon">
23 23 <div class="title">{{ channel.name }}</div>
24 24 </div>
25 25 </div>
26 26 <!-- 微信支付 -->
27 27 <el-descriptions title="选择微信支付" style="margin-top: 20px;" />
28 28 <div class="pay-channel-container">
29   - <div class="box" v-for="channel in wxPayChannels" :key="channel.code">
30   - <img :src="icons[channel.code]">
  29 + <div class="box" v-for="channel in channels" v-if="channel.code.indexOf('wx_') === 0" :key="channel.code">
  30 + <img :src="channel.icon">
31 31 <div class="title">{{ channel.name }}</div>
32 32 </div>
33 33 </div>
34 34 <!-- 其它支付 -->
35 35 <el-descriptions title="选择其它支付" style="margin-top: 20px;" />
36 36 <div class="pay-channel-container">
37   - <div class="box" v-for="channel in otherPayChannels" :key="channel.code">
38   - <img :src="icons[channel.code]">
  37 + <div class="box" v-for="channel in channels" :key="channel.code"
  38 + v-if="channel.code.indexOf('alipay_') === -1 && channel.code.indexOf('wx_') === -1">
  39 + <img :src="channel.icon">
39 40 <div class="title">{{ channel.name }}</div>
40 41 </div>
41 42 </div>
... ... @@ -47,15 +48,6 @@
47 48 <qrcode-vue :value="qrCode.url" size="310" level="L" />
48 49 </el-dialog>
49 50  
50   - <!-- 展示形式:IFrame -->
51   - <el-dialog :title="iframe.title" :visible.sync="iframe.visible" width="800px" height="800px" append-to-body
52   - :close-on-press-escape="false">
53   - <iframe :src="iframe.url" width="100%" />
54   - </el-dialog>
55   -
56   - <!-- 展示形式:Form -->
57   - <div ref="formRef" v-html="form.value" />
58   -
59 51 <!-- 展示形式:BarCode 条形码 -->
60 52 <el-dialog :title="barCode.title" :visible.sync="barCode.visible" width="500px" append-to-body
61 53 :close-on-press-escape="false">
... ... @@ -88,32 +80,56 @@
88 80 import QrcodeVue from 'qrcode.vue'
89 81 import { DICT_TYPE, getDictDatas } from "@/utils/dict";
90 82 import { getOrder, submitOrder } from '@/api/pay/order';
91   -import {PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum} from "@/utils/constants";
  83 +import { PayChannelEnum, PayDisplayModeEnum, PayOrderStatusEnum } from "@/utils/constants";
92 84  
93 85 export default {
94   - name: "PayOrderSubmit",
  86 + name: "PayCashier",
95 87 components: {
96 88 QrcodeVue,
97 89 },
98 90 data() {
99 91 return {
100 92 id: undefined, // 请假编号
  93 + returnUrl: undefined, // 支付完的回调地址
101 94 loading: false, // 支付信息的 loading
102 95 payOrder: {}, // 支付信息
103   - aliPayChannels: [], // 阿里支付的渠道
104   - wxPayChannels: [], // 微信支付的渠道
105   - otherPayChannels: [], // 其它的支付渠道
106   - icons: {
107   - alipay_qr: require("@/assets/images/pay/icon/alipay_qr.svg"),
108   - alipay_app: require("@/assets/images/pay/icon/alipay_app.svg"),
109   - alipay_wap: require("@/assets/images/pay/icon/alipay_wap.svg"),
110   - alipay_pc: require("@/assets/images/pay/icon/alipay_pc.svg"),
111   - alipay_bar: require("@/assets/images/pay/icon/alipay_bar.svg"),
112   - wx_app: require("@/assets/images/pay/icon/wx_app.svg"),
113   - wx_lite: require("@/assets/images/pay/icon/wx_lite.svg"),
114   - wx_pub: require("@/assets/images/pay/icon/wx_pub.svg"),
115   - mock: require("@/assets/images/pay/icon/mock.svg"),
116   - },
  96 + channels: [{
  97 + name: '支付宝 PC 网站支付',
  98 + icon: require("@/assets/images/pay/icon/alipay_pc.svg"),
  99 + code: "alipay_pc"
  100 + }, {
  101 + name: '支付宝 Wap 网站支付',
  102 + icon: require("@/assets/images/pay/icon/alipay_wap.svg"),
  103 + code: "alipay_wap"
  104 + }, {
  105 + name: '支付宝 App 网站支付',
  106 + icon: require("@/assets/images/pay/icon/alipay_app.svg"),
  107 + code: "alipay_app"
  108 + }, {
  109 + name: '支付宝扫码支付',
  110 + icon: require("@/assets/images/pay/icon/alipay_app.svg"),
  111 + code: "alipay_qr"
  112 + }, {
  113 + name: '支付宝条码支付',
  114 + icon: require("@/assets/images/pay/icon/alipay_bar.svg"),
  115 + code: "alipay_bar"
  116 + }, {
  117 + name: '微信公众号支付',
  118 + icon: require("@/assets/images/pay/icon/wx_pub.svg"),
  119 + code: "wx_pub"
  120 + }, {
  121 + name: '微信小程序支付',
  122 + icon: require("@/assets/images/pay/icon/wx_lite.svg"),
  123 + code: "wx_lite"
  124 + }, {
  125 + name: '微信 App 支付',
  126 + icon: require("@/assets/images/pay/icon/wx_app.svg"),
  127 + code: "wx_app"
  128 + }, {
  129 + name: '模拟支付',
  130 + icon: require("@/assets/images/pay/icon/mock.svg"),
  131 + code: "mock"
  132 + }],
117 133 submitLoading: false, // 提交支付的 loading
118 134 interval: undefined, // 定时任务,轮询是否完成支付
119 135 qrCode: { // 展示形式:二维码
... ... @@ -121,14 +137,6 @@ export default {
121 137 title: '',
122 138 visible: false,
123 139 },
124   - iframe: { // 展示形式:iframe
125   - url: '',
126   - title: '',
127   - visible: false
128   - },
129   - form: { // 展示形式:form
130   - html: '',
131   - },
132 140 barCode: { // 展示形式:条形码
133 141 channelCode: '',
134 142 value: '',
... ... @@ -139,46 +147,35 @@ export default {
139 147 },
140 148 created() {
141 149 this.id = this.$route.query.id;
  150 + if (this.$route.query.returnUrl) {
  151 + this.returnUrl = decodeURIComponent(this.$route.query.returnUrl)
  152 + }
142 153 this.getDetail();
143   - this.initPayChannels();
144 154 },
145 155 methods: {
146   - /** 初始化支付渠道 */
147   - initPayChannels() {
148   - // 微信支付
149   - for (const dict of getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)) {
150   - const payChannel = {
151   - name: dict.label,
152   - code: dict.value
153   - }
154   - if (dict.value.indexOf('wx_') === 0) {
155   - this.wxPayChannels.push(payChannel);
156   - } else if (dict.value.indexOf('alipay_') === 0) {
157   - this.aliPayChannels.push(payChannel);
158   - } else {
159   - this.otherPayChannels.push(payChannel);
160   - }
161   - }
162   - },
163 156 /** 获得支付信息 */
164 157 getDetail() {
165 158 // 1.1 未传递订单编号
166 159 if (!this.id) {
167 160 this.$message.error('未传递支付单号,无法查看对应的支付信息');
168   - this.goBackToList();
  161 + this.goReturnUrl('cancel');
169 162 return;
170 163 }
171 164 getOrder(this.id).then(response => {
172 165 // 1.2 无法查询到支付信息
173 166 if (!response.data) {
174 167 this.$message.error('支付订单不存在,请检查!');
175   - this.goBackToList();
  168 + this.goReturnUrl('cancel');
176 169 return;
177 170 }
178   - // 1.3 订单已支付
179   - if (response.data.status !== PayOrderStatusEnum.WAITING.status) {
180   - this.$message.error('支付订单不处于待支付状态,请检查!');
181   - this.goBackToList();
  171 + // 1.3 如果已支付、或者已关闭,则直接跳转
  172 + if (response.data.status === PayOrderStatusEnum.SUCCESS.status) {
  173 + this.$message.success('支付成功');
  174 + this.goReturnUrl('success');
  175 + return;
  176 + } else if (response.data.status === PayOrderStatusEnum.CLOSED.status) {
  177 + this.$message.error('无法支付,原因:订单已关闭');
  178 + this.goReturnUrl('close');
182 179 return;
183 180 }
184 181  
... ... @@ -207,15 +204,12 @@ export default {
207 204 submitOrder({
208 205 id: this.id,
209 206 channelCode: channelCode,
  207 + returnUrl: location.href, // 支付成功后,支付渠道跳转回当前页;再由当前页,跳转回 {@link returnUrl} 对应的地址
210 208 ...this.buildSubmitParam(channelCode)
211 209 }).then(response => {
212 210 const data = response.data
213   - if (data.displayMode === PayDisplayModeEnum.IFRAME.mode) {
214   - this.displayIFrame(channelCode, data)
215   - } else if (data.displayMode === PayDisplayModeEnum.URL.mode) {
  211 + if (data.displayMode === PayDisplayModeEnum.URL.mode) {
216 212 this.displayUrl(channelCode, data)
217   - } else if (data.displayMode === PayDisplayModeEnum.FORM.mode) {
218   - this.displayForm(channelCode, data)
219 213 } else if (data.displayMode === PayDisplayModeEnum.QR_CODE.mode) {
220 214 this.displayQrCode(channelCode, data)
221 215 }
... ... @@ -228,53 +222,7 @@ export default {
228 222 },
229 223 /** 构建提交支付的额外参数 */
230 224 buildSubmitParam(channelCode) {
231   - // ① 支付宝 PC 支付时,有多种展示形态
232   - if (channelCode === PayChannelEnum.ALIPAY_PC.code) {
233   - // 情况【前置模式】:将二维码前置到商户的订单确认页的模式。需要商户在自己的页面中以 iframe 方式请求支付宝页面。具体支持的枚举值有以下几种:
234   - // 0:订单码-简约前置模式,对应 iframe 宽度不能小于 600px,高度不能小于 300px
235   - // return {
236   - // "channelExtras": {
237   - // "qr_pay_mode": "0"
238   - // }
239   - // }
240   - // 1:订单码-前置模式,对应iframe 宽度不能小于 300px,高度不能小于 600px
241   - // return {
242   - // "channelExtras": {
243   - // "qr_pay_mode": "1"
244   - // }
245   - // }
246   - // 3:订单码-迷你前置模式,对应 iframe 宽度不能小于 75px,高度不能小于 75px
247   - // return {
248   - // "channelExtras": {
249   - // "qr_pay_mode": "3"
250   - // }
251   - // }
252   - // 4:订单码-可定义宽度的嵌入式二维码,商户可根据需要设定二维码的大小
253   - // return {
254   - // "channelExtras": {
255   - // "qr_pay_mode": "4"
256   - // }
257   - // }
258   - // 情况【跳转模式】:跳转模式下,用户的扫码界面是由支付宝生成的,不在商户的域名下。支持传入的枚举值有
259   - return {
260   - "channelExtras": {
261   - "qr_pay_mode": "2"
262   - }
263   - }
264   - // 情况【表单模式】:直接提交当前页面到支付宝
265   - // return {
266   - // displayMode: PayDisplayModeEnum.FORM.mode
267   - // }
268   - }
269   -
270   - // ② 支付宝 Wap 支付时,引导手机扫码支付
271   - if (channelCode === PayChannelEnum.ALIPAY_WAP.code) {
272   - return {
273   - displayMode: PayDisplayModeEnum.QR_CODE.mode
274   - }
275   - }
276   -
277   - // ③ 支付宝 BarCode 支付时,需要传递 authCode 条形码
  225 + // ① 支付宝 BarCode 支付时,需要传递 authCode 条形码
278 226 if (channelCode === PayChannelEnum.ALIPAY_BAR.code) {
279 227 return {
280 228 "channelExtras": {
... ... @@ -284,36 +232,12 @@ export default {
284 232 }
285 233 return {}
286 234 },
287   - /** 提交支付后,IFrame 内置 URL 的展示形式 */
288   - displayIFrame(channelCode, data) {
289   - // TODO 芋艿:目前有点奇怪,支付宝总是会显示“支付环境存在风险”
290   - this.iframe = {
291   - title: '支付窗口',
292   - url: data.displayContent,
293   - visible: true
294   - }
295   - this.submitLoading = false
296   - },
297 235 /** 提交支付后,URL 的展示形式 */
298 236 displayUrl(channelCode, data) {
299   - window.open(data.displayContent)
  237 + // window.open(data.displayContent)
  238 + location.href = data.displayContent
300 239 this.submitLoading = false
301 240 },
302   - /** 提交支付后,Form 的展示形式 */
303   - displayForm(channelCode, data) {
304   - // 渲染支付页面
305   - this.form = {
306   - value: data.displayContent
307   - }
308   - // 防抖避免重复支付
309   - this.$nextTick(() => {
310   - // 提交支付表单
311   - this.$refs.formRef.children[0].submit();
312   - setTimeout(() => {
313   - this.submitLoading = false
314   - }, 1000);
315   - });
316   - },
317 241 /** 提交支付后(支付宝扫码支付) */
318 242 displayQrCode(channelCode, data) {
319 243 let title = '请使用手机浏览器“扫一扫”';
... ... @@ -342,13 +266,13 @@ export default {
342 266 if (response.data.status === PayOrderStatusEnum.SUCCESS.status) {
343 267 this.clearQueryInterval();
344 268 this.$message.success('支付成功!');
345   - this.goBackToList();
  269 + this.goReturnUrl();
346 270 }
347 271 // 已取消
348 272 if (response.data.status === PayOrderStatusEnum.CLOSED.status) {
349 273 this.clearQueryInterval();
350 274 this.$message.error('支付已关闭!');
351   - this.goBackToList();
  275 + this.goReturnUrl();
352 276 }
353 277 })
354 278 }, 1000 * 2)
... ... @@ -365,10 +289,34 @@ export default {
365 289 clearInterval(this.interval)
366 290 this.interval = undefined
367 291 },
368   - /** 回到列表 **/
369   - goBackToList() {
370   - this.$tab.closePage();
371   - this.$router.go(-1);
  292 + /**
  293 + * 回到业务的 URL
  294 + *
  295 + * @param payResult 支付结果
  296 + * ① success:支付成功
  297 + * ② cancel:取消支付
  298 + * ③ close:支付已关闭
  299 + */
  300 + goReturnUrl(payResult) {
  301 + // 未配置的情况下,只能关闭
  302 + if (!this.returnUrl) {
  303 + this.$tab.closePage();
  304 + return
  305 + }
  306 +
  307 + const url = this.returnUrl.indexOf('?') >= 0
  308 + ? this.returnUrl + '&payResult=' + payResult
  309 + : this.returnUrl + '?payResult=' + payResult
  310 + // 如果有配置,且是 http 开头,则浏览器跳转
  311 + if (this.returnUrl.indexOf('http') === 0) {
  312 + location.href = url;
  313 + } else {
  314 + this.$tab.closePage(() => {
  315 + this.$router.push({
  316 + path: url
  317 + });
  318 + });
  319 + }
372 320 }
373 321 }
374 322 };
... ...
yudao-ui-admin/src/views/pay/demo/index.vue
... ... @@ -29,9 +29,9 @@
29 29 </template>
30 30 </el-table-column>
31 31 <el-table-column label="支付单号" align="center" prop="payOrderId" />
32   - <el-table-column label="是否支付" align="center" prop="payed">
  32 + <el-table-column label="是否支付" align="center" prop="payStatus">
33 33 <template v-slot="scope">
34   - <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payed" />
  34 + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.payStatus" />
35 35 </template>
36 36 </el-table-column>
37 37 <el-table-column label="支付时间" align="center" prop="payTime" width="180">
... ... @@ -47,9 +47,9 @@
47 47 <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
48 48 <template v-slot="scope">
49 49 <el-button size="mini" type="text" icon="el-icon-edit" @click="handlePay(scope.row)"
50   - v-if="!scope.row.payed">前往支付</el-button>
  50 + v-if="!scope.row.payStatus">前往支付</el-button>
51 51 <el-button size="mini" type="text" icon="el-icon-delete" @click="handleRefund(scope.row)"
52   - v-if="scope.row.payed && !scope.row.payRefundId">发起退款</el-button>
  52 + v-if="scope.row.payStatus && !scope.row.payRefundId">发起退款</el-button>
53 53 </template>
54 54 </el-table-column>
55 55 </el-table>
... ... @@ -78,12 +78,10 @@
78 78 </template>
79 79  
80 80 <script>
81   -import {createDemoOrder, getDemoOrderPage, refundDemoOrder} from "@/api/pay/demo";
  81 +import { createDemoOrder, getDemoOrderPage, refundDemoOrder } from "@/api/pay/demo";
82 82  
83 83 export default {
84 84 name: "PayDemoOrder",
85   - components: {
86   - },
87 85 data() {
88 86 return {
89 87 // 遮罩层
... ... @@ -192,9 +190,10 @@ export default {
192 190 /** 支付按钮操作 */
193 191 handlePay(row) {
194 192 this.$router.push({
195   - name: 'PayOrderSubmit',
  193 + name: 'PayCashier',
196 194 query:{
197   - id: row.payOrderId
  195 + id: row.payOrderId,
  196 + returnUrl: encodeURIComponent('/pay/demo-order?id=' + row.id)
198 197 }
199 198 })
200 199 },
... ...
yudao-ui-admin/src/views/pay/order/index.vue
... ... @@ -81,19 +81,19 @@
81 81 </template>
82 82 </el-table-column>
83 83 <el-table-column label="商品标题" align="center" prop="subject" width="180" :show-overflow-tooltip="true"/>
84   - <el-table-column label="支付金额" align="center" prop="amount" width="100">
  84 + <el-table-column label="支付金额" align="center" prop="price" width="100">
85 85 <template v-slot="scope">
86   - ¥{{ parseFloat(scope.row.amount / 100).toFixed(2) }}
  86 + ¥{{ parseFloat(scope.row.price / 100).toFixed(2) }}
87 87 </template>
88 88 </el-table-column>
89   - <el-table-column label="手续金额" align="center" prop="channelFeeAmount" width="100">
  89 + <el-table-column label="手续金额" align="center" prop="channelFeePrice" width="100">
90 90 <template v-slot="scope">
91   - ¥{{ parseFloat(scope.row.channelFeeAmount / 100).toFixed(2) }}
  91 + ¥{{ parseFloat(scope.row.channelFeePrice / 100).toFixed(2) }}
92 92 </template>
93 93 </el-table-column>
94   - <el-table-column label="退款金额" align="center" prop="refundAmount" width="100">
  94 + <el-table-column label="退款金额" align="center" prop="refundPrice" width="100">
95 95 <template v-slot="scope">
96   - ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
  96 + ¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
97 97 </template>
98 98 </el-table-column>
99 99 <el-table-column label="支付状态" align="center" prop="status">
... ... @@ -154,10 +154,10 @@
154 154 </el-tag>
155 155 </el-descriptions-item>
156 156 <el-descriptions-item label="金额">
157   - <el-tag type="success" size="small">{{ parseFloat(orderDetail.amount / 100, 2) }}</el-tag>
  157 + <el-tag type="success" size="small">{{ parseFloat(orderDetail.price / 100, 2) }}</el-tag>
158 158 </el-descriptions-item>
159 159 <el-descriptions-item label="手续费">
160   - <el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeeAmount / 100, 2) }}</el-tag>
  160 + <el-tag type="warning" size="small">{{ parseFloat(orderDetail.channelFeePrice / 100, 2) }}</el-tag>
161 161 </el-descriptions-item>
162 162 <el-descriptions-item label="手续费比例">
163 163 {{ parseFloat(orderDetail.channelFeeRate / 100, 2) }}%
... ... @@ -184,7 +184,7 @@
184 184 <el-descriptions-item label="退款次数">{{ orderDetail.refundTimes }}</el-descriptions-item>
185 185 <el-descriptions-item label="退款金额">
186 186 <el-tag type="warning">
187   - {{ parseFloat(orderDetail.refundAmount / 100, 2) }}
  187 + {{ parseFloat(orderDetail.refundPrice / 100, 2) }}
188 188 </el-tag>
189 189 </el-descriptions-item>
190 190 </el-descriptions>
... ... @@ -213,16 +213,16 @@ const defaultOrderDetail = {
213 213 merchantOrderId: null,
214 214 channelOrderNo: '',
215 215 body: '',
216   - amount: null,
  216 + price: null,
217 217 channelFeeRate: null,
218   - channelFeeAmount: null,
  218 + channelFeePrice: null,
219 219 userIp: '',
220 220 status: null,
221 221 notifyUrl: '',
222 222 notifyStatus: null,
223 223 refundStatus: null,
224 224 refundTimes: '',
225   - refundAmount: null,
  225 + refundPrice: null,
226 226 createTime: '',
227 227 successTime: '',
228 228 notifyTime: '',
... ... @@ -262,15 +262,15 @@ export default {
262 262 body: null,
263 263 notifyUrl: null,
264 264 notifyStatus: null,
265   - amount: null,
  265 + price: null,
266 266 channelFeeRate: null,
267   - channelFeeAmount: null,
  267 + channelFeePrice: null,
268 268 status: null,
269 269 userIp: null,
270 270 successExtensionId: null,
271 271 refundStatus: null,
272 272 refundTimes: null,
273   - refundAmount: null,
  273 + refundPrice: null,
274 274 channelUserId: null,
275 275 channelOrderNo: null,
276 276 expireTime: [],
... ... @@ -285,7 +285,7 @@ export default {
285 285 // 支付应用列表集合
286 286 appList: null,
287 287 // 支付渠道编码字典数据集合
288   - payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
  288 + payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE),
289 289 // 订单回调商户状态字典数据集合
290 290 payOrderNotifyDictDatum: getDictDatas(DICT_TYPE.PAY_ORDER_NOTIFY_STATUS),
291 291 // 订单状态字典数据集合
... ...
yudao-ui-admin/src/views/pay/refund/index.vue
... ... @@ -95,14 +95,14 @@
95 95 </p>
96 96 </template>
97 97 </el-table-column>
98   - <el-table-column label="支付金额(元)" align="center" prop="payAmount" width="100">
  98 + <el-table-column label="支付金额(元)" align="center" prop="payPrice" width="100">
99 99 <template v-slot="scope" class="">
100   - ¥{{ parseFloat(scope.row.payAmount / 100).toFixed(2) }}
  100 + ¥{{ parseFloat(scope.row.payPrice / 100).toFixed(2) }}
101 101 </template>
102 102 </el-table-column>
103   - <el-table-column label="退款金额(元)" align="center" prop="refundAmount" width="100">
  103 + <el-table-column label="退款金额(元)" align="center" prop="refundPrice" width="100">
104 104 <template v-slot="scope">
105   - ¥{{ parseFloat(scope.row.refundAmount / 100).toFixed(2) }}
  105 + ¥{{ parseFloat(scope.row.refundPrice / 100).toFixed(2) }}
106 106 </template>
107 107 </el-table-column>
108 108 <el-table-column label="退款类型" align="center" prop="type" width="80">
... ... @@ -160,10 +160,10 @@
160 160 <el-divider></el-divider>
161 161 <el-descriptions :column="2" label-class-name="desc-label">
162 162 <el-descriptions-item label="支付金额">
163   - {{ parseFloat(refundDetail.payAmount / 100).toFixed(2) }}
  163 + {{ parseFloat(refundDetail.payPrice / 100).toFixed(2) }}
164 164 </el-descriptions-item>
165 165 <el-descriptions-item label="退款金额" size="mini">
166   - <el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundAmount / 100).toFixed(2) }}</el-tag>
  166 + <el-tag class="tag-purple" size="mini">{{ parseFloat(refundDetail.refundPrice / 100).toFixed(2) }}</el-tag>
167 167 </el-descriptions-item>
168 168 <el-descriptions-item label="退款类型">
169 169 <template v-slot="scope">
... ... @@ -234,9 +234,9 @@ const defaultRefundDetail = {
234 234 notifyTime: null,
235 235 notifyUrl: '',
236 236 orderId: null,
237   - payAmount: null,
  237 + payPrice: null,
238 238 reason: '',
239   - refundAmount: null,
  239 + refundPrice: null,
240 240 status: null,
241 241 subject: '',
242 242 successTime: null,
... ... @@ -277,8 +277,8 @@ export default {
277 277 notifyStatus: null,
278 278 status: null,
279 279 type: null,
280   - payAmount: null,
281   - refundAmount: null,
  280 + payPrice: null,
  281 + refundPrice: null,
282 282 reason: null,
283 283 userIp: null,
284 284 channelOrderNo: null,
... ... @@ -298,7 +298,7 @@ export default {
298 298 // 支付应用列表集合
299 299 appList: null,
300 300 // 支付渠道编码字典数据集合
301   - payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE_TYPE),
  301 + payChannelCodeDictDatum: getDictDatas(DICT_TYPE.PAY_CHANNEL_CODE),
302 302 // 订单退款状态字典数据集合
303 303 payRefundOrderDictDatum: getDictDatas(DICT_TYPE.PAY_REFUND_ORDER_STATUS),
304 304 // 退款订单类别字典数据集合
... ...