优化 支付配置校验方式,优化业务层异常抛出类型,优化支付应用渲染逻辑,添加删除支付商户 支付应用的校验,退款订单去除reqNo字段,支付订单去除 channelExtras 参数展示

This commit is contained in:
chen quan
2021-12-29 19:47:59 +08:00
parent 08103685f1
commit d556eae556
34 changed files with 267 additions and 300 deletions

View File

@ -49,7 +49,7 @@ export function getMerchant(id) {
// 根据商户名称搜索商户列表
export function getMerchantListByName(name) {
return request({
url: '/pay/merchant/list-name',
url: '/pay/merchant/list-by-name',
params:{
name:name
},

View File

@ -34,12 +34,6 @@ export const DICT_TYPE = {
OA_LEAVE_STATUS: 'oa_leave_status',
OA_LEAVE_TYPE: 'oa_leave_type',
// 商户状态
PAY_MERCHANT_STATUS: 'pay_merchant_status', // TODO @aquan一般使用 COMMON_RESULT 即可。保持数值一致,以后加更多状态的时候,在单独数据字典
// 应用状态
PAY_APP_STATUS: 'pay_app_status',
// 渠道状态
PAY_CHANNEL_STATUS: 'pay_channel_status',
// 微信渠道版本
PAY_CHANNEL_WECHAT_VERSION:'pay_channel_wechat_version',
// 支付渠道支付宝算法类型

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog :visible.sync="transferParam.aliPayOpen" @closed="close" append-to-body width="800px">
<el-dialog :visible.sync="transferParam.aliPayOpen" :title="title" @closed="close" append-to-body width="800px">
<el-form ref="aliPayForm" :model="form" :rules="rules" size="medium" label-width="100px"
v-loading="transferParam.loading">
<el-form-item label-width="180px" label="渠道费率" prop="feeRate">
@ -172,6 +172,7 @@ export default {
},
data() {
return {
title:'',
form: JSON.parse(JSON.stringify(defaultForm)),
rules: {
feeRate: [{
@ -232,7 +233,7 @@ export default {
},
fileAccept: ".crt",
// 渠道状态 数据字典
statusDictDatas: getDictDatas(DICT_TYPE.PAY_CHANNEL_STATUS),
statusDictDatas: getDictDatas(DICT_TYPE.SYS_COMMON_STATUS),
// 支付宝加密方式
aliPaySignTypeDatas: getDictDatas(DICT_TYPE.PAY_CHANNEL_ALIPAY_SIGN_TYPE),
// 版本状态 数据字典
@ -251,7 +252,10 @@ export default {
this.form.merchantId = newVal.payMerchant.id;
// 只有在初次进来为编辑 并且为加载中的时候才回去请求数据
if (newVal.edit === true && newVal.loading) {
this.title = "编辑支付渠道";
this.init();
} else {
this.title = "创建支付渠道";
}
}
}

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog :visible.sync="transferParam.wechatOpen" @close="close" append-to-body width="800px">
<el-dialog :visible.sync="transferParam.wechatOpen" :title="title" @close="close" append-to-body width="800px">
<el-form ref="wechatJsApiForm" :model="form" :rules="rules" size="medium" label-width="100px"
v-loading="transferParam.loading">
<el-form-item label-width="180px" label="渠道费率" prop="feeRate">
@ -134,6 +134,7 @@ export default {
},
data() {
return {
title:'',
form: JSON.parse(JSON.stringify(defaultForm)),
rules: {
feeRate: [{
@ -188,7 +189,7 @@ export default {
},
fileAccept: ".pem",
// 渠道状态 数据字典
statusDictDatas: getDictDatas(DICT_TYPE.PAY_CHANNEL_STATUS),
statusDictDatas: getDictDatas(DICT_TYPE.SYS_COMMON_STATUS),
versionDictDatas: getDictDatas(DICT_TYPE.PAY_CHANNEL_WECHAT_VERSION),
}
},
@ -202,7 +203,10 @@ export default {
this.form.merchantId = newVal.payMerchant.id;
// 只有在初次进来为编辑 并且为加载中的时候才回去请求数据
if (newVal.edit && newVal.loading) {
this.title = "编辑支付渠道";
this.init();
} else {
this.title = "创建支付渠道";
}
}
}

View File

@ -57,59 +57,49 @@
<el-table-column label="支付宝配置" align="center">
<el-table-column :label="payChannelEnum.ALIPAY_APP.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayApp === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.ALIPAY_APP.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayApp === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)">
</el-button>
</template>
</el-table-column>
<el-table-column :label="payChannelEnum.ALIPAY_PC.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_PC.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayPc === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.ALIPAY_PC.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_PC.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayPc === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_PC.code,payType.ALIPAY)">
</el-button>
</template>
</el-table-column>
<el-table-column :label="payChannelEnum.ALIPAY_WAP.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_WAP.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayWap === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.ALIPAY_WAP.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_WAP.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayWap === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_WAP.code,payType.ALIPAY)">
</el-button>
</template>
</el-table-column>
<el-table-column :label="payChannelEnum.ALIPAY_QR.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_QR.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayQr === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.ALIPAY_QR.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.ALIPAY)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_QR.code,payType.ALIPAY)"
v-if="scope.row.payChannel.alipayQr === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.ALIPAY_QR.code,payType.ALIPAY)">
</el-button>
</template>
</el-table-column>
@ -117,43 +107,37 @@
<el-table-column label="微信配置" align="center">
<el-table-column :label="payChannelEnum.WX_LITE.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.WX_LITE.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxLite === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.WX_LITE.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.WECHAT)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_LITE.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxLite === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_LITE.code,payType.WECHAT)">
</el-button>
</template>
</el-table-column>
<el-table-column :label="payChannelEnum.WX_PUB.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.WX_PUB.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxPub === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.WX_PUB.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.WECHAT)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_PUB.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxPub === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_PUB.code,payType.WECHAT)">
</el-button>
</template>
</el-table-column>
<el-table-column :label="payChannelEnum.WX_APP.name" align="center">
<template slot-scope="scope">
<el-button
type="success" icon="el-icon-check" circle
@click="handleUpdateChannel(scope.row,payChannelEnum.WX_APP.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxApp === sysCommonStatusEnum.ENABLE">
<el-button type="success" icon="el-icon-check" circle
v-if="judgeChannelExist(scope.row.channelCodes,payChannelEnum.WX_APP.code)"
@click="handleUpdateChannel(scope.row,payChannelEnum.ALIPAY_APP.code,payType.WECHAT)">
</el-button>
<el-button
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_APP.code,payType.WECHAT)"
v-if="scope.row.payChannel.wxApp === sysCommonStatusEnum.DISABLE">
<el-button v-else
type="danger" icon="el-icon-close" circle
@click="handleCreateChannel(scope.row,payChannelEnum.WX_APP.code,payType.WECHAT)">
</el-button>
</template>
</el-table-column>
@ -276,7 +260,7 @@ export default {
merchantId: [{required: true, message: "商户编号不能为空", trigger: "blur"}],
},
// 数据字典
statusDictDatas: getDictDatas(DICT_TYPE.PAY_APP_STATUS),
statusDictDatas: getDictDatas(DICT_TYPE.SYS_COMMON_STATUS),
sysCommonStatusEnum: SysCommonStatusEnum,
// 支付渠道枚举
payChannelEnum: PayChannelEnum,
@ -322,6 +306,7 @@ export default {
// 执行查询
getAppPage(params).then(response => {
this.list = response.data.list;
console.log(this.list);
this.total = response.data.total;
this.loading = false;
});
@ -422,7 +407,12 @@ export default {
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
/** 导出按钮操作 */
handleExport() {
@ -486,6 +476,14 @@ export default {
this.channelParam.payCode = payCode;
this.channelParam.payMerchant = row.payMerchant;
},
/**
* 根据渠道编码判断渠道列表中是否存在
* @param channels 渠道列表
* @param channelCode 渠道编码
*/
judgeChannelExist(channels, channelCode) {
return channels.indexOf(channelCode) !== -1;
},
refreshTable() {
this.getList();
}

View File

@ -154,8 +154,8 @@ export default {
shortName: [{ required: true, message: "商户简称不能为空", trigger: "blur" }],
status: [{ required: true, message: "开启状态不能为空", trigger: "blur" }],
},
// 数据字典
statusDictDatas: getDictDatas(DICT_TYPE.PAY_MERCHANT_STATUS)
// 商户状态数据字典
statusDictDatas: getDictDatas(DICT_TYPE.SYS_COMMON_STATUS)
};
},
created() {

View File

@ -236,9 +236,6 @@
<el-descriptions-item label="商品描述">
{{ orderDetail.body }}
</el-descriptions-item>
<el-descriptions-item label="支付通道额外扩展参数">
{{ orderDetail.payOrderExtension.channelExtras }}
</el-descriptions-item>
<el-descriptions-item label="支付通道异步回调内容">
{{ orderDetail.payOrderExtension.channelNotifyData }}
</el-descriptions-item>
@ -278,7 +275,6 @@ const defaultOrderDetail = {
notifyTime: '',
expireTime: '',
payOrderExtension: {
channelExtras: '',
channelNotifyData: '',
no: ''
}

View File

@ -43,20 +43,17 @@
<el-option v-for="dict in payChannelCodeDictDatum" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="退款单号" prop="reqNo">
<el-input v-model="queryParams.reqNo" placeholder="请输入退款单请求号" clearable size="small"
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="商户退款订单号" prop="merchantRefundNo">
<el-input v-model="queryParams.merchantRefundNo" placeholder="请输入商户退款订单号" clearable size="small"
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="退款类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择退款类型" clearable size="small">
<el-option v-for="dict in payRefundOrderTypeDictDatum" :key="parseInt(dict.value)"
:label="dict.label" :value="parseInt(dict.value)"/>
</el-select>
</el-form-item>
<el-form-item label="商户退款订单号" prop="merchantRefundNo">
<el-input v-model="queryParams.merchantRefundNo" placeholder="请输入商户退款订单号" clearable size="small"
@keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="退款状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择退款状态" clearable size="small">
<el-option v-for="dict in payRefundOrderDictDatum" :key="parseInt(dict.value)"
@ -112,15 +109,15 @@
</el-table-column>
<!-- <el-table-column label="交易订单号" align="center" prop="tradeNo" width="140"/>-->
<!-- <el-table-column label="商户订单编号" align="center" prop="merchantOrderId" width="140"/>-->
<el-table-column label="退款订单号" align="left" width="230">
<el-table-column label="商户订单号" align="left" width="230">
<template v-slot="scope">
<p class="order-font">
<el-tag size="mini">退款</el-tag>
{{ scope.row.reqNo }}
{{ scope.row.merchantRefundNo }}
</p>
<p class="order-font">
<el-tag size="mini" type="success">商户</el-tag>
{{ scope.row.merchantRefundNo }}
<el-tag type="success">交易</el-tag>
{{ scope.row.merchantOrderId }}
</p>
</template>
</el-table-column>
@ -202,9 +199,6 @@
<el-descriptions-item label="商户退款单号">
<el-tag size="mini">{{ refundDetail.merchantRefundNo }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="商户退款请求单号" size="mini">
<el-tag type="success" size="mini">{{ refundDetail.reqNo }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="商户订单号">{{ refundDetail.merchantOrderId }}</el-descriptions-item>
<el-descriptions-item label="交易订单号">{{ refundDetail.tradeNo }}</el-descriptions-item>
</el-descriptions>
@ -299,7 +293,6 @@ const defaultRefundDetail = {
payAmount: null,
reason: '',
refundAmount: null,
reqNo: '',
status: null,
subject: '',
successTime: null,
@ -333,7 +326,6 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
reqNo: null,
merchantId: null,
appId: null,
channelId: null,