ref 增加枚举值

This commit is contained in:
bootx
2024-05-03 00:41:11 +08:00
parent 51ffdbf790
commit 4cf97ae232
13 changed files with 75 additions and 145 deletions

View File

@@ -8,9 +8,6 @@ export enum PayStatus {
/** 成功 */
SUCCESS = 'success',
/** 失败 */
FAIL = 'fail',
/** 支付关闭(超时/手动取消/订单已经关闭撤销支付单) */
CANCEL = 'close',
@@ -19,4 +16,7 @@ export enum PayStatus {
/** 全部退款 */
REFUNDED = 'refunded',
/** 失败 */
FAIL = 'fail',
}

View File

@@ -0,0 +1,17 @@
/**
* 支付同步状态
*/
export enum PaySyncStatus {
// 支付查询失败
FAIL = 'fail',
// 支付成功
SUCCESS = 'success',
// 支付中
PROGRESS = 'progress',
// 支付已关闭
CLOSED = 'closed',
// 支付退款
REFUND = 'refund',
// 交易不存在
NOT_FOUND = 'not_found',
}

View File

@@ -0,0 +1,13 @@
/**
* 退款状态枚举
*/
export enum RefundStatus {
// 退款中
PROGRESS = 'progress',
// 成功
SUCCESS = 'success',
// 关闭
CLOSE = 'close',
// 失败
FAIL = 'fail',
}

View File

@@ -0,0 +1,13 @@
/**
* 退款同步状态枚举
*/
export enum RefundSyncStatus {
//退款成功
SUCCESS = 'refund_success',
//退款失败
FAIL = 'refund_fail',
//退款中
PROGRESS = 'refund_progress',
//交易不存在
NOT_FOUND = 'pay_not_found',
}

View File

@@ -6,6 +6,5 @@ export enum payChannelEnum {
WECHAT = 'wechat_pay',
UNION_PAY = 'union_pay',
WALLET = 'wallet_pay',
CREDIT_CARD = 'credit_pay',
AGGREGATION = 'aggregation_pay',
}

View File

@@ -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',
}

View File

@@ -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',
}

View File

@@ -15,10 +15,10 @@ export function simplePayCashier(obj) {
/**
* 根据业务ID获取支付状态
*/
export function findStatusByBusinessId(businessNo) {
export function findStatusByBizOrderNoeNo(bizOrderNoeNo) {
return defHttp.get<Result<boolean>>({
url: '/demo/cashier/queryPayOrderSuccess',
params: { businessNo },
params: { businessNo: 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
}

View File

@@ -140,7 +140,7 @@
<script lang="ts" setup>
import CashierQrCode from './CashierQrCode.vue'
import CashierBarCode from './CashierBarCode.vue'
import { aggregateBarCodePay, createAggregatePayUrl, findStatusByBusinessId, getUniCashierUrl, simplePayCashier } from './Cashier.api'
import { aggregateBarCodePay, createAggregatePayUrl, findStatusByBizOrderNoeNo, getUniCashierUrl, simplePayCashier } from './Cashier.api'
import { useMessage } from '/@/hooks/web/useMessage'
import { $ref } from 'vue/macros'
import { nextTick, onMounted, onUnmounted } from 'vue'
@@ -266,7 +266,7 @@
// 检查支付状态
const { pause, resume } = useIntervalFn(
() => {
findStatusByBusinessId(bizOrderNo)
findStatusByBizOrderNoeNo(bizOrderNo)
.then((res) => {
// 成功
if (res.data) {

View File

@@ -87,17 +87,23 @@ export function sync(id){
*/
export interface AllocationOrder extends BaseEntity {
// 支付订单ID
paymentId?: string
// 分账订单号
orderId?: string
// 支付订单号
orderNo?: string
// 支付标题
// 商户支付订单号
bizOrderNo?: string
// 外部系统支付订单号
outOrderNo?: string
// 支付订单号
title?: string
// 网关支付订单号
gatewayPayOrderNo?: string
// 网关分账
gatewayAllocationNo?: string
// 外部分账号
outAllocationNo?: string
// 分账单号
allocationNo?: string
// 商户分账单号
bizAllocationNo?: string
// 外部请求号
outReqNo?: string
// 所属通道
@@ -108,6 +114,8 @@ export interface AllocationOrder extends BaseEntity {
description?: string
// 状态
status?: string
// 错误码
errorCode?: string
// 错误原因
errorMsg?: string
// 完成时间

View File

@@ -88,8 +88,8 @@
// 查询条件
const fields = computed(() => {
return [
{ field: 'tradeId', type: STRING, name: '本地交易号', placeholder: '请输入本地交易号' },
{ field: 'outTradeNo', type: STRING, name: '网关订单号', placeholder: '请输入完整网关订单号' },
{ field: 'tradeNo', type: STRING, name: '本地交易号', placeholder: '请输入本地交易号' },
{ field: 'outTradeNo', type: STRING, name: '外部交易号', placeholder: '请输入外部交易号' },
{
field: 'channel',
type: LIST,

View File

@@ -15,10 +15,10 @@ export function page(params) {
/**
* 获取单条
*/
export function get(paymentId) {
export function get(id) {
return defHttp.get<Result<PayCloseRecord>>({
url: '/record/close/findById',
params: { paymentId },
params: { id },
})
}

View File

@@ -15,10 +15,10 @@ export function page(params) {
/**
* 获取单条
*/
export function get(paymentId) {
export function get(id) {
return defHttp.get<Result<SyncRecord>>({
url: '/record/sync/findById',
params: { paymentId },
params: { id },
})
}