叶静 1 долоо хоног өмнө
parent
commit
603fa25aee

+ 0 - 778
doc/daili.json

@@ -1,778 +0,0 @@
-{
-	"openapi": "3.0.1",
-	"info": {
-		"title": "默认模块",
-		"description": "",
-		"version": "1.0.0"
-	},
-	"tags": [],
-	"paths": {
-		"/agentUser/page": {
-			"get": {
-				"summary": "分页",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [
-					{
-						"name": "records[0].key",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": ""
-						}
-					},
-					{
-						"name": "total",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int64"
-						}
-					},
-					{
-						"name": "size",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int64"
-						}
-					},
-					{
-						"name": "current",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int64"
-						}
-					},
-					{
-						"name": "orders[0].column",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "string"
-						}
-					},
-					{
-						"name": "orders[0].asc",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "boolean"
-						}
-					},
-					{
-						"name": "optimizeCountSql",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "boolean"
-						}
-					},
-					{
-						"name": "searchCount",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "boolean"
-						}
-					},
-					{
-						"name": "optimizeJoinOfCountSql",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "boolean"
-						}
-					},
-					{
-						"name": "maxLimit",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "integer",
-							"format": "int64"
-						}
-					},
-					{
-						"name": "countId",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "string"
-						}
-					},
-					{
-						"name": "query",
-						"in": "query",
-						"description": "",
-						"required": false,
-						"schema": {
-							"type": "string"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/RPageAgentUserPageDTO"
-								},
-								"example": {
-									"code": 0,
-									"msg": "",
-									"data": {
-										"records": [
-											{
-												"userId": 0,
-												"status": false,
-												"agentName": ""
-											}
-										],
-										"total": 0,
-										"size": 0,
-										"current": 0,
-										"orders": [
-											{
-												"column": "",
-												"asc": false
-											}
-										],
-										"optimizeCountSql": false,
-										"searchCount": false,
-										"optimizeJoinOfCountSql": false,
-										"maxLimit": 0,
-										"countId": ""
-									}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		},
-		"/agentUser/save": {
-			"post": {
-				"summary": "新增",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [],
-				"requestBody": {
-					"content": {
-						"application/json": {
-							"schema": {
-								"$ref": "#/components/schemas/AgentUserROAdd",
-								"description": ""
-							}
-						}
-					}
-				},
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/R",
-									"description": "响应信息主体"
-								},
-								"example": {
-									"ok": false,
-									"code": null,
-									"msg": "",
-									"data": {}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		},
-		"/agentUser/changePwd/{id:^\\d+$}": {
-			"patch": {
-				"summary": "修改密码",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [
-					{
-						"name": "id",
-						"in": "path",
-						"description": "",
-						"required": true,
-						"schema": {
-							"type": "integer"
-						}
-					}
-				],
-				"requestBody": {
-					"content": {
-						"application/json": {
-							"schema": {
-								"$ref": "#/components/schemas/AgentUserROChangePwd",
-								"description": ""
-							}
-						}
-					}
-				},
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/R",
-									"description": "响应信息主体"
-								},
-								"example": {
-									"ok": false,
-									"code": null,
-									"msg": "",
-									"data": {}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		},
-		"/agentUser/changeStatus/{id:^\\d+$}": {
-			"patch": {
-				"summary": "启用禁用",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [
-					{
-						"name": "id",
-						"in": "path",
-						"description": "",
-						"required": true,
-						"schema": {
-							"type": "integer"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/R",
-									"description": "响应信息主体"
-								},
-								"example": {
-									"ok": false,
-									"code": null,
-									"msg": "",
-									"data": {}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		},
-		"/agentUser/info/{id:^\\d+$}": {
-			"get": {
-				"summary": "详情",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [
-					{
-						"name": "id",
-						"in": "path",
-						"description": "",
-						"required": true,
-						"schema": {
-							"type": "integer"
-						}
-					}
-				],
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/R",
-									"description": "响应信息主体"
-								},
-								"example": {
-									"ok": false,
-									"code": null,
-									"msg": "",
-									"data": {}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		},
-		"/agentUser/edit/{id:^\\d+$}": {
-			"patch": {
-				"summary": "修改",
-				"deprecated": false,
-				"description": "",
-				"tags": [],
-				"parameters": [
-					{
-						"name": "id",
-						"in": "path",
-						"description": "",
-						"required": true,
-						"schema": {
-							"type": "integer"
-						}
-					}
-				],
-				"requestBody": {
-					"content": {
-						"application/json": {
-							"schema": {
-								"$ref": "#/components/schemas/AgentUserROUpdate",
-								"description": ""
-							}
-						}
-					}
-				},
-				"responses": {
-					"200": {
-						"description": "",
-						"content": {
-							"application/json": {
-								"schema": {
-									"$ref": "#/components/schemas/R",
-									"description": "响应信息主体"
-								},
-								"example": {
-									"ok": false,
-									"code": null,
-									"msg": "",
-									"data": {}
-								}
-							}
-						},
-						"headers": {}
-					}
-				},
-				"security": [
-					{
-						"bearer": []
-					}
-				]
-			}
-		}
-	},
-	"components": {
-		"schemas": {
-			"R": {
-				"type": "object",
-				"properties": {
-					"ok": {
-						"type": "boolean"
-					},
-					"code": {
-						"description": "返回标记:成功标记=0,失败标记=1",
-						"type": "null"
-					},
-					"msg": {
-						"type": "string",
-						"description": "返回信息"
-					},
-					"data": {
-						"type": "object",
-						"properties": {},
-						"description": "数据"
-					}
-				}
-			},
-			"AgentUserPageDTO": {
-				"type": "object",
-				"properties": {
-					"userId": {
-						"type": "integer",
-						"description": "用户ID",
-						"format": "int64"
-					},
-					"status": {
-						"type": "boolean",
-						"description": "启用状态"
-					},
-					"agentName": {
-						"type": "string",
-						"description": "代理商名称"
-					}
-				}
-			},
-			"AgentUserROAdd": {
-				"type": "object",
-				"properties": {
-					"username": {
-						"type": "string",
-						"description": "用户名"
-					},
-					"agentName": {
-						"type": "string",
-						"description": "代理商名称"
-					},
-					"realname": {
-						"type": "string",
-						"description": "真实姓名"
-					},
-					"phone": {
-						"type": "string",
-						"description": "手机号码"
-					},
-					"idcard": {
-						"type": "string",
-						"description": "身份证号"
-					},
-					"address": {
-						"type": "string",
-						"description": "通讯地址"
-					},
-					"email": {
-						"type": "string",
-						"description": "邮箱地址"
-					},
-					"offlineRechargeRate": {
-						"type": "number",
-						"description": "线下充值费率"
-					},
-					"status": {
-						"type": "boolean",
-						"description": "启用状态"
-					},
-					"bankName": {
-						"type": "string",
-						"description": "开户行名称"
-					},
-					"bankBranch": {
-						"type": "string",
-						"description": "开户网点"
-					},
-					"accountName": {
-						"type": "string",
-						"description": "账户名"
-					},
-					"accountNum": {
-						"type": "string",
-						"description": "账户号"
-					},
-					"bankProvince": {
-						"type": "string",
-						"description": "开户省"
-					},
-					"bankCity": {
-						"type": "string",
-						"description": "开户市"
-					},
-					"newPwd": {
-						"type": "string",
-						"description": "新密码"
-					},
-					"oldPwd": {
-						"type": "string",
-						"description": "旧密码"
-					}
-				},
-				"required": ["username", "agentName", "realname", "phone", "email"]
-			},
-			"OrderItem": {
-				"type": "object",
-				"properties": {
-					"column": {
-						"type": "string",
-						"description": ""
-					},
-					"asc": {
-						"type": "boolean",
-						"description": ""
-					}
-				}
-			},
-			"PageAgentUserPageDTO": {
-				"type": "object",
-				"properties": {
-					"records": {
-						"type": "array",
-						"items": {
-							"$ref": "#/components/schemas/AgentUserPageDTO",
-							"description": ""
-						},
-						"description": ""
-					},
-					"total": {
-						"type": "integer",
-						"description": "",
-						"format": "int64"
-					},
-					"size": {
-						"type": "integer",
-						"description": "",
-						"format": "int64"
-					},
-					"current": {
-						"type": "integer",
-						"description": "",
-						"format": "int64"
-					},
-					"orders": {
-						"type": "array",
-						"items": {
-							"$ref": "#/components/schemas/OrderItem",
-							"description": "com.baomidou.mybatisplus.core.metadata.OrderItem"
-						},
-						"description": ""
-					},
-					"optimizeCountSql": {
-						"type": "boolean",
-						"description": ""
-					},
-					"searchCount": {
-						"type": "boolean",
-						"description": ""
-					},
-					"optimizeJoinOfCountSql": {
-						"type": "boolean",
-						"description": ""
-					},
-					"maxLimit": {
-						"type": "integer",
-						"description": "",
-						"format": "int64"
-					},
-					"countId": {
-						"type": "string",
-						"description": ""
-					}
-				}
-			},
-			"RPageAgentUserPageDTO": {
-				"type": "object",
-				"properties": {
-					"code": {
-						"type": "integer",
-						"description": "返回标记:成功标记=0,失败标记=1"
-					},
-					"msg": {
-						"type": "string",
-						"description": "返回信息"
-					},
-					"data": {
-						"$ref": "#/components/schemas/PageAgentUserPageDTO",
-						"description": "数据"
-					}
-				}
-			},
-			"AgentUserROUpdate": {
-				"type": "object",
-				"properties": {
-					"username": {
-						"type": "string",
-						"description": "用户名"
-					},
-					"agentName": {
-						"type": "string",
-						"description": "代理商名称"
-					},
-					"realname": {
-						"type": "string",
-						"description": "真实姓名"
-					},
-					"phone": {
-						"type": "string",
-						"description": "手机号码"
-					},
-					"idcard": {
-						"type": "string",
-						"description": "身份证号"
-					},
-					"address": {
-						"type": "string",
-						"description": "通讯地址"
-					},
-					"email": {
-						"type": "string",
-						"description": "邮箱地址"
-					},
-					"offlineRechargeRate": {
-						"type": "number",
-						"description": "线下充值费率"
-					},
-					"status": {
-						"type": "boolean",
-						"description": "启用状态"
-					},
-					"bankName": {
-						"type": "string",
-						"description": "开户行名称"
-					},
-					"bankBranch": {
-						"type": "string",
-						"description": "开户网点"
-					},
-					"accountName": {
-						"type": "string",
-						"description": "账户名"
-					},
-					"accountNum": {
-						"type": "string",
-						"description": "账户号"
-					},
-					"bankProvince": {
-						"type": "string",
-						"description": "开户省"
-					},
-					"bankCity": {
-						"type": "string",
-						"description": "开户市"
-					},
-					"newPwd": {
-						"type": "string",
-						"description": "新密码"
-					},
-					"oldPwd": {
-						"type": "string",
-						"description": "旧密码"
-					}
-				},
-				"required": ["username", "agentName", "realname", "phone", "email"]
-			},
-			"AgentUserROChangePwd": {
-				"type": "object",
-				"properties": {
-					"username": {
-						"type": "string",
-						"description": "用户名"
-					},
-					"agentName": {
-						"type": "string",
-						"description": "代理商名称"
-					},
-					"realname": {
-						"type": "string",
-						"description": "真实姓名"
-					},
-					"phone": {
-						"type": "string",
-						"description": "手机号码"
-					},
-					"idcard": {
-						"type": "string",
-						"description": "身份证号"
-					},
-					"address": {
-						"type": "string",
-						"description": "通讯地址"
-					},
-					"email": {
-						"type": "string",
-						"description": "邮箱地址"
-					},
-					"offlineRechargeRate": {
-						"type": "number",
-						"description": "线下充值费率"
-					},
-					"status": {
-						"type": "boolean",
-						"description": "启用状态"
-					},
-					"bankName": {
-						"type": "string",
-						"description": "开户行名称"
-					},
-					"bankBranch": {
-						"type": "string",
-						"description": "开户网点"
-					},
-					"accountName": {
-						"type": "string",
-						"description": "账户名"
-					},
-					"accountNum": {
-						"type": "string",
-						"description": "账户号"
-					},
-					"bankProvince": {
-						"type": "string",
-						"description": "开户省"
-					},
-					"bankCity": {
-						"type": "string",
-						"description": "开户市"
-					},
-					"newPwd": {
-						"type": "string",
-						"description": "新密码"
-					},
-					"oldPwd": {
-						"type": "string",
-						"description": "旧密码"
-					}
-				},
-				"required": ["newPwd", "oldPwd"]
-			}
-		},
-		"securitySchemes": {
-			"bearer": {
-				"type": "http",
-				"scheme": "bearer"
-			}
-		}
-	},
-	"servers": [],
-	"security": []
-}

+ 178 - 516
doc/shanghu.json → doc/payChannel.json

@@ -7,9 +7,9 @@
   },
   "tags": [],
   "paths": {
-    "/merchantUser/page": {
+    "/paymentChannel/page": {
       "get": {
-        "summary": "分页",
+        "summary": "分页 payment_channel_page",
         "deprecated": false,
         "description": "",
         "tags": [],
@@ -125,6 +125,15 @@
             "schema": {
               "type": "string"
             }
+          },
+          {
+            "name": "status",
+            "in": "query",
+            "description": "",
+            "required": false,
+            "schema": {
+              "type": "boolean"
+            }
           }
         ],
         "responses": {
@@ -133,7 +142,7 @@
             "content": {
               "application/json": {
                 "schema": {
-                  "$ref": "#/components/schemas/RPageMerchantUserPageDTO"
+                  "$ref": "#/components/schemas/RPagePaymentChannelPageVO"
                 },
                 "example": {
                   "code": 0,
@@ -141,11 +150,11 @@
                   "data": {
                     "records": [
                       {
-                        "userId": 0,
-                        "nickname": "",
-                        "agentId": "",
-                        "agentName": "",
-                        "status": false
+                        "id": 0,
+                        "status": false,
+                        "channelName": "",
+                        "baseRechargeRate": 0,
+                        "riskControlStatus": false
                       }
                     ],
                     "total": 0,
@@ -176,76 +185,9 @@
         ]
       }
     },
-    "/merchantUser/agentList/{id:^\\d+$}": {
-      "get": {
-        "summary": "所属代理商列表",
-        "deprecated": false,
-        "description": "",
-        "tags": [],
-        "parameters": [
-          {
-            "name": "id",
-            "in": "path",
-            "description": "",
-            "required": true,
-            "schema": {
-              "type": "integer"
-            }
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/RListAgentUser"
-                },
-                "example": {
-                  "code": 0,
-                  "msg": "",
-                  "data": [
-                    {
-                      "userId": 0,
-                      "username": "",
-                      "agentName": "",
-                      "password": "",
-                      "realname": "",
-                      "phone": "",
-                      "idcard": "",
-                      "address": "",
-                      "email": "",
-                      "offlineRechargeRate": 0,
-                      "status": false,
-                      "bankName": "",
-                      "bankBranch": "",
-                      "accountName": "",
-                      "accountNum": "",
-                      "bankProvince": "",
-                      "bankCity": "",
-                      "createBy": "",
-                      "updateBy": "",
-                      "createTime": "",
-                      "updateTime": "",
-                      "tenantId": 0
-                    }
-                  ]
-                }
-              }
-            },
-            "headers": {}
-          }
-        },
-        "security": [
-          {
-            "bearer": []
-          }
-        ]
-      }
-    },
-    "/merchantUser/save": {
+    "/paymentChannel/save": {
       "post": {
-        "summary": "新增",
+        "summary": "新增 payment_channel_save",
         "deprecated": false,
         "description": "",
         "tags": [],
@@ -254,7 +196,7 @@
           "content": {
             "application/json": {
               "schema": {
-                "$ref": "#/components/schemas/MerchantUserROAdd",
+                "$ref": "#/components/schemas/PaymentChannelROAdd",
                 "description": ""
               }
             }
@@ -287,9 +229,9 @@
         ]
       }
     },
-    "/merchantUser/changePwd/{id:^\\d+$}": {
-      "patch": {
-        "summary": "修改密码",
+    "/paymentChannel/info/{id:^\\d+$}": {
+      "get": {
+        "summary": "详情 payment_channel_info",
         "deprecated": false,
         "description": "",
         "tags": [],
@@ -304,30 +246,31 @@
             }
           }
         ],
-        "requestBody": {
-          "content": {
-            "application/json": {
-              "schema": {
-                "$ref": "#/components/schemas/MerchantUserROChangePwd",
-                "description": ""
-              }
-            }
-          }
-        },
         "responses": {
           "200": {
             "description": "",
             "content": {
               "application/json": {
                 "schema": {
-                  "$ref": "#/components/schemas/R",
-                  "description": "响应信息主体"
+                  "$ref": "#/components/schemas/RPaymentChannel"
                 },
                 "example": {
-                  "ok": false,
-                  "code": null,
+                  "code": 0,
                   "msg": "",
-                  "data": {}
+                  "data": {
+                    "id": 0,
+                    "status": false,
+                    "createBy": "",
+                    "updateBy": "",
+                    "createTime": "",
+                    "updateTime": "",
+                    "channelName": "",
+                    "baseRechargeRate": 0,
+                    "todayTotalAmount": 0,
+                    "singleMaxAmount": 0,
+                    "singleMinAmount": 0,
+                    "riskControlStatus": false
+                  }
                 }
               }
             },
@@ -341,9 +284,9 @@
         ]
       }
     },
-    "/merchantUser/changeStatus/{id:^\\d+$}": {
+    "/paymentChannel/edit/{id:^\\d+$}": {
       "patch": {
-        "summary": "启用禁用",
+        "summary": "编辑(不可修改状态) payment_channel_edit",
         "deprecated": false,
         "description": "",
         "tags": [],
@@ -358,6 +301,16 @@
             }
           }
         ],
+        "requestBody": {
+          "content": {
+            "application/json": {
+              "schema": {
+                "$ref": "#/components/schemas/PaymentChannelROEdit",
+                "description": ""
+              }
+            }
+          }
+        },
         "responses": {
           "200": {
             "description": "",
@@ -385,67 +338,9 @@
         ]
       }
     },
-    "/merchantUser/info/{id:^\\d+$}": {
-      "get": {
-        "summary": "详情",
-        "deprecated": false,
-        "description": "",
-        "tags": [],
-        "parameters": [
-          {
-            "name": "id",
-            "in": "path",
-            "description": "",
-            "required": true,
-            "schema": {
-              "type": "integer"
-            }
-          }
-        ],
-        "responses": {
-          "200": {
-            "description": "",
-            "content": {
-              "application/json": {
-                "schema": {
-                  "$ref": "#/components/schemas/RMerchantUserInfoVO"
-                },
-                "example": {
-                  "code": 0,
-                  "msg": "",
-                  "data": {
-                    "userId": 0,
-                    "username": "",
-                    "merchantName": "",
-                    "phone": "",
-                    "email": "",
-                    "websiteName": "",
-                    "websiteAddress": "",
-                    "appId": "",
-                    "idcard": "",
-                    "realname": "",
-                    "contactAddress": "",
-                    "offlineRechargeRate": 0,
-                    "status": false,
-                    "agentId": 0,
-                    "agentName": ""
-                  }
-                }
-              }
-            },
-            "headers": {}
-          }
-        },
-        "security": [
-          {
-            "bearer": []
-          }
-        ]
-      }
-    },
-    "/merchantUser/edit/{id:^\\d+$}": {
+    "/paymentChannel/changeStatus/{id:^\\d+$}": {
       "patch": {
-        "summary": "修改",
+        "summary": "修改状态 payment_channel_edit",
         "deprecated": false,
         "description": "",
         "tags": [],
@@ -460,16 +355,6 @@
             }
           }
         ],
-        "requestBody": {
-          "content": {
-            "application/json": {
-              "schema": {
-                "$ref": "#/components/schemas/MerchantUserROUpdate",
-                "description": ""
-              }
-            }
-          }
-        },
         "responses": {
           "200": {
             "description": "",
@@ -500,73 +385,43 @@
   },
   "components": {
     "schemas": {
-      "R": {
-        "type": "object",
-        "properties": {
-          "ok": {
-            "type": "boolean"
-          },
-          "code": {
-            "description": "返回标记:成功标记=0,失败标记=1",
-            "type": "null"
-          },
-          "msg": {
-            "type": "string",
-            "description": "返回信息"
-          },
-          "data": {
-            "type": "object",
-            "properties": {},
-            "description": "数据"
-          }
-        }
-      },
-      "MerchantUserPageDTO": {
+      "PaymentChannelPageVO": {
         "type": "object",
         "properties": {
-          "userId": {
+          "id": {
             "type": "integer",
-            "description": "用户ID",
+            "description": "",
             "format": "int64"
           },
-          "nickname": {
-            "type": "string",
-            "description": "昵称"
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
           },
-          "agentId": {
+          "channelName": {
             "type": "string",
-            "description": "代理商id"
+            "description": "通道名称"
           },
-          "agentName": {
+          "channelCode": {
             "type": "string",
-            "description": "代理商名称"
+            "description": "通道编码"
           },
-          "status": {
-            "type": "boolean",
-            "description": "启用状态"
-          }
-        }
-      },
-      "OrderItem": {
-        "type": "object",
-        "properties": {
-          "column": {
-            "type": "string",
-            "description": ""
+          "baseRechargeRate": {
+            "type": "number",
+            "description": "基础费率(百分比)"
           },
-          "asc": {
+          "riskControlStatus": {
             "type": "boolean",
-            "description": ""
+            "description": "风控状态"
           }
         }
       },
-      "PageMerchantUserPageDTO": {
+      "PagePaymentChannelPageVO": {
         "type": "object",
         "properties": {
           "records": {
             "type": "array",
             "items": {
-              "$ref": "#/components/schemas/MerchantUserPageDTO",
+              "$ref": "#/components/schemas/PaymentChannelPageVO",
               "description": ""
             },
             "description": ""
@@ -617,7 +472,7 @@
           }
         }
       },
-      "RPageMerchantUserPageDTO": {
+      "RPagePaymentChannelPageVO": {
         "type": "object",
         "properties": {
           "code": {
@@ -629,333 +484,155 @@
             "description": "返回信息"
           },
           "data": {
-            "$ref": "#/components/schemas/PageMerchantUserPageDTO",
+            "$ref": "#/components/schemas/PagePaymentChannelPageVO",
             "description": "数据"
           }
         }
       },
-      "RListAgentUser": {
+      "R": {
         "type": "object",
         "properties": {
+          "ok": {
+            "type": "boolean"
+          },
           "code": {
-            "type": "integer",
-            "description": "返回标记:成功标记=0,失败标记=1"
+            "description": "返回标记:成功标记=0,失败标记=1",
+            "type": "null"
           },
           "msg": {
             "type": "string",
             "description": "返回信息"
           },
           "data": {
-            "type": "array",
-            "items": {
-              "$ref": "#/components/schemas/AgentUser",
-              "description": ""
-            },
+            "type": "object",
+            "properties": {},
             "description": "数据"
           }
         }
       },
-      "AgentUser": {
+      "PaymentChannelROAdd": {
         "type": "object",
         "properties": {
-          "userId": {
-            "type": "integer",
-            "description": "用户ID",
-            "format": "int64"
-          },
-          "username": {
-            "type": "string",
-            "description": "用户名"
-          },
-          "agentName": {
-            "type": "string",
-            "description": "代理商名称"
-          },
-          "password": {
-            "type": "string",
-            "description": "密码"
-          },
-          "realname": {
-            "type": "string",
-            "description": "真实姓名"
-          },
-          "phone": {
-            "type": "string",
-            "description": "手机号"
-          },
-          "idcard": {
-            "type": "string",
-            "description": "身份证号"
-          },
-          "address": {
-            "type": "string",
-            "description": "通讯地址"
-          },
-          "email": {
-            "type": "string",
-            "description": "邮箱地址"
-          },
-          "offlineRechargeRate": {
-            "type": "number",
-            "description": "线下充值费率"
-          },
           "status": {
             "type": "boolean",
             "description": "启用状态"
           },
-          "bankName": {
-            "type": "string",
-            "description": "开户行名称"
-          },
-          "bankBranch": {
-            "type": "string",
-            "description": "开户网点"
-          },
-          "accountName": {
-            "type": "string",
-            "description": "账户名"
-          },
-          "accountNum": {
-            "type": "string",
-            "description": "账户号"
-          },
-          "bankProvince": {
-            "type": "string",
-            "description": "开户省"
-          },
-          "bankCity": {
-            "type": "string",
-            "description": "开户市"
-          },
-          "createBy": {
-            "type": "string",
-            "description": "创建人"
-          },
-          "updateBy": {
-            "type": "string",
-            "description": "修改人"
-          },
-          "createTime": {
-            "type": "string",
-            "description": "创建时间"
-          },
-          "updateTime": {
-            "type": "string",
-            "description": "修改时间"
-          },
-          "tenantId": {
-            "type": "integer",
-            "description": "所属租户ID",
-            "format": "int64"
-          }
-        }
-      },
-      "MerchantUserROAdd": {
-        "type": "object",
-        "properties": {
-          "username": {
-            "type": "string",
-            "description": "用户名"
-          },
-          "merchantName": {
-            "type": "string",
-            "description": "商户名称"
-          },
-          "phone": {
-            "type": "string",
-            "description": "电话号码"
-          },
-          "email": {
-            "type": "string",
-            "description": "邮箱地址"
-          },
-          "websiteName": {
-            "type": "string",
-            "description": "网站名称"
-          },
-          "websiteAddress": {
-            "type": "string",
-            "description": "网站地址"
-          },
-          "idcard": {
+          "channelName": {
             "type": "string",
-            "description": "身份证号"
+            "description": "通道名称"
           },
-          "realname": {
+          "channelCode": {
             "type": "string",
-            "description": "真实姓名"
+            "description": "通道编码"
           },
-          "contactAddress": {
-            "type": "string",
-            "description": "通讯地址"
-          },
-          "offlineRechargeRate": {
+          "baseRechargeRate": {
             "type": "number",
-            "description": "线下充值费率",
+            "description": "基础费率(百分比)",
             "minimum": 0,
             "maximum": 100,
             "exclusiveMinimum": true,
             "exclusiveMaximum": true
           },
-          "status": {
-            "type": "boolean",
-            "description": "启用状态"
+          "todayTotalAmount": {
+            "type": "number",
+            "description": "当天总金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "agentId": {
-            "type": "integer",
-            "description": "所属商户ID",
-            "format": "int64"
+          "singleMaxAmount": {
+            "type": "number",
+            "description": "单比最大金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "newPwd": {
-            "type": "string",
-            "description": "新密码"
+          "singleMinAmount": {
+            "type": "number",
+            "description": "单比最小金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "oldPwd": {
-            "type": "string",
-            "description": "旧密码"
+          "riskControlStatus": {
+            "type": "boolean",
+            "description": "风控状态"
           }
         },
         "required": [
-          "username",
-          "merchantName",
-          "phone",
-          "email"
+          "channelName",
+          "channelCode"
         ]
       },
-      "MerchantUserROChangePwd": {
+      "OrderItem": {
         "type": "object",
         "properties": {
-          "username": {
-            "type": "string",
-            "description": "用户名"
-          },
-          "merchantName": {
-            "type": "string",
-            "description": "商户名称"
-          },
-          "phone": {
-            "type": "string",
-            "description": "电话号码"
-          },
-          "email": {
-            "type": "string",
-            "description": "邮箱地址"
-          },
-          "websiteName": {
-            "type": "string",
-            "description": "网站名称"
-          },
-          "websiteAddress": {
-            "type": "string",
-            "description": "网站地址"
-          },
-          "idcard": {
-            "type": "string",
-            "description": "身份证号"
-          },
-          "realname": {
-            "type": "string",
-            "description": "真实姓名"
-          },
-          "contactAddress": {
+          "column": {
             "type": "string",
-            "description": "通讯地址"
-          },
-          "offlineRechargeRate": {
-            "type": "number",
-            "description": "线下充值费率"
+            "description": ""
           },
-          "status": {
+          "asc": {
             "type": "boolean",
-            "description": "启用状态"
-          },
-          "agentId": {
-            "type": "integer",
-            "description": "所属商户ID",
-            "format": "int64"
-          },
-          "newPwd": {
-            "type": "string",
-            "description": "新密码"
-          },
-          "oldPwd": {
-            "type": "string",
-            "description": "旧密码"
+            "description": ""
           }
-        },
-        "required": [
-          "newPwd",
-          "oldPwd"
-        ]
+        }
       },
-      "MerchantUserInfoVO": {
+      "PaymentChannel": {
         "type": "object",
         "properties": {
-          "userId": {
+          "id": {
             "type": "integer",
             "description": "",
             "format": "int64"
           },
-          "username": {
-            "type": "string",
-            "description": "用户名"
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
           },
-          "merchantName": {
+          "createBy": {
             "type": "string",
-            "description": "昵称"
+            "description": "创建人"
           },
-          "phone": {
+          "updateBy": {
             "type": "string",
-            "description": "电话号码"
+            "description": "修改人"
           },
-          "email": {
+          "createTime": {
             "type": "string",
-            "description": "邮箱地址"
+            "description": "创建时间"
           },
-          "websiteName": {
+          "updateTime": {
             "type": "string",
-            "description": "网站名称"
+            "description": "修改时间"
           },
-          "websiteAddress": {
+          "channelName": {
             "type": "string",
-            "description": "网站地址"
+            "description": "通道名称"
           },
-          "appId": {
+          "channelCode": {
             "type": "string",
-            "description": "appId"
+            "description": "通道编码"
           },
-          "idcard": {
-            "type": "string",
-            "description": "身份证号"
+          "baseRechargeRate": {
+            "type": "number",
+            "description": "基础费率(百分比)"
           },
-          "realname": {
-            "type": "string",
-            "description": "真实姓名"
+          "todayTotalAmount": {
+            "type": "number",
+            "description": "当天总金额"
           },
-          "contactAddress": {
-            "type": "string",
-            "description": "通讯地址"
+          "singleMaxAmount": {
+            "type": "number",
+            "description": "单比最大金额"
           },
-          "offlineRechargeRate": {
+          "singleMinAmount": {
             "type": "number",
-            "description": "线下充值费率"
+            "description": "单比最小金额"
           },
-          "status": {
+          "riskControlStatus": {
             "type": "boolean",
-            "description": "启用状态"
-          },
-          "agentId": {
-            "type": "integer",
-            "description": "所属商户ID",
-            "format": "int64"
-          },
-          "agentName": {
-            "type": "string",
-            "description": "所属商户名称"
+            "description": "风控状态"
           }
         }
       },
-      "RMerchantUserInfoVO": {
+      "RPaymentChannel": {
         "type": "object",
         "properties": {
           "code": {
@@ -967,76 +644,61 @@
             "description": "返回信息"
           },
           "data": {
-            "$ref": "#/components/schemas/MerchantUserInfoVO",
+            "$ref": "#/components/schemas/PaymentChannel",
             "description": "数据"
           }
         }
       },
-      "MerchantUserROUpdate": {
+      "PaymentChannelROEdit": {
         "type": "object",
         "properties": {
-          "username": {
-            "type": "string",
-            "description": "用户名"
-          },
-          "merchantName": {
-            "type": "string",
-            "description": "商户名称"
-          },
-          "phone": {
-            "type": "string",
-            "description": "电话号码"
-          },
-          "email": {
-            "type": "string",
-            "description": "邮箱地址"
-          },
-          "websiteName": {
-            "type": "string",
-            "description": "网站名称"
-          },
-          "websiteAddress": {
-            "type": "string",
-            "description": "网站地址"
-          },
-          "idcard": {
-            "type": "string",
-            "description": "身份证号"
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
           },
-          "realname": {
+          "channelName": {
             "type": "string",
-            "description": "真实姓名"
+            "description": "通道名称"
           },
-          "contactAddress": {
+          "channelCode": {
             "type": "string",
-            "description": "通讯地址"
+            "description": "通道编码"
           },
-          "offlineRechargeRate": {
+          "baseRechargeRate": {
             "type": "number",
-            "description": "线下充值费率",
+            "description": "基础费率(百分比)",
             "minimum": 0,
             "maximum": 100,
             "exclusiveMinimum": true,
             "exclusiveMaximum": true
           },
-          "status": {
-            "type": "boolean",
-            "description": "启用状态"
+          "todayTotalAmount": {
+            "type": "number",
+            "description": "当天总金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "agentId": {
-            "type": "integer",
-            "description": "所属商户ID",
-            "format": "int64"
+          "singleMaxAmount": {
+            "type": "number",
+            "description": "单比最大金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "newPwd": {
-            "type": "string",
-            "description": "新密码"
+          "singleMinAmount": {
+            "type": "number",
+            "description": "单比最小金额",
+            "minimum": 0,
+            "maximum": 9999999999.99
           },
-          "oldPwd": {
-            "type": "string",
-            "description": "旧密码"
+          "riskControlStatus": {
+            "type": "boolean",
+            "description": "风控状态"
           }
-        }
+        },
+        "required": [
+          "channelName",
+          "channelCode"
+        ]
       }
     },
     "securitySchemes": {

+ 507 - 0
doc/payType.json

@@ -0,0 +1,507 @@
+{
+  "openapi": "3.0.1",
+  "info": {
+    "title": "默认模块",
+    "description": "",
+    "version": "1.0.0"
+  },
+  "tags": [],
+  "paths": {
+    "/paymentType/list/{id:^\\d+$}": {
+      "get": {
+        "summary": "列表 payment_type_query",
+        "deprecated": false,
+        "description": "",
+        "tags": [],
+        "parameters": [
+          {
+            "name": "id",
+            "in": "path",
+            "description": "",
+            "required": true,
+            "schema": {
+              "type": "integer"
+            }
+          },
+          {
+            "name": "query",
+            "in": "query",
+            "description": "",
+            "required": false,
+            "schema": {
+              "type": "string"
+            }
+          },
+          {
+            "name": "status",
+            "in": "query",
+            "description": "",
+            "required": false,
+            "schema": {
+              "type": "boolean"
+            }
+          },
+          {
+            "name": "paymentType",
+            "in": "query",
+            "description": " PAY :代付\nHARVEST :代收",
+            "required": false,
+            "schema": {
+              "type": "string"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/RListPaymentTypeListVO"
+                },
+                "example": {
+                  "code": 0,
+                  "msg": "",
+                  "data": [
+                    {
+                      "id": 0,
+                      "status": false,
+                      "paymentName": "",
+                      "paymentCode": "",
+                      "paymentType": ""
+                    }
+                  ]
+                }
+              }
+            },
+            "headers": {}
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          }
+        ]
+      }
+    },
+    "/paymentType/save": {
+      "post": {
+        "summary": "新增 payment_type_save",
+        "deprecated": false,
+        "description": "",
+        "tags": [],
+        "parameters": [],
+        "requestBody": {
+          "content": {
+            "application/json": {
+              "schema": {
+                "$ref": "#/components/schemas/PaymentTypeROAdd",
+                "description": ""
+              }
+            }
+          }
+        },
+        "responses": {
+          "200": {
+            "description": "",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/R",
+                  "description": "响应信息主体"
+                },
+                "example": {
+                  "ok": false,
+                  "code": null,
+                  "msg": "",
+                  "data": {}
+                }
+              }
+            },
+            "headers": {}
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          }
+        ]
+      }
+    },
+    "/paymentType/info/{id:^\\d+$}": {
+      "get": {
+        "summary": "详情 payment_type_info",
+        "deprecated": false,
+        "description": "",
+        "tags": [],
+        "parameters": [
+          {
+            "name": "id",
+            "in": "path",
+            "description": "",
+            "required": true,
+            "schema": {
+              "type": "integer"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/RPaymentType"
+                },
+                "example": {
+                  "code": 0,
+                  "msg": "",
+                  "data": {
+                    "id": 0,
+                    "status": false,
+                    "createBy": "",
+                    "updateBy": "",
+                    "createTime": "",
+                    "updateTime": "",
+                    "channelId": 0,
+                    "paymentName": "",
+                    "paymentCode": "",
+                    "paymentType": ""
+                  }
+                }
+              }
+            },
+            "headers": {}
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          }
+        ]
+      }
+    },
+    "/paymentType/edit/{id:^\\d+$}": {
+      "patch": {
+        "summary": "编辑(不可修改状态、不可修改类型) payment_type_edit",
+        "deprecated": false,
+        "description": "",
+        "tags": [],
+        "parameters": [
+          {
+            "name": "id",
+            "in": "path",
+            "description": "",
+            "required": true,
+            "schema": {
+              "type": "integer"
+            }
+          }
+        ],
+        "requestBody": {
+          "content": {
+            "application/json": {
+              "schema": {
+                "$ref": "#/components/schemas/PaymentTypeROEdit",
+                "description": ""
+              }
+            }
+          }
+        },
+        "responses": {
+          "200": {
+            "description": "",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/R",
+                  "description": "响应信息主体"
+                },
+                "example": {
+                  "ok": false,
+                  "code": null,
+                  "msg": "",
+                  "data": {}
+                }
+              }
+            },
+            "headers": {}
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          }
+        ]
+      }
+    },
+    "/paymentType/changeStatus/{id:^\\d+$}": {
+      "patch": {
+        "summary": "修改状态 payment_channel_edit",
+        "deprecated": false,
+        "description": "",
+        "tags": [],
+        "parameters": [
+          {
+            "name": "id",
+            "in": "path",
+            "description": "",
+            "required": true,
+            "schema": {
+              "type": "integer"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "$ref": "#/components/schemas/R",
+                  "description": "响应信息主体"
+                },
+                "example": {
+                  "ok": false,
+                  "code": null,
+                  "msg": "",
+                  "data": {}
+                }
+              }
+            },
+            "headers": {}
+          }
+        },
+        "security": [
+          {
+            "bearer": []
+          }
+        ]
+      }
+    }
+  },
+  "components": {
+    "schemas": {
+      "PaymentTypeListVO": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "integer",
+            "description": "",
+            "format": "int64"
+          },
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
+          },
+          "paymentName": {
+            "type": "string",
+            "description": "支付类型名称"
+          },
+          "paymentCode": {
+            "type": "string",
+            "description": "支付类型代码"
+          },
+          "paymentType": {
+            "type": "string",
+            "description": "支付类别",
+            "enum": [
+              "PAY",
+              "HARVEST"
+            ]
+          }
+        }
+      },
+      "RListPaymentTypeListVO": {
+        "type": "object",
+        "properties": {
+          "code": {
+            "type": "integer",
+            "description": "返回标记:成功标记=0,失败标记=1"
+          },
+          "msg": {
+            "type": "string",
+            "description": "返回信息"
+          },
+          "data": {
+            "type": "array",
+            "items": {
+              "$ref": "#/components/schemas/PaymentTypeListVO",
+              "description": ""
+            },
+            "description": "数据"
+          }
+        }
+      },
+      "PaymentTypeROAdd": {
+        "type": "object",
+        "properties": {
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
+          },
+          "channelId": {
+            "type": "integer",
+            "description": "通道id",
+            "format": "int64"
+          },
+          "paymentName": {
+            "type": "string",
+            "description": "支付类型名称"
+          },
+          "paymentCode": {
+            "type": "string",
+            "description": "支付类型代码"
+          },
+          "paymentType": {
+            "type": "string",
+            "description": "支付类别",
+            "enum": [
+              "PAY",
+              "HARVEST"
+            ]
+          }
+        },
+        "required": [
+          "status",
+          "channelId",
+          "paymentName",
+          "paymentCode",
+          "paymentType"
+        ]
+      },
+      "PaymentType": {
+        "type": "object",
+        "properties": {
+          "id": {
+            "type": "integer",
+            "description": "",
+            "format": "int64"
+          },
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
+          },
+          "createBy": {
+            "type": "string",
+            "description": "创建人"
+          },
+          "updateBy": {
+            "type": "string",
+            "description": "修改人"
+          },
+          "createTime": {
+            "type": "string",
+            "description": "创建时间"
+          },
+          "updateTime": {
+            "type": "string",
+            "description": "修改时间"
+          },
+          "channelId": {
+            "type": "integer",
+            "description": "通道id",
+            "format": "int64"
+          },
+          "paymentName": {
+            "type": "string",
+            "description": "支付类型名称"
+          },
+          "paymentCode": {
+            "type": "string",
+            "description": "支付类型代码"
+          },
+          "paymentType": {
+            "type": "string",
+            "description": "支付类别",
+            "enum": [
+              "PAY",
+              "HARVEST"
+            ]
+          }
+        }
+      },
+      "R": {
+        "type": "object",
+        "properties": {
+          "ok": {
+            "type": "boolean"
+          },
+          "code": {
+            "description": "返回标记:成功标记=0,失败标记=1",
+            "type": "null"
+          },
+          "msg": {
+            "type": "string",
+            "description": "返回信息"
+          },
+          "data": {
+            "type": "object",
+            "properties": {},
+            "description": "数据"
+          }
+        }
+      },
+      "RPaymentType": {
+        "type": "object",
+        "properties": {
+          "code": {
+            "type": "integer",
+            "description": "返回标记:成功标记=0,失败标记=1"
+          },
+          "msg": {
+            "type": "string",
+            "description": "返回信息"
+          },
+          "data": {
+            "$ref": "#/components/schemas/PaymentType",
+            "description": "数据"
+          }
+        }
+      },
+      "PaymentTypeROEdit": {
+        "type": "object",
+        "properties": {
+          "status": {
+            "type": "boolean",
+            "description": "启用状态"
+          },
+          "channelId": {
+            "type": "integer",
+            "description": "通道id",
+            "format": "int64"
+          },
+          "paymentName": {
+            "type": "string",
+            "description": "支付类型名称"
+          },
+          "paymentCode": {
+            "type": "string",
+            "description": "支付类型代码"
+          },
+          "paymentType": {
+            "type": "string",
+            "description": "支付类别",
+            "enum": [
+              "PAY",
+              "HARVEST"
+            ]
+          }
+        },
+        "required": [
+          "channelId",
+          "paymentName",
+          "paymentCode"
+        ]
+      }
+    },
+    "securitySchemes": {
+      "bearer": {
+        "type": "http",
+        "scheme": "bearer"
+      }
+    }
+  },
+  "servers": [],
+  "security": []
+}

+ 7 - 0
src/api/merchant/merchantUser.ts

@@ -52,3 +52,10 @@ export function getAgentList(id: string) {
 		method: 'get',
 	});
 }
+
+export function resetMd5Key(id: string) {
+	return request({
+		url: `/admin/merchantUser/resetMd5/${id}`,
+		method: 'patch',
+	});
+}

+ 84 - 0
src/api/payment/index.ts

@@ -0,0 +1,84 @@
+import request from '/@/utils/request';
+
+// ==================== 支付通道相关 API ====================
+
+export function fetchChannelList(query?: Object) {
+	return request({
+		url: 'admin/paymentChannel/page',
+		method: 'get',
+		params: query,
+	});
+}
+
+export function addChannel(obj?: Object) {
+	return request({
+		url: 'admin/paymentChannel/save',
+		method: 'post',
+		data: obj,
+	});
+}
+
+export function getChannel(id?: string) {
+	return request({
+		url: `admin/paymentChannel/info/${id}`,
+		method: 'get',
+	});
+}
+
+export function putChannel(id: string, obj?: Object) {
+	return request({
+		url: `admin/paymentChannel/edit/${id}`,
+		method: 'patch',
+		data: obj,
+	});
+}
+
+export function changeChannelStatus(id: string) {
+	return request({
+		url: `/admin/paymentChannel/changeStatus/${id}`,
+		method: 'patch',
+	});
+}
+
+// ==================== 支付类型相关 API ====================
+
+export function fetchTypeList(channelId: string, query?: Object) {
+	return request({
+		url: `admin/paymentType/list/${channelId}`,
+		method: 'get',
+		params: query,
+	});
+}
+
+export function addType(obj?: Object) {
+	return request({
+		url: 'admin/paymentType/save',
+		method: 'post',
+		data: obj,
+	});
+}
+
+export function getType(id?: string) {
+	return request({
+		url: `admin/paymentType/info/${id}`,
+		method: 'get',
+	});
+}
+
+export function putType(id: string, obj?: Object) {
+	return request({
+		url: `admin/paymentType/edit/${id}`,
+		method: 'patch',
+		data: obj,
+	});
+}
+
+export function changeTypeStatus(id: string) {
+	return request({
+		url: `/admin/paymentType/changeStatus/${id}`,
+		method: 'patch',
+	});
+}
+
+// ==================== 后续可添加其他支付相关 API ====================
+// 例如:支付订单、支付记录等

+ 5 - 1
src/i18n/index.ts

@@ -75,7 +75,7 @@ await fetchI18n()
 // 远程获取i18n
 async function fetchI18n() {
     const infoI18n = await info();
-    const messageLocal = {};
+    const messageLocal: Record<string, any> = {};
     const itemizeLocal = {en: [] as any[], 'zh-cn': [] as any[]};
     itemizeLocal['zh-cn'].push(...infoI18n.data.data['zh-cn']);
     itemizeLocal.en.push(...infoI18n.data.data.en);
@@ -85,7 +85,11 @@ async function fetchI18n() {
             ...mergeArrObj(itemizeLocal, key),
         };
     }
+    // 先合并远程数据,再合并本地数据,确保本地配置优先级更高
     i18n.global.mergeLocaleMessage('zh-cn', messageLocal['zh-cn']);
     i18n.global.mergeLocaleMessage('en', messageLocal['en']);
+    // 重新合并本地配置,确保本地的 common 等配置不被远程覆盖
+    i18n.global.mergeLocaleMessage('zh-cn', messages['zh-cn']);
+    i18n.global.mergeLocaleMessage('en', messages['en']);
     i18n.global.locale.value = themeConfig.value.globalI18n;
 }

+ 11 - 3
src/i18n/lang/en.ts

@@ -218,10 +218,18 @@ export default {
 		switchError: 'Failed to switch tenant, please try again'
 	},
 	common: {
-		cancel: 'Cancel',
-		confirm: 'Confirm',
+		closeBtn: 'Close',
+		cancelButtonText: 'Cancel',
 		confirmButtonText: 'Confirm',
-		cancelButtonText: 'Cancel'
+		addBtn: 'Add',
+		editBtn: 'Edit',
+		delBtn: 'Delete',
+		searchBtn: 'Search',
+		resetBtn: 'Reset',
+		delConfirmText: 'This operation will permanently delete, continue?',
+		delSuccessText: 'Delete successfully',
+		addSuccessText: 'Add successfully',
+		editSuccessText: 'Edit successfully'
 	},
 	message: {
 		box: {

+ 14 - 0
src/i18n/lang/zh-cn.ts

@@ -210,6 +210,20 @@ export default {
 		switchSuccess: '租户切换成功,即将刷新页面...',
 		switchError: '租户切换失败,请重试'
 	},
+	common: {
+		closeBtn: '关闭',
+		cancelButtonText: '取消',
+		confirmButtonText: '确定',
+		addBtn: '新增',
+		editBtn: '编辑',
+		delBtn: '删除',
+		searchBtn: '查询',
+		resetBtn: '重置',
+		delConfirmText: '此操作将永久删除, 是否继续?',
+		delSuccessText: '删除成功',
+		addSuccessText: '添加成功',
+		editSuccessText: '修改成功'
+	},
 	message: {
 		box: {
 			title: '提示'

+ 14 - 0
src/i18n/pages/merchant/en.ts

@@ -39,6 +39,7 @@ export default {
 		// Buttons
 		viewBtn: 'View',
 		changePwdBtn: 'Change Password',
+		resetKeyBtn: 'Reset Key',
 		
 		// Status
 		statusEnable: 'Enable',
@@ -69,5 +70,18 @@ export default {
 		confirmPasswordRequired: 'Please enter new password again',
 		passwordNotMatch: 'Passwords do not match',
 		changePwdSuccess: 'Password changed successfully',
+		
+		// Reset key
+		resetKeyTitle: 'Reset MD5 Key',
+		resetKeyConfirm: 'Are you sure to reset the MD5 key for this merchant? The original key will be invalid!',
+		resetKeySuccess: 'Key reset successfully',
+		keyDialogTitle: 'MD5 Key Information',
+		keyDialogTip: 'Please keep the following key information properly. It cannot be viewed again after closing!',
+		appIdLabel: 'AppId',
+		md5KeyLabel: 'MD5 Key',
+		copyBtn: 'Copy',
+		copyAllBtn: 'Copy All',
+		copySuccess: 'Copied successfully',
+		copyFailed: 'Copy failed',
 	},
 };

+ 14 - 0
src/i18n/pages/merchant/zh-cn.ts

@@ -39,6 +39,7 @@ export default {
 		// 按钮
 		viewBtn: '查看',
 		changePwdBtn: '改密',
+		resetKeyBtn: '重置密钥',
 		
 		// 状态
 		statusEnable: '启用',
@@ -69,5 +70,18 @@ export default {
 		confirmPasswordRequired: '请再次输入新密码',
 		passwordNotMatch: '两次输入的密码不一致',
 		changePwdSuccess: '密码修改成功',
+		
+		// 重置密钥
+		resetKeyTitle: '重置MD5密钥',
+		resetKeyConfirm: '确定要重置该商户的MD5密钥吗?重置后原密钥将失效!',
+		resetKeySuccess: '密钥重置成功',
+		keyDialogTitle: 'MD5密钥信息',
+		keyDialogTip: '请妥善保管以下密钥信息,关闭后将无法再次查看!',
+		appIdLabel: 'AppId',
+		md5KeyLabel: 'MD5密钥',
+		copyBtn: '复制',
+		copyAllBtn: '一键复制',
+		copySuccess: '复制成功',
+		copyFailed: '复制失败',
 	},
 };

+ 6 - 6
src/views/agent/list/index.vue

@@ -16,7 +16,7 @@
 			</el-row>
 			<el-row>
 				<div class="mb8" style="width: 100%">
-					<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'agent'">
+					<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'agent_admin'">
 						{{ $t('common.addBtn') }}
 					</el-button>
 					<right-toolbar
@@ -47,17 +47,17 @@
 							:active-value="true"
 							:inactive-value="false"
 							@change="handleStatusChange(scope.row)"
-							v-auth="'agent'"
+							v-auth="'agent_admin'"
 						/>
 					</template>
 				</el-table-column>
-				<el-table-column :label="$t('agentUser.operation')" fixed="right" width="200">
+				<el-table-column :label="$t('agentUser.operation')" width="200">
 					<template #default="scope">
-						<el-button icon="View" @click="handleView(scope.row)" text type="primary" v-auth="'agent'">{{ $t('agentUser.viewBtn') }}</el-button>
-						<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.userId)" text type="primary" v-auth="'agent'"
+						<el-button icon="View" @click="handleView(scope.row)" text type="primary" v-auth="'agent_admin'">{{ $t('agentUser.viewBtn') }}</el-button>
+						<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.userId)" text type="primary" v-auth="'agent_admin'"
 							>{{ $t('common.editBtn') }}
 						</el-button>
-						<el-button icon="Key" @click="handleChangePwd(scope.row)" text type="warning" v-auth="'agent'">{{
+						<el-button icon="Key" @click="handleChangePwd(scope.row)" text type="warning" v-auth="'agent_admin'">{{
 							$t('agentUser.changePwdBtn')
 						}}</el-button>
 					</template>

+ 44 - 11
src/views/merchant/list/form.vue

@@ -7,6 +7,18 @@
 		width="920px"
 	>
 		<el-alert v-if="!form.userId" :title="$t('merchantUser.defaultPasswordTip')" type="warning" :closable="false" style="margin-bottom: 15px" />
+
+		<!-- AppId 显示区域 -->
+		<el-card v-if="form.userId && form.appId" shadow="never" style="margin-bottom: 20px; background: #f5f7fa">
+			<div style="display: flex; align-items: center; justify-content: space-between">
+				<div style="flex: 1">
+					<div style="color: #909399; font-size: 13px; margin-bottom: 5px">{{ $t('merchantUser.appId') }}</div>
+					<div style="color: #303133; font-size: 16px; font-weight: 600; font-family: 'Courier New', monospace">{{ form.appId }}</div>
+				</div>
+				<el-button @click="handleCopyAppId" icon="DocumentCopy" type="primary">{{ $t('merchantUser.copyBtn') }}</el-button>
+			</div>
+		</el-card>
+
 		<el-form :model="form" :rules="dataRules" label-width="140px" ref="dataFormRef" v-loading="loading">
 			<!-- 基本信息 -->
 			<el-divider content-position="left">{{ $t('merchantUser.basicInfo') }}</el-divider>
@@ -99,12 +111,6 @@
 						<el-input :placeholder="$t('merchantUser.inputWebsiteAddressTip')" v-model="form.websiteAddress" :disabled="readonly" />
 					</el-form-item>
 				</el-col>
-
-				<el-col :span="12" class="mb20" v-if="form.userId">
-					<el-form-item :label="$t('merchantUser.appId')" prop="appId">
-						<el-input :placeholder="'AppId'" v-model="form.appId" disabled />
-					</el-form-item>
-				</el-col>
 			</el-row>
 		</el-form>
 		<template #footer>
@@ -114,6 +120,9 @@
 			</span>
 		</template>
 	</el-dialog>
+
+	<!-- 密钥显示 -->
+	<key-dialog ref="keyDialogRef" />
 </template>
 
 <script lang="ts" name="MerchantUserDialog" setup>
@@ -122,12 +131,18 @@ import { useMessage } from '/@/hooks/message';
 import { addObj, getObj, putObj, getAgentList } from '/@/api/merchant/merchantUser';
 import { useI18n } from 'vue-i18n';
 import { rule } from '/@/utils/validate';
+import { useClipboard } from '@vueuse/core';
 
 const emit = defineEmits(['refresh']);
 
+// 引入密钥弹窗组件
+const KeyDialog = defineAsyncComponent(() => import('./keyDialog.vue'));
+
 const { t } = useI18n();
+const { copy } = useClipboard();
 // 定义变量内容
 const dataFormRef = ref();
+const keyDialogRef = ref();
 const visible = ref(false);
 const loading = ref(false);
 const readonly = ref(false);
@@ -214,6 +229,16 @@ const getMerchantUserData = (id: string) => {
 		});
 };
 
+// 复制 AppId
+const handleCopyAppId = async () => {
+	try {
+		await copy(form.appId);
+		useMessage().success(t('merchantUser.copySuccess'));
+	} catch (err) {
+		useMessage().error(t('merchantUser.copyFailed'));
+	}
+};
+
 // 提交
 const onSubmit = async () => {
 	const valid = await dataFormRef.value.validate().catch(() => {});
@@ -221,14 +246,22 @@ const onSubmit = async () => {
 
 	try {
 		loading.value = true;
+		let res: any;
 		if (form.userId) {
-			await putObj(form.userId, form);
+			res = await putObj(form.userId, form);
+			useMessage().success(t('common.editSuccessText'));
+			visible.value = false;
+			emit('refresh');
 		} else {
-			await addObj(form);
+			res = await addObj(form);
+			useMessage().success(t('common.addSuccessText'));
+			visible.value = false;
+			emit('refresh');
+			// 新增成功后显示密钥信息
+			if (res.data && res.data.appId && res.data.md5Key) {
+				keyDialogRef.value.openDialog(res.data);
+			}
 		}
-		useMessage().success(t(form.userId ? 'common.editSuccessText' : 'common.addSuccessText'));
-		visible.value = false;
-		emit('refresh');
 	} catch (err: any) {
 		useMessage().error(err.msg);
 	} finally {

+ 33 - 7
src/views/merchant/list/index.vue

@@ -16,7 +16,7 @@
 			</el-row>
 			<el-row>
 				<div class="mb8" style="width: 100%">
-					<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'merchant'">
+					<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'merchant_admin'">
 						{{ $t('common.addBtn') }}
 					</el-button>
 					<right-toolbar
@@ -48,17 +48,24 @@
 							@change="handleStatusChange(scope.row)"
 							:active-value="true"
 							:inactive-value="false"
-							v-auth="'merchant'"
+							v-auth="'merchant_admin'"
 						/>
 					</template>
 				</el-table-column>
-				<el-table-column :label="$t('merchantUser.operation')" fixed="right" width="200">
+				<el-table-column :label="$t('merchantUser.operation')" width="320">
 					<template #default="scope">
-						<el-button icon="View" @click="handleView(scope.row)" text type="primary" v-auth="'merchant'">{{ $t('merchantUser.viewBtn') }}</el-button>
-						<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.userId)" text type="primary" v-auth="'merchant'"
+						<el-button icon="View" @click="handleView(scope.row)" text type="primary" v-auth="'merchant_admin'">{{
+							$t('merchantUser.viewBtn')
+						}}</el-button>
+						<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.userId)" text type="primary" v-auth="'merchant_admin'"
 							>{{ $t('common.editBtn') }}
 						</el-button>
-						<el-button icon="Key" @click="handleChangePwd(scope.row)" text type="warning" v-auth="'merchant'">{{ $t('merchantUser.changePwdBtn') }}</el-button>
+						<el-button icon="Key" @click="handleChangePwd(scope.row)" text type="warning" v-auth="'merchant_admin'">{{
+							$t('merchantUser.changePwdBtn')
+						}}</el-button>
+						<el-button icon="RefreshRight" @click="handleResetKey(scope.row)" text type="danger" v-auth="'merchant_admin'">{{
+							$t('merchantUser.resetKeyBtn')
+						}}</el-button>
 					</template>
 				</el-table-column>
 			</el-table>
@@ -70,12 +77,15 @@
 
 		<!-- 修改密码 -->
 		<change-pwd-dialog @refresh="getDataList(false)" ref="changePwdDialogRef" />
+
+		<!-- 密钥显示 -->
+		<key-dialog ref="keyDialogRef" />
 	</div>
 </template>
 
 <script lang="ts" name="systemMerchantUser" setup>
 import { BasicTableProps, useTable } from '/@/hooks/table';
-import { fetchList, changeStatus } from '/@/api/merchant/merchantUser';
+import { fetchList, changeStatus, resetMd5Key } from '/@/api/merchant/merchantUser';
 import { useMessage, useMessageBox } from '/@/hooks/message';
 import { useI18n } from 'vue-i18n';
 
@@ -84,10 +94,12 @@ const { t } = useI18n();
 // 引入组件
 const FormDialog = defineAsyncComponent(() => import('./form.vue'));
 const ChangePwdDialog = defineAsyncComponent(() => import('./changePwd.vue'));
+const KeyDialog = defineAsyncComponent(() => import('./keyDialog.vue'));
 
 // 定义变量内容
 const formDialogRef = ref();
 const changePwdDialogRef = ref();
+const keyDialogRef = ref();
 const queryRef = ref();
 const showSearch = ref(true);
 const selectObjs = ref([]);
@@ -137,4 +149,18 @@ const handleView = (row: any) => {
 const handleChangePwd = (row: any) => {
 	changePwdDialogRef.value.openDialog(row.userId);
 };
+
+// 重置密钥
+const handleResetKey = async (row: any) => {
+	try {
+		await useMessageBox().confirm(t('merchantUser.resetKeyConfirm'));
+		const res = await resetMd5Key(row.userId);
+		// 显示密钥信息
+		keyDialogRef.value.openDialog(res.data);
+	} catch (err: any) {
+		if (err !== 'cancel') {
+			useMessage().error(err.msg);
+		}
+	}
+};
 </script>

+ 65 - 0
src/views/merchant/list/keyDialog.vue

@@ -0,0 +1,65 @@
+<template>
+	<el-dialog :close-on-click-modal="false" :title="$t('merchantUser.keyDialogTitle')" draggable v-model="visible" width="600px" @close="handleClose">
+		<el-alert :title="$t('merchantUser.keyDialogTip')" type="warning" :closable="false" style="margin-bottom: 20px" />
+
+		<el-form label-width="120px">
+			<el-form-item :label="$t('merchantUser.appIdLabel')">
+				<el-input v-model="keyData.appId" readonly />
+			</el-form-item>
+
+			<el-form-item :label="$t('merchantUser.md5KeyLabel')">
+				<el-input v-model="keyData.md5Key" readonly type="textarea" :rows="3" />
+			</el-form-item>
+		</el-form>
+
+		<template #footer>
+			<span class="dialog-footer">
+				<el-button @click="handleCopyAll" icon="DocumentCopy" type="primary">{{ $t('merchantUser.copyAllBtn') }}</el-button>
+				<el-button @click="visible = false">{{ $t('common.closeBtn') }}</el-button>
+			</span>
+		</template>
+	</el-dialog>
+</template>
+
+<script lang="ts" name="MerchantKeyDialog" setup>
+import { useMessage } from '/@/hooks/message';
+import { useI18n } from 'vue-i18n';
+import { useClipboard } from '@vueuse/core';
+
+const { t } = useI18n();
+const { copy } = useClipboard();
+
+const visible = ref(false);
+const keyData = reactive({
+	appId: '',
+	md5Key: '',
+});
+
+// 打开弹窗
+const openDialog = (data: any) => {
+	visible.value = true;
+	keyData.appId = data.appId || '';
+	keyData.md5Key = data.md5Key || '';
+};
+
+// 一键复制所有信息
+const handleCopyAll = async () => {
+	try {
+		const copyText = `AppId: ${keyData.appId}\nMD5密钥: ${keyData.md5Key}`;
+		await copy(copyText);
+		useMessage().success(t('merchantUser.copySuccess'));
+	} catch (err) {
+		useMessage().error(t('merchantUser.copyFailed'));
+	}
+};
+
+// 关闭弹窗
+const handleClose = () => {
+	keyData.appId = '';
+	keyData.md5Key = '';
+};
+
+defineExpose({
+	openDialog,
+});
+</script>

+ 265 - 0
src/views/payment/channel/form.vue

@@ -0,0 +1,265 @@
+<template>
+	<el-dialog
+		:close-on-click-modal="false"
+		:title="form.id ? (readonly ? '查看详情' : '编辑支付通道') : '新增支付通道'"
+		draggable
+		v-model="visible"
+		width="920px"
+	>
+		<el-form :model="form" :rules="dataRules" label-width="140px" ref="dataFormRef" v-loading="loading">
+			<!-- 基本信息 -->
+			<el-divider content-position="left">基本信息</el-divider>
+			<el-row :gutter="24">
+				<el-col :span="12" class="mb20">
+					<el-form-item label="通道名称" prop="channelName">
+						<el-input placeholder="请输入通道名称" v-model="form.channelName" :disabled="readonly" />
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="通道编码" prop="channelCode">
+						<el-input placeholder="请输入通道编码" v-model="form.channelCode" :disabled="readonly" />
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="基础费率(%)" prop="baseRechargeRate">
+						<el-input-number
+							placeholder="请输入基础费率"
+							v-model="form.baseRechargeRate"
+							:min="0"
+							:max="100"
+							:precision="2"
+							:disabled="readonly"
+							style="width: 100%"
+						/>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="启用状态" prop="status">
+						<el-radio-group v-model="form.status" :disabled="readonly || !!form.id">
+							<el-radio :label="true">启用</el-radio>
+							<el-radio :label="false">禁用</el-radio>
+						</el-radio-group>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="风控状态" prop="riskControlStatus">
+						<el-radio-group v-model="form.riskControlStatus" :disabled="readonly">
+							<el-radio :label="true">启用</el-radio>
+							<el-radio :label="false">禁用</el-radio>
+						</el-radio-group>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="权重值" prop="roundVal">
+						<el-input-number
+							placeholder="请输入权重值"
+							v-model="form.roundVal"
+							:min="0"
+							:max="100"
+							:precision="0"
+							:disabled="readonly"
+							style="width: 100%"
+						/>
+					</el-form-item>
+				</el-col>
+			</el-row>
+
+			<!-- 金额配置 -->
+			<el-divider content-position="left">金额配置</el-divider>
+			<el-row :gutter="24">
+				<el-col :span="12" class="mb20">
+					<el-form-item label="当天总金额" prop="todayTotalAmount">
+						<el-input-number
+							placeholder="请输入当天总金额"
+							v-model="form.todayTotalAmount"
+							:min="0"
+							:max="9999999999.99"
+							:precision="2"
+							:disabled="readonly"
+							style="width: 100%"
+						/>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="单笔最小金额" prop="singleMinAmount">
+						<el-input-number
+							placeholder="请输入单笔最小金额"
+							v-model="form.singleMinAmount"
+							:min="0"
+							:max="9999999999.99"
+							:precision="2"
+							:disabled="readonly"
+							style="width: 100%"
+						/>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12" class="mb20">
+					<el-form-item label="单笔最大金额" prop="singleMaxAmount">
+						<el-input-number
+							placeholder="请输入单笔最大金额"
+							v-model="form.singleMaxAmount"
+							:min="0"
+							:max="9999999999.99"
+							:precision="2"
+							:disabled="readonly"
+							style="width: 100%"
+						/>
+					</el-form-item>
+				</el-col>
+			</el-row>
+		</el-form>
+		<template #footer>
+			<span class="dialog-footer">
+				<el-button @click="visible = false">{{ readonly ? '关闭' : '取消' }}</el-button>
+				<el-button @click="onSubmit" type="primary" :disabled="loading" v-if="!readonly">确定</el-button>
+			</span>
+		</template>
+	</el-dialog>
+</template>
+
+<script lang="ts" name="PaymentChannelDialog" setup>
+// 定义子组件向父组件传值/事件
+import { useMessage } from '/@/hooks/message';
+import { addChannel, getChannel, putChannel } from '/@/api/payment';
+import { rule } from '/@/utils/validate';
+
+const emit = defineEmits(['refresh']);
+
+// 定义变量内容
+const dataFormRef = ref();
+const visible = ref(false);
+const loading = ref(false);
+const readonly = ref(false);
+
+// 提交表单数据(严格按照接口文档字段)
+const form = reactive({
+	id: '',
+	channelName: '',
+	channelCode: '',
+	baseRechargeRate: 0,
+	todayTotalAmount: 0,
+	singleMinAmount: 0,
+	singleMaxAmount: 0,
+	status: true,
+	riskControlStatus: false,
+	roundType: 'WEIGHT',
+	roundVal: 1,
+});
+
+// 定义校验规则(根据接口文档,必填字段:channelName, channelCode)
+const dataRules = ref({
+	channelName: [
+		{ required: true, message: '请输入通道名称', trigger: 'blur' },
+		{ validator: rule.overLength, trigger: 'blur' },
+	],
+	channelCode: [
+		{ required: true, message: '请输入通道编码', trigger: 'blur' },
+		{ validator: rule.overLength, trigger: 'blur' },
+	],
+	baseRechargeRate: [{ required: false, message: '请输入基础费率', trigger: 'blur' }],
+	singleMinAmount: [
+		{
+			validator: (rule: any, value: any, callback: any) => {
+				if (value && form.singleMaxAmount && value > form.singleMaxAmount) {
+					callback(new Error('单笔最小金额不能大于单笔最大金额'));
+				} else {
+					callback();
+				}
+			},
+			trigger: 'blur',
+		},
+	],
+	singleMaxAmount: [
+		{
+			validator: (rule: any, value: any, callback: any) => {
+				if (value && form.singleMinAmount && value < form.singleMinAmount) {
+					callback(new Error('单笔最大金额不能小于单笔最小金额'));
+				} else {
+					callback();
+				}
+			},
+			trigger: 'blur',
+		},
+	],
+	roundVal: [
+		{ required: true, message: '请输入权重值', trigger: 'blur' },
+		{
+			validator: (rule: any, value: any, callback: any) => {
+				if (value !== undefined && value !== null && (value < 0 || value > 100)) {
+					callback(new Error('权重值范围为0-100'));
+				} else {
+					callback();
+				}
+			},
+			trigger: 'blur',
+		},
+	],
+});
+
+// 打开弹窗
+const openDialog = (id: string, isReadonly = false) => {
+	visible.value = true;
+	readonly.value = isReadonly;
+	form.id = '';
+
+	// 重置表单数据
+	nextTick(() => {
+		dataFormRef.value?.resetFields();
+	});
+
+	// 获取支付通道信息
+	if (id) {
+		form.id = id;
+		getPaymentChannelData(id);
+	}
+};
+
+// 获取支付通道数据
+const getPaymentChannelData = (id: string) => {
+	loading.value = true;
+	getChannel(id)
+		.then((res: any) => {
+			Object.assign(form, res.data);
+		})
+		.finally(() => {
+			loading.value = false;
+		});
+};
+
+// 提交
+const onSubmit = async () => {
+	const valid = await dataFormRef.value.validate().catch(() => {});
+	if (!valid) return false;
+
+	try {
+		loading.value = true;
+		if (form.id) {
+			await putChannel(form.id, form);
+			useMessage().success('编辑成功');
+		} else {
+			await addChannel(form);
+			useMessage().success('新增成功');
+		}
+		visible.value = false;
+		emit('refresh');
+	} catch (err: any) {
+		useMessage().error(err.msg);
+	} finally {
+		loading.value = false;
+	}
+};
+
+/**
+ * 暴露变量
+ */
+defineExpose({
+	openDialog,
+});
+</script>

+ 164 - 0
src/views/payment/channel/index.vue

@@ -0,0 +1,164 @@
+<template>
+	<div class="layout-padding">
+		<div class="layout-padding-auto layout-padding-view">
+			<el-row class="ml10" v-show="showSearch">
+				<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
+					<el-form-item label="通道名称/编码" prop="query">
+						<el-input placeholder="请输入通道名称或编码" style="max-width: 180px" v-model="state.queryForm.query" />
+					</el-form-item>
+					<el-form-item label="启用状态" prop="status">
+						<el-select v-model="state.queryForm.status" placeholder="请选择状态" clearable style="width: 120px">
+							<el-option label="启用" :value="true" />
+							<el-option label="禁用" :value="false" />
+						</el-select>
+					</el-form-item>
+					<el-form-item>
+						<el-button @click="getDataList" icon="search" type="primary"> 查询 </el-button>
+						<el-button @click="resetQuery" icon="Refresh">重置</el-button>
+					</el-form-item>
+				</el-form>
+			</el-row>
+			<el-row>
+				<div class="mb8" style="width: 100%">
+					<el-button @click="formDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary" v-auth="'payment_channel_save'">
+						新增
+					</el-button>
+					<right-toolbar
+						@queryTable="getDataList"
+						class="ml10"
+						style="float: right; margin-right: 20px"
+						v-model:showSearch="showSearch"
+					></right-toolbar>
+				</div>
+			</el-row>
+			<el-table
+				:data="state.dataList"
+				@selection-change="handleSelectionChange"
+				@sort-change="sortChangeHandle"
+				style="width: 100%"
+				v-loading="state.loading"
+				border
+				:cell-style="tableStyle.cellStyle"
+				:header-cell-style="tableStyle.headerCellStyle"
+			>
+				<el-table-column align="center" type="selection" width="40" />
+				<el-table-column label="通道ID" prop="id" show-overflow-tooltip />
+				<el-table-column label="通道名称" prop="channelName" show-overflow-tooltip />
+				<el-table-column label="通道编码" prop="channelCode" show-overflow-tooltip />
+				<el-table-column label="基础费率(%)" prop="baseRechargeRate" show-overflow-tooltip>
+					<template #default="scope">
+						{{ scope.row.baseRechargeRate ? scope.row.baseRechargeRate.toFixed(2) : '0.00' }}
+					</template>
+				</el-table-column>
+				<el-table-column label="启用状态" prop="status" show-overflow-tooltip>
+					<template #default="scope">
+						<el-switch
+							v-model="scope.row.status"
+							@change="handleStatusChange(scope.row)"
+							:active-value="true"
+							:inactive-value="false"
+							v-auth="'payment_channel_edit'"
+						/>
+					</template>
+				</el-table-column>
+				<el-table-column label="风控状态" prop="riskControlStatus" show-overflow-tooltip>
+					<template #default="scope">
+						<el-tag :type="scope.row.riskControlStatus ? 'success' : 'info'">
+							{{ scope.row.riskControlStatus ? '启用' : '禁用' }}
+						</el-tag>
+					</template>
+				</el-table-column>
+				<el-table-column label="权重值" prop="roundVal" show-overflow-tooltip>
+					<template #default="scope">
+						{{ scope.row.roundVal || 0 }}
+					</template>
+				</el-table-column>
+				<el-table-column label="操作" width="400">
+					<template #default="scope">
+						<el-button icon="View" @click="handleView(scope.row)" text type="primary" v-auth="'payment_channel_info'">查看</el-button>
+						<el-button icon="edit-pen" @click="formDialogRef.openDialog(scope.row.id)" text type="primary" v-auth="'payment_channel_edit'"
+							>编辑
+						</el-button>
+						<el-button icon="Setting" @click="handlePayTypeConfig(scope.row, 'HARVEST')" text type="success" v-auth="'payment_type_query'"
+							>代收支付配置
+						</el-button>
+						<el-button icon="Setting" @click="handlePayTypeConfig(scope.row, 'PAY')" text type="warning" v-auth="'payment_type_query'"
+							>代付支付配置
+						</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+			<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle" v-bind="state.pagination" />
+		</div>
+
+		<!-- 编辑、新增 -->
+		<form-dialog @refresh="getDataList(false)" ref="formDialogRef" />
+
+		<!-- 支付类型配置 -->
+		<pay-type-dialog ref="payTypeDialogRef" />
+	</div>
+</template>
+
+<script lang="ts" name="systemPaymentChannel" setup>
+import { BasicTableProps, useTable } from '/@/hooks/table';
+import { fetchChannelList, changeChannelStatus } from '/@/api/payment';
+import { useMessage } from '/@/hooks/message';
+
+// 引入组件
+const FormDialog = defineAsyncComponent(() => import('./form.vue'));
+const PayTypeDialog = defineAsyncComponent(() => import('./payTypeDialog.vue'));
+
+// 定义变量内容
+const formDialogRef = ref();
+const payTypeDialogRef = ref();
+const queryRef = ref();
+const showSearch = ref(true);
+const selectObjs = ref([]);
+const multiple = ref(true);
+
+// 定义表格查询、变更
+const state: BasicTableProps = reactive<BasicTableProps>({
+	queryForm: {
+		query: '',
+		status: undefined,
+	},
+	pageList: fetchChannelList,
+});
+
+const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, tableStyle } = useTable(state);
+
+// 重置查询
+const resetQuery = () => {
+	queryRef.value?.resetFields();
+	getDataList();
+};
+
+// 多选事件
+const handleSelectionChange = (objs: any) => {
+	selectObjs.value = objs.map((val: any) => val.id);
+	multiple.value = !objs.length;
+};
+
+// 状态切换
+const handleStatusChange = async (row: any) => {
+	try {
+		await changeChannelStatus(row.id);
+		useMessage().success('状态修改成功');
+		getDataList(false);
+	} catch (err: any) {
+		useMessage().error(err.msg);
+		// 恢复原状态
+		row.status = !row.status;
+	}
+};
+
+// 查看详情
+const handleView = (row: any) => {
+	formDialogRef.value.openDialog(row.id, true);
+};
+
+// 打开支付类型配置
+const handlePayTypeConfig = (row: any, type: 'HARVEST' | 'PAY') => {
+	payTypeDialogRef.value.openDialog(row.id, type);
+};
+</script>

+ 257 - 0
src/views/payment/channel/payTypeDialog.vue

@@ -0,0 +1,257 @@
+<template>
+	<el-dialog :close-on-click-modal="false" :title="dialogTitle" draggable v-model="visible" width="1200px" @close="handleClose">
+		<!-- 搜索表单 -->
+		<el-row class="ml10">
+			<el-form :inline="true" :model="queryForm" @keyup.enter="loadTypeList" ref="queryRef">
+				<el-form-item label="支付类型名称/代码" prop="query">
+					<el-input placeholder="请输入支付类型名称或代码" style="max-width: 180px" v-model="queryForm.query" clearable />
+				</el-form-item>
+				<el-form-item label="启用状态" prop="status">
+					<el-select v-model="queryForm.status" placeholder="请选择状态" clearable style="width: 120px">
+						<el-option label="启用" :value="true" />
+						<el-option label="禁用" :value="false" />
+					</el-select>
+				</el-form-item>
+				<el-form-item>
+					<el-button @click="loadTypeList" icon="search" type="primary">查询</el-button>
+					<el-button @click="resetQuery" icon="Refresh">重置</el-button>
+				</el-form-item>
+			</el-form>
+		</el-row>
+		<el-row>
+			<div class="mb8" style="width: 100%">
+				<el-button @click="handleAdd" class="ml10" icon="folder-add" type="primary" v-auth="'payment_type_save'">新增</el-button>
+			</div>
+		</el-row>
+
+		<!-- 表格 -->
+		<el-table
+			:data="typeList"
+			v-loading="loading"
+			border
+			:cell-style="tableStyle.cellStyle"
+			:header-cell-style="tableStyle.headerCellStyle"
+			style="width: 100%"
+			max-height="500"
+		>
+			<el-table-column label="ID" prop="id" show-overflow-tooltip />
+			<el-table-column label="支付类型名称" prop="paymentName" show-overflow-tooltip />
+			<el-table-column label="支付类型代码" prop="paymentCode" show-overflow-tooltip />
+			<el-table-column label="启用状态" prop="status" show-overflow-tooltip>
+				<template #default="scope">
+					<el-switch
+						v-model="scope.row.status"
+						@change="handleStatusChange(scope.row)"
+						:active-value="true"
+						:inactive-value="false"
+						v-auth="'payment_type_edit'"
+					/>
+				</template>
+			</el-table-column>
+			<el-table-column label="操作" fixed="right" width="100">
+				<template #default="scope">
+					<el-button icon="edit-pen" @click="handleEdit(scope.row)" text type="primary" v-auth="'payment_type_edit'">编辑</el-button>
+				</template>
+			</el-table-column>
+		</el-table>
+
+		<template #footer>
+			<span class="dialog-footer">
+				<el-button @click="visible = false">关闭</el-button>
+			</span>
+		</template>
+	</el-dialog>
+
+	<!-- 新增/编辑表单弹窗 -->
+	<el-dialog :close-on-click-modal="false" :title="formData.id ? '编辑支付类型' : '新增支付类型'" draggable v-model="formVisible" width="600px">
+		<el-form :model="formData" :rules="formRules" label-width="140px" ref="formRef" v-loading="formLoading">
+			<el-form-item label="支付类型名称" prop="paymentName">
+				<el-input placeholder="请输入支付类型名称" v-model="formData.paymentName" />
+			</el-form-item>
+
+			<el-form-item label="支付类型代码" prop="paymentCode">
+				<el-input placeholder="请输入支付类型代码" v-model="formData.paymentCode" />
+			</el-form-item>
+
+			<el-form-item label="启用状态" prop="status">
+				<el-radio-group v-model="formData.status" :disabled="!!formData.id">
+					<el-radio :label="true">启用</el-radio>
+					<el-radio :label="false">禁用</el-radio>
+				</el-radio-group>
+			</el-form-item>
+		</el-form>
+
+		<template #footer>
+			<span class="dialog-footer">
+				<el-button @click="formVisible = false">取消</el-button>
+				<el-button @click="handleSubmit" type="primary" :disabled="formLoading">确定</el-button>
+			</span>
+		</template>
+	</el-dialog>
+</template>
+
+<script lang="ts" name="PayTypeDialog" setup>
+import { fetchTypeList, addType, getType, putType, changeTypeStatus } from '/@/api/payment';
+import { useMessage } from '/@/hooks/message';
+import { rule } from '/@/utils/validate';
+
+// 定义表格样式
+const tableStyle = {
+	cellStyle: { textAlign: 'center' },
+	headerCellStyle: { textAlign: 'center', background: '#f5f7fa' },
+};
+
+// 定义变量
+const visible = ref(false);
+const formVisible = ref(false);
+const loading = ref(false);
+const formLoading = ref(false);
+const queryRef = ref();
+const formRef = ref();
+const channelId = ref('');
+const paymentType = ref('');
+const dialogTitle = ref('');
+const typeList = ref<any[]>([]);
+
+// 查询表单
+const queryForm = reactive({
+	query: '',
+	status: undefined,
+});
+
+// 表单数据
+const formData = reactive({
+	id: '',
+	channelId: '',
+	paymentName: '',
+	paymentCode: '',
+	paymentType: '',
+	status: true,
+});
+
+// 表单验证规则
+const formRules = ref({
+	paymentName: [
+		{ required: true, message: '请输入支付类型名称', trigger: 'blur' },
+		{ validator: rule.overLength, trigger: 'blur' },
+	],
+	paymentCode: [
+		{ required: true, message: '请输入支付类型代码', trigger: 'blur' },
+		{ validator: rule.overLength, trigger: 'blur' },
+	],
+	status: [{ required: true, message: '请选择启用状态', trigger: 'change' }],
+});
+
+// 打开弹窗
+const openDialog = (id: string, type: 'HARVEST' | 'PAY') => {
+	visible.value = true;
+	channelId.value = id;
+	paymentType.value = type;
+	dialogTitle.value = type === 'HARVEST' ? '代收支付配置' : '代付支付配置';
+
+	// 重置查询表单
+	queryForm.query = '';
+	queryForm.status = undefined;
+
+	// 加载数据
+	loadTypeList();
+};
+
+// 加载支付类型列表
+const loadTypeList = async () => {
+	try {
+		loading.value = true;
+		const params = {
+			...queryForm,
+			paymentType: paymentType.value,
+		};
+		const res = await fetchTypeList(channelId.value, params);
+		typeList.value = res.data || [];
+	} catch (err: any) {
+		useMessage().error(err.msg);
+	} finally {
+		loading.value = false;
+	}
+};
+
+// 重置查询
+const resetQuery = () => {
+	queryRef.value?.resetFields();
+	loadTypeList();
+};
+
+// 新增
+const handleAdd = () => {
+	formVisible.value = true;
+	formData.id = '';
+	formData.channelId = channelId.value;
+	formData.paymentName = '';
+	formData.paymentCode = '';
+	formData.paymentType = paymentType.value;
+	formData.status = true;
+
+	nextTick(() => {
+		formRef.value?.resetFields();
+	});
+};
+
+// 编辑
+const handleEdit = async (row: any) => {
+	try {
+		formLoading.value = true;
+		formVisible.value = true;
+		const res = await getType(row.id);
+		Object.assign(formData, res.data);
+	} catch (err: any) {
+		useMessage().error(err.msg);
+	} finally {
+		formLoading.value = false;
+	}
+};
+
+// 提交表单
+const handleSubmit = async () => {
+	const valid = await formRef.value.validate().catch(() => {});
+	if (!valid) return false;
+
+	try {
+		formLoading.value = true;
+		if (formData.id) {
+			await putType(formData.id, formData);
+			useMessage().success('编辑成功');
+		} else {
+			await addType(formData);
+			useMessage().success('新增成功');
+		}
+		formVisible.value = false;
+		loadTypeList();
+	} catch (err: any) {
+		useMessage().error(err.msg);
+	} finally {
+		formLoading.value = false;
+	}
+};
+
+// 状态切换
+const handleStatusChange = async (row: any) => {
+	try {
+		await changeTypeStatus(row.id);
+		useMessage().success('状态修改成功');
+		loadTypeList();
+	} catch (err: any) {
+		useMessage().error(err.msg);
+		// 恢复原状态
+		row.status = !row.status;
+	}
+};
+
+// 关闭弹窗
+const handleClose = () => {
+	typeList.value = [];
+};
+
+// 暴露方法
+defineExpose({
+	openDialog,
+});
+</script>