Commit e8e95736 by gonglei

加入框架代码

1 parent c59ab4cb
......@@ -4,6 +4,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.finance.entity.Recharge;
import com.glsx.usedcar.module.finance.entity.Recharge_;
import com.glsx.usedcar.module.finance.entity.Refund;
import com.glsx.usedcar.module.finance.entity.Withdraw;
import com.glsx.usedcar.module.finance.service.TransactionService;
import com.glsx.usedcar.module.meta.AuditState;
......@@ -48,11 +49,15 @@ public class RechargeController {
// }
@GetMapping("getRechargeById")
public Recharge getRechargeById(@RequestParam int rechargeId) {
return transactionService.getRechargeById(rechargeId);
}
@GetMapping("getRefundsByRechargeId")
public List<Refund> getRefundsByRechargeId(@RequestParam int rechargeId) {
return transactionService.getRefundsByRechargeId(rechargeId);
}
}
......@@ -1552,9 +1552,9 @@
},
{
"code": "finance_recharge",
"name": "提现审核",
"name": "微信支付流水",
"type": "MENU",
"enabled": false,
"enabled": true,
"value": "/finance/recharge",
"children": [
{
......@@ -1577,51 +1577,9 @@
},
{
"code": "recharge_4",
"name": "查看用户冻结明细",
"type": "BUTTON",
"enabled": false
},
{
"code": "recharge_5",
"name": "执行提现初审(通过/驳回)",
"type": "BUTTON",
"enabled": true
},
{
"code": "recharge_6",
"name": "执行提现打款",
"name": "查看退款明细",
"type": "BUTTON",
"enabled": false
},
{
"code": "recharge_8",
"name": "查看数据统计概览",
"type": "BUTTON",
"enabled": true
},
{
"code": "recharge_9",
"name": "查看“全部”Tab",
"type": "BUTTON",
"enabled": true
},
{
"code": "recharge_10",
"name": "查看“已通过”Tab",
"type": "BUTTON",
"enabled": true
},
{
"code": "recharge_11",
"name": "查看“已驳回”Tab",
"type": "BUTTON",
"enabled": true
},
{
"code": "recharge_14",
"name": "导出提现审核记录",
"type": "BUTTON",
"enabled": true
}
]
},
......
......@@ -19,6 +19,8 @@ public interface RefundDao extends BaseRepository<Refund, Long>, JpaSpecificatio
@EntityGraph(attributePaths = {"recharge"})
List<Refund> findByWithdraw_WithdrawIdOrderByRefundTimeAsc(int withdrawId);
List<Refund> findByRecharge_RechargeIdOrderByRefundTimeAsc(int rechargeId);
@Query("select sum(r.refundAmount) from Refund r where r.withdraw =?1 and r.refundSuccessTime is not null")
Optional<Double> sumByWithdraw(Withdraw withdraw);
}
......@@ -359,4 +359,8 @@ public class TransactionService extends AbstractAuctionService {
return refundDao.findByWithdraw_WithdrawIdOrderByRefundTimeAsc(withdrawId);
}
public List<Refund> getRefundsByRechargeId(int rechargeId) {
return refundDao.findByRecharge_RechargeIdOrderByRefundTimeAsc(rechargeId);
}
}
\ No newline at end of file
......@@ -18,6 +18,12 @@ export class RechargeController{
/**
*/
static getRefundsByRechargeId(axios:AxiosStatic, rechargeId: number): Promise<AxiosResponse<Refund[]>> {
return axios.get('recharge/getRefundsByRechargeId', {params: {rechargeId: rechargeId}});
}
/**
*/
static pageRecharge(axios:AxiosStatic, pagination: any): Promise<AxiosResponse<Page<Recharge>>> {
return axios.post('recharge/pageRecharge', pagination);
}
......
<template>
<a-card class="tabs-card" :bordered="false" :tab-list="states" :active-tab-key="state" @tabChange="key => changeTab(key )">
<!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" @onReset="pageReset" :simpleFieldNum="4"/>
<!--查询栏end-->
<!--提现申请列表start-->
<div class="table-operations">
<a-button v-sec="'withdraw_14'" type="primary" @click="downloadExcel" :disabled="exporting">导出</a-button>
</div>
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn"
size="small" :pagination="pageState" :row-key="record => record.withdrawId" :scroll="{y: 'calc(100vh - 446px)'}">
<template #customFilterDropdown="{setSelectedKeys, selectedKeys, confirm, clearFilters, column}">
<m-filter-text-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-text-render>
<m-filter-checkbox-group-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-checkbox-group-render>
<!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" @onReset="pageReset" :simpleFieldNum="4"/>
<!--查询栏end-->
<!--提现申请列表start-->
<div class="table-operations">
<a-button v-sec="'withdraw_14'" type="primary" @click="downloadExcel" :disabled="exporting">导出</a-button>
</div>
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn"
size="small" :pagination="pageState" :row-key="record => record.withdrawId" :scroll="{y: 'calc(100vh - 446px)'}">
<template #customFilterDropdown="{setSelectedKeys, selectedKeys, confirm, clearFilters, column}">
<m-filter-text-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-text-render>
<m-filter-checkbox-group-render :pagination="pagination" :column="column" :confirm="confirm"></m-filter-checkbox-group-render>
</template>
<template #bodyCell="{column,record}">
<template v-if="column.key === 'action'">
<a-button type="link" size="small" @click="showRecharge(record)">查看明细</a-button>
</template>
<template #bodyCell="{column,record}">
<template v-if="column.key === 'action'">
<a-button v-sec="'recharge_5'" v-if="record.auditState==='UNAUDITED'" type="link" size="small" @click="editRecharge(record)">审核</a-button>
<router-link v-sec="'recharge_1'" :to="{ path:'/finance/recharge/view',query:{rechargeId: record.rechargeId}}">
<a-button type="link" size="small">查看</a-button>
</router-link>
</template>
<template v-if="column.key === 'auditState'">
<audit-state-tag :audit-state="record.auditState"></audit-state-tag>
</template>
<template v-if="column.key === 'refundState'">
<a-tag v-if="record.refundState==='REFUNDED'" color="red">已退款</a-tag>
<a-tag v-if="record.refundState==='REFUNDING'" color="blue">退款中</a-tag>
<a-tag v-if="record.refundState==='UNREFUND'" color="green">未退款</a-tag>
</template>
<template v-if="column.key === 'updateBy'">
<user-real-name :user-name="record.updateBy"></user-real-name>
</template>
<!-- <template v-if="column.key === 'frozenDeposit'">-->
<!-- <a-button type="link" size="small" @click="showDeposit(record)">¥{{ record.account.frozenDeposit }}</a-button>-->
<!-- </template>-->
</template>
<!--提现申请列表end-->
</a-table>
</a-card>
</template>
<!--提现申请列表end-->
</a-table>
</template>
<script lang="ts">
import {Component, Vue} from "vue-facing-decorator";
......@@ -45,27 +26,24 @@ import AuditStateTag from "@/views/common/AuditStateTag.vue";
import UserRealName from "@/components/UserRealName.vue";
import {PaginationComponent} from "@/components/PaginationComponent";
import {Withdraw} from "lib/src/entity/finance/entity/Withdraw";
import {DepositStat} from "lib/src/entity/finance/domain/DepositStat";
import {Security} from "@/store";
import {message, TableColumnsType} from "ant-design-vue";
import {AUDIT_STATES, AuditState} from "lib/src/entity/enum_types";
import {WithdrawController} from "@/api/WithdrawController";
import {Operator, Order} from "lib/src/core/page/Pagination";
import {DepositController} from "@/api/DepositController";
import {ModalService} from "@/components/ModalService";
import AccountDepositModal from "@/views/finance/deposit/AccountDepositModal.vue";
import {ExportUtil} from "@/common/ExportUtil";
import {Recharge} from "lib/src/entity/finance/entity/Recharge";
import {RechargeController} from "@/api/RechargeController";
import RechargeForm from "@/views/finance/recharge/RechargeForm.vue";
import ViewRecharge from "@/views/finance/recharge/ViewRecharge.vue";
@Component({
components: {UserRealName, AuditStateTag}
})
export default class RechargePage extends PaginationComponent<Recharge> {
depositStat: DepositStat = null;
exporting = false;
rechargeCount = {};
@Security.Getter hasPrivilege;
/**
* 表格列配置
......@@ -73,7 +51,7 @@ export default class RechargePage extends PaginationComponent<Recharge> {
columns: TableColumnsType = [
{title: '流水号', dataIndex: 'outTradeNo', key: 'outTradeNo', width: 150, resizable: true, ellipsis: true, sorter: true},
{
title: '申请人姓名', dataIndex: ['account', 'accountName'], key: 'accountName', width: 130, resizable: true, ellipsis: true, sorter: true,
title: '姓名', dataIndex: ['account', 'accountName'], key: 'accountName', width: 130, resizable: true, ellipsis: true, sorter: true,
customRender: ({text, record, index, column}) => {
if (this.isPrivilege('recharge_2')) {
return text;
......@@ -84,7 +62,7 @@ export default class RechargePage extends PaginationComponent<Recharge> {
},
{title: '昵称', dataIndex: ['account', 'nickName'], key: 'nickName', width: 150, resizable: true, ellipsis: true, sorter: true},
{
title: '申请人手机', dataIndex: ['account', 'mobile'], key: 'mobile', width: 130, resizable: true, ellipsis: true, sorter: true,
title: '手机', dataIndex: ['account', 'mobile'], key: 'mobile', width: 130, resizable: true, ellipsis: true, sorter: true,
customRender: ({text, record, index, column}) => {
if (this.isPrivilege('recharge_3')) {
return text;
......@@ -93,27 +71,24 @@ export default class RechargePage extends PaginationComponent<Recharge> {
}
}
},
{title: '微信支付订单号', dataIndex: 'transactionId', key: 'transactionId', width: 170, resizable: true, ellipsis: true, sorter: true},
// {
// title: '账户余额', dataIndex: ['account', 'surplus'], key: 'surplus', align: 'right', width: 150, resizable: true, ellipsis: true, sorter: true, customRender: ({text, record, index, column}) => {
// return '¥' + text;
// }
// },
{
title: '账户余额', dataIndex: ['account', 'surplus'], key: 'surplus', align: 'right', width: 150, resizable: true, ellipsis: true, sorter: true, customRender: ({text, record, index, column}) => {
title: '充值金额', dataIndex: 'amount', key: 'amount', align: 'right', width: 150, resizable: true, ellipsis: true, sorter: true, customRender: ({text, record, index, column}) => {
return '¥' + text;
}
},
// {
// title: '可提现金额', dataIndex: ['account', 'surplus'], key: 'surplus', align: 'right', width: 150, resizable: true, ellipsis: true, sorter: true, customRender: ({text, record, index, column}) => {
// return '¥' + (text - record.account.frozenDeposit);
// }
// },
{
title: '申请提现金额', dataIndex: 'amount', key: 'amount', width: 120, align: 'right', resizable: true, ellipsis: true, sorter: true,
title: '剩余退款金额', dataIndex: 'refundableAmount', key: 'refundableAmount', width: 120, align: 'right', resizable: true, ellipsis: true, sorter: true,
customRender: ({text, record, index, column}) => {
return '¥' + text;
}
},
{title: '支付时间', dataIndex: 'paymentTime', key: 'paymentTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
// {title: '审核人', dataIndex: 'updateBy', key: 'updateBy', width: 120, resizable: true, ellipsis: true, sorter: true},
{title: '审核时间', dataIndex: 'auditTime', key: 'auditTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
{title: '退款进度', dataIndex: 'refundState', key: 'refundState', align: 'center', fixed: 'right', width: 120, resizable: true, ellipsis: true, sorter: true},
{title: '审核状态', dataIndex: 'auditState', key: 'auditState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 110, align: 'center', fixed: 'right'},
];
......@@ -128,60 +103,22 @@ export default class RechargePage extends PaginationComponent<Recharge> {
this.init(this.axios, RechargeController.PAGE_RECHARGE);
this.buildQueryForm({
outTradeNo: [null, {label: '流水号', field: 'outTradeNo', operator: Operator.like}],
accountName: [null, {label: '申请人姓名', field: 'account.accountName', operator: Operator.like}],
mobile: [null, {label: '申请人手机号', field: 'account.mobile', operator: Operator.like}],
nickName: [null, {label: '申请人昵称', field: 'account.nickName', operator: Operator.like}],
transactionId: [null, {label: '微信支付订单号', field: 'transactionId', operator: Operator.like}],
accountName: [null, {label: '姓名', field: 'account.accountName', operator: Operator.like}],
mobile: [null, {label: '手机号', field: 'account.mobile', operator: Operator.like}],
nickName: [null, {label: '昵称', field: 'account.nickName', operator: Operator.like}],
paymentTime: [null, {label: '支付时间', field: 'paymentTime', operator: Operator.dateBetween, type: 'date-range'}],
auditTime: [null, {label: '审核时间', field: 'auditTime', operator: Operator.dateBetween, type: 'date-range'}],
amount: [null, {label: '提现金额', field: 'amount', type: 'number-range', fieldName2: 'amount2', operator: Operator.numberBetween}],
});
this.pagination.setDefaultSort('createTime', Order.desc);
this.changeTab(this.state);
DepositController.getDepositStat(this.axios).then(response => {
this.depositStat = response.data;
amount: [null, {label: '充值金额', field: 'amount', type: 'number-range', fieldName2: 'amount2', operator: Operator.numberBetween}],
refundableAmount: [null, {label: '剩余退款金额', field: 'refundableAmount', type: 'number-range', fieldName2: 'amount2', operator: Operator.numberBetween}],
});
this.reloadRechargeCount();
this.pagination.setDefaultSort('paymentTime', Order.desc);
this.pageReload();
}
isPrivilege(code): boolean {
return this.hasPrivilege(code);
}
reloadRechargeCount(): void {
RechargeController.getRechargeCountByAuditState(this.axios).then(response => {
this.rechargeCount = response.data;
});
}
get states() {
const tabs = [];
if (this.hasPrivilege('recharge_9')) tabs.push({key: "", tab: "全部"});
AUDIT_STATES.forEach(item => {
if (item === 'UNAUDITED') tabs.push(this.buildTab(item));
if (item === 'EXCEPTION') tabs.push(this.buildTab(item));
if (item === 'REJECTED' && this.hasPrivilege('recharge_11')) tabs.push(this.buildTab(item));
if (item === 'AUDITED' && this.hasPrivilege('recharge_10')) tabs.push(this.buildTab(item));
});
return tabs;
}
buildTab(item: string) {
return {key: item, tab: this.$t('enum.auditState.' + item) + '(' + (this.rechargeCount[item] ?? 0) + ')'};
}
changeTab(orderState: AuditState): void {
this.state = orderState;
if (this.state) {
this.pagination.addDefaultFilter("auditState", this.state);
} else {
this.pagination.removeDefaultFilter("auditState");
}
this.loading = true;
this.pagination.reload().then(res => {
this.reloadRechargeCount();
}).finally(() => this.loading = false);
}
/**
* 编辑提现申请
......@@ -198,16 +135,15 @@ export default class RechargePage extends PaginationComponent<Recharge> {
handleOk: (e) => {
modal.destroy();
this.pagination.refresh();
this.reloadRechargeCount();
}
},
});
}
showDeposit(recharge: Withdraw): void {
showRecharge(recharge: Recharge): void {
const modal = ModalService.confirm({
title: '冻结明细', component: AccountDepositModal, closable: true, appContext: this.$.appContext, width: 1200,
props: {account: recharge.account},
title: '退款明细', component: ViewRecharge, closable: true, appContext: this.$.appContext, width: 1200,
props: {recharge: recharge},
emits: {
handleOk: (e) => {
modal.destroy();
......
<template>
<a-alert type="info" :show-icon="true" :closable="false" message="请仔细核对收款账户信息,确保与申请人身份一致。">
</a-alert>
<a-descriptions :bordered="false" :column="3" size="small" v-if="recharge" class=" mt-16">
<template #title>
<title-tip-icon></title-tip-icon>
申请与账户信息
充值信息
</template>
<a-descriptions-item label="流水号" name="name">
{{ recharge.outTradeNo }}
</a-descriptions-item>
<a-descriptions-item label="申请状态" name="auditState">
<audit-state-tag :audit-state="recharge.auditState"></audit-state-tag>
</a-descriptions-item>
<a-descriptions-item label="申请人" name="updateBy">
<a-descriptions-item label="充值用户" name="updateBy">
{{ recharge.account.accountName }}
</a-descriptions-item>
<a-descriptions-item label="付款成功时间">
{{ recharge.paymentTime }}
</a-descriptions-item>
<a-descriptions-item label="审核时间" name="bankAccount">
{{ recharge.auditTime }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :bordered="false" :column="3" size="small" v-if="recharge" class="withdraw-view mt-16">
<template #title>
申请提现金额
</template>
<template #extra>
申请时间: {{ recharge.createTime }}
</template>
<a-descriptions-item label="申请提现金额" name="amount">
<a-descriptions-item label="充值金额" name="amount">
¥{{ recharge.amount }}
</a-descriptions-item>
<a-descriptions-item label="剩余退款金额" name="amount">
¥{{ recharge.refundableAmount }}
</a-descriptions-item>
<a-descriptions-item label="账户余额" name="amount">
¥{{ recharge.account.surplus }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :bordered="false" :column="3" size="small" v-if="recharge&&recharge.auditState==='REJECTED'">
<template #title>
<title-tip-icon></title-tip-icon>
驳回原因
</template>
<a-descriptions-item label="详细驳回原因" name="amount">
{{ recharge.rejectReason }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions v-if="recharge&&recharge.auditState==='AUDITED'" :bordered="false" :column="3" size="small">
<template #title>
<title-tip-icon></title-tip-icon>
转账情况
</template>
<a-descriptions-item label="退款单号">
{{ recharge.outRefundNo }}
</a-descriptions-item>
<a-descriptions-item label="转账状态">
<a-tag v-if="recharge.refundState==='REFUNDED'" color="red">已退款</a-tag>
<a-tag v-if="recharge.refundState==='REFUNDING'" color="blue">退款中</a-tag>
<a-tag v-if="recharge.refundState==='UNREFUND'" color="green">未退款</a-tag>
</a-descriptions-item>
<a-descriptions-item v-if="recharge.rejectReason" label="驳回原因" :span="2">
{{ recharge.rejectReason ?? '-' }}
</a-descriptions-item>
<a-descriptions-item label="退款时间">
{{ recharge.refundTime }}
</a-descriptions-item>
<a-descriptions-item label="退款成功时间">
{{ recharge.refundSuccessTime }}
</a-descriptions-item>
<a-descriptions-item label="退款备注">
{{ recharge.auditRemark }}
</a-descriptions-item>
</a-descriptions>
<br/>
<title-divider title="审核记录"></title-divider>
<approve-history-timeline v-if="recharge" approve-type="WITHDRAW" :approve-id="recharge.rechargeId" :create-time="recharge.createTime" :starter="recharge.account.accountName"></approve-history-timeline>
<title-divider title="退款记录"></title-divider>
<a-table :columns="columns" :data-source="refunds" :pagination="false" size="small"></a-table>
<a-space :gap="8" v-if="recharge&&recharge.auditState==='UNAUDITED'">
<a-button type="primary" @click="editWithdraw('AUDITED')">审核通过</a-button>
<a-button type="default" @click="editWithdraw('REJECTED')">审核驳回</a-button>
<a-button type="default" @click="this.$goBack()">取消</a-button>
</a-space>
</template>
<script lang="ts">
import {Component, Vue} from "vue-facing-decorator";
import {Component, Prop, Vue} from "vue-facing-decorator";
import TitleDivider from "@/components/TitleDivider.vue";
import AuditStateTag from "@/views/common/AuditStateTag.vue";
import ApproveHistoryTimeline from "@/views/common/ApproveHistoryTimeline.vue";
......@@ -96,24 +41,39 @@ import {ModalService} from "@/components/ModalService";
import {Recharge} from "lib/src/entity/finance/entity/Recharge";
import {RechargeController} from "@/api/RechargeController";
import RechargeForm from "@/views/finance/recharge/RechargeForm.vue";
import {TableColumnsType} from "ant-design-vue";
import {Refund} from "lib/src/entity/finance/entity/Refund";
@Component({
components: {TransferStateTag, TitleTipIcon, ApproveHistoryTimeline, AuditStateTag, TitleDivider}
})
export default class ViewRecharge extends Vue {
rechargeId: any;
@Prop({required: true})
recharge: Recharge;
refunds: Refund[] = [];
columns: TableColumnsType = [
{title: '微信退款订单号', dataIndex: 'outRefundNo', key: 'outRefundNo', align: 'left', width: 170, resizable: true, ellipsis: true, sorter: false},
{
title: '退款金额', dataIndex: 'refundAmount', key: 'refundAmount', align: 'right', width: 120, resizable: true, ellipsis: true, sorter: false,
customRender: ({text, record, index, column}) => {
return '¥' + text;
}
},
recharge: Recharge = null;
{title: '退款时间', dataIndex: 'refundTime', key: 'refundTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: false},
{title: '退款成功时间', dataIndex: 'refundSuccessTime', key: 'refundSuccessTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: false},
];
created(): void {
this.rechargeId = Number(this.$route.query.rechargeId);
this.loadData();
}
loadData(): void {
RechargeController.getRechargeById(this.axios, this.rechargeId).then(response => {
this.recharge = response.data;
RechargeController.getRefundsByRechargeId(this.axios, this.recharge.rechargeId).then(response => {
this.refunds = response.data;
});
}
......
......@@ -116,7 +116,7 @@
<!-- 车况描述 -->
<view class="section-card">
<view class="section-title">车辆描述</view>
<view class="section-title">车况描述</view>
<view class="description-content">
<text>{{ vehicle.historyCondition.conditionDescription }}</text>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!