Bläddra i källkod

@
feat: sign_scene 改为下拉框选择,列出官方文档全部26个行业场景码

- 新增 SIGN_SCENE_OPTIONS 常量,含支付宝文档全部预定义场景码及中文名称
- 新增 signSceneDialogVisible 弹窗控制
- el-dialog + el-select(filterable) 替代 ElMessageBox.prompt 手动输入
- handleSignSceneConfirm → handleAuthorize(signScene)
- 默认值 INDUSTRY|PURCHASE(采购业)
@

alphaH 1 dag sedan
förälder
incheckning
65741807ab
2 ändrade filer med 127 tillägg och 16 borttagningar
  1. 63 16
      frontend/src/views/module_payment/account/index.vue
  2. 64 0
      logs/payment-platform.log

+ 63 - 16
frontend/src/views/module_payment/account/index.vue

@@ -510,6 +510,31 @@
     <TransferDetail v-model="transferDetailVisible" :out-biz-no="currentTransferOutBizNo"
       @refresh="handleTransferDetailRefresh" />
 
+    <!-- 签约场景码选择对话框 -->
+    <el-dialog v-model="signSceneDialogVisible" title="选择签约场景码" width="520px" :close-on-click-modal="false">
+      <el-form label-width="140px">
+        <el-form-item label="签约场景码 (sign_scene)">
+          <el-select v-model="authorizeResult.sign_scene" filterable placeholder="请选择行业场景码" style="width: 100%">
+            <el-option
+              v-for="item in SIGN_SCENE_OPTIONS"
+              :key="item.value"
+              :label="`${item.value} - ${item.label}`"
+              :value="item.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-alert type="info" :closable="false" show-icon style="margin-top: 12px">
+          <template #title>
+            external_agreement_no 不为空时必须选择场景码,不能使用 DEFAULT|DEFAULT
+          </template>
+        </el-alert>
+      </el-form>
+      <template #footer>
+        <el-button @click="signSceneDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="handleSignSceneConfirm">确认签约</el-button>
+      </template>
+    </el-dialog>
+
     <!-- 批量转账对话框 -->
     <el-dialog v-model="batchTransferVisible" title="批量转账" width="1000px" :close-on-click-modal="false" :close-on-press-escape="false">
       <div class="batch-transfer-container" :class="{ 'has-overlay': showBatchTransferOverlay }">
@@ -772,6 +797,38 @@ const authorizeForm = reactive({
   enterprise_id: "",
 });
 
+// 签约场景码 — 来自支付宝官方文档 https://opendocs.alipay.com/open/20190319114403226822/signscene
+const SIGN_SCENE_OPTIONS = [
+  { value: "INDUSTRY|LOTTERY", label: "彩票行业" },
+  { value: "INDUSTRY|SOCIALIZATION", label: "社交行业" },
+  { value: "INDUSTRY|MEDICAL", label: "医疗行业" },
+  { value: "INDUSTRY|APPSTORE", label: "电子商城行业" },
+  { value: "INDUSTRY|SUPERMARKET", label: "超市行业" },
+  { value: "INDUSTRY|B2B_TICKET_AGENT", label: "机票机构行业" },
+  { value: "INDUSTRY|CARRENTAL", label: "租车行业" },
+  { value: "INDUSTRY|GENERAL_TRAVEL", label: "出行行业" },
+  { value: "INDUSTRY|CATERING", label: "餐饮业" },
+  { value: "INDUSTRY|PURCHASE", label: "采购业" },
+  { value: "INDUSTRY|REPAYMENT", label: "信贷还款" },
+  { value: "INDUSTRY|DIGITAL_MEDIA", label: "数字传媒行业" },
+  { value: "INDUSTRY|GAME_CHARGE", label: "网游行业" },
+  { value: "INDUSTRY|BADGE_CONSUMPTION", label: "工牌消费" },
+  { value: "INDUSTRY|PARKING", label: "停车行业" },
+  { value: "INDUSTRY|MOBILE", label: "移动支付" },
+  { value: "INDUSTRY|TV", label: "电视支付" },
+  { value: "INDUSTRY|LEASE", label: "租借行业" },
+  { value: "INDUSTRY|EDU", label: "教育行业" },
+  { value: "INDUSTRY|VOICEPAY", label: "语音支付" },
+  { value: "INDUSTRY|FOREX_PLAT_PURCHASE", label: "境外平台采购" },
+  { value: "INDUSTRY|ALIPAYGO", label: "ALIPAYGO" },
+  { value: "INDUSTRY|TICKET", label: "票务行业" },
+  { value: "INDUSTRY|METRO", label: "地铁行业" },
+  { value: "INDUSTRY|VRPAY", label: "VR支付" },
+  { value: "INDUSTRY|LIFE_PAYMENT", label: "生活缴费行业" },
+];
+
+const signSceneDialogVisible = ref(false);
+
 const authorizeRules: FormRules = {
   enterprise_id: [{ required: true, message: "请输入企业ID", trigger: "blur" }],
 };
@@ -1223,6 +1280,11 @@ function resetBatchTransfer() {
   batchTransferFailCount.value = 0;
 }
 
+function handleSignSceneConfirm() {
+  signSceneDialogVisible.value = false;
+  handleAuthorize(authorizeResult.sign_scene);
+}
+
 async function handleAuthorize(signScene?: string) {
   try {
     const res = await AccountAPI.authorizeApply({
@@ -1692,22 +1754,7 @@ function handleOverviewRefresh(data: any) {
 async function handleGoTab(tab: string) {
   console.log("goTab => ", tab);
   if (tab === "authorize") {
-    // 弹出场景码选择框(external_agreement_no 不为空时 sign_scene 不能为 DEFAULT|DEFAULT)
-    try {
-      const { value: signScene } = await ElMessageBox.prompt("请选择签约场景码", "转账授权签约", {
-        confirmButtonText: "确认签约",
-        cancelButtonText: "取消",
-        inputType: "textarea" as any,
-        inputValue: authorizeResult.sign_scene || "INDUSTRY|PURCHASE",
-        inputPlaceholder: "格式: INDUSTRY|XXXX,如 INDUSTRY|PURCHASE",
-      });
-      if (signScene) {
-        authorizeResult.sign_scene = signScene;
-        await handleAuthorize(signScene);
-      }
-    } catch {
-      // 用户取消
-    }
+    signSceneDialogVisible.value = true;
   } else if (tab === "create") {
     await handleCreate();
   } else if (tab === "deposit") {

+ 64 - 0
logs/payment-platform.log

@@ -36,3 +36,67 @@
 2026-07-15 11:13:22.909 [tomcat-handler-0] INFO  o.s.web.servlet.DispatcherServlet - Completed initialization in 2 ms
 2026-07-15 11:13:43.974 [SpringApplicationShutdownHook] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closing ...
 2026-07-15 11:13:43.976 [SpringApplicationShutdownHook] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed
+2026-07-15 11:13:46.605 [background-preinit] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.1.Final
+2026-07-15 11:13:46.701 [main] INFO  c.p.platform.PaymentApplication - Starting PaymentApplication using Java 21.0.11 with PID 16812 (D:\project2\payment-platform\java\target\classes started by 1 in D:\project2\payment-platform)
+2026-07-15 11:13:46.702 [main] INFO  c.p.platform.PaymentApplication - The following 1 profile is active: "dev"
+2026-07-15 11:13:47.544 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
+2026-07-15 11:13:47.546 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
+2026-07-15 11:13:47.597 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 39 ms. Found 0 Redis repository interfaces.
+2026-07-15 11:13:48.116 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port 8001 (http)
+2026-07-15 11:13:48.124 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8001"]
+2026-07-15 11:13:48.125 [main] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
+2026-07-15 11:13:48.125 [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.20]
+2026-07-15 11:13:48.166 [main] INFO  o.a.c.c.C.[.[localhost].[/api/v1] - Initializing Spring embedded WebApplicationContext
+2026-07-15 11:13:48.166 [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1287 ms
+2026-07-15 11:13:48.189 [main] INFO  c.a.d.s.b.a.DruidDataSourceAutoConfigure - Init DruidDataSource
+2026-07-15 11:13:49.589 [main] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
+2026-07-15 11:13:50.297 [main] WARN  c.p.p.c.alipay.AlipayClientFactory - 支付宝默认配置不完整,将仅使用服务商/租户专属客户端
+2026-07-15 11:13:50.438 [main] INFO  c.p.platform.core.oss.OssService - OSS client initialized: bucket=hunanxiaojunzioss, endpoint=oss-cn-beijing.aliyuncs.com
+2026-07-15 11:13:50.743 [main] INFO  c.p.p.m.p.e.s.EnterpriseNameSyncScheduler - [企业名称同步] 调度器启动
+2026-07-15 11:13:51.002 [main] INFO  c.p.p.m.p.n.s.NotificationService - 已注册 7 个通知处理器: [AccountHandler, BillHandler, EmployeeHandler, EnterpriseHandler, InstitutionHandler, OrderHandler, VoucherHandler]
+2026-07-15 11:13:51.477 [main] INFO  o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@1ced1d14, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@237b54bc, org.springframework.security.web.context.SecurityContextHolderFilter@46f041cb, org.springframework.security.web.header.HeaderWriterFilter@53570fff, org.springframework.web.filter.CorsFilter@5263f554, org.springframework.security.web.authentication.logout.LogoutFilter@7d086485, com.payment.platform.core.security.JwtAuthFilter@54e680fe, com.payment.platform.core.security.TenantApiKeyAuthFilter@698e1bf5, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@493489dd, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3358805a, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@7d28efd5, org.springframework.security.web.session.SessionManagementFilter@3c7787a7, org.springframework.security.web.access.ExceptionTranslationFilter@53202b06, org.springframework.security.web.access.intercept.AuthorizationFilter@21b3d356]
+2026-07-15 11:13:51.871 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8001"]
+2026-07-15 11:13:51.882 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port 8001 (http) with context path '/api/v1'
+2026-07-15 11:13:51.980 [main] INFO  c.p.platform.PaymentApplication - Started PaymentApplication in 5.831 seconds (process running for 6.411)
+2026-07-15 11:13:52.020 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:13:52.142 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:13:53.826 [main] INFO  c.p.p.core.config.AppStartupRunner - 系统配置缓存初始化完成
+2026-07-15 11:13:54.764 [main] INFO  c.p.p.core.config.AppStartupRunner - 数据字典缓存初始化完成 (10 个字典类型)
+2026-07-15 11:14:06.937 [tomcat-handler-1] INFO  o.a.c.c.C.[.[localhost].[/api/v1] - Initializing Spring DispatcherServlet 'dispatcherServlet'
+2026-07-15 11:14:06.937 [tomcat-handler-1] INFO  o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
+2026-07-15 11:14:06.938 [tomcat-handler-1] INFO  o.s.web.servlet.DispatcherServlet - Completed initialization in 1 ms
+2026-07-15 11:14:15.073 [tomcat-handler-2] INFO  c.p.p.m.s.auth.service.AuthService - 用户ID: 2, 用户名: q 正在生成JWT令牌
+2026-07-15 11:14:15.199 [tomcat-handler-2] INFO  c.p.p.m.s.a.c.AuthController - 用户q登录成功
+2026-07-15 11:14:28.084 [tomcat-handler-15] INFO  c.p.p.c.alipay.AlipayClientFactory - 服务商[3]客户端创建成功, appId=2021006160682088, name=跨境服务商
+2026-07-15 11:14:52.149 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:14:52.196 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:15:52.203 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:15:52.249 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:16:52.258 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:16:52.304 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:17:52.310 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:17:52.355 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:18:52.360 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:18:52.405 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:19:52.410 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:19:52.456 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:20:52.462 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:20:52.509 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:21:52.521 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:21:52.566 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:22:52.579 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:22:52.626 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:23:52.631 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:23:52.677 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:24:52.679 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:24:52.732 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:25:52.741 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:25:52.785 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:26:52.798 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:26:52.842 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:27:52.843 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:27:52.887 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:28:52.901 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:28:52.945 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易
+2026-07-15 11:29:52.960 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 定时任务开始执行
+2026-07-15 11:29:53.004 [scheduling-1] INFO  c.p.p.m.p.f.s.F2fTradePollScheduler - [收款轮询] 无待轮询交易