diff --git a/_config/sql/iam_perm_menu.sql b/_config/sql/iam_perm_menu.sql index 3d3e098f3..41375bcb6 100644 --- a/_config/sql/iam_perm_menu.sql +++ b/_config/sql/iam_perm_menu.sql @@ -12,7 +12,7 @@ Target Server Version : 160014 (160014) File Encoding : 65001 - Date: 25/07/2026 11:11:42 + Date: 25/07/2026 20:50:24 */ @@ -134,7 +134,6 @@ INSERT INTO "public"."iam_perm_menu" VALUES (204, 2, 'demos:artemis', 'admin', ' INSERT INTO "public"."iam_perm_menu" VALUES (900001, 304, 'iam:social', 'admin', 'ThirdPlatform', 'menu.system.config.thirdPlatform', 'lucide:share-2', 'f', 'f', '/system/config/third-platform/ThirdPlatform', '/system/config/third-platform', NULL, 5, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-13 02:15:41.505142+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040103, 4040130, 'merchant:profile', 'admin', 'MchInfoManage', 'menu.payment.merchant.profile', NULL, 't', 'f', '/payment/merchant/manage/info/MchInfoManage', '/payment/merchant/manage/info', NULL, 1, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-11 03:37:15.424776+00'); INSERT INTO "public"."iam_perm_menu" VALUES (801, 8, 'develop:trade', 'admin', 'DevelopTrade', 'menu.develop.trade', 'lucide:credit-card', 'f', 'f', '/payment/develop/trade/DevelopTrade', '/develop/trade', NULL, 1, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-23 16:00:00+00', '2026-06-23 16:00:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (802, 8, 'develop:sign', 'admin', 'DevelopSign', 'menu.develop.sign', 'lucide:file-signature', 'f', 'f', '/payment/develop/sign/DevelopSign', '/develop/sign', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-23 16:00:00+00', '2026-06-23 16:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (405, 4, 'payment:config', 'admin', 'PaymentConfig', 'menu.payment.config', 'lucide:settings-2', 't', 'f', NULL, '/payment/config', NULL, 2, 'f', 't', 'f', 1, 1, 0, 't', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-14 00:00:00+00', '2026-07-15 15:24:29.325656+00'); INSERT INTO "public"."iam_perm_menu" VALUES (40105, 4, 'payment:config:product-config', 'admin', 'ProductConfig', 'menu.payment.config.productConfig', 'lucide:layout-grid', 'f', 'f', '/payment/config/product/ProductConfig', '/payment/config/product', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-13 00:00:00+00', '2026-07-13 13:02:20.703887+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040116, 401, 'payment:platform:provider', 'admin', 'PayProviderManage', 'menu.payment.platform.provider.manage', 'lucide:wallet', 'f', 'f', '/payment/masterdata/provider/PayProviderList', '/payment/platform/pay-provider', NULL, 0.5, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-17 10:00:31.640482+00', '2026-06-27 13:01:24.318649+00'); @@ -147,7 +146,7 @@ INSERT INTO "public"."iam_perm_menu" VALUES (40503, 40508, 'payment:isv', 'admin INSERT INTO "public"."iam_perm_menu" VALUES (30403, 301, 'system:protocol', 'admin', 'UserProtocol', 'menu.system.basic.protocol', 'lucide:file-text', 'f', 'f', '/system/basic/protocol/UserProtocolList', '/system/basic/protocol', NULL, 2, 'f', 't', 'f', 1, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-24 10:32:13.183371+00', '2026-07-16 08:43:35.038937+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040115, 4040132, 'channel:app', 'admin', 'DouyinMchAppManage', 'menu.payment.merchant.channelMerchant.douyinApp', NULL, 't', 'f', '/payment/channel/douyin/manage/app/DouyinMchAppManage', '/payment/global/channel-merchant/douyin-app-manage', NULL, 13, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-15 16:00:00+00', '2026-07-22 13:50:46.642335+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040119, 4040132, 'channel:app', 'admin', 'WechatIsvMchAppManage', 'menu.payment.merchant.channelMerchant.wechatIsvApp', NULL, 't', 'f', '/payment/channel/wechat/manage/mch/isv-app/WechatIsvMchAppManage', '/payment/global/channel-merchant/wechat-isv-mch-app-manage', NULL, 14, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-05 01:49:32.557374+00', '2026-07-22 13:50:46.650292+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (803, 8, 'develop:auth', 'admin', 'ChannelAuth', 'menu.develop.auth', 'lucide:key-round', 'f', 'f', '/payment/develop/auth/ChannelAuth', '/develop/auth', NULL, 3, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-09 16:00:00+00', '2026-07-09 16:00:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (802, 8, 'develop:sign', 'admin', 'DevelopSign', 'menu.develop.sign', 'lucide:pen-tool', 'f', 'f', '/payment/develop/sign/DevelopSign', '/develop/sign', NULL, 3, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-23 16:00:00+00', '2026-06-23 16:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (310, 308, 'system:notify:wechat-config', 'admin', 'WechatNotify', 'menu.system.notify.wechatConfig', 'lucide:message-circle', 'f', 'f', '/system/notify/wechat/index', '/system/notify/wechat', NULL, 30, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-09 00:00:00+00', '2026-07-09 00:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040121, 4040130, 'merchant:gateway-aggregate', 'admin', 'AggregateScanConfig', 'menu.payment.merchant.aggregateScan', NULL, 't', 'f', '/payment/merchant/aggregate/AggregateScanConfig', '/payment/merchant/aggregate', NULL, 3, 'f', 't', 'f', 1, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-11 03:00:13.374496+00', '2026-07-13 10:13:20.81126+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040130, 40401, NULL, 'admin', 'MchManageGroup', 'menu.payment.merchant.group.manage', 'lucide:settings-2', 't', 'f', NULL, NULL, NULL, 1, 'f', 'f', 'f', 1, 1, 0, 'f', 'subpage_group', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-11 03:37:15.421585+00', '2026-07-11 03:37:15.421585+00'); @@ -158,6 +157,7 @@ INSERT INTO "public"."iam_perm_menu" VALUES (4040120, 4040130, 'merchant:wx-veri INSERT INTO "public"."iam_perm_menu" VALUES (40501, 40105, 'payment:config:product-detail', 'admin', 'ProductDetailDispatch', 'menu.payment.config.detail', NULL, 't', 'f', '/payment/config/product/detail/ProductDetailDispatch', '/payment/product-detail', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-06-14 00:00:00+00', '2026-06-27 13:01:24.321883+00'); INSERT INTO "public"."iam_perm_menu" VALUES (3040102, 30401, 'system:security-config:pay', 'admin', 'PaySecurityConfig', 'menu.system.security.pay', 'lucide:shield-alert', 'f', 'f', '/system/config/security/PaySecurityConfig', '/system/config/security/pay', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-16 07:31:19.449836+00', '2026-07-16 07:31:19.449836+00'); INSERT INTO "public"."iam_perm_menu" VALUES (40505, 40504, 'system:config:mobile-app-detail', 'admin', 'MobileAppDetail', 'menu.system.config.mobileAppDetail', NULL, 't', 'f', '/system/config/mobile-app/detail/MobileAppDetail', '/system/config/mobile-app/detail/:appType', NULL, 1, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-05 00:00:00+00', '2026-07-22 13:50:46.655058+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (804, 8, 'develop:gateway', 'admin', 'DevelopGateway', 'menu.develop.gateway', 'lucide:globe', 'f', 'f', '/payment/develop/gateway/DevelopGateway', '/develop/gateway', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-16 16:00:00+00', '2026-07-16 16:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040123, 4040130, 'merchant:app:workbench', 'admin', 'MchAppWorkbench', 'menu.payment.merchant.appWorkbench', NULL, 't', 'f', '/payment/merchant/app/MchAppWorkbench', '/payment/merchant/app/manage', NULL, 11, 'f', 't', 'f', 1, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-11 08:00:00+00', '2026-07-11 08:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (40506, 40508, 'payment:isv', 'admin', 'LakalaManage', 'menu.payment.lakala.config', NULL, 't', 'f', '/payment/channel/lakala/manage/LakalaManage', '/payment/config/product/lakala-manage', NULL, 5, 'f', 't', 'f', 1, 1, 0, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-05 00:00:00+00', '2026-07-11 03:37:15.43231+00'); INSERT INTO "public"."iam_perm_menu" VALUES (4040132, 40401, NULL, 'admin', 'ChannelAppGroup', 'menu.payment.merchant.group.channelApp', 'lucide:layout-grid', 't', 'f', NULL, NULL, NULL, 3, 'f', 'f', 'f', 1, 1, 0, 'f', 'subpage_group', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-11 03:37:15.421585+00', '2026-07-13 10:13:20.804554+00'); @@ -171,12 +171,12 @@ INSERT INTO "public"."iam_perm_menu" VALUES (311, 3, 'system:sensitive', 'admin' INSERT INTO "public"."iam_perm_menu" VALUES (31101, 311, 'system:sensitive-word', 'admin', 'SensitiveWordList', 'menu.system.sensitive.word', 'lucide:book-x', 'f', 'f', '/system/sensitive-word/SensitiveWordList', '/system/sensitive/word', NULL, 1, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-16 00:40:06.511319+00', '2026-07-16 00:40:06.511319+00'); INSERT INTO "public"."iam_perm_menu" VALUES (31102, 311, 'system:sensitive-word-hit', 'admin', 'SensitiveWordHitList', 'menu.system.sensitive.hit', 'lucide:scan-search', 'f', 'f', '/system/sensitive-word/SensitiveWordHitList', '/system/sensitive/hit', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-16 00:40:06.51532+00', '2026-07-16 00:40:06.51532+00'); INSERT INTO "public"."iam_perm_menu" VALUES (40507, 405, 'payment:config:wx-verify', 'admin', 'PlatformWxDomainVerifyList', 'menu.payment.config.wxVerify', 'lucide:shield-check', 'f', 'f', '/payment/config/wx-verify/PlatformWxDomainVerifyList', '/payment/config/wx-verify', NULL, 3, 'f', 't', 'f', 1, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-09 16:00:00+00', '2026-07-16 08:43:35.047953+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (804, 8, 'develop:gateway', 'admin', 'DevelopGateway', 'menu.develop.gateway', 'lucide:store', 'f', 'f', '/payment/develop/gateway/DevelopGateway', '/develop/gateway', NULL, 4, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-16 16:00:00+00', '2026-07-16 16:00:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (803, 8, 'develop:auth', 'admin', 'ChannelAuth', 'menu.develop.auth', 'lucide:shield-check', 'f', 'f', '/payment/develop/auth/ChannelAuth', '/develop/auth', NULL, 4, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-09 16:00:00+00', '2026-07-09 16:00:00+00'); INSERT INTO "public"."iam_perm_menu" VALUES (40504, 304, 'system:config:mobile-app', 'admin', 'MobileAppConfig', 'menu.system.config.mobileApp', 'lucide:smartphone', 'f', 'f', '/system/config/mobile-app/MobileAppConfig', '/system/config/mobile-app', NULL, 6, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-05 00:00:00+00', '2026-07-22 13:50:46.652727+00'); INSERT INTO "public"."iam_perm_menu" VALUES (610, 6, 'trade:pay-order', 'admin', 'PayOrderCatalog', 'menu.trade.payOrder', 'lucide:receipt', 'f', 'f', NULL, '/trade/pay-order', '/trade/pay-order/normal', 3, 'f', 't', 'f', 1, 1, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-17 06:18:15.454191+00', '2026-07-17 06:18:15.463823+00'); INSERT INTO "public"."iam_perm_menu" VALUES (604, 610, 'trade:gateway-order', 'admin', 'GatewayOrderList', 'menu.trade.gatewayOrder', 'lucide:store', 'f', 'f', '/payment/order/GatewayOrderList', '/trade/pay-order/gateway', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-17 06:18:15.468829+00', '2026-07-17 06:18:15.47158+00'); INSERT INTO "public"."iam_perm_menu" VALUES (30203, 302, 'system:log:unipay', 'admin', 'SystemUnipayApiLog', 'menu.system.log.unipay', 'lucide:webhook', 'f', 'f', '/system/log/unipay/UnipayApiLogList', '/system/log/unipay', NULL, 3, 'f', 't', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-17 00:00:00+00', '2026-07-17 00:00:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91100, NULL, 'trade', 'merchant', 'TransactionManagement', 'menu.trade', 'lucide:arrow-left-right', 'f', 'f', NULL, '/trade', '/trade/pay-trade', 4, 'f', 't', 'f', 1, 1, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 03:48:14.886531+00', '2026-07-23 06:44:16.725707+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91200, NULL, 'trade:record', 'merchant', 'TradeRecordCatalog', 'menu.trade.record', 'lucide:scroll-text', 'f', 'f', NULL, '/trade/record', '/trade/record/mch-notice', 4, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.651967+00', '2026-07-23 09:32:12.651967+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91101, 91100, 'trade:fund', 'merchant', 'PayTradeList', 'menu.trade.payTrade', 'lucide:arrow-left-right', 'f', 'f', '/payment/order/PayTradeList', '/trade/pay-trade', NULL, 1, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 03:48:14.896997+00', '2026-07-23 06:44:16.735074+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91103, 91100, 'trade:refund', 'merchant', 'RefundOrderList', 'menu.trade.refundOrder', 'lucide:rotate-ccw', 'f', 'f', '/payment/order/RefundOrderList', '/trade/refund-order', NULL, 2, 'f', 't', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 03:48:14.903907+00', '2026-07-23 06:44:16.737803+00'); INSERT INTO "public"."iam_perm_menu" VALUES (607, NULL, 'trade:record', 'admin', 'TradeRecordCatalog', 'menu.trade.record', 'lucide:scroll-text', 'f', 'f', NULL, '/trade/record', '/trade/record/mch-notice', 4.5, 'f', 't', 'f', 1, 1, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-21 06:30:00+00', '2026-07-21 06:45:00+00'); @@ -190,21 +190,18 @@ INSERT INTO "public"."iam_perm_menu" VALUES (91003, 91001, 'dashboard:analytics' INSERT INTO "public"."iam_perm_menu" VALUES (91104, 91100, 'trade:pay-order', 'merchant', 'PayOrderCatalog', 'menu.trade.payOrder', 'lucide:receipt', 'f', 'f', NULL, '/trade/pay-order', '/trade/pay-order/normal', 3, 'f', 't', 'f', 1, 1, 0, 't', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 06:33:41.347277+00', '2026-07-23 14:54:00.459736+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91102, 91104, 'trade:order', 'merchant', 'NormalOrderList', 'menu.trade.normalPay', 'lucide:credit-card', 'f', 'f', '/payment/order/NormalOrderList', '/trade/pay-order/normal', NULL, 1, 'f', 't', 'f', 1, 1, 0, 't', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 03:48:14.901128+00', '2026-07-23 14:54:00.459736+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91105, 91104, 'trade:gateway-order', 'merchant', 'GatewayOrderList', 'menu.trade.gatewayOrder', 'lucide:store', 'f', 'f', '/payment/order/GatewayOrderList', '/trade/pay-order/gateway', NULL, 2, 'f', 't', 'f', 1, 1, 0, 't', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 06:33:41.366052+00', '2026-07-23 14:54:00.459736+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91110, 91100, 'trade:pay-order', 'merchant', 'PayOrderCatalog', 'menu.trade.payOrder', 'lucide:receipt', 'f', 'f', NULL, '/trade/pay-order', '/trade/pay-order/normal', 3, 'f', 'f', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.636962+00', '2026-07-23 09:32:12.636962+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91111, 91110, 'trade:order', 'merchant', 'NormalOrderList', 'menu.trade.normalPay', 'lucide:file-text', 'f', 'f', '/payment/order/NormalOrderList', '/trade/pay-order/normal', NULL, 1, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.645988+00', '2026-07-23 09:32:12.645988+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91112, 91110, 'trade:gateway-order', 'merchant', 'GatewayOrderList', 'menu.trade.gatewayOrder', 'lucide:globe', 'f', 'f', '/payment/order/GatewayOrderList', '/trade/pay-order/gateway', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.648789+00', '2026-07-23 09:32:12.648789+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91200, NULL, 'trade:record', 'merchant', 'TradeRecordCatalog', 'menu.trade.record', 'lucide:scroll-text', 'f', 'f', NULL, '/trade/record', '/trade/record/mch-notice', 3, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.651967+00', '2026-07-23 09:32:12.651967+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91106, NULL, 'trade:record', 'merchant', 'TradeRecordCatalog', 'menu.trade.record', 'lucide:scroll-text', 'f', 'f', NULL, '/trade/record', '/trade/record/mch-notice', 4.5, 'f', 't', 'f', 1, 1, 0, 't', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 06:33:41.369341+00', '2026-07-23 14:54:00.459736+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91107, 91106, 'trade:mch-notice', 'merchant', 'MchNoticeTaskList', 'menu.trade.mchNotice', 'lucide:bell-ring', 'f', 'f', '/payment/notice/MchNoticeTaskList', '/trade/record/mch-notice', NULL, 1, 'f', 't', 'f', 1, 1, 0, 't', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 06:33:41.372431+00', '2026-07-23 14:54:00.459736+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91108, 91106, 'trade:callback-record', 'merchant', 'PayCallbackRecordList', 'menu.trade.callbackRecord', 'lucide:inbox', 'f', 'f', '/payment/record/PayCallbackRecordList', '/trade/record/callback-record', NULL, 2, 'f', 't', 'f', 1, 1, 0, 't', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 06:33:41.375612+00', '2026-07-23 14:54:00.459736+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91100, NULL, 'trade', 'merchant', 'TransactionManagement', 'menu.trade', 'lucide:arrow-left-right', 'f', 'f', NULL, '/trade', '/trade/pay-trade', 3, 'f', 't', 'f', 1, 1, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 03:48:14.886531+00', '2026-07-23 06:44:16.725707+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91201, 91200, 'trade:mch-notice', 'merchant', 'MchNoticeTaskList', 'menu.trade.mchNotice', 'lucide:bell-ring', 'f', 'f', '/payment/notice/MchNoticeTaskList', '/trade/record/mch-notice', NULL, 1, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.655107+00', '2026-07-23 09:32:12.655107+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91202, 91200, 'trade:callback-record', 'merchant', 'PayCallbackRecordList', 'menu.trade.callbackRecord', 'lucide:webhook', 'f', 'f', '/payment/record/PayCallbackRecordList', '/trade/record/callback-record', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.658982+00', '2026-07-23 09:32:12.658982+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91300, NULL, NULL, 'merchant', 'MchCenter', 'menu.mch.center', 'lucide:building-2', 'f', 'f', NULL, '/mch-center', '/mch/info', 4, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.662617+00', '2026-07-23 09:32:12.662617+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91202, 91200, 'trade:callback-record', 'merchant', 'PayCallbackRecordList', 'menu.trade.callbackRecord', 'lucide:inbox', 'f', 'f', '/payment/record/PayCallbackRecordList', '/trade/record/callback-record', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.658982+00', '2026-07-23 09:32:12.658982+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91301, 91300, 'merchant:profile', 'merchant', 'MchInfoManage', 'menu.payment.merchant.profile', 'lucide:badge-info', 'f', 'f', '/payment/merchant/info/MchInfoManage', '/mch/info', NULL, 1, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.665593+00', '2026-07-23 09:32:12.665593+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91302, 91300, 'merchant:user', 'merchant', 'MerchantUserList', 'menu.payment.merchant.user', 'lucide:users', 'f', 'f', '/payment/merchant/user/MerchantUserList', '/mch/user', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.669009+00', '2026-07-23 09:32:12.669009+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91303, 91300, 'merchant:store', 'merchant', 'MchStoreInfoList', 'menu.payment.merchant.store', 'lucide:store', 'f', 'f', '/payment/merchant/store/MchStoreInfoList', '/mch/store', NULL, 3, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.671534+00', '2026-07-23 09:32:12.671534+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91304, 91300, 'merchant:terminal', 'merchant', 'SystemTerminalList', 'menu.payment.merchant.terminal', 'lucide:monitor', 'f', 'f', '/payment/device/terminal/system/SystemTerminalList', '/mch/terminal', NULL, 4, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.67447+00', '2026-07-23 09:32:12.67447+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91400, NULL, NULL, 'merchant', 'PaymentConfig', 'menu.payment.config', 'lucide:settings-2', 'f', 'f', NULL, '/mch-payment', '/mch/app', 5, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.677882+00', '2026-07-23 09:32:12.677882+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91401, 91400, 'merchant:app', 'merchant', 'MchAppInfoList', 'menu.payment.merchant.app', 'lucide:app-window', 'f', 'f', '/payment/merchant/app/MchAppInfoList', '/mch/app', NULL, 1, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.681008+00', '2026-07-23 09:32:12.681008+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91402, 91400, 'channel:merchant', 'merchant', 'ChannelMerchantList', 'menu.payment.merchant.channelMerchant', 'lucide:store', 'f', 'f', '/payment/channel-merchant/ChannelMerchantList', '/mch/channel-merchant', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.684068+00', '2026-07-23 09:32:12.684068+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91411, 91402, 'channel:merchant:detail', 'merchant', 'ChannelMerchantDetail', 'menu.payment.merchant.channelMerchant.detail', NULL, 't', 'f', '/payment/channel-merchant/detail/ChannelMerchantDetailDispatch', '/mch/channel-merchant/detail', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.689613+00', '2026-07-23 09:32:12.689613+00'); @@ -213,6 +210,8 @@ INSERT INTO "public"."iam_perm_menu" VALUES (91403, 91401, NULL, 'merchant', 'Ap INSERT INTO "public"."iam_perm_menu" VALUES (40107, 40106, 'payment:wx:mch-app', 'admin', 'WxMchApp', 'menu.payment.wx.mchApp', NULL, 't', 'f', NULL, NULL, NULL, 1, 'f', 'f', 'f', 1, 1, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 13:44:05.963399+00', '2026-07-23 14:32:14.494862+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91412, 91400, 'payment:wx:mch-app', 'merchant', 'MchWxAppList', 'menu.payment.wx.mchApp', 'lucide:message-circle', 'f', 'f', '/payment/wx/mch/MchWxAppList', '/mch/wx-app', NULL, 3, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, '', '', '2026-07-24 01:58:27.304104+00', '2026-07-24 01:58:27.304104+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91413, 91403, 'merchant:app:workbench', 'merchant', 'MchAppWorkbench', 'menu.payment.merchant.appWorkbench', NULL, 't', 'f', '/payment/merchant/app/MchAppWorkbench', '/mch/app/manage', NULL, 0, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-24 10:20:36.109679+00', '2026-07-24 13:08:44.946319+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91300, NULL, NULL, 'merchant', 'MchCenter', 'menu.mch.center', 'lucide:building-2', 'f', 'f', NULL, '/mch-center', '/mch/info', 1, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.662617+00', '2026-07-23 09:32:12.662617+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91400, NULL, NULL, 'merchant', 'PaymentConfig', 'menu.payment.config', 'lucide:settings-2', 'f', 'f', NULL, '/mch-payment', '/mch/app', 2, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-23 09:32:12.677882+00', '2026-07-23 09:32:12.677882+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91404, 91403, 'merchant:app:route', 'merchant', 'PayRouteConfig', 'menu.payment.merchant.payRoute', 'lucide:git-branch', 't', 'f', '/payment/route/PayRouteConfig', '/mch/route', NULL, 1, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.695589+00', '2026-07-23 09:32:12.695589+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91405, 91403, 'merchant:gateway-aggregate', 'merchant', 'AggregateScanConfig', 'menu.payment.merchant.aggregateScan', 'lucide:qr-code', 't', 'f', '/payment/merchant/aggregate/AggregateScanConfig', '/mch/aggregate', NULL, 2, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.698644+00', '2026-07-23 09:32:12.698644+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91406, 91403, 'merchant:gateway-code', 'merchant', 'CodePayConfig', 'menu.payment.merchant.codePayConfig', 'lucide:smartphone', 't', 'f', '/payment/merchant/code-config/CodePayConfig', '/mch/code-config', NULL, 3, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, '', '', '2026-07-23 09:32:12.701544+00', '2026-07-23 09:32:12.701544+00'); @@ -221,6 +220,32 @@ INSERT INTO "public"."iam_perm_menu" VALUES (91409, 91403, 'merchant:easypay', ' INSERT INTO "public"."iam_perm_menu" VALUES (91501, 91300, 'merchant:credential', 'merchant', 'MerchantCredentialConfig', 'menu.payment.merchant.credential', 'lucide:key', 'f', 'f', '/payment/merchant/credential/MerchantCredentialConfig', '/mch/credential', NULL, 5, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-24 13:08:44.950986+00', '2026-07-24 13:08:44.950986+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91305, 91300, 'merchant:wx-verify', 'merchant', 'MchWxDomainVerifyList', 'menu.payment.merchant.wxVerify', 'lucide:shield-check', 'f', 'f', '/payment/merchant/wx-verify/MchWxDomainVerifyList', '/mch/wx-verify', NULL, 6, 'f', 'f', 'f', 0, 1, 1, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-24 14:17:59.251093+00', '2026-07-24 14:17:59.251093+00'); INSERT INTO "public"."iam_perm_menu" VALUES (91421, 91402, 'channel:app', 'merchant', 'AlipayMchAppManage', 'menu.payment.merchant.channelMerchant.alipayApp', NULL, 't', 'f', '/payment/channel/alipay/manage/mch/app/AlipayMchAppManage', '/mch/channel-merchant/alipay-app-manage', NULL, 4, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 01:53:14.928869+00', '2026-07-25 01:53:14.928869+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91422, 91402, 'channel:app', 'merchant', 'DouyinMchAppManage', 'menu.payment.merchant.channelMerchant.douyinApp', NULL, 't', 'f', '/payment/channel/douyin/manage/app/DouyinMchAppManage', '/mch/channel-merchant/douyin-app-manage', NULL, 5, 'f', 'f', 'f', 0, 1, 1, 'f', 'subpage', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 03:24:01.70476+00', '2026-07-25 03:24:01.70476+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91601, 91600, 'develop:trade', 'merchant', 'DevelopTrade', 'menu.develop.trade', 'lucide:credit-card', 'f', 'f', '/payment/develop/trade/DevelopTrade', '/develop/trade', NULL, 1, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91602, 91600, 'develop:gateway', 'merchant', 'DevelopGateway', 'menu.develop.gateway', 'lucide:globe', 'f', 'f', '/payment/develop/gateway/DevelopGateway', '/develop/gateway', NULL, 2, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91603, 91600, 'develop:sign', 'merchant', 'DevelopSign', 'menu.develop.sign', 'lucide:pen-tool', 'f', 'f', '/payment/develop/sign/DevelopSign', '/develop/sign', NULL, 3, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91604, 91600, 'develop:auth', 'merchant', 'ChannelAuth', 'menu.develop.auth', 'lucide:shield-check', 'f', 'f', '/payment/develop/auth/ChannelAuth', '/develop/auth', NULL, 4, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); +INSERT INTO "public"."iam_perm_menu" VALUES (91600, NULL, NULL, 'merchant', 'Develop', 'menu.develop', 'lucide:wrench', 'f', 'f', NULL, '/develop', '/develop/trade', 9, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); + +-- ---------------------------- +-- 扩展插件菜单(运营端 + 商户端) +-- ---------------------------- +-- 运营端 扩展插件目录 +INSERT INTO "public"."iam_perm_menu" VALUES (7, NULL, 'plugin', 'admin', 'PluginManagement', 'menu.plugin', 'lucide:puzzle', 'f', 'f', NULL, '/plugin', '/plugin/easypay/order', 6, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 运营端 易支付目录 +INSERT INTO "public"."iam_perm_menu" VALUES (701, 7, NULL, 'admin', 'EasyPayPlugin', 'menu.plugin.easypay', 'lucide:plug', 'f', 'f', NULL, '/plugin/easypay', '/plugin/easypay/order', 1, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 运营端 易支付订单 +INSERT INTO "public"."iam_perm_menu" VALUES (70101, 701, 'plugin:easypay-order', 'admin', 'EasyPayOrderList', 'menu.plugin.easypay.order', 'lucide:credit-card', 'f', 'f', '/plugin/easypay/EasyPayOrderList', '/plugin/easypay/order', NULL, 1, 'f', 't', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 运营端 易支付退款订单 +INSERT INTO "public"."iam_perm_menu" VALUES (70102, 701, 'plugin:easypay-refund', 'admin', 'EasyPayRefundOrderList', 'menu.plugin.easypay.refund', 'lucide:undo-2', 'f', 'f', '/plugin/easypay/EasyPayRefundOrderList', '/plugin/easypay/refund-order', NULL, 2, 'f', 't', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 商户端 扩展插件目录 +INSERT INTO "public"."iam_perm_menu" VALUES (91700, NULL, 'plugin', 'merchant', 'PluginManagement', 'menu.plugin', 'lucide:puzzle', 'f', 'f', NULL, '/plugin', '/plugin/easypay/order', 10, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 商户端 易支付目录 +INSERT INTO "public"."iam_perm_menu" VALUES (91701, 91700, NULL, 'merchant', 'EasyPayPlugin', 'menu.plugin.easypay', 'lucide:plug', 'f', 'f', NULL, '/plugin/easypay', '/plugin/easypay/order', 1, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 商户端 易支付订单 +INSERT INTO "public"."iam_perm_menu" VALUES (91702, 91701, 'plugin:easypay-order', 'merchant', 'EasyPayOrderList', 'menu.plugin.easypay.order', 'lucide:credit-card', 'f', 'f', '/plugin/easypay/EasyPayOrderList', '/plugin/easypay/order', NULL, 1, 'f', 't', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); +-- 商户端 易支付退款订单 +INSERT INTO "public"."iam_perm_menu" VALUES (91703, 91701, 'plugin:easypay-refund', 'merchant', 'EasyPayRefundOrderList', 'menu.plugin.easypay.refund', 'lucide:undo-2', 'f', 'f', '/plugin/easypay/EasyPayRefundOrderList', '/plugin/easypay/refund-order', NULL, 2, 'f', 't', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-26 02:00:00+00', '2026-07-26 02:00:00+00'); -- ---------------------------- -- Primary Key structure for table iam_perm_menu diff --git a/_config/sql/update-datas.sql b/_config/sql/update-datas.sql index b9c2af10c..e69de29bb 100644 --- a/_config/sql/update-datas.sql +++ b/_config/sql/update-datas.sql @@ -1,17 +0,0 @@ --- ============================================================ --- 升级数据脚本 (上一个版本 -> 当前版本) --- 执行顺序: update-tables.sql -> update-datas.sql --- 注意: 不可跨版本升级, 仅限相邻版本间执行 --- ============================================================ - --- ---------------------------- --- 商户端 开发调试(develop) 菜单 --- 顶级目录 + 4 子菜单(交易/网关/签名/认证调试) --- 对应前端 apps/daxpay-merchant, 后端 /mch/develop/* 接口 --- 排序: 顶级目录 sort=5, 位于「回调通知/交易记录」(sort=4.5)之后 --- ---------------------------- -INSERT INTO "public"."iam_perm_menu" VALUES (91600, NULL, NULL, 'merchant', 'Develop', 'menu.develop', 'lucide:wrench', 'f', 'f', NULL, '/develop', '/develop/trade', 5, 'f', 't', 'f', 0, NULL, 0, 'f', 'catalog', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91601, 91600, 'develop:trade', 'merchant', 'DevelopTrade', 'menu.develop.trade', 'lucide:credit-card', 'f', 'f', '/payment/develop/trade/DevelopTrade', '/develop/trade', NULL, 1, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91602, 91600, 'develop:gateway', 'merchant', 'DevelopGateway', 'menu.develop.gateway', 'lucide:globe', 'f', 'f', '/payment/develop/gateway/DevelopGateway', '/develop/gateway', NULL, 2, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91603, 91600, 'develop:sign', 'merchant', 'DevelopSign', 'menu.develop.sign', 'lucide:pen-tool', 'f', 'f', '/payment/develop/sign/DevelopSign', '/develop/sign', NULL, 3, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); -INSERT INTO "public"."iam_perm_menu" VALUES (91604, 91600, 'develop:auth', 'merchant', 'ChannelAuth', 'menu.develop.auth', 'lucide:shield-check', 'f', 'f', '/payment/develop/auth/ChannelAuth', '/develop/auth', NULL, 4, 'f', 'f', 'f', 0, NULL, 0, 'f', 'menu', NULL, NULL, NULL, NULL, NULL, NULL, '2026-07-25 15:10:00+00', '2026-07-25 15:10:00+00'); diff --git a/daxpay-platform/daxpay-platform-core/src/main/java/cn/daxpay/open/platform/core/code/PermCodes.java b/daxpay-platform/daxpay-platform-core/src/main/java/cn/daxpay/open/platform/core/code/PermCodes.java index f5769ae55..7deafeb01 100644 --- a/daxpay-platform/daxpay-platform-core/src/main/java/cn/daxpay/open/platform/core/code/PermCodes.java +++ b/daxpay-platform/daxpay-platform-core/src/main/java/cn/daxpay/open/platform/core/code/PermCodes.java @@ -431,5 +431,20 @@ public interface PermCodes { String MENU = "device:qrcode"; } } + + /// 扩展插件域(协议适配层的订单/退款,与内核交易单据隔离) + interface Plugin { + /// 易支付协议订单 menuCode=plugin:easypay-order + interface EasyPayOrder { + /// 菜单编码 + String MENU = "plugin:easypay-order"; + } + + /// 易支付协议退款订单 menuCode=plugin:easypay-refund + interface EasyPayRefund { + /// 菜单编码 + String MENU = "plugin:easypay-refund"; + } + } } diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayOrderController.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayOrderController.java new file mode 100644 index 000000000..3281ef56e --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayOrderController.java @@ -0,0 +1,70 @@ +package cn.daxpay.open.plugin.easypay.controller.order; + +import cn.daxpay.open.payment.unipay.result.trade.pay.NormalPaySyncResult; +import cn.daxpay.open.platform.core.annotation.PermCode; +import cn.daxpay.open.platform.core.code.PermCodes; +import cn.daxpay.open.platform.core.rest.Res; +import cn.daxpay.open.platform.core.rest.param.PageParam; +import cn.daxpay.open.platform.core.rest.result.PageResult; +import cn.daxpay.open.platform.core.rest.result.Result; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayOrderQuery; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayOrderResult; +import cn.daxpay.open.plugin.easypay.service.order.EasyPayOrderQueryService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/// # 易支付协议订单(管理) +/// +/// 运营端 / 商户端共用。同步/关单透传内核 [cn.daxpay.open.payment.trade.order.service.NormalPayOrderService]; +/// 生命周期回写钩子位于 [cn.daxpay.open.plugin.easypay.service.order.EasyPayOrderService], 与本控制器分离。 +@PermCode(menuCode = PermCodes.Plugin.EasyPayOrder.MENU) +@Validated +@Tag(name = "易支付协议订单") +@RestController +@RequestMapping({"/admin/easypay/order", "/merchant/easypay/order"}) +@RequiredArgsConstructor +public class EasyPayOrderController { + + private final EasyPayOrderQueryService easyPayOrderQueryService; + + @PermCode(code = PermCodes.Action.VIEW) + @Operation(summary = "易支付订单分页") + @GetMapping("/page") + public Result> page(PageParam pageParam, EasyPayOrderQuery query) { + return Res.ok(easyPayOrderQueryService.page(pageParam, query)); + } + + @PermCode(code = PermCodes.Action.VIEW) + @Operation(summary = "根据ID查询易支付订单详情") + @GetMapping("/get-by-id") + public Result findById( + @NotNull(message = "{validation.field.id.notNull}") Long id) { + return Res.ok(easyPayOrderQueryService.findById(id)); + } + + @PermCode(code = PermCodes.Action.MANAGE) + @Operation(summary = "同步易支付订单状态") + @PostMapping("/sync") + public Result sync( + @NotNull(message = "{validation.field.id.notNull}") Long id) { + return Res.ok(easyPayOrderQueryService.sync(id)); + } + + @PermCode(code = PermCodes.Action.MANAGE) + @Operation(summary = "关闭/撤销易支付订单") + @PostMapping("/close") + public Result close( + @NotNull(message = "{validation.field.id.notNull}") Long id, + @RequestParam(defaultValue = "false") boolean useCancel) { + easyPayOrderQueryService.close(id, useCancel); + return Res.ok(); + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayRefundOrderController.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayRefundOrderController.java new file mode 100644 index 000000000..5cff17699 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/controller/order/EasyPayRefundOrderController.java @@ -0,0 +1,58 @@ +package cn.daxpay.open.plugin.easypay.controller.order; + +import cn.daxpay.open.platform.core.annotation.PermCode; +import cn.daxpay.open.platform.core.code.PermCodes; +import cn.daxpay.open.platform.core.rest.Res; +import cn.daxpay.open.platform.core.rest.param.PageParam; +import cn.daxpay.open.platform.core.rest.result.PageResult; +import cn.daxpay.open.platform.core.rest.result.Result; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayRefundOrderQuery; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayRefundOrderResult; +import cn.daxpay.open.plugin.easypay.service.order.EasyPayRefundOrderQueryService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.constraints.NotNull; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/// # 易支付协议退款订单(管理) +/// +/// 运营端 / 商户端共用。同步透传内核 [cn.daxpay.open.payment.trade.order.service.RefundOrderService]; +/// 生命周期钩子(双写/成功回写)位于 [cn.daxpay.open.plugin.easypay.service.order.EasyPayRefundOrderService], 与本控制器分离。 +@PermCode(menuCode = PermCodes.Plugin.EasyPayRefund.MENU) +@Validated +@Tag(name = "易支付协议退款订单") +@RestController +@RequestMapping({"/admin/easypay/refund", "/merchant/easypay/refund"}) +@RequiredArgsConstructor +public class EasyPayRefundOrderController { + + private final EasyPayRefundOrderQueryService easyPayRefundOrderQueryService; + + @PermCode(code = PermCodes.Action.VIEW) + @Operation(summary = "易支付退款订单分页") + @GetMapping("/page") + public Result> page(PageParam pageParam, EasyPayRefundOrderQuery query) { + return Res.ok(easyPayRefundOrderQueryService.page(pageParam, query)); + } + + @PermCode(code = PermCodes.Action.VIEW) + @Operation(summary = "根据ID查询易支付退款订单详情") + @GetMapping("/get-by-id") + public Result findById( + @NotNull(message = "{validation.field.id.notNull}") Long id) { + return Res.ok(easyPayRefundOrderQueryService.findById(id)); + } + + @PermCode(code = PermCodes.Action.MANAGE) + @Operation(summary = "同步易支付退款状态") + @PostMapping("/sync") + public Result sync( + @NotNull(message = "{validation.field.id.notNull}") Long id) { + return Res.ok(easyPayRefundOrderQueryService.sync(id)); + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/convert/EasyPayRefundOrderConvert.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/convert/EasyPayRefundOrderConvert.java new file mode 100644 index 000000000..ae89496da --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/convert/EasyPayRefundOrderConvert.java @@ -0,0 +1,15 @@ +package cn.daxpay.open.plugin.easypay.convert; + +import cn.daxpay.open.plugin.easypay.entity.EasyPayRefundOrder; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayRefundOrderResult; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +/// # 易支付协议退款订单转换 +/// +@Mapper +public interface EasyPayRefundOrderConvert { + EasyPayRefundOrderConvert CONVERT = Mappers.getMapper(EasyPayRefundOrderConvert.class); + + EasyPayRefundOrderResult toResult(EasyPayRefundOrder entity); +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayOrderManager.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayOrderManager.java index 36f0583a1..d8f75b492 100644 --- a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayOrderManager.java +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayOrderManager.java @@ -1,8 +1,14 @@ package cn.daxpay.open.plugin.easypay.dao; import cn.daxpay.open.platform.common.mybatisplus.impl.BaseManager; +import cn.daxpay.open.platform.common.mybatisplus.query.generator.QueryGenerator; +import cn.daxpay.open.platform.common.mybatisplus.util.MpUtil; import cn.daxpay.open.platform.core.annotation.IgnoreTenant; +import cn.daxpay.open.platform.core.rest.param.PageParam; import cn.daxpay.open.plugin.easypay.entity.EasyPayOrder; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayOrderQuery; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Repository; @@ -40,4 +46,13 @@ public class EasyPayOrderManager extends BaseManager findByOrderIdNotTenant(Long orderId) { return findByField(EasyPayOrder::getOrderId, orderId); } + + /// 分页查询(管理端), 默认按创建时间倒序 + public Page page(PageParam pageParam, EasyPayOrderQuery query) { + Page mpPage = MpUtil.getMpPage(pageParam); + QueryWrapper wrapper = QueryGenerator.generator(query); + // 默认按创建时间倒序 + wrapper.orderByDesc("create_time"); + return this.page(mpPage, wrapper); + } } diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderManager.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderManager.java new file mode 100644 index 000000000..2183c4121 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderManager.java @@ -0,0 +1,51 @@ +package cn.daxpay.open.plugin.easypay.dao; + +import cn.daxpay.open.platform.common.mybatisplus.impl.BaseManager; +import cn.daxpay.open.platform.common.mybatisplus.query.generator.QueryGenerator; +import cn.daxpay.open.platform.common.mybatisplus.util.MpUtil; +import cn.daxpay.open.platform.core.annotation.IgnoreTenant; +import cn.daxpay.open.platform.core.rest.param.PageParam; +import cn.daxpay.open.plugin.easypay.entity.EasyPayRefundOrder; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayRefundOrderQuery; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +/// # 易支付协议退款订单 Manager +/// +@Repository +public class EasyPayRefundOrderManager extends BaseManager { + + /// 按内核退款单 ID 查询 + public Optional findByRefundId(Long refundId) { + return findByField(EasyPayRefundOrder::getRefundId, refundId); + } + + /// 按平台退款单号查询 + public Optional findByRefundNo(String refundNo) { + return findByField(EasyPayRefundOrder::getRefundNo, refundNo); + } + + /// 忽略租户按内核退款单 ID 查询(插件钩子无租户上下文场景) + @IgnoreTenant + public Optional findByRefundIdNotTenant(Long refundId) { + return findByField(EasyPayRefundOrder::getRefundId, refundId); + } + + /// 忽略租户按主键查询 + @IgnoreTenant + public Optional findByIdNotTenant(Long id) { + return findById(id); + } + + /// 分页查询(管理端), 默认按创建时间倒序 + public Page page(PageParam pageParam, EasyPayRefundOrderQuery query) { + Page mpPage = MpUtil.getMpPage(pageParam); + QueryWrapper wrapper = QueryGenerator.generator(query); + // 默认按创建时间倒序 + wrapper.orderByDesc("create_time"); + return this.page(mpPage, wrapper); + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderMapper.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderMapper.java new file mode 100644 index 000000000..d3871757a --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/dao/EasyPayRefundOrderMapper.java @@ -0,0 +1,11 @@ +package cn.daxpay.open.plugin.easypay.dao; + +import cn.daxpay.open.plugin.easypay.entity.EasyPayRefundOrder; +import com.github.yulichang.base.MPJBaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/// # 易支付协议退款订单 Mapper +/// +@Mapper +public interface EasyPayRefundOrderMapper extends MPJBaseMapper { +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/entity/EasyPayRefundOrder.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/entity/EasyPayRefundOrder.java new file mode 100644 index 000000000..b5b2b3963 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/entity/EasyPayRefundOrder.java @@ -0,0 +1,71 @@ +package cn.daxpay.open.plugin.easypay.entity; + +import cn.daxpay.open.payment.common.entity.MchBaseEntity; +import cn.daxpay.open.platform.common.mybatisplus.function.ToResult; +import cn.daxpay.open.plugin.easypay.convert.EasyPayRefundOrderConvert; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayRefundOrderResult; +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.OffsetDateTime; + +/// # 易支付协议退款订单 +/// +/// 独立于内核 [cn.daxpay.open.payment.trade.order.entity.RefundOrder],记录易支付协议侧的退款信息, +/// 通过 [refundId] 关联内核退款单。 +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +@TableName("pay_easy_pay_refund_order") +public class EasyPayRefundOrder extends MchBaseEntity implements ToResult { + + /// 关联内核退款单 ID(RefundOrder.id) + private Long refundId; + + /// 关联易支付订单 ID(EasyPayOrder.id) + private Long easyPayOrderId; + + /// 易支付商户号 + private Integer pid; + + /// 应用号 + @TableField(updateStrategy = FieldStrategy.NEVER) + private String appId; + + /// 平台退款单号 + private String refundNo; + + /// 商户退款单号 out_refund_no + private String bizRefundNo; + + /// 平台业务单号 + private String tradeNo; + + /// 商户订单号 out_trade_no + private String outTradeNo; + + /// 退款金额(元) + private BigDecimal money; + + /// 协议退款状态 0=失败/处理中 1=成功 + private Integer status; + + /// API 版本 v1/v2 + private String apiVersion; + + /// 退款发起时间 + private OffsetDateTime addTime; + + /// 退款完成时间 + private OffsetDateTime endTime; + + @Override + public EasyPayRefundOrderResult toResult() { + return EasyPayRefundOrderConvert.CONVERT.toResult(this); + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayOrderQuery.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayOrderQuery.java new file mode 100644 index 000000000..c89d31511 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayOrderQuery.java @@ -0,0 +1,71 @@ +package cn.daxpay.open.plugin.easypay.param.order; + +import cn.daxpay.open.platform.core.annotation.QueryParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.OffsetDateTime; + +/// # 易支付协议订单查询参数(管理) +/// +@Data +@Accessors(chain = true) +@Schema(title = "易支付订单查询参数") +public class EasyPayOrderQuery { + + /// 商户号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "商户号") + private String mchNo; + + /// 应用号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "应用号") + private String appId; + + /// 商户订单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "商户订单号") + private String outTradeNo; + + /// 平台业务单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "平台业务单号") + private String tradeNo; + + /// 商品名称 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "商品名称") + private String name; + + /// 协议支付方式 alipay/wxpay/aggregate + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "协议支付方式") + private String type; + + /// 协议状态 0=待付 1=成功 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "协议状态") + private Integer status; + + /// 易支付商户号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "易支付商户号") + private Integer pid; + + /// API 版本 v1/v2 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "API版本") + private String apiVersion; + + /// 创建时间-开始 + @QueryParam(type = QueryParam.CompareTypeEnum.GE, fieldName = "create_time") + @Schema(description = "创建时间-开始") + private OffsetDateTime createTimeStart; + + /// 创建时间-结束 + @QueryParam(type = QueryParam.CompareTypeEnum.LE, fieldName = "create_time") + @Schema(description = "创建时间-结束") + private OffsetDateTime createTimeEnd; +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayRefundOrderQuery.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayRefundOrderQuery.java new file mode 100644 index 000000000..2aa53a9cb --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/param/order/EasyPayRefundOrderQuery.java @@ -0,0 +1,71 @@ +package cn.daxpay.open.plugin.easypay.param.order; + +import cn.daxpay.open.platform.core.annotation.QueryParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.experimental.Accessors; + +import java.time.OffsetDateTime; + +/// # 易支付协议退款订单查询参数(管理) +/// +@Data +@Accessors(chain = true) +@Schema(title = "易支付退款订单查询参数") +public class EasyPayRefundOrderQuery { + + /// 商户号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "商户号") + private String mchNo; + + /// 应用号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "应用号") + private String appId; + + /// 平台退款单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "平台退款单号") + private String refundNo; + + /// 商户退款单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "商户退款单号") + private String bizRefundNo; + + /// 商户订单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "商户订单号") + private String outTradeNo; + + /// 平台业务单号 + @QueryParam(type = QueryParam.CompareTypeEnum.LIKE) + @Schema(description = "平台业务单号") + private String tradeNo; + + /// 易支付商户号 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "易支付商户号") + private Integer pid; + + /// 协议退款状态 0=失败/处理中 1=成功 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "协议退款状态") + private Integer status; + + /// API 版本 v1/v2 + @QueryParam(type = QueryParam.CompareTypeEnum.EQ) + @Schema(description = "API版本") + private String apiVersion; + + /// 创建时间-开始 + @QueryParam(type = QueryParam.CompareTypeEnum.GE, fieldName = "create_time") + @Schema(description = "创建时间-开始") + private OffsetDateTime createTimeStart; + + /// 创建时间-结束 + @QueryParam(type = QueryParam.CompareTypeEnum.LE, fieldName = "create_time") + @Schema(description = "创建时间-结束") + private OffsetDateTime createTimeEnd; +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/result/order/EasyPayRefundOrderResult.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/result/order/EasyPayRefundOrderResult.java new file mode 100644 index 000000000..1e9f07279 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/result/order/EasyPayRefundOrderResult.java @@ -0,0 +1,71 @@ +package cn.daxpay.open.plugin.easypay.result.order; + +import cn.daxpay.open.payment.common.result.MchBaseResult; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; +import java.time.OffsetDateTime; + +/// # 易支付协议退款订单结果 +/// +@EqualsAndHashCode(callSuper = true) +@Data +@Accessors(chain = true) +@Schema(title = "易支付退款订单结果") +public class EasyPayRefundOrderResult extends MchBaseResult { + + /// 关联内核退款单 ID(RefundOrder.id) + @Schema(description = "关联内核退款单ID") + private Long refundId; + + /// 关联易支付订单 ID(EasyPayOrder.id) + @Schema(description = "关联易支付订单ID") + private Long easyPayOrderId; + + /// 易支付商户号 + @Schema(description = "易支付商户号") + private Integer pid; + + /// 应用号 + @Schema(description = "应用号") + private String appId; + + /// 平台退款单号 + @Schema(description = "平台退款单号") + private String refundNo; + + /// 商户退款单号 + @Schema(description = "商户退款单号") + private String bizRefundNo; + + /// 平台业务单号 + @Schema(description = "平台业务单号") + private String tradeNo; + + /// 商户订单号 + @Schema(description = "商户订单号") + private String outTradeNo; + + /// 退款金额(元) + @Schema(description = "退款金额(元)") + private BigDecimal money; + + /// 协议退款状态 0=失败/处理中 1=成功 + @Schema(description = "协议退款状态 0=失败/处理中 1=成功") + private Integer status; + + /// API 版本 v1/v2 + @Schema(description = "API版本") + private String apiVersion; + + /// 退款发起时间 + @Schema(description = "退款发起时间") + private OffsetDateTime addTime; + + /// 退款完成时间 + @Schema(description = "退款完成时间") + private OffsetDateTime endTime; +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/api/v2/EasyPayRefundV2Service.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/api/v2/EasyPayRefundV2Service.java index 11be359cb..7d1b89417 100644 --- a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/api/v2/EasyPayRefundV2Service.java +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/api/v2/EasyPayRefundV2Service.java @@ -11,6 +11,7 @@ import cn.daxpay.open.plugin.easypay.result.api.v2.EasyPayRefundOrderV2Result; import cn.daxpay.open.plugin.easypay.result.api.v2.EasyPayRefundV2Result; import cn.daxpay.open.plugin.easypay.service.api.EasyPayAssistService; import cn.daxpay.open.plugin.easypay.service.config.EasyPayCredentialService; +import cn.daxpay.open.plugin.easypay.service.order.EasyPayRefundOrderService; import cn.daxpay.open.plugin.easypay.util.EasyPayUtil; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; @@ -31,6 +32,7 @@ public class EasyPayRefundV2Service { private final EasyPayAssistService easyPayAssistService; private final RefundService payRefundService; private final RefundOrderManager payRefundOrderManager; + private final EasyPayRefundOrderService easyPayRefundOrderService; /// 退款 public EasyPayRefundV2Result refund(EasyPayRefundV2Param param) { @@ -53,6 +55,8 @@ public class EasyPayRefundV2Service { refundParam.setAmount(EasyPayUtil.yuanToFen(param.getMoney())); refundParam.setReason("easypay refund"); RefundOrder refundOrder = payRefundService.refund(refundParam); + // 双写:内核退款单返回后创建/更新易支付协议退款记录 + easyPayRefundOrderService.createFromKernelRefund(refundOrder, credential); if (Objects.equals(refundOrder.getStatus(), RefundOrderStatusEnum.SUCCESS.getCode())) { result.setCode(0).setMsg("success"); } else if (Objects.equals(refundOrder.getStatus(), RefundOrderStatusEnum.PROGRESS.getCode())) { diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderQueryService.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderQueryService.java new file mode 100644 index 000000000..9268f1da7 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderQueryService.java @@ -0,0 +1,96 @@ +package cn.daxpay.open.plugin.easypay.service.order; + +import cn.daxpay.open.payment.trade.order.service.NormalPayOrderService; +import cn.daxpay.open.payment.unipay.result.trade.pay.NormalPaySyncResult; +import cn.daxpay.open.platform.common.translate.service.TransService; +import cn.daxpay.open.platform.core.enums.client.ClientEnum; +import cn.daxpay.open.platform.core.exception.DataNotExistException; +import cn.daxpay.open.platform.core.rest.param.PageParam; +import cn.daxpay.open.platform.core.rest.result.PageResult; +import cn.daxpay.open.platform.iam.service.client.ClientCodeService; +import cn.daxpay.open.plugin.easypay.dao.EasyPayOrderManager; +import cn.daxpay.open.plugin.easypay.entity.EasyPayOrder; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayOrderQuery; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayOrderResult; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/// # 易支付订单管理端查询服务 +/// +/// 承接运营端/商户端管理后台的易支付订单管理入口:分页、详情、同步、关单。 +/// 同步/关单透传内核 [cn.daxpay.open.payment.trade.order.service.NormalPayOrderService]。 +/// 生命周期回写(支付成功/退款/关单钩子) 见 [EasyPayOrderService], 与本类解耦以避免循环依赖。 +@Slf4j +@Service +@RequiredArgsConstructor +public class EasyPayOrderQueryService { + + private final EasyPayOrderManager easyPayOrderManager; + private final NormalPayOrderService normalPayOrderService; + private final TransService transService; + private final ClientCodeService clientCodeService; + + /// 分页查询 + public PageResult page(PageParam pageParam, EasyPayOrderQuery query) { + sanitizeQuery(query); + Page page = easyPayOrderManager.page(pageParam, query); + var records = page.getRecords().stream() + .map(EasyPayOrder::toResult) + .toList(); + var pageResult = new PageResult() + .setRecords(records) + .setTotal(page.getTotal()) + .setSize(page.getSize()) + .setCurrent(page.getCurrent()); + translateIfAdmin(pageResult); + return pageResult; + } + + /// 详情查询 + public EasyPayOrderResult findById(Long id) { + EasyPayOrder entity = easyPayOrderManager.findById(id) + .orElseThrow(() -> new DataNotExistException("pay.error.payOrderNotExist")); + EasyPayOrderResult result = entity.toResult(); + translateIfAdmin(result); + return result; + } + + /// 同步支付状态(透传内核普通支付订单同步) + public NormalPaySyncResult sync(Long id) { + EasyPayOrder entity = easyPayOrderManager.findById(id) + .orElseThrow(() -> new DataNotExistException("pay.error.payOrderNotExist")); + if (entity.getOrderId() == null) { + throw new DataNotExistException("pay.error.payOrderNotExist"); + } + return normalPayOrderService.sync(entity.getOrderId()); + } + + /// 关闭/撤销订单(透传内核普通支付订单关单) + public void close(Long id, boolean useCancel) { + EasyPayOrder entity = easyPayOrderManager.findById(id) + .orElseThrow(() -> new DataNotExistException("pay.error.payOrderNotExist")); + if (entity.getOrderId() == null) { + throw new DataNotExistException("pay.error.payOrderNotExist"); + } + normalPayOrderService.close(entity.getOrderId(), useCancel); + } + + private void sanitizeQuery(EasyPayOrderQuery query) { + if (query == null) { + return; + } + if (ClientEnum.MERCHANT.getCode().equals(clientCodeService.getClientCode())) { + // 商户端强制按当前商户过滤 + query.setMchNo(null); + } + } + + private void translateIfAdmin(Object target) { + if (ClientEnum.ADMIN.getCode().equals(clientCodeService.getClientCode())) { + // 翻译商户名称(mchNo -> mchName) + transService.translate(target); + } + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderService.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderService.java index 4f5aa5e60..e885926cf 100644 --- a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderService.java +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayOrderService.java @@ -13,8 +13,14 @@ import java.math.RoundingMode; import java.time.OffsetDateTime; import java.time.ZoneOffset; -/// # 易支付订单服务 +/// # 易支付订单生命周期回写服务 /// +/// 仅承担支付/退款/关单钩子的协议单回写; 由 [cn.daxpay.open.plugin.easypay.strategy.EasyPayPluginStrategy] +/// 经插件分发链调用。 +/// 管理端入口(分页/详情/同步/关单) 见 [EasyPayOrderQueryService], 与本类解耦以避免循环依赖: +/// 钩子链位于 [cn.daxpay.open.payment.trade.runtime.service.pay.common.PayUniHandleService] 的下游, +/// 若本类同时持有 [cn.daxpay.open.payment.trade.order.service.NormalPayOrderService] 用于同步/关单透传, +/// 会经 NormalPayOrderService -> PaySyncService -> PayUniHandleService -> 插件链 -> 本类 形成构造期循环依赖。 @Slf4j @Service @RequiredArgsConstructor diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderQueryService.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderQueryService.java new file mode 100644 index 000000000..faa416fc2 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderQueryService.java @@ -0,0 +1,104 @@ +package cn.daxpay.open.plugin.easypay.service.order; + +import cn.daxpay.open.payment.trade.enums.RefundOrderStatusEnum; +import cn.daxpay.open.payment.trade.order.result.RefundOrderResult; +import cn.daxpay.open.payment.trade.order.service.RefundOrderService; +import cn.daxpay.open.platform.common.translate.service.TransService; +import cn.daxpay.open.platform.core.enums.client.ClientEnum; +import cn.daxpay.open.platform.core.exception.DataNotExistException; +import cn.daxpay.open.platform.core.rest.param.PageParam; +import cn.daxpay.open.platform.core.rest.result.PageResult; +import cn.daxpay.open.platform.iam.service.client.ClientCodeService; +import cn.daxpay.open.plugin.easypay.dao.EasyPayRefundOrderManager; +import cn.daxpay.open.plugin.easypay.entity.EasyPayRefundOrder; +import cn.daxpay.open.plugin.easypay.param.order.EasyPayRefundOrderQuery; +import cn.daxpay.open.plugin.easypay.result.order.EasyPayRefundOrderResult; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Objects; + +/// # 易支付协议退款订单管理端查询服务 +/// +/// 承接运营端/商户端管理后台的易支付退款订单管理入口:分页、详情、同步。 +/// 同步透传内核 [cn.daxpay.open.payment.trade.order.service.RefundOrderService] 并回写易支付退款单状态。 +/// 生命周期钩子(双写/成功回写) 见 [EasyPayRefundOrderService], 与本类解耦以避免循环依赖: +/// 钩子链位于 [cn.daxpay.open.payment.trade.runtime.service.plugin.PayPluginAssistService] 的下游, +/// 若本类同时持有 RefundOrderService 用于同步透传, 会经 RefundOrderService -> RefundService +/// -> RefundSettleService -> PayPluginAssistService -> 插件链 -> 本类 形成构造期循环依赖。 +@Slf4j +@Service +@RequiredArgsConstructor +public class EasyPayRefundOrderQueryService { + + private final EasyPayRefundOrderManager easyPayRefundOrderManager; + private final RefundOrderService refundOrderService; + private final TransService transService; + private final ClientCodeService clientCodeService; + + /// 分页查询 + public PageResult page(PageParam pageParam, EasyPayRefundOrderQuery query) { + sanitizeQuery(query); + Page page = easyPayRefundOrderManager.page(pageParam, query); + var records = page.getRecords().stream() + .map(EasyPayRefundOrder::toResult) + .toList(); + var pageResult = new PageResult() + .setRecords(records) + .setTotal(page.getTotal()) + .setSize(page.getSize()) + .setCurrent(page.getCurrent()); + translateIfAdmin(pageResult); + return pageResult; + } + + /// 详情查询 + public EasyPayRefundOrderResult findById(Long id) { + EasyPayRefundOrder entity = easyPayRefundOrderManager.findById(id) + .orElseThrow(() -> new DataNotExistException("pay.error.refund.orderNotFound")); + EasyPayRefundOrderResult result = entity.toResult(); + translateIfAdmin(result); + return result; + } + + /// 同步退款状态(透传内核退款同步, 并回写易支付退款单状态) + public EasyPayRefundOrderResult sync(Long id) { + EasyPayRefundOrder entity = easyPayRefundOrderManager.findById(id) + .orElseThrow(() -> new DataNotExistException("pay.error.refund.orderNotFound")); + RefundOrderResult kernelResult = refundOrderService.sync(entity.getRefundId()); + entity.setStatus(mapStatus(kernelResult.getStatus())); + if (Objects.equals(entity.getStatus(), 1) && entity.getEndTime() == null) { + entity.setEndTime(OffsetDateTime.now(ZoneOffset.UTC)); + } + easyPayRefundOrderManager.updateById(entity); + EasyPayRefundOrderResult result = entity.toResult(); + translateIfAdmin(result); + return result; + } + + /// 内核退款状态码 → 易支付协议状态(1=成功, 0=其它) + private int mapStatus(String kernelStatus) { + return Objects.equals(kernelStatus, RefundOrderStatusEnum.SUCCESS.getCode()) ? 1 : 0; + } + + private void sanitizeQuery(EasyPayRefundOrderQuery query) { + if (query == null) { + return; + } + if (ClientEnum.MERCHANT.getCode().equals(clientCodeService.getClientCode())) { + // 商户端强制按当前商户过滤 + query.setMchNo(null); + } + } + + private void translateIfAdmin(Object target) { + if (ClientEnum.ADMIN.getCode().equals(clientCodeService.getClientCode())) { + // 翻译商户名称(mchNo -> mchName) + transService.translate(target); + } + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderService.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderService.java new file mode 100644 index 000000000..6d7c03386 --- /dev/null +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/service/order/EasyPayRefundOrderService.java @@ -0,0 +1,128 @@ +package cn.daxpay.open.plugin.easypay.service.order; + +import cn.daxpay.open.payment.trade.enums.RefundOrderStatusEnum; +import cn.daxpay.open.payment.trade.order.entity.RefundOrder; +import cn.daxpay.open.plugin.easypay.dao.EasyPayOrderManager; +import cn.daxpay.open.plugin.easypay.dao.EasyPayRefundOrderManager; +import cn.daxpay.open.plugin.easypay.entity.EasyPayCredential; +import cn.daxpay.open.plugin.easypay.entity.EasyPayRefundOrder; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Objects; +import java.util.Optional; + +/// # 易支付协议退款订单生命周期回写服务 +/// +/// 仅承担退款双写与状态钩子: +/// - [createFromKernelRefund]: 退款发起后由 [cn.daxpay.open.plugin.easypay.service.api.v2.EasyPayRefundV2Service] 调用, 创建/更新易支付退款镜像 +/// - [markSuccess]: 异步退款最终成功时由 [cn.daxpay.open.plugin.easypay.strategy.EasyPayPluginStrategy] 经插件链调用 +/// +/// 管理端入口(分页/详情/同步) 见 [EasyPayRefundOrderQueryService], 与本类解耦以避免循环依赖: +/// 钩子链位于 [cn.daxpay.open.payment.trade.runtime.service.plugin.PayPluginAssistService] 的下游, +/// 若本类同时持有 [cn.daxpay.open.payment.trade.order.service.RefundOrderService] 用于同步透传, +/// 会经 RefundOrderService -> RefundService -> RefundSettleService -> PayPluginAssistService -> 插件链 -> 本类 形成构造期循环依赖。 +@Slf4j +@Service +@RequiredArgsConstructor +public class EasyPayRefundOrderService { + + private final EasyPayRefundOrderManager easyPayRefundOrderManager; + private final EasyPayOrderManager easyPayOrderManager; + + /// 退款发起后由内核退款单创建/更新易支付退款记录(双写) + public void createFromKernelRefund(RefundOrder refundOrder, EasyPayCredential credential) { + // 幂等:已存在则按内核状态更新 + var existing = easyPayRefundOrderManager.findByRefundId(refundOrder.getId()); + if (existing.isPresent()) { + updateStatusFromKernel(existing.get(), refundOrder); + return; + } + EasyPayRefundOrder entity = new EasyPayRefundOrder() + .setRefundId(refundOrder.getId()) + .setRefundNo(refundOrder.getRefundNo()) + .setBizRefundNo(refundOrder.getBizRefundNo()) + .setTradeNo(refundOrder.getTradeNo()) + .setOutTradeNo(refundOrder.getBizOrderNo()) + .setPid(credential.getPid()) + .setAppId(credential.getAppId()) + .setMoney(fenToYuan(refundOrder.getAmount())) + .setStatus(mapStatus(refundOrder.getStatus())) + .setApiVersion("v2") + .setAddTime(OffsetDateTime.now(ZoneOffset.UTC)); + // MchBaseEntity#setMchNo 返回父类类型,单独赋值不链式 + entity.setMchNo(credential.getMchNo()); + if (Objects.equals(entity.getStatus(), 1)) { + entity.setEndTime(OffsetDateTime.now(ZoneOffset.UTC)); + } + // 关联易支付订单 + findEasyPayOrderId(refundOrder).ifPresent(entity::setEasyPayOrderId); + easyPayRefundOrderManager.save(entity); + } + + /// 退款成功钩子回写(异步退款最终成功时由插件策略调用) + public void markSuccess(RefundOrder refundOrder) { + var opt = easyPayRefundOrderManager.findByRefundIdNotTenant(refundOrder.getId()); + if (opt.isEmpty()) { + // 同步退款时记录在 refund() 返回后才创建,此处跳过 + return; + } + EasyPayRefundOrder entity = opt.get(); + if (Objects.equals(entity.getStatus(), 1)) { + // 已是成功,幂等跳过 + return; + } + entity.setStatus(1).setEndTime(OffsetDateTime.now(ZoneOffset.UTC)); + easyPayRefundOrderManager.updateById(entity); + } + + /// 根据内核退款单定位关联的易支付订单 ID + private Optional findEasyPayOrderId(RefundOrder refundOrder) { + // 优先用商户订单号查 + if (refundOrder.getBizOrderNo() != null) { + var opt = easyPayOrderManager.findByOutTradeNo(refundOrder.getBizOrderNo()); + if (opt.isPresent()) { + return Optional.of(opt.get().getId()); + } + } + // 再用平台业务单号查 + if (refundOrder.getTradeNo() != null) { + var opt = easyPayOrderManager.findByTradeNo(refundOrder.getTradeNo()); + if (opt.isPresent()) { + return Optional.of(opt.get().getId()); + } + } + return Optional.empty(); + } + + /// 根据内核状态更新易支付退款单状态 + private void updateStatusFromKernel(EasyPayRefundOrder entity, RefundOrder refundOrder) { + int mapped = mapStatus(refundOrder.getStatus()); + if (Objects.equals(entity.getStatus(), mapped)) { + return; + } + entity.setStatus(mapped); + if (mapped == 1 && entity.getEndTime() == null) { + entity.setEndTime(OffsetDateTime.now(ZoneOffset.UTC)); + } + easyPayRefundOrderManager.updateById(entity); + } + + /// 内核退款状态码 → 易支付协议状态(1=成功, 0=其它) + private int mapStatus(String kernelStatus) { + return Objects.equals(kernelStatus, RefundOrderStatusEnum.SUCCESS.getCode()) ? 1 : 0; + } + + /// 分(最小货币单位) → 元(BigDecimal) + private BigDecimal fenToYuan(Long fen) { + if (fen == null) { + return BigDecimal.ZERO; + } + return BigDecimal.valueOf(fen).divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP); + } +} diff --git a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/strategy/EasyPayPluginStrategy.java b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/strategy/EasyPayPluginStrategy.java index 470d048ad..fe5afd1d2 100644 --- a/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/strategy/EasyPayPluginStrategy.java +++ b/daxpay-plugin/daxpay-plugin-easypay/src/main/java/cn/daxpay/open/plugin/easypay/strategy/EasyPayPluginStrategy.java @@ -12,6 +12,7 @@ import cn.daxpay.open.platform.core.enums.pay.notice.NoticeProtocolEnum; import cn.daxpay.open.platform.core.enums.pay.trade.TradeSourceEnum; import cn.daxpay.open.plugin.easypay.entity.EasyPayOrder; import cn.daxpay.open.plugin.easypay.service.order.EasyPayOrderService; +import cn.daxpay.open.plugin.easypay.service.order.EasyPayRefundOrderService; import cn.hutool.core.util.StrUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -29,6 +30,7 @@ import java.util.Objects; public class EasyPayPluginStrategy implements AbsPayPluginStrategy { private final EasyPayOrderService easyPayOrderService; + private final EasyPayRefundOrderService easyPayRefundOrderService; private final NoticeDispatcher noticeDispatcher; /// 支付成功:回写协议单状态并注册易支付出站通知 @@ -50,7 +52,7 @@ public class EasyPayPluginStrategy implements AbsPayPluginStrategy { easyPayOrderService.payClose(trade); } - /// 退款成功:累加协议单已退金额 + /// 退款成功:累加协议单已退金额并回写独立退款记录状态 @Override public void refundSuccess(PayTrade trade, RefundOrder refundOrder) { if (!Objects.equals(TradeSourceEnum.EASY_PAY.getCode(), trade.getSource())) { @@ -58,6 +60,8 @@ public class EasyPayPluginStrategy implements AbsPayPluginStrategy { } long amount = refundOrder.getAmount() == null ? 0L : refundOrder.getAmount(); easyPayOrderService.refundSuccess(trade, amount); + // 回写独立退款记录状态(异步退款最终成功时生效;同步退款记录已直接建为成功,幂等跳过) + easyPayRefundOrderService.markSuccess(refundOrder); } /// 注册易支付协议出站(content 仅存 id 指针)