2 Komitmen 9e3ffa8794 ... fde591f202

Pembuat SHA1 Pesan Tanggal
  liaoxxxx fde591f202 1.文档整理, 2.表结构 2 tahun lalu
  liaoxxxx 7b1920af0f 1.文档整理, 2.表结构 2 tahun lalu

+ 0 - 0
doc/history/提交记录.md


+ 3 - 3
doc/model/bank.md

@@ -1,8 +1,8 @@
 ##  银行记录表
 
-> bank_code :关联银行记录[bank.bank_code](./bank.md)  
+> bank_code :银行代码
 >
-> bank_name  : 关联银行记录[bank.bank_name](./bank.md)  
+> bank_name  : 银行名称
 
 
 
@@ -10,7 +10,7 @@
 CREATE TABLE `bank` (
    `id` int NOT NULL AUTO_INCREMENT,
    `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-   `bank_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种类型',
+   `bank_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '银行名称',
    `state` int DEFAULT NULL,
    `created_at` datetime DEFAULT NULL,
    `updated_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,

+ 18 - 16
doc/model/channel.md

@@ -2,26 +2,28 @@
 > channel_name: 渠道名称
 > 
 > channel_code: 渠道代码
+>
+> area : 区域代码(英文)国家级行政单位,来自[area.area_en](./area.md)
 > 
-> area : 关联区域的id[area.id](./area.md)
+> supported_currencies : 支持的币种代码id,多个币种id的数组json字符[currency.currency_id](./currency.md) 如`[840,978,..]`
 >
-> supported_currencies : 支持的币种id,多个币种id的数组json字符[area.id](./area.md) 如`[1,2,3,..]`
-
+> config :保存json配置信息,如 微信需要保存app_id,secret
 
 ```mysql
 CREATE TABLE `channel` (
-  `id` int NOT NULL AUTO_INCREMENT,
-  `channel_id` bigint DEFAULT NULL,
-  `channel_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
-  `channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '渠道名称',
-  `docking_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '对接方式',
-  `channel_type` int DEFAULT NULL,
-  `area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '区域',
-  `supported_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支持的币种',
-  `state` int DEFAULT NULL,
-  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  PRIMARY KEY (`id`) USING BTREE
+    `id` int NOT NULL AUTO_INCREMENT,
+    `channel_id` bigint DEFAULT NULL,
+    `channel_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
+    `channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '通道名称',
+    `docking_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '对接方式',
+    `channel_type` int DEFAULT NULL,
+    `area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '区域',
+    `support_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '支持的币种',
+    `config` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '保存json配置信息',
+    `state` int DEFAULT NULL,
+    `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC;
 ```

+ 18 - 10
doc/model/currency.md

@@ -1,23 +1,31 @@
 
 ###币种信息表 `currency`
-
-
-> currency_code :币种国际代码 如USD ERU CNH ,  
+> currency_id: 货币国际编号,如美元对应:840,
+>
+> currency_name: 货币英文名,如 US Dollar,
+>
+> currency_name_zh:货币中文名,如 美元
 > 
-> currency_name  : 币种名称 美元,欧元,人民币等,
+> country_zh :发行国家(中文) ,来自 [area.area_name](./area.md),同时area.level=1
+>
+> country_en :发行国家(英文) ,来自 [area.area_en](./area.md),同时area.level=1
 > 
-> currency_type :货币类型
+> min_unit :流通的最小交易单位,日本 最小单位就是 1 ,美元 人民币都可以到 0.01
 
 ```mysql
 CREATE TABLE `currency` (
     `id` int NOT NULL AUTO_INCREMENT,
-    `currency_code` bigint DEFAULT NULL,
-    `currency_name` varchar(255) DEFAULT NULL,
-    `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种类型',
+    `currency_id` bigint DEFAULT NULL COMMENT '货币国际编号,如美元对应:840',
+    `currency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '货币英文名 US Dollar',
+    `currency_name_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '货币中文名 美元',
+    `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '币种类型 USD CNY',
+    `country_zh` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '发行国家(中文)',
+    `min_unit` float(10,5) DEFAULT NULL COMMENT '流通的最小交易单位',
+    `country_en` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '发行国家(英文)',
     `state` int DEFAULT NULL,
     `created_at` datetime DEFAULT NULL,
     `updated_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
     `deleted_at` datetime DEFAULT NULL,
-    PRIMARY KEY (`id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='币种';
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='币种';
 ```

+ 23 - 18
doc/model/merchant_account_out_log.md

@@ -6,32 +6,37 @@
 > 
 > account_out_id : 关联商户的外部账户id [merchant_account_out.id](./merchant_account_out_struct.md)
 > 
+> account_sys_id:  充值到平台的系统账户的id ,关联[sys_account.id](./sys_account.md)
+> 
 > account_num :  关联商户的外部账户记录的银行帐户编号  [merchant_account_out.account_num](./merchant_account_out_struct.md)
 > 
+> trade_no :  关联交易订单记录表 [payment_order.trade_no](./payment_order.md)
+> 
 > before:  交易前的余额
 > 
 > after:交易后的余额
 > 
->amount: 交易的金额
+> amount: 交易的金额
 
 
 ```mysql
 CREATE TABLE `merchant_account_out_log` (
-  `id` int NOT NULL AUTO_INCREMENT,
-  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  `merchant_id` int NOT NULL DEFAULT '0' COMMENT '商户ID',
-  `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
-  `account_out_id` int DEFAULT '0' COMMENT '外部账户记录的id',
-  `before` decimal(10,2) NOT NULL COMMENT '交易前的余额',
-  `after` decimal(10,2) NOT NULL COMMENT '交易后的余额',
-  `amount` decimal(10,2) NOT NULL COMMENT '交易的金额',
-  `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
-  `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
-  `transfer_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '交易状态',
-  `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
-  `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户余额明细记录';
+    `id` int NOT NULL AUTO_INCREMENT,
+    `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `merchant_id` int NOT NULL DEFAULT '0' COMMENT '商户ID',
+    `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
+    `account_out_id` int DEFAULT '0' COMMENT '外部账户记录的id',
+    `account_sys_id` int DEFAULT NULL COMMENT '充值到平台的系统账户的id',
+    `before` decimal(10,2) NOT NULL COMMENT '交易前的余额',
+    `after` decimal(10,2) NOT NULL COMMENT '交易后的余额',
+    `amount` decimal(10,2) NOT NULL COMMENT '交易的金额',
+    `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
+    `transfer_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '交易状态',
+    `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
+    `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
+    `trade_no` varchar(64) DEFAULT NULL COMMENT '交易单号',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户余额明细记录';
 ```

+ 9 - 7
doc/model/merchant_account_out_struct.md

@@ -7,17 +7,19 @@ CREATE TABLE `merchant_account_out` (
     `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
     `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
     `merchant_id` int NOT NULL DEFAULT '0' COMMENT '商户ID',
-    `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
+    `account_num_bank` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
     `balance_amount` decimal(10,2) NOT NULL COMMENT '余额',
     `freeze_amount` decimal(10,2) NOT NULL COMMENT '冻结的余额',
     `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
-    `currency_id` int DEFAULT '0' COMMENT '关联的币种id',
-    `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种类型',
+    `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
     `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
+    `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账户识别码,用于标识',
     PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户表';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户表';
 ```
 
-> merchant_id 关联 [merchant.id](./merchant_struct.md) 
-
-> `currency_id` 关联 [currency.id](./currency.md),   `currency_type`  关联 [currency.currency_type](./currency.md)
+> merchant_id 关联 [merchant.id](./merchant_struct.md)
+> 
+> `account_code` 账户识别码,用于标识当前账户,
+> 
+> `currency_type`  来自于创建时选择的外部钱包模板 [currency.currency_type](./currency.md)

+ 13 - 10
doc/model/merchant_account_out_tpl_struct.md

@@ -2,16 +2,17 @@
 ###商户外部账户模板表 `merchant_account_out_tpl`
 ```mysql
 CREATE TABLE `merchant_account_out_tpl` (
-   `id` int NOT NULL AUTO_INCREMENT,
-   `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-   `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-   `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-   `state` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '状态',
-   `currency` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
-   `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型',
-   `currency_type_cn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型中文',
-   `account_properties` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账户属性',
-   PRIMARY KEY (`id`) USING BTREE
+    `id` int NOT NULL AUTO_INCREMENT,
+    `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `state` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '状态',
+    `currency` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
+    `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型',
+    `currency_type_cn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型中文',
+    `account_properties` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '账户属性',
+    `tpl_no` varchar(32) DEFAULT NULL COMMENT '模板编号,用于标识',
+    PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户模板表';
 ```
 
@@ -20,3 +21,5 @@ CREATE TABLE `merchant_account_out_tpl` (
 > `currency_type_cn`: 币种中文名称 关联[currency.currency_name](./currency.md), .
 > 
 > `currency_type`:  关联币种国际代码 [currency.currency_code](./currency.md)
+> 
+> `tpl_code`:  模板识别码,用于标识当前的模板 

+ 3 - 7
doc/model/merchant_account_sys.md

@@ -1,9 +1,9 @@
 
-###商户系统账户表 `merchant_account_out`
+###商户系统账户表 `merchant_account_sys`
 > merchant_id: 关联商户的id  [merchant.id](./merchant_struct.md)
 >
->  sys_account_id :关联系统的银行帐户id 
-
+>  sys_account_id :关联系统的银行帐户id
+> 
 >  currency_id :关联货币id[currency.id](./currency.md)
 > 
 >  currency_type :关联货币的类型[currency.currency_type](./currency.md)
@@ -25,7 +25,3 @@ CREATE TABLE `merchant_account_sys` (
    PRIMARY KEY (`id`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户表';
 ```
-
-> merchant_id 关联 [merchant.id](./merchant_struct.md) 
-
-> `currency_id` 关联 [currency.id](./currency.md),   `currency_type`  关联 [currency.currency_type](./currency.md)

+ 20 - 25
doc/model/merchant_struct.md

@@ -5,13 +5,10 @@
 >
 >phone:手机号,
 >
->password:密碼,
->
 >pause_transfer:是否暂停转账,  (0:否,1:是),
 >
 >pause_login:是否暂停登录,停用账户,(0:否,1:是),
-
-
+>
 >transfer_fee_type:付款手续费收取形式(0:内扣;1:外扣;) ,
 > 
 >join_fee:开户费,
@@ -26,25 +23,23 @@
 
 ```mysql
 CREATE TABLE `merchant` (
-       `id` int NOT NULL AUTO_INCREMENT,
-       `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-       `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-       `deleted_at` datetime DEFAULT NULL COMMENT '修改时间',
-       `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
-       `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
-       `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密碼',
-       `salt` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '加密盐',
-       `state` tinyint NOT NULL DEFAULT '0' COMMENT '状态 0:关停,1:激活,2:待激活,3:待审核',
-       `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '头像',
-       `email` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '邮箱',
-       `pause_transfer` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否暂停转账(0:否,1:是)',
-       `pause_login` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否暂停登录(0:否,1:是)',
-       `transfer_fee_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '付款手续费收取形式(0:内扣;1:外扣;) ',
-       `join_fee` decimal(10,2) NOT NULL COMMENT '开户费',
-       `annual_fee` decimal(10,2) NOT NULL COMMENT '年服务费',
-       `transfer_fee` decimal(10,2) NOT NULL COMMENT '外币付款手续费(USD)',
-       `transfer_fee_cny` decimal(10,2) NOT NULL COMMENT '人民币付款手续费(USD)',
-       `confirm_token` varchar(64) NOT NULL COMMENT '开户验证码 (google登陆验证器token)',
-       PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户基本信息表';
+     `id` int NOT NULL AUTO_INCREMENT,
+     `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+     `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+     `deleted_at` datetime DEFAULT NULL COMMENT '修改时间',
+     `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
+     `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
+     `state` tinyint NOT NULL DEFAULT '0' COMMENT '状态 0:关停,1:激活,2:待激活,3:待审核',
+     `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '头像',
+     `email` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '邮箱',
+     `pause_transfer` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否暂停转账(0:否,1:是)',
+     `pause_login` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否暂停登录(0:否,1:是)',
+     `transfer_fee_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '付款手续费收取形式(0:内扣;1:外扣;) ',
+     `join_fee` decimal(10,2) NOT NULL COMMENT '开户费',
+     `annual_fee` decimal(10,2) NOT NULL COMMENT '年服务费',
+     `transfer_fee` decimal(10,2) NOT NULL COMMENT '外币付款手续费(USD)',
+     `transfer_fee_cny` decimal(10,2) NOT NULL COMMENT '人民币付款手续费(USD)',
+     `confirm_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户验证码 (google登陆验证器token)',
+     PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户基本信息表';
 ```

+ 45 - 25
doc/model/sys_account.md

@@ -2,18 +2,23 @@
 > 伞形账户的主账户 由`is_main`判断, 主账户 有多个子账户
 > 
 > 伞形账户的子账户的pid关联当前银行记录表的主账户
-
+> open_at :开户时间
+> 
 > is_main :是否主账户,主账户关联本表的一个或多个子账户
 >
 > pid` int DEFAULT '0' COMMENT '子账户所关联的父账户id
 >
-> bank_id: 关联银行记录的id[bank.id](./bank.md)  ,
->
-> bank_code :关联银行记录[bank.bank_code](./bank.md)  ,
+> bank_code : 所属银行的代码  关联银行记录[bank.bank_code](./bank.md)  ,
 >
-> bank_name  : 关联银行记录[bank.bank_name](./bank.md)  ,
+> bank_name  :所属银行的名称 关联银行记录[bank.bank_name](./bank.md)  ,
+> 
+> country :账户所属的国家/地区 如中国,来自[area.area](./area.md)
+> 
+> province:账户所属的省/州 如广东省, 来自[area.area](./area.md)
+> 
+> city:账户所属的省/州 如深圳市, 来自[area.area](./area.md)
 > 
-> area_id : 关联区域的id[area.id](./area.md)
+> area : 账户所属的区域 如南山区, 来自[area.area](./area.md)
 >
 > postal_code : 关联区域的邮政编码[area.postal_code](./area.md)
 >
@@ -22,23 +27,38 @@
 
 ```mysql
 CREATE TABLE `sys_account` (
-  `id` int NOT NULL AUTO_INCREMENT,
-  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
-  `pid` int DEFAULT '0' COMMENT '子账户所关联的父账户id',
-  `is_main` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否主账户{ 1:是 ,2:子账户}',
-  `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
-  `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
-  `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
-  `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
-  `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
-  `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
-  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
-  `area_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
-  `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
-  `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
-  `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'SWIFT CODE',
-  PRIMARY KEY (`id`) USING BTREE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户交易明细';
+    `id` int NOT NULL AUTO_INCREMENT,
+    `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    `open_at` datetime DEFAULT NULL COMMENT '开户时间',
+    `pid` int DEFAULT '0' COMMENT '子账户所关联的父账户id',
+    `is_main` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否主账户{ 1:是 ,2:子账户}',
+    `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
+    `bank_mer_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行商户号',
+    `bank_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '在银行的账户号',
+    `bank_no` varchar(32) DEFAULT NULL COMMENT '银行号',
+    `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
+    `bank_branch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '分行代码',
+    `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
+    `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名称',
+    `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
+    `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区 如中国',
+    `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如广东省',
+    `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如深圳市',
+    `area` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的区域 如南山区',
+    `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
+    `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
+    `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'SWIFT CODE',
+    `state` tinyint(1) DEFAULT NULL COMMENT '账户状态(特指本收款平台方)',
+    `account_state` tinyint(1) DEFAULT NULL COMMENT '银行账户状态(特指银行方)',
+    `bank_state_branc_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT 'BSB(BankStateBranch)NO',
+    `path_clearing_no` varchar(32) DEFAULT NULL COMMENT '路径清算号',
+    `bpay_biller_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
+    `bpay_customer_ref` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
+    `cnaps_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '中国现代化支付系统;',
+    `zengin_no` varchar(32) DEFAULT NULL COMMENT 'zengin',
+    `fedwire` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'Fedwire',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='平台的银行帐户';
 ```

+ 37 - 18
doc/sql/crossbordercoll.sql

@@ -11,7 +11,7 @@
  Target Server Version : 80024
  File Encoding         : 65001
 
- Date: 24/04/2022 17:57:33
+ Date: 25/04/2022 16:21:47
 */
 
 SET NAMES utf8mb4;
@@ -71,7 +71,7 @@ CREATE TABLE `area`  (
 DROP TABLE IF EXISTS `bank`;
 CREATE TABLE `bank`  (
   `id` int(0) NOT NULL AUTO_INCREMENT,
-  `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
+  `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '银行名称中文',
   `bank_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型',
   `state` int(0) NULL DEFAULT NULL,
   `created_at` datetime(0) NULL DEFAULT NULL,
@@ -96,7 +96,8 @@ CREATE TABLE `channel`  (
   `docking_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '对接方式',
   `channel_type` int(0) NULL DEFAULT NULL,
   `area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区域',
-  `supported_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '支持的币种',
+  `support_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '支持的币种',
+  `config` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '保存json配置信息',
   `state` int(0) NULL DEFAULT NULL,
   `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
   `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
@@ -114,9 +115,13 @@ CREATE TABLE `channel`  (
 DROP TABLE IF EXISTS `currency`;
 CREATE TABLE `currency`  (
   `id` int(0) NOT NULL AUTO_INCREMENT,
-  `currency_id` bigint(0) NULL DEFAULT NULL,
-  `currency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
-  `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型',
+  `currency_id` bigint(0) NULL DEFAULT NULL COMMENT '货币国际编号',
+  `currency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货币英文名 US Dollar',
+  `currency_name_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货币中文名 美元',
+  `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型 USD CNY',
+  `country_zh` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发行国家(中文)',
+  `min_unit` float(10, 5) NULL DEFAULT NULL COMMENT '流通的最小交易单位',
+  `country_en` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发行国家(英文)',
   `state` int(0) NULL DEFAULT NULL,
   `created_at` datetime(0) NULL DEFAULT NULL,
   `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
@@ -139,8 +144,6 @@ CREATE TABLE `merchant`  (
   `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
   `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
   `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
-  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密碼',
-  `salt` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '加密盐',
   `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '状态 0:关停,1:激活,2:待激活,3:待审核',
   `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像',
   `email` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '邮箱',
@@ -148,7 +151,7 @@ CREATE TABLE `merchant`  (
   `pause_login` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否暂停登录(0:否,1:是)',
   `transfer_fee_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '付款手续费收取形式(0:内扣;1:外扣;) ',
   `join_fee` decimal(10, 2) NOT NULL COMMENT '开户费',
-  `anual_fee` decimal(10, 2) NOT NULL COMMENT '年服务费',
+  `annual_fee` decimal(10, 2) NOT NULL COMMENT '年服务费',
   `transfer_fee` decimal(10, 2) NOT NULL COMMENT '外币付款手续费(USD)',
   `transfer_fee_cny` decimal(10, 2) NOT NULL COMMENT '人民币付款手续费(USD)',
   `confirm_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户验证码 (google登陆验证器token)',
@@ -169,13 +172,13 @@ CREATE TABLE `merchant_account_out`  (
   `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
-  `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
+  `account_num_bank` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
   `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
   `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
-  `currency_id` int(0) NULL DEFAULT 0 COMMENT '关联的币种id',
   `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
   `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
   `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
+  `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户识别码,用于标识',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
 
@@ -195,14 +198,15 @@ CREATE TABLE `merchant_account_out_log`  (
   `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
   `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
   `account_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
+  `account_sys_id` int(0) NULL DEFAULT NULL COMMENT '充值到平台的系统账户的id',
   `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
   `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
   `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
   `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
-  `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
   `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
   `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
   `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
+  `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易单号',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
 
@@ -224,6 +228,7 @@ CREATE TABLE `merchant_account_out_tpl`  (
   `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型',
   `currency_type_cn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型中文',
   `account_properties` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户属性',
+  `tpl_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板识别码,用于标识当前的模板',
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户模板表' ROW_FORMAT = Dynamic;
 
@@ -398,22 +403,36 @@ CREATE TABLE `sys_account`  (
   `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
   `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  `open_at` datetime(0) NULL DEFAULT NULL COMMENT '开户时间',
   `pid` int(0) NULL DEFAULT 0 COMMENT '子账户所关联的父账户id',
   `is_main` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否主账户{ 1:是 ,2:子账户}',
-  `bank_id` int(0) NULL DEFAULT NULL COMMENT '银行记录的id',
   `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
+  `bank_mer_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行商户号',
+  `bank_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '在银行的账户号',
+  `bank_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '银行号',
   `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
+  `bank_branch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分行代码',
   `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
-  `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
+  `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
   `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
-  `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
-  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
-  `area_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
+  `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区 如中国',
+  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如广东省',
+  `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如深圳市',
+  `area` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的区域 如南山区',
   `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
   `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
   `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
+  `state` tinyint(1) NULL DEFAULT NULL COMMENT '账户状态(特指本收款平台方)',
+  `account_state` tinyint(1) NULL DEFAULT NULL COMMENT '银行账户状态(特指银行方)',
+  `bank_state_branc_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT 'BSB(BankStateBranch)NO',
+  `path_clearing_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路径清算号',
+  `bpay_biller_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+  `bpay_customer_ref` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
+  `cnaps_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '中国现代化支付系统;',
+  `zengin_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'zengin',
+  `fedwire` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Fedwire',
   PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户交易明细' ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '平台的银行帐户' ROW_FORMAT = Dynamic;
 
 -- ----------------------------
 -- Records of sys_account