Compare commits

...

2 Commits

Author SHA1 Message Date
22b0abad0b Merge pull request '添加充值记录' (#104) from sjy-two into master
Reviewed-on: #104
2024-11-06 11:10:10 +08:00
9106348ff2 添加充值记录 2024-11-04 18:57:36 +08:00
16 changed files with 923 additions and 6 deletions

View File

@ -0,0 +1,56 @@
import request from '@/config/axios'
// 钱包充值 VO
export interface WalletRechargeVO {
id: number // id
walletId: number // 钱包编号
totalPrice: number // 充值实际到账
payPrice: number // 实际支付金额
bonusPrice: number // 钱包赠送金额
packageId: number // 充值套餐编号
payStatus: boolean // 是否支付
payOrderId: number // 支付订单编号
payChannelCode: string // 支付成功的支付渠道
payTime: Date // 订单支付时间
payRefundId: number // 支付退款单编号
refundTotalPrice: number // 退款金额(包含赠送金额)
refundPayPrice: number // 退款支付金额
refundBonusPrice: number // 退款钱包赠送金额
refundTime: Date // 退款时间
refundStatus: number // 退款状态
name : string
avatar: string
}
// 钱包充值 API
export const WalletRechargeApi = {
// 查询钱包充值分页
getWalletRechargePage: async (params: any) => {
return await request.get({ url: `/pay/wallet-recharge/page`, params })
},
// 查询钱包充值详情
getWalletRecharge: async (id: number) => {
return await request.get({ url: `/pay/wallet-recharge/get?id=` + id })
},
// 新增钱包充值
createWalletRecharge: async (data: WalletRechargeVO) => {
return await request.post({ url: `/pay/wallet-recharge/create`, data })
},
// 修改钱包充值
updateWalletRecharge: async (data: WalletRechargeVO) => {
return await request.put({ url: `/pay/wallet-recharge/update`, data })
},
// 删除钱包充值
deleteWalletRecharge: async (id: number) => {
return await request.delete({ url: `/pay/wallet-recharge/delete?id=` + id })
},
// 导出钱包充值 Excel
exportWalletRecharge: async (params) => {
return await request.download({ url: `/pay/wallet-recharge/export-excel`, params })
}
}

View File

@ -126,6 +126,8 @@ export enum DICT_TYPE {
INFRA_FILE_TYPE = 'infra_file_type', INFRA_FILE_TYPE = 'infra_file_type',
PAY_WALLET_RECHARGE_PAY_STATUS = 'pay_wallet_recharge_pay_status',
//预约:项目 //预约:项目
SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status', SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status',

View File

@ -44,7 +44,7 @@
<el-menu-item style="width:33%;height:70px" index="1">客户信息</el-menu-item> <el-menu-item style="width:33%;height:70px" index="1">客户信息</el-menu-item>
<el-menu-item style="width:33%;height:70px" index="2">交易订单</el-menu-item> <el-menu-item style="width:33%;height:70px" index="2">交易订单</el-menu-item>
<el-menu-item style="width:34%;height:70px" index="3">商品信息</el-menu-item> <el-menu-item style="width:34%;height:70px" index="3">商品信息</el-menu-item>
</el-menu> </el-menu>
<!-- <div style="color: #ffffff;" class="header-title h-60px flex justify-center items-center">他的足迹</div> --> <!-- <div style="color: #ffffff;" class="header-title h-60px flex justify-center items-center">他的足迹</div> -->

View File

@ -0,0 +1,181 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="钱包编号" prop="walletId">
<el-input v-model="formData.walletId" placeholder="请输入钱包编号" />
</el-form-item>
<el-form-item label="充值实际到账" prop="totalPrice">
<el-input v-model="formData.totalPrice" placeholder="请输入充值实际到账" />
</el-form-item>
<el-form-item label="实际支付金额" prop="payPrice">
<el-input v-model="formData.payPrice" placeholder="请输入实际支付金额" />
</el-form-item>
<el-form-item label="钱包赠送金额" prop="bonusPrice">
<el-input v-model="formData.bonusPrice" placeholder="请输入钱包赠送金额" />
</el-form-item>
<el-form-item label="充值套餐编号" prop="packageId">
<el-input v-model="formData.packageId" placeholder="请输入充值套餐编号" />
</el-form-item>
<el-form-item label="是否支付" prop="payStatus">
<el-select v-model="formData.payStatus" placeholder="请选择是否支付">
<el-option
v-for="dict in getBoolDictOptions(DICT_TYPE.PAY_WALLET_RECHARGE_PAY_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付订单编号" prop="payOrderId">
<el-input v-model="formData.payOrderId" placeholder="请输入支付订单编号" />
</el-form-item>
<el-form-item label="支付成功的支付渠道" prop="payChannelCode">
<el-input v-model="formData.payChannelCode" placeholder="请输入支付成功的支付渠道" />
</el-form-item>
<el-form-item label="订单支付时间" prop="payTime">
<el-date-picker
v-model="formData.payTime"
type="date"
value-format="x"
placeholder="选择订单支付时间"
/>
</el-form-item>
<el-form-item label="支付退款单编号" prop="payRefundId">
<el-input v-model="formData.payRefundId" placeholder="请输入支付退款单编号" />
</el-form-item>
<el-form-item label="退款金额(包含赠送金额)" prop="refundTotalPrice">
<el-input v-model="formData.refundTotalPrice" placeholder="请输入退款金额(包含赠送金额)" />
</el-form-item>
<el-form-item label="退款支付金额" prop="refundPayPrice">
<el-input v-model="formData.refundPayPrice" placeholder="请输入退款支付金额" />
</el-form-item>
<el-form-item label="退款钱包赠送金额" prop="refundBonusPrice">
<el-input v-model="formData.refundBonusPrice" placeholder="请输入退款钱包赠送金额" />
</el-form-item>
<el-form-item label="退款时间" prop="refundTime">
<el-date-picker
v-model="formData.refundTime"
type="date"
value-format="x"
placeholder="选择退款时间"
/>
</el-form-item>
<el-form-item label="退款状态" prop="refundStatus">
<el-radio-group v-model="formData.refundStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
import { WalletRechargeApi, WalletRechargeVO } from '@/api/pay/wallet/recharge'
/** 钱包充值 表单 */
defineOptions({ name: 'WalletRechargeForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
walletId: undefined,
totalPrice: undefined,
payPrice: undefined,
bonusPrice: undefined,
packageId: undefined,
payStatus: undefined,
payOrderId: undefined,
payChannelCode: undefined,
payTime: undefined,
payRefundId: undefined,
refundTotalPrice: undefined,
refundPayPrice: undefined,
refundBonusPrice: undefined,
refundTime: undefined,
refundStatus: undefined
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await WalletRechargeApi.getWalletRecharge(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as WalletRechargeVO
if (formType.value === 'create') {
await WalletRechargeApi.createWalletRecharge(data)
message.success(t('common.createSuccess'))
} else {
await WalletRechargeApi.updateWalletRecharge(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
walletId: undefined,
totalPrice: undefined,
payPrice: undefined,
bonusPrice: undefined,
packageId: undefined,
payStatus: undefined,
payOrderId: undefined,
payChannelCode: undefined,
payTime: undefined,
payRefundId: undefined,
refundTotalPrice: undefined,
refundPayPrice: undefined,
refundBonusPrice: undefined,
refundTime: undefined,
refundStatus: undefined
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,280 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="100px"
>
<el-form-item label="是否支付" prop="payStatus">
<el-select
v-model="queryParams.payStatus"
placeholder="请选择是否支付"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getBoolDictOptions(DICT_TYPE.PAY_WALLET_RECHARGE_PAY_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="支付渠道" prop="payChannelCode">
<el-input
v-model="queryParams.payChannelCode"
placeholder="请输入支付渠道"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="订单支付时间" prop="payTime">
<el-date-picker
v-model="queryParams.payTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<!-- <el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['pay:wallet-recharge:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['pay:wallet-recharge:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> -->
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="用户昵称" align="center" prop="name" />
<!-- <el-table-column label="用户头像" align="center" prop="avatar" /> -->
<el-table-column label="用户头像" align="center" prop="avatar" >
<template #default="{ row }">
<div class="flex justify-center items-center">
<el-image
fit="cover"
:src="row.avatar"
class="flex-none w-50px h-50px"
@click="imagePreview(row.avatar)"
/>
</div>
</template>
</el-table-column>
<el-table-column label="支付订单编号" align="center" prop="payOrderId" />
<el-table-column label="支付金额" align="center" prop="payPrice" />
<el-table-column label="支付渠道" align="center" prop="payChannelCode" />
<!-- <el-table-column label="钱包赠送金额" align="center" prop="bonusPrice" />
<el-table-column label="充值套餐编号" align="center" prop="packageId" /> -->
<el-table-column label="是否支付" align="center" prop="payStatus">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PAY_WALLET_RECHARGE_PAY_STATUS" :value="scope.row.payStatus" />
</template>
</el-table-column>
<el-table-column
label="订单支付时间"
align="center"
prop="payTime"
:formatter="dateFormatter"
width="180px"
/>
<!-- <el-table-column label="支付退款单编号" align="center" prop="payRefundId" />
<el-table-column label="退款金额(包含赠送金额)" align="center" prop="refundTotalPrice" />
<el-table-column label="退款支付金额" align="center" prop="refundPayPrice" />
<el-table-column label="退款钱包赠送金额" align="center" prop="refundBonusPrice" />
<el-table-column
label="退款时间"
align="center"
prop="refundTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="退款状态" align="center" prop="refundStatus" /> -->
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<!-- <el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['pay:wallet-recharge:update']"
>
编辑
</el-button> -->
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['pay:wallet-recharge:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<WalletRechargeForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { WalletRechargeApi, WalletRechargeVO } from '@/api/pay/wallet/recharge'
import WalletRechargeForm from './WalletRechargeForm.vue'
import { createImageViewer } from "@/components/ImageViewer"
/** 钱包充值 列表 */
defineOptions({ name: 'WalletRecharge' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<WalletRechargeVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
walletId: undefined,
totalPrice: undefined,
payPrice: undefined,
bonusPrice: undefined,
packageId: undefined,
payStatus: undefined,
payOrderId: undefined,
payChannelCode: undefined,
payTime: [],
payRefundId: undefined,
refundTotalPrice: undefined,
refundPayPrice: undefined,
refundBonusPrice: undefined,
refundTime: [],
refundStatus: undefined,
createTime: []
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await WalletRechargeApi.getWalletRechargePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
const imagePreview = (imgUrl : string) => {
createImageViewer({
urlList: [imgUrl]
})
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await WalletRechargeApi.deleteWalletRecharge(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await WalletRechargeApi.exportWalletRecharge(queryParams)
download.excel(data, '钱包充值.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

View File

@ -26,7 +26,7 @@ public interface SupportStaffMapper extends BaseMapperX<SupportStaffDO> {
.eqIfPresent(SupportStaffDO::getOrderManage, reqVO.getOrderManage()) .eqIfPresent(SupportStaffDO::getOrderManage, reqVO.getOrderManage())
.eqIfPresent(SupportStaffDO::getOrderInform, reqVO.getOrderInform()) .eqIfPresent(SupportStaffDO::getOrderInform, reqVO.getOrderInform())
.betweenIfPresent(SupportStaffDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(SupportStaffDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(SupportStaffDO::getId)); .orderByAsc(SupportStaffDO::getId));
} }
} }

View File

@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert;
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
import cn.iocoder.yudao.module.trade.enums.brokerage.BrokerageRecordBizTypeEnum;
import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum;
import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties;
import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService; import cn.iocoder.yudao.module.trade.service.aftersale.AfterSaleService;

View File

@ -1,13 +1,20 @@
package cn.iocoder.yudao.module.pay.controller.admin.wallet; package cn.iocoder.yudao.module.pay.controller.admin.wallet;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO; import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO; import cn.iocoder.yudao.module.pay.api.notify.dto.PayRefundNotifyReqDTO;
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge.WalletRechargePageReqVO;
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge.WalletRechargeRespVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO;
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletRechargeService; import cn.iocoder.yudao.module.pay.service.wallet.PayWalletRechargeService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -55,4 +62,12 @@ public class PayWalletRechargeController {
return success(true); return success(true);
} }
@GetMapping("/page")
@Operation(summary = "获得钱包充值分页")
@PreAuthorize("@ss.hasPermission('pay:wallet-recharge:query')")
public CommonResult<PageResult<WalletRechargeRespVO>> getWalletRechargePage(@Valid WalletRechargePageReqVO pageReqVO) {
PageResult<PayWalletRechargeDO> pageResult = walletRechargeService.getWalletRechargePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, WalletRechargeRespVO.class));
}
} }

View File

@ -0,0 +1,69 @@
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 钱包充值分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class WalletRechargePageReqVO extends PageParam {
@Schema(description = "钱包编号", example = "3219")
private Long walletId;
@Schema(description = "充值实际到账", example = "24628")
private Integer totalPrice;
@Schema(description = "实际支付金额", example = "11386")
private Integer payPrice;
@Schema(description = "钱包赠送金额", example = "6594")
private Integer bonusPrice;
@Schema(description = "充值套餐编号", example = "2831")
private Long packageId;
@Schema(description = "是否支付", example = "2")
private Boolean payStatus;
@Schema(description = "支付订单编号", example = "5515")
private Long payOrderId;
@Schema(description = "支付成功的支付渠道")
private String payChannelCode;
@Schema(description = "订单支付时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] payTime;
@Schema(description = "支付退款单编号", example = "22733")
private Long payRefundId;
@Schema(description = "退款金额(包含赠送金额)", example = "15904")
private Integer refundTotalPrice;
@Schema(description = "退款支付金额", example = "30626")
private Integer refundPayPrice;
@Schema(description = "退款钱包赠送金额", example = "2421")
private Integer refundBonusPrice;
@Schema(description = "退款时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] refundTime;
@Schema(description = "退款状态", example = "2")
private Integer refundStatus;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,91 @@
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
@Schema(description = "管理后台 - 钱包充值 Response VO")
@Data
@ExcelIgnoreUnannotated
public class WalletRechargeRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13484")
@ExcelProperty("id")
private Long id;
@Schema(description = "钱包编号", example = "3219")
@ExcelProperty("钱包编号")
private Long walletId;
@Schema(description = "充值实际到账", example = "24628")
@ExcelProperty("充值实际到账")
private Integer totalPrice;
@Schema(description = "实际支付金额", example = "11386")
@ExcelProperty("实际支付金额")
private Integer payPrice;
@Schema(description = "钱包赠送金额", example = "6594")
@ExcelProperty("钱包赠送金额")
private Integer bonusPrice;
@Schema(description = "充值套餐编号", example = "2831")
@ExcelProperty("充值套餐编号")
private Long packageId;
@Schema(description = "是否支付", example = "2")
@ExcelProperty(value = "是否支付", converter = DictConvert.class)
@DictFormat("pay_wallet_recharge_pay_status") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中
private Boolean payStatus;
@Schema(description = "支付订单编号", example = "5515")
@ExcelProperty("支付订单编号")
private Long payOrderId;
@Schema(description = "支付成功的支付渠道")
@ExcelProperty("支付成功的支付渠道")
private String payChannelCode;
@Schema(description = "订单支付时间")
@ExcelProperty("订单支付时间")
private LocalDateTime payTime;
@Schema(description = "支付退款单编号", example = "22733")
@ExcelProperty("支付退款单编号")
private Long payRefundId;
@Schema(description = "退款金额(包含赠送金额)", example = "15904")
@ExcelProperty("退款金额(包含赠送金额)")
private Integer refundTotalPrice;
@Schema(description = "退款支付金额", example = "30626")
@ExcelProperty("退款支付金额")
private Integer refundPayPrice;
@Schema(description = "退款钱包赠送金额", example = "2421")
@ExcelProperty("退款钱包赠送金额")
private Integer refundBonusPrice;
@Schema(description = "退款时间")
@ExcelProperty("退款时间")
private LocalDateTime refundTime;
@Schema(description = "退款状态", example = "2")
@ExcelProperty("退款状态")
private Integer refundStatus;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
private String avatar;
private String name;
}

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 钱包充值新增/修改 Request VO")
@Data
public class WalletRechargeSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13484")
private Long id;
@Schema(description = "钱包编号", example = "3219")
private Long walletId;
@Schema(description = "充值实际到账", example = "24628")
private Integer totalPrice;
@Schema(description = "实际支付金额", example = "11386")
private Integer payPrice;
@Schema(description = "钱包赠送金额", example = "6594")
private Integer bonusPrice;
@Schema(description = "充值套餐编号", example = "2831")
private Long packageId;
@Schema(description = "是否支付", example = "2")
private Boolean payStatus;
@Schema(description = "支付订单编号", example = "5515")
private Long payOrderId;
@Schema(description = "支付成功的支付渠道")
private String payChannelCode;
@Schema(description = "订单支付时间")
private LocalDateTime payTime;
@Schema(description = "支付退款单编号", example = "22733")
private Long payRefundId;
@Schema(description = "退款金额(包含赠送金额)", example = "15904")
private Integer refundTotalPrice;
@Schema(description = "退款支付金额", example = "30626")
private Integer refundPayPrice;
@Schema(description = "退款钱包赠送金额", example = "2421")
private Integer refundBonusPrice;
@Schema(description = "退款时间")
private LocalDateTime refundTime;
@Schema(description = "退款状态", example = "2")
private Integer refundStatus;
}

View File

@ -4,10 +4,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO;
import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum; import cn.iocoder.yudao.module.pay.enums.refund.PayRefundStatusEnum;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -114,4 +111,10 @@ public class PayWalletRechargeDO extends BaseDO {
*/ */
private Integer refundStatus; private Integer refundStatus;
@TableField(exist = false)
private String avatar;
@TableField(exist = false)
private String name;
} }

View File

@ -0,0 +1,95 @@
package cn.iocoder.yudao.module.pay.dal.dataobject.wallet;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 钱包充值 DO
*
* @author 管理员
*/
@TableName("pay_wallet_recharge")
@KeySequence("pay_wallet_recharge_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WalletRechargeDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 钱包编号
*/
private Long walletId;
/**
* 充值实际到账
*/
private Integer totalPrice;
/**
* 实际支付金额
*/
private Integer payPrice;
/**
* 钱包赠送金额
*/
private Integer bonusPrice;
/**
* 充值套餐编号
*/
private Long packageId;
/**
* 是否支付
*
* 枚举 {@link TODO pay_wallet_recharge_pay_status 对应的类}
*/
private Boolean payStatus;
/**
* 支付订单编号
*/
private Long payOrderId;
/**
* 支付成功的支付渠道
*/
private String payChannelCode;
/**
* 订单支付时间
*/
private LocalDateTime payTime;
/**
* 支付退款单编号
*/
private Long payRefundId;
/**
* 退款金额(包含赠送金额)
*/
private Integer refundTotalPrice;
/**
* 退款支付金额
*/
private Integer refundPayPrice;
/**
* 退款钱包赠送金额
*/
private Integer refundBonusPrice;
/**
* 退款时间
*/
private LocalDateTime refundTime;
/**
* 退款状态
*/
private Integer refundStatus;
}

View File

@ -4,8 +4,10 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge.WalletRechargePageReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
@ -28,4 +30,25 @@ public interface PayWalletRechargeMapper extends BaseMapperX<PayWalletRechargeDO
.orderByDesc(PayWalletRechargeDO::getId)); .orderByDesc(PayWalletRechargeDO::getId));
} }
default PageResult<PayWalletRechargeDO> selectPage(WalletRechargePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PayWalletRechargeDO>()
.eqIfPresent(PayWalletRechargeDO::getWalletId, reqVO.getWalletId())
.eqIfPresent(PayWalletRechargeDO::getTotalPrice, reqVO.getTotalPrice())
.eqIfPresent(PayWalletRechargeDO::getPayPrice, reqVO.getPayPrice())
.eqIfPresent(PayWalletRechargeDO::getBonusPrice, reqVO.getBonusPrice())
.eqIfPresent(PayWalletRechargeDO::getPackageId, reqVO.getPackageId())
.eqIfPresent(PayWalletRechargeDO::getPayStatus, reqVO.getPayStatus())
.eqIfPresent(PayWalletRechargeDO::getPayOrderId, reqVO.getPayOrderId())
.eqIfPresent(PayWalletRechargeDO::getPayChannelCode, reqVO.getPayChannelCode())
.betweenIfPresent(PayWalletRechargeDO::getPayTime, reqVO.getPayTime())
.eqIfPresent(PayWalletRechargeDO::getPayRefundId, reqVO.getPayRefundId())
.eqIfPresent(PayWalletRechargeDO::getRefundTotalPrice, reqVO.getRefundTotalPrice())
.eqIfPresent(PayWalletRechargeDO::getRefundPayPrice, reqVO.getRefundPayPrice())
.eqIfPresent(PayWalletRechargeDO::getRefundBonusPrice, reqVO.getRefundBonusPrice())
.betweenIfPresent(PayWalletRechargeDO::getRefundTime, reqVO.getRefundTime())
.eqIfPresent(PayWalletRechargeDO::getRefundStatus, reqVO.getRefundStatus())
.betweenIfPresent(PayWalletRechargeDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(PayWalletRechargeDO::getId));
}
} }

View File

@ -2,9 +2,11 @@ package cn.iocoder.yudao.module.pay.service.wallet;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge.WalletRechargePageReqVO;
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateReqVO; import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO;
/** /**
* 钱包充值 Service 接口 * 钱包充值 Service 接口
@ -61,4 +63,12 @@ public interface PayWalletRechargeService {
*/ */
void updateWalletRechargeRefunded(Long id, Long payRefundId); void updateWalletRechargeRefunded(Long id, Long payRefundId);
/**
* 获得钱包充值分页
*
* @param pageReqVO 分页查询
* @return 钱包充值分页
*/
PageResult<PayWalletRechargeDO> getWalletRechargePage(WalletRechargePageReqVO pageReqVO);
} }

View File

@ -4,14 +4,19 @@ import cn.hutool.core.lang.Assert;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.pay.core.enums.refund.PayRefundStatusRespEnum; import cn.iocoder.yudao.framework.pay.core.enums.refund.PayRefundStatusRespEnum;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO;
import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO; import cn.iocoder.yudao.module.pay.api.refund.dto.PayRefundCreateReqDTO;
import cn.iocoder.yudao.module.pay.controller.admin.wallet.vo.recharge.WalletRechargePageReqVO;
import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateReqVO; import cn.iocoder.yudao.module.pay.controller.app.wallet.vo.recharge.AppPayWalletRechargeCreateReqVO;
import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO; import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO; import cn.iocoder.yudao.module.pay.dal.dataobject.refund.PayRefundDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargeDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO; import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletRechargePackageDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.WalletRechargeDO;
import cn.iocoder.yudao.module.pay.dal.mysql.wallet.PayWalletMapper;
import cn.iocoder.yudao.module.pay.dal.mysql.wallet.PayWalletRechargeMapper; import cn.iocoder.yudao.module.pay.dal.mysql.wallet.PayWalletRechargeMapper;
import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum; import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum;
import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum; import cn.iocoder.yudao.module.pay.enums.order.PayOrderStatusEnum;
@ -53,9 +58,14 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
private static final String WALLET_RECHARGE_ORDER_SUBJECT = "钱包余额充值"; private static final String WALLET_RECHARGE_ORDER_SUBJECT = "钱包余额充值";
@Resource
private MemberUserApi memberUserApi;
@Resource @Resource
private PayWalletRechargeMapper walletRechargeMapper; private PayWalletRechargeMapper walletRechargeMapper;
@Resource @Resource
private PayWalletMapper payWalletMapper;
@Resource
private PayWalletService payWalletService; private PayWalletService payWalletService;
@Resource @Resource
private PayOrderService payOrderService; private PayOrderService payOrderService;
@ -205,6 +215,24 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
walletRechargeMapper.updateByIdAndRefunded(id, WAITING.getStatus(), updateObj); walletRechargeMapper.updateByIdAndRefunded(id, WAITING.getStatus(), updateObj);
} }
@Override
public PageResult<PayWalletRechargeDO> getWalletRechargePage(WalletRechargePageReqVO pageReqVO) {
PageResult<PayWalletRechargeDO> payWalletRechargeDOPageResult = walletRechargeMapper.selectPage(pageReqVO);
for (int i = 0; i < payWalletRechargeDOPageResult.getList().size(); i++) {
PayWalletRechargeDO payWalletRechargeDO = payWalletRechargeDOPageResult.getList().get(i);
payWalletRechargeDO.setPayPrice((int) (payWalletRechargeDO.getPayPrice() * 0.01));
//获取用户头像和昵称
PayWalletDO payWalletDO = payWalletMapper.selectById(payWalletRechargeDO.getWalletId());
MemberUserRespDTO user = memberUserApi.getUser(payWalletDO.getUserId());
payWalletRechargeDO.setName(user.getNickname());
payWalletRechargeDO.setAvatar(user.getAvatar());
}
return payWalletRechargeDOPageResult;
}
private PayRefundDO validateWalletRechargeCanRefunded(PayWalletRechargeDO walletRecharge, Long payRefundId) { private PayRefundDO validateWalletRechargeCanRefunded(PayWalletRechargeDO walletRecharge, Long payRefundId) {
// 1. 校验退款订单匹配 // 1. 校验退款订单匹配
if (notEqual(walletRecharge.getPayRefundId(), payRefundId)) { if (notEqual(walletRecharge.getPayRefundId(), payRefundId)) {
@ -295,4 +323,5 @@ public class PayWalletRechargeServiceImpl implements PayWalletRechargeService {
return payOrder; return payOrder;
} }
} }