diff --git a/README.md b/README.md index 5ee9ffc8c7be9ae8a802ae5045611aef43eb570b..6fa81c5d4a7d64f1492206c4b19e8f7a9cf77c34 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,20 @@ ## 🍈项目介绍 -> DaxPay是一套基于Bootx-Platform脚手架构建的一套开源支付网关系统,已经对接支付宝、微信支付相关的接口,以及扩展了钱包支付、储值卡支付、现金支付等新的支付方式。 +> DaxPay是一套基于Bootx-Platform脚手架构建的一套开源支付网关系统,已经对接支付宝、微信支付、云闪付相关的接口。 > 可以独立部署,提供接口供业务系统进行调用,不对原有系统产生影响 + +## 项目启动 +```shell +# 安装项目依赖, 请使用Node20.x版本, pnpm使用8.0.0到8.5.1版本,推荐直接使用8.5.1版本,更高版本会导致 pnpm-lock.yaml 失效 +pnpm install +# 启动项目 +pnpm run dev +# 构建打包 +pnpm build +``` + ## 🍒 文档和源码地址 ### 文档地址 在 [Bootx开源文档站](https://bootx.gitee.io/) 下的支付网关(DaxPay)模块下可以进行查阅相关文档,具体链接地址如下: @@ -52,16 +63,6 @@ 手机收银台地址: https://daxpay.demo.bootx.cn/h5/#/cashier/uniCashier -## 项目启动 -```shell -# 安装项目依赖, 请使用Node16及以上版本 -pnpm install -# 启动项目 -pnpm run dev -# 构建打包 -pnpm build -``` - ## 常见问题 出现以下错误不用管,不影响使用,只在第一次启动时出现,之后就不会再出现 ```shell diff --git a/package.json b/package.json index 2984629646bf17f85746d8e2378ad9b43ddf7f07..723f36754dff7cd27bb94dbde0cbe45b4cf7b490 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "typescript": "^4.6.3", "vite": "4.3.3", "vite-plugin-compression": "^0.5.1", - "vite-plugin-html": "^3.2.0", + "vite-plugin-html": "^3.2.1", "vite-plugin-imagemin": "^0.6.1", "vite-plugin-mkcert": "^1.10.1", "vite-plugin-mock": "^2.9.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2ebe5f5ba06845ccb0c7b10438ce17936f4ae00..93c8d46a02b0418d470891937777c464c97f7422 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -322,8 +322,8 @@ devDependencies: specifier: ^0.5.1 version: 0.5.1(vite@4.3.3) vite-plugin-html: - specifier: ^3.2.0 - version: 3.2.0(vite@4.3.3) + specifier: ^3.2.1 + version: 3.2.2(vite@4.3.3) vite-plugin-imagemin: specifier: ^0.6.1 version: 0.6.1(vite@4.3.3) @@ -11011,8 +11011,8 @@ packages: - supports-color dev: true - /vite-plugin-html@3.2.0(vite@4.3.3): - resolution: {integrity: sha512-2VLCeDiHmV/BqqNn5h2V+4280KRgQzCFN47cst3WiNK848klESPQnzuC3okH5XHtgwHH/6s1Ho/YV6yIO0pgoQ==} + /vite-plugin-html@3.2.2(vite@4.3.3): + resolution: {integrity: sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==} peerDependencies: vite: '>=2.0.0' dependencies: diff --git a/src/enums/payment/PayStatus.ts b/src/enums/payment/PayStatus.ts index 41ca6f24915fe21e11d4e6de881b12c51d20159c..0a9a1a8ae8dc7913708f1c6ef5173cb89bf38009 100644 --- a/src/enums/payment/PayStatus.ts +++ b/src/enums/payment/PayStatus.ts @@ -1,16 +1,13 @@ /** * 支付状态 */ -export enum PayStatus { +export enum payStatus { /** 支付中 */ PROGRESS = 'progress', /** 成功 */ SUCCESS = 'success', - /** 失败 */ - FAIL = 'fail', - /** 支付关闭(超时/手动取消/订单已经关闭撤销支付单) */ CANCEL = 'close', @@ -19,4 +16,7 @@ export enum PayStatus { /** 全部退款 */ REFUNDED = 'refunded', + + /** 失败 */ + FAIL = 'fail', } diff --git a/src/enums/payment/PaySyncStatusEnum.ts b/src/enums/payment/PaySyncStatusEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccdbebb0c33dee78e9a712db7e3fc72cb248f504 --- /dev/null +++ b/src/enums/payment/PaySyncStatusEnum.ts @@ -0,0 +1,17 @@ +/** + * 支付同步状态 + */ +export enum PaySyncStatus { + // 支付查询失败 + FAIL = 'fail', + // 支付成功 + SUCCESS = 'success', + // 支付中 + PROGRESS = 'progress', + // 支付已关闭 + CLOSED = 'closed', + // 支付退款 + REFUND = 'refund', + // 交易不存在 + NOT_FOUND = 'not_found', +} diff --git a/src/enums/payment/RefundStatusEnum.ts b/src/enums/payment/RefundStatusEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fe2ecfb26873e777a2a26ea2951d36771124008 --- /dev/null +++ b/src/enums/payment/RefundStatusEnum.ts @@ -0,0 +1,13 @@ +/** + * 退款状态枚举 + */ +export enum RefundStatus { + // 退款中 + PROGRESS = 'progress', + // 成功 + SUCCESS = 'success', + // 关闭 + CLOSE = 'close', + // 失败 + FAIL = 'fail', +} diff --git a/src/enums/payment/RefundSyncStatusEnum.ts b/src/enums/payment/RefundSyncStatusEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..23c1cffbb4b371639a46ccad03d82ee100396ab7 --- /dev/null +++ b/src/enums/payment/RefundSyncStatusEnum.ts @@ -0,0 +1,13 @@ +/** + * 退款同步状态枚举 + */ +export enum RefundSyncStatus { + //退款成功 + SUCCESS = 'refund_success', + //退款失败 + FAIL = 'refund_fail', + //退款中 + PROGRESS = 'refund_progress', + //交易不存在 + NOT_FOUND = 'pay_not_found', +} diff --git a/src/enums/payment/payChannelEnum.ts b/src/enums/payment/payChannelEnum.ts index 4d122816196dfb5eb4adf2716da8f8cf78bf3fc0..06b797d7fb861100a9b53393b6a3dd4075fd452e 100644 --- a/src/enums/payment/payChannelEnum.ts +++ b/src/enums/payment/payChannelEnum.ts @@ -5,9 +5,6 @@ export enum payChannelEnum { ALI = 'ali_pay', WECHAT = 'wechat_pay', UNION_PAY = 'union_pay', - CASH = 'cash_pay', WALLET = 'wallet_pay', - VOUCHER = 'voucher_pay', - CREDIT_CARD = 'credit_pay', AGGREGATION = 'aggregation_pay', } diff --git a/src/enums/payment/payWayEnum.ts b/src/enums/payment/payMethodEnum.ts similarity index 84% rename from src/enums/payment/payWayEnum.ts rename to src/enums/payment/payMethodEnum.ts index 2a4fc23eb26f7a50267d6b2301f7bfab0eb73b95..2eb7222ece45dd25040086aa062c19ac94b24928 100644 --- a/src/enums/payment/payWayEnum.ts +++ b/src/enums/payment/payMethodEnum.ts @@ -1,7 +1,7 @@ /** * 支付通道 */ -export enum payWayEnum { +export enum payMethodEnum { NORMAL = 'normal', WAP = 'wap', APP = 'app', diff --git a/src/enums/payment/reconcileResultEnum.ts b/src/enums/payment/reconcileResultEnum.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa6980bbb917d4ea9727ee5604944c828ee035e6 --- /dev/null +++ b/src/enums/payment/reconcileResultEnum.ts @@ -0,0 +1,4 @@ +/** + * 对账结果枚举 + */ +export enum ReconcileResult {} diff --git a/src/enums/payment/voucherEnum.ts b/src/enums/payment/voucherEnum.ts deleted file mode 100644 index 9b263864fdcf6ae46ed3cd9baac9e127f43919a1..0000000000000000000000000000000000000000 --- a/src/enums/payment/voucherEnum.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 储值卡常量 - */ -export enum VoucherEnum { - /** - * 状态-正常 - */ - STATUS_NORMAL = 'normal', - - /** - * 状态-停用 - */ - STATUS_FORBIDDEN = 'forbidden', - - /** - * 储值卡日志-开通 - */ - LOG_ACTIVE = 'active', - - /** - * 储值卡日志-预冻结额度 - */ - LOG_FREEZE_BALANCE = 'freeze', - - /** - * 储值卡日志-扣减并解冻余额 - */ - LOG_REDUCE_AND_UNFREEZE_BALANCE = 'reduceAndUnfreeze', - - /** - * 储值卡日志-直接支付 - */ - LOG_PAY = 'pay', - /** - * 储值卡日志-取消支付 - */ - LOG_CLOSE_PAY = 'closePay', - - /** - * 储值卡日志-退款到本卡中 - */ - LOG_REFUND_SELF = 'refundSelf', -} diff --git a/src/enums/payment/walletEnum.ts b/src/enums/payment/walletEnum.ts deleted file mode 100644 index d857537f66ac2fb3f1998d964448bb1679616239..0000000000000000000000000000000000000000 --- a/src/enums/payment/walletEnum.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 钱包枚举 - */ -export enum WalletEnum { - /** 钱包状态-正常 */ - NORMAL = 'normal', - - /** 钱包状态-禁用 */ - FORBIDDEN = 'forbidden', -} -/** - * 钱包日志枚举 - */ -export enum WalletLogEnum { - /** - * 钱包日志-开通 - */ - ACTIVE = 'active', - - /** - * 钱包日志-Admin操作余额变动 - */ - ADMIN_CHANGER = 'adminChanger', - - /** - * 钱包日志-预冻结额度 - */ - FREEZE_BALANCE = 'freeze', - - /** - * 钱包日志-解冻额度 - */ - UNFREEZE_BALANCE = 'unfreeze', - - /** - * 钱包日志-解冻并扣减余额 - */ - REDUCE_AND_UNFREEZE_BALANCE = 'reduceAndUnfreeze', - - /** - * 钱包日志-直接支付 - */ - PAY = 'pay', - /** - * 钱包日志-取消支付 - */ - CLOSE_PAY = 'closePay', - - /** - * 钱包日志-退款 - */ - REFUND = 'refund', - - /** - * 锁定钱包 - */ - LOCK = 'lock', - - /** - * 解锁钱包 - */ - UNLOCK = 'unlock', -} - -/** - * 操作类型 - */ -export enum WalletOperationEnum { - /** 系统操作 */ - SOURCE_SYSTEM = 'system', - - /** 管理员操作 */ - SOURCE_ADMIN = 'admin', - - /** 用户操作 */ - SOURCE_USER = 'user', -} diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index 166af4bb78c32cf1991129d9ce4684d43c6b3d1b..d8219f510bf4a1cf2e82d8c3492000dabcbdf1b7 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -44,9 +44,9 @@ const transform: AxiosTransform = { if (!rawData) { throw new Error('请求出错,请稍候重试') } - // 下载流处理 + // 下载流处理, 直接原样返回 if (contentType === 'application/octet-stream') { - return rawData + return res } // 接收的通常是json的数据,这里 code,data,message为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式 @@ -102,7 +102,7 @@ const transform: AxiosTransform = { if (apiUrl && isString(apiUrl)) { config.url = `${apiUrl}${config.url}` } - // 请求参数和请求体藕最 + // 请求参数和请求体转换 const params = config.params || {} const data = config.data || false formatDate && data && !isString(data) && formatRequestDate(data) diff --git a/src/views/demo/cashier/Cashier.api.ts b/src/views/demo/cashier/Cashier.api.ts index 147dce124851d7ff331a600d80485e241ce6ad84..1876d25c9a7c019cfe1e923a517534e507a7d3e1 100644 --- a/src/views/demo/cashier/Cashier.api.ts +++ b/src/views/demo/cashier/Cashier.api.ts @@ -15,10 +15,10 @@ export function simplePayCashier(obj) { /** * 根据业务ID获取支付状态 */ -export function findStatusByBusinessId(businessNo) { +export function findStatusByBizOrderNoeNo(bizOrderNoeNo) { return defHttp.get>({ url: '/demo/cashier/queryPayOrderSuccess', - params: { businessNo }, + params: { bizOrderNoeNo }, }) } @@ -56,12 +56,12 @@ export function aggregateBarCodePay(obj) { * 发起支付后响应对象 */ export interface PayOrderResult { - // 支付ID - paymentId: string - // 是否是异步支付 - asyncPay: boolean - // 异步支付通道 - asyncChannel: string + // 商户订单号 + bizOrderNo: string + // 订单号 + orderNo: string + // 支付状态 + status: string // 支付参数体(通常用于发起异步支付的参数) payBody: string } diff --git a/src/views/demo/cashier/Cashier.vue b/src/views/demo/cashier/Cashier.vue index 0ce8012b5010f8a4b276188b6de94897be98d46f..7a7fb3990e3edae896dd9165ba882e549499d756 100644 --- a/src/views/demo/cashier/Cashier.vue +++ b/src/views/demo/cashier/Cashier.vue @@ -15,7 +15,7 @@
微信支付
-
+
{{ item.title }} @@ -34,7 +34,7 @@
支付宝支付
-
+
{{ item.title }} @@ -57,7 +57,7 @@ 条码仿真工具
-
+
{{ item.title }} @@ -66,7 +66,7 @@
聚合支付
-
+
{{ item.title }} @@ -84,9 +84,9 @@
- + - 生成 + 生成
@@ -120,7 +120,7 @@
{{ '¥ ' + totalMoney }} - 立即支付 + 立即支付
@@ -140,14 +140,14 @@ - - diff --git a/src/views/payment/channel/alipay/record/AlipayRecordList.vue b/src/views/payment/channel/alipay/record/AlipayRecordList.vue deleted file mode 100644 index 91272b22f3346fd97d4303fa46f69d2022e0aaa0..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/alipay/record/AlipayRecordList.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/cash/config/CashConfig.api.ts b/src/views/payment/channel/cash/config/CashConfig.api.ts deleted file mode 100644 index fa9bf318f418659d23fb4bf66f1dee1d2fd73ae1..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/cash/config/CashConfig.api.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result } from '/#/axios' -import { BaseEntity, KeyValue } from '/#/web' - -/** - * 获取单条 - */ -export function getConfig() { - return defHttp.get>({ - url: '/cash/config/getConfig', - }) -} - -/** - * 更新 - */ -export function update(obj: CashConfig) { - return defHttp.post({ - url: '/cash/config/update', - data: obj, - }) -} - -/** - * 获取支持的支付方式 - */ -export function findPayWays() { - return defHttp.get>({ - url: '/cash/config/findPayWays', - }) -} - -/** - * 现金支付配置 - */ -export interface CashConfig extends BaseEntity { - // 是否启用 - enable?: boolean - // 单次支持支持多少钱 - singleLimit?: number - // 支持的支付类型 - payWays?: string[] - // 备注 - remark?: string -} diff --git a/src/views/payment/channel/cash/config/CashConfigEdit.vue b/src/views/payment/channel/cash/config/CashConfigEdit.vue deleted file mode 100644 index 85624f8ff492712506996f00c2abca58b6114e2f..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/cash/config/CashConfigEdit.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/cash/record/CashRecord.api.ts b/src/views/payment/channel/cash/record/CashRecord.api.ts deleted file mode 100644 index 6cf66e9fffd22bad4411defe4aa17fa3473f108f..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/cash/record/CashRecord.api.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result, PageResult } from '/#/axios' -import { BaseEntity } from '/#/web' - -/** - * 分页 - */ -export function page(params) { - return defHttp.get>>({ - url: '/cash/record/page', - params, - }) -} - -/** - * 详情 - */ -export function get(id) { - return defHttp.get>({ - url: '/cash/record/findById', - params: { id }, - }) -} - -/** - * 现金记录 - */ -export interface CashRecord extends BaseEntity { - // 标题 - title?: string - // 类型 - type?: string - // 金额 - amount?: string - // 交易订单号 - orderId?: string - // 地址 - ip?: string - // 备注 - remark?: string -} diff --git a/src/views/payment/channel/cash/record/CashRecordInfo.vue b/src/views/payment/channel/cash/record/CashRecordInfo.vue deleted file mode 100644 index 5988d1bba6de66c12c7b913410ef9fc5c8c9346b..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/cash/record/CashRecordInfo.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/cash/record/CashRecordList.vue b/src/views/payment/channel/cash/record/CashRecordList.vue deleted file mode 100644 index 9bf32fc26faae3d9e9d7d02e0bcfbaac33c0d4b1..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/cash/record/CashRecordList.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/config/ChannelPayConfigEdit.vue b/src/views/payment/channel/config/ChannelPayConfigEdit.vue index 7ff0db20400e2675ac5919c20b265755519e8e9a..5fecf81ed1aa8c403c6d615ad23ced8feeb88cc1 100644 --- a/src/views/payment/channel/config/ChannelPayConfigEdit.vue +++ b/src/views/payment/channel/config/ChannelPayConfigEdit.vue @@ -3,8 +3,6 @@ - - - - diff --git a/src/views/payment/channel/union/record/UnionPayRecordList.vue b/src/views/payment/channel/union/record/UnionPayRecordList.vue deleted file mode 100644 index fcce70e27331a43d633706af12f2bc92caadf0a6..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/union/record/UnionPayRecordList.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/config/VoucherConfig.api.ts b/src/views/payment/channel/voucher/config/VoucherConfig.api.ts deleted file mode 100644 index c4eebaf7cf4f221ea402d3d5d5d1c81626371e11..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/config/VoucherConfig.api.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result } from '/#/axios' -import { BaseEntity, KeyValue } from '/#/web' - -/** - * 获取单条 - */ -export function getConfig() { - return defHttp.get>({ - url: '/voucher/config/getConfig', - }) -} - -/** - * 更新 - */ -export function update(obj: VoucherConfig) { - return defHttp.post({ - url: '/voucher/config/update', - data: obj, - }) -} - -/** - * 获取支持的支付方式 - */ -export function findPayWays() { - return defHttp.get>({ - url: '/voucher/config/findPayWays', - }) -} - -/** - * 储值卡配置 - */ -export interface VoucherConfig extends BaseEntity { - // 是否启用 - enable?: boolean - // 单次支持支持多少钱 - singleLimit?: number - // 支持的支付类型 - payWays?: string[] - // 备注 - remark?: string -} diff --git a/src/views/payment/channel/voucher/config/VoucherConfigEdit.vue b/src/views/payment/channel/voucher/config/VoucherConfigEdit.vue deleted file mode 100644 index 4183866179146fdaf27fd85608c858293c7f639a..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/config/VoucherConfigEdit.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/manager/Voucher.api.ts b/src/views/payment/channel/voucher/manager/Voucher.api.ts deleted file mode 100644 index 34a97831fdf7892962b0a5a759fae17744548633..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/manager/Voucher.api.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result, PageResult } from '/#/axios' -import { BaseEntity } from '/#/web' - -/** - * 导入 - */ -export function voucherImport(params) { - return defHttp.post({ - url: '/voucher/import', - data: params, - }) -} - -/** - * 分页 - */ -export function page(params) { - return defHttp.get>>({ - url: '/voucher/page', - params, - }) -} - -/** - * 查询详情 - */ -export function get(id) { - return defHttp.get>({ - url: '/voucher/findById', - params: { id }, - }) -} - -/** - * 储值卡 - */ -export interface Voucher extends BaseEntity { - // 卡号 - cardNo?: string - // 面值 - faceValue?: number - // 余额 - balance?: string - // 是否长期有效 - enduring?: boolean - // 开始时间 - startTime?: string - // 结束时间 - endTime?: string - // 状态 - status?: string -} diff --git a/src/views/payment/channel/voucher/manager/VoucherImportModel.vue b/src/views/payment/channel/voucher/manager/VoucherImportModel.vue deleted file mode 100644 index 2399433f189796009b31a281b9eef925db4a1a27..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/manager/VoucherImportModel.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/manager/VoucherInfo.vue b/src/views/payment/channel/voucher/manager/VoucherInfo.vue deleted file mode 100644 index a852d95b058e949c5953622a74e4739dd350be84..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/manager/VoucherInfo.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/manager/VoucherList.vue b/src/views/payment/channel/voucher/manager/VoucherList.vue deleted file mode 100644 index bf0b9c9b49dee0db2fdbb5696eee567f799dd576..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/manager/VoucherList.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/record/VoucherRecord.api.ts b/src/views/payment/channel/voucher/record/VoucherRecord.api.ts deleted file mode 100644 index 72f608bf1c47b70fe274cf5c714699613804ea5f..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/record/VoucherRecord.api.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result, PageResult } from '/#/axios' -import { BaseEntity } from '/#/web' - -/** - * 分页 - */ -export function page(params) { - return defHttp.get>>({ - url: '/voucher/record/page', - params, - }) -} - -/** - * 获取详情 - */ -export function get(id) { - return defHttp.get>({ - url: '/voucher/record/findById', - params: { id }, - }) -} - -/** - * 钱包记录 - */ -export interface VoucherRecord extends BaseEntity { - // 储值卡 id - voucherId?: string - // 标题 - title?: string - // 业务类型 - type?: string - // 金额 - amount?: string - // 变动之前的金额 - oldAmount?: string - // 变动之后的金额 - newAmount?: string - // 交易订单号 - orderId?: string - // 终端ip - ip?: string -} diff --git a/src/views/payment/channel/voucher/record/VoucherRecordInfo.vue b/src/views/payment/channel/voucher/record/VoucherRecordInfo.vue deleted file mode 100644 index a93480d296fa2b6ce239d02dc1078ea5347840e4..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/record/VoucherRecordInfo.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/voucher/record/VoucherRecordList.vue b/src/views/payment/channel/voucher/record/VoucherRecordList.vue deleted file mode 100644 index d8917676f79375fdc325dd6b4819c22d96623068..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/voucher/record/VoucherRecordList.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/wallet/manager/WalletInfo.vue b/src/views/payment/channel/wallet/manager/WalletInfo.vue index ed41579443788fb7204edea77535842094218e2f..8ca2335b60c911ea2fea7d0f720435df50e3ad4e 100644 --- a/src/views/payment/channel/wallet/manager/WalletInfo.vue +++ b/src/views/payment/channel/wallet/manager/WalletInfo.vue @@ -9,25 +9,13 @@ @cancel="handleCancel" > - - - {{ wallet.id }} - - - {{ wallet.userId }} - - - {{ wallet.name }} - - - {{ wallet.balance }} - - - {{ dictConvert('WalletStatus', wallet.status) }} - - - {{ wallet.createTime }} - + + {{ wallet.id }} + {{ wallet.userId }} + {{ wallet.name }} + {{ wallet.balance }} + {{ dictConvert('WalletStatus', wallet.status) }} + {{ wallet.createTime }} diff --git a/src/views/payment/channel/wallet/manager/WalletList.vue b/src/views/payment/channel/wallet/manager/WalletList.vue index 987ac0072958ef2a0766debe9acc17c64ee7e9d5..4feeb3bdf72403cfd2eb8517769b2fa6873340aa 100644 --- a/src/views/payment/channel/wallet/manager/WalletList.vue +++ b/src/views/payment/channel/wallet/manager/WalletList.vue @@ -12,6 +12,7 @@ @@ -69,7 +70,6 @@ import { VxeTableInstance, VxeToolbarInstance, VxePager, VxeTable, VxeToolbar } from 'vxe-table' import ALink from '/@/components/Link/Link.vue' import WalletCreateModel from './WalletCreateModel.vue' - import WalletRecordList from '../record/WalletRecordList.vue' import WalletRechargeModel from './WalletRechargeModel.vue' import WalletDeductModel from './WalletDeductModel.vue' import WalletInfo from './WalletInfo.vue' @@ -152,6 +152,18 @@ function showRecord(record) { walletRecordList.init(record) } + function cellStyle({ row, column }) { + if (column.field == 'status') { + if (row.status == 'normal') { + return { color: 'green' } + } + if (row.status == 'forbidden') { + return { color: 'red' } + } + return { color: 'gray' } + } + + } diff --git a/src/views/payment/channel/wallet/record/WalletRecord.api.ts b/src/views/payment/channel/wallet/record/WalletRecord.api.ts deleted file mode 100644 index 28826ad4b165533235e39c50efb5bb28d0aef0df..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wallet/record/WalletRecord.api.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result, PageResult } from '/#/axios' -import { BaseEntity } from '/#/web' - -/** - * 分页 - */ -export function page(params) { - return defHttp.get>>({ - url: '/wallet/record/page', - params, - }) -} - -/** - * 获取详情 - */ -export function get(id) { - return defHttp.get>({ - url: '/wallet/record/findById', - params: { id }, - }) -} - -/** - * 钱包记录 - */ -export interface WalletRecord extends BaseEntity { - // 钱包id - walletId?: string - // 标题 - title?: string - // 业务类型 - type?: string - // 金额 - amount?: string - // 变动之前的金额 - oldAmount?: string - // 变动之后的金额 - newAmount?: string - // 交易订单号 - orderId?: string - // 终端ip - ip?: string -} diff --git a/src/views/payment/channel/wallet/record/WalletRecordInfo.vue b/src/views/payment/channel/wallet/record/WalletRecordInfo.vue deleted file mode 100644 index 7672f5e2b3402607cf9d74fcc0b3e0712f9321f2..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wallet/record/WalletRecordInfo.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/wallet/record/WalletRecordList.vue b/src/views/payment/channel/wallet/record/WalletRecordList.vue deleted file mode 100644 index fc2c2f44def65a0495e05f29ba4715f0944c741c..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wallet/record/WalletRecordList.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/wechat/record/WechatPayRecord.api.ts b/src/views/payment/channel/wechat/record/WechatPayRecord.api.ts deleted file mode 100644 index 28cdaa2f07175d52ff2a8d67c58392e19e510d9c..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wechat/record/WechatPayRecord.api.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { defHttp } from '/@/utils/http/axios' -import { Result, PageResult } from '/#/axios' -import { BaseEntity } from '/#/web' - -/** - * 分页 - */ -export function page(params) { - return defHttp.get>>({ - url: '/wechat/pay/record/page', - params, - }) -} - -/** - * 获取详情 - */ -export function get(id) { - return defHttp.get>({ - url: '/wechat/pay/record/findById', - params: { id }, - }) -} - -/** - * 记录 - */ -export interface WechatPayRecord extends BaseEntity { - // 标题 - title?: string - // 业务类型 - type?: string - // 金额 - amount?: string - // 交易订单号 - orderId?: string - // 交易订单号 - gatewayOrderNo?: string - // 终端ip - ip?: string - // 网关时间 - gatewayTime?: string -} diff --git a/src/views/payment/channel/wechat/record/WechatPayRecordInfo.vue b/src/views/payment/channel/wechat/record/WechatPayRecordInfo.vue deleted file mode 100644 index 16b3097eaf4a5316334ba4ca94ee5b96619ed9f8..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wechat/record/WechatPayRecordInfo.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/src/views/payment/channel/wechat/record/WechatPayRecordList.vue b/src/views/payment/channel/wechat/record/WechatPayRecordList.vue deleted file mode 100644 index 2457cba58efdbf61e65b85ae315c0b21ab3976c8..0000000000000000000000000000000000000000 --- a/src/views/payment/channel/wechat/record/WechatPayRecordList.vue +++ /dev/null @@ -1,122 +0,0 @@ - - - - - diff --git a/src/views/payment/order/pay/PayChannelOrderInfo.vue b/src/views/payment/order/pay/PayChannelOrderInfo.vue deleted file mode 100644 index ed56a90291b366a8fe0752739aa053650fc2f9c1..0000000000000000000000000000000000000000 --- a/src/views/payment/order/pay/PayChannelOrderInfo.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/src/views/payment/order/pay/PayChannelOrderList.vue b/src/views/payment/order/pay/PayChannelOrderList.vue deleted file mode 100644 index 787db63cd15bce87ed76cc44dfb65627e405c74d..0000000000000000000000000000000000000000 --- a/src/views/payment/order/pay/PayChannelOrderList.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - - diff --git a/src/views/payment/order/pay/PayOrder.api.ts b/src/views/payment/order/pay/PayOrder.api.ts index 78bf76d8b909016300698ae03c4094c4aaa81572..a3cf2522f58f70e8091d24473c3f2b2ee657f513 100644 --- a/src/views/payment/order/pay/PayOrder.api.ts +++ b/src/views/payment/order/pay/PayOrder.api.ts @@ -1,8 +1,6 @@ import { defHttp } from '/@/utils/http/axios' import { PageResult, Result } from '/#/axios' import { BaseEntity } from '/#/web' -import { RefundableInfo } from '/@/views/payment/order/refund/RefundOrder.api' -import { PaySyncResult } from '/@/views/payment/record/sync/PaySyncRecord.api' /** * 分页 @@ -17,7 +15,7 @@ export function page(params) { /** * 获取订单 */ -export function getOrder(id) { +export function getOrder(id: number) { return defHttp.get>({ url: '/order/pay/findById', params: { id }, @@ -25,62 +23,52 @@ export function getOrder(id) { } /** - * 获取订单扩展信息 - */ -export function getOrderExtra(id) { - return defHttp.get>({ - url: '/order/pay/getExtraById', - params: { id }, - }) -} - -/** - * 获取付通道订单列表 - */ -export function listByChannel(paymentId) { - return defHttp.get>({ - url: '/order/pay/listByChannel', - params: { paymentId }, - }) -} - -/** - * 获取付通道订单列表 + * 获取订单 */ -export function getChannel(id) { - return defHttp.get>({ - url: '/order/pay/getChannel', - params: { id }, +export function getOrderByOrderNo(orderNo: string) { + return defHttp.get({ + url: '/order/pay/findByOrderNo', + params: { orderNo }, }) } /** - * 同步支付状态 + * 根据订单号同步支付状态 */ -export function syncById(id) { - return defHttp.post>({ - url: '/order/pay/syncById', - params: { id }, +export function syncByOrderNo(orderNo: string) { + return defHttp.post({ + url: '/order/pay/syncByOrderNo', + params: { orderNo }, }) } /** * 关闭支付记录 */ -export function close(id) { +export function close(orderNo) { return defHttp.post>({ url: '/order/pay/close', - params: { id }, + params: { orderNo }, }) } /** * 触发分账 */ -export function allocationById(id) { +export function allocationByOrderNo(orderNo) { return defHttp.post>({ url: '/order/pay/allocation', - params: { id }, + params: { orderNo }, + }) +} + +/** + * 获取汇总金额 + */ +export function getTotalAmount(param) { + return defHttp.get>({ + url: '/order/pay/getTotalAmount', + params: param, }) } @@ -88,76 +76,56 @@ export function allocationById(id) { * 支付记录 */ export interface PayOrder extends BaseEntity { - // 关联的业务号 - businessNo?: string // 标题 title?: string - // 是否是异步支付 - asyncPay?: boolean - // 异步支付通道 - asyncChannel?: boolean - // 是否是组合支付 - combinationPay?: boolean - // 关联网关支付ID - gatewayOrderNo?: number + // 商户订单号 + bizOrderNo?: string + // 支付订单号 + orderNo?: string + // 三方系统交易号 + outOrderNo?: string + // 描述 + description?: any + // 是否支持分账 + allocation?: boolean + // 支付通道 + channel?: string + // 支付方式 + method?: string // 金额 amount?: number // 可退款余额 refundableBalance?: number // 支付状态 - status?: number + status?: string + // 分账状态 + allocationStatus?: string // 支付时间 payTime?: string // 过期时间 expiredTime?: string + // 关闭时间 + closeTime?: string + // 错误码 + errorCode?: string + // 错误信息 + errorMsg?: string } /** * 支付扩展信息 */ export interface PayOrderExtra { - // 描述 - description?: string - // 支付终端ip - clientIp?: string // 是否不需要异步通知 notNotify?: string // 异步通知地址 notifyUrl?: string - // 签名类型 - signType?: string - // 支付终端ip - sign?: string // 商户扩展参数 attach?: string - // API版本号 - apiVersion?: string + // 附加参数 + extraParam?: string // 请求时间 reqTime?: string - // 错误码 - errorCode?: string - // 错误信息 - errorMsg?: string -} - -/** - * 支付通道信息 - */ -export interface PayChannelOrder extends BaseEntity { - // 支付通道 - channel?: number - // 支付方式 - payWay?: number - // 异步支付方式 - async?: boolean - // 金额 - amount?: number - // 可退款金额 - refundableBalance?: number - // 支付状态 - status?: string - // 支付状态 - payTime?: string - // 附加支付参数 - channelExtra?: string + // 支付终端ip + clientIp?: string } diff --git a/src/views/payment/order/pay/PayOrderInfo.vue b/src/views/payment/order/pay/PayOrderInfo.vue index fb4826b98e2e968a95c8157eb782de6c5e088042..a45f2ec5ad8a6a7f95d3d91a94e9293db8f7d6f3 100644 --- a/src/views/payment/order/pay/PayOrderInfo.vue +++ b/src/views/payment/order/pay/PayOrderInfo.vue @@ -3,85 +3,76 @@ title="查看支付单" v-bind="$attrs" :loading="confirmLoading" - :width="modalWidth" + :width="1200" :visible="visible" :mask-closable="showable" @cancel="handleCancel" > - - - {{ order.id }} - - - {{ order.businessNo }} - - - {{ order.gatewayOrderNo }} - - + + {{ order.title }} - - {{ orderExtra.description }} - - - {{ order.amount }} + + {{ order.amount ? (order.amount / 100).toFixed(2) : 0 }} - - {{ order.refundableBalance }} + + {{ order.refundableBalance ? (order.refundableBalance / 100).toFixed(2) : 0 }} - {{ dictConvert('PayStatus', order.status) }} + {{ dictConvert('PayStatus', order.status) }} - - {{ order.asyncPay ? '是' : '否' }} + + {{ order.orderNo }} - - {{ order.combinationPay ? '是' : '否' }} + + {{ order.allocation ? '是' : '否' }} - - {{ dictConvert('PayChannel', order.asyncChannel) }} + + {{ order.bizOrderNo }} - - {{ dictConvert('PayChannel', o.channel) }}: {{ o.amount }} + + {{ dictConvert('PayOrderAllocationStatus', order.allocationStatus) || '无' }} - - {{ dictConvert('PayChannel', o.channel) }}: {{ o.refundableBalance }} + + {{ order.outOrderNo || '无' }} - - {{ orderExtra.clientIp }} + + {{ order.errorCode }} - - {{ orderExtra.errorMsg }} + + {{ order.errorMsg }} {{ orderExtra.notNotify ? '否' : '是' }} - - {{ orderExtra.notifyUrl }} - - - {{ orderExtra.signType }} + + {{ orderExtra.notifyUrl || '无' }} - - {{ orderExtra.sign }} + + {{ orderExtra.clientIp }} - - {{ orderExtra.attach }} + + {{ orderExtra.attach || '无' }} - {{ orderExtra.reqTime }} + {{ orderExtra.reqTime || '无' }} - {{ order.payTime }} + {{ order.payTime || '无' }} - {{ order.expiredTime }} + {{ order.expiredTime || '无' }} + + + {{ order.closeTime || '无' }} {{ order.createTime }} + + {{ order.description }} +